1 From: Stefan Sicleru <stefan.sicleru@enea.com>
2 Date: Tue, 30 Aug 2016 17:53:41 +0200
3 Subject: [PATCH] net-check: add support for faulty operstate
5 Some eth drivers, such as those for APM X-Gene Mustang Board's NICs, do
6 not advertise operstate properly in sysfs, ie. it is advertised as
7 "unknown" whereas ethtool shows the NIC as fully functional with link
8 detected. This further affects "ip link show" output which is parsed
9 within _check_iface_ready() method.
11 Replace "ip link show" command with "ethtool" in order to obtain proper
12 results when operstate is unknown.
14 Signed-off-by: Stefan Sicleru <stefan.sicleru@enea.com>
16 ...et-check-add-support-for-faulty-operstate.patch | 38 ++++++++++++++++++++++
17 1 file changed, 38 insertions(+)
18 create mode 100644 build/patch-repos/build/repos/network-checker/0010-net-check-add-support-for-faulty-operstate.patch
20 diff --git a/build/patch-repos/build/repos/network-checker/0010-net-check-add-support-for-faulty-operstate.patch b/build/patch-repos/build/repos/network-checker/0010-net-check-add-support-for-faulty-operstate.patch
22 index 0000000..71e7b73
24 +++ b/build/patch-repos/build/repos/network-checker/0010-net-check-add-support-for-faulty-operstate.patch
26 +From: Stefan Sicleru <stefan.sicleru@enea.com>
27 +Date: Tue, 30 Aug 2016 17:30:24 +0200
28 +Subject: [PATCH] net-check: add support for faulty operstate
30 +Some eth drivers, such as those for APM X-Gene Mustang Board's NICs, do
31 +not advertise operstate properly in sysfs, ie. it is advertised as
32 +"unknown" whereas ethtool shows the NIC as fully functional with link
33 +detected. This further affects "ip link show" output which is parsed
34 +within _check_iface_ready() method.
36 +Replace "ip link show" command with "ethtool" in order to obtain proper
37 +results when operstate is unknown.
39 +Signed-off-by: Stefan Sicleru <stefan.sicleru@enea.com>
41 + network_checker/net_check/api.py | 9 ++++++++-
42 + 1 file changed, 8 insertions(+), 1 deletion(-)
44 +diff --git a/network_checker/net_check/api.py b/network_checker/net_check/api.py
45 +index e3c3b4e..87aa257 100755
46 +--- a/network_checker/net_check/api.py
47 ++++ b/network_checker/net_check/api.py
48 +@@ -195,7 +195,14 @@ class Actor(object):
49 + def _check_iface_ready(self, iface, vid=None):
50 + check_iface = self._iface_name(iface, vid)
51 + output = self._execute(['ip', '-o', 'link', 'show', check_iface])
52 +- return 'state UP' in '\n'.join(output)
53 ++ if 'state UP' in '\n'.join(output):
56 ++ if 'state UNKNOWN' in '\n'.join(output) and vid == None:
57 ++ output = self._execute(['ethtool', check_iface])
58 ++ return 'Link detected: yes' in '\n'.join(output).replace('\n', ' ')
62 + def _ensure_iface_up(self, iface, vid=None):
63 + """Ensures interface is with vid up."""