Blame SOURCES/sos-bz1870379-networking_skip_eeprom_colection_for_bnx2x.patch

c3caec
From e489e4c361ca1153970d1f37db90081ad991f69b Mon Sep 17 00:00:00 2001
c3caec
From: Jan Jansky <jjansky@redhat.com>
c3caec
Date: Thu, 20 Aug 2020 09:43:08 +0200
c3caec
Subject: [PATCH] [networking] remove 'ethtool -e' option for bnx2x NICs
c3caec
c3caec
Running EEPROM dump (ethtool -e) can result in bnx2x driver NICs to
c3caec
pause for few seconds and is not recommended in production environment.
c3caec
c3caec
Related: #2200
c3caec
Resolves: #2208
c3caec
c3caec
Signed-off-by: Jan Jansky <jjansky@redhat.com>
c3caec
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
c3caec
---
c3caec
 sos/plugins/networking.py | 12 +++++++++++-
c3caec
 1 file changed, 11 insertions(+), 1 deletion(-)
c3caec
c3caec
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
c3caec
index 56d5b44..b04bb98 100644
c3caec
--- a/sos/plugins/networking.py
c3caec
+++ b/sos/plugins/networking.py
c3caec
@@ -179,7 +179,6 @@ class Networking(Plugin):
c3caec
                 "ethtool -a " + eth,
c3caec
                 "ethtool -c " + eth,
c3caec
                 "ethtool -g " + eth,
c3caec
-                "ethtool -e " + eth,
c3caec
                 "ethtool -P " + eth,
c3caec
                 "ethtool -l " + eth,
c3caec
                 "ethtool --phy-statistics " + eth,
c3caec
@@ -187,6 +186,17 @@ class Networking(Plugin):
c3caec
                 "ethtool --show-eee " + eth
c3caec
             ])
c3caec
 
c3caec
+            # skip EEPROM collection for 'bnx2x' NICs as this command
c3caec
+            # can pause the NIC and is not production safe.
c3caec
+            bnx_output = {
c3caec
+                "cmd": "ethtool -i %s" % eth,
c3caec
+                "output": "bnx2x"
c3caec
+            }
c3caec
+            bnx_pred = SoSPredicate(self,
c3caec
+                                    cmd_outputs=bnx_output,
c3caec
+                                    required={'cmd_outputs': 'none'})
c3caec
+            self.add_cmd_output("ethtool -e %s" % eth, pred=bnx_pred)
c3caec
+
c3caec
         # Collect information about bridges (some data already collected via
c3caec
         # "ip .." commands)
c3caec
         self.add_cmd_output([
c3caec
-- 
c3caec
1.8.3.1
c3caec