Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe - Return EPERM when the interface is not t...



details:   https://anonhg.NetBSD.org/src/rev/e8ba24843d81
branches:  trunk
changeset: 454286:e8ba24843d81
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Sep 13 06:50:18 2019 +0000

description:
- Return EPERM when the interface is not trusted.
- Treat IXGBE_ERR_FEATURE_NOT_SUPPORTED.

diffstat:

 sys/dev/pci/ixgbe/ixv.c |  19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diffs (47 lines):

diff -r f20674a67cfe -r e8ba24843d81 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Fri Sep 13 06:39:29 2019 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Fri Sep 13 06:50:18 2019 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.134 2019/09/12 12:25:46 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.135 2019/09/13 06:50:18 msaitoh Exp $*/
 
 /******************************************************************************
 
@@ -1145,7 +1145,11 @@
                if (error == IXGBE_ERR_NOT_TRUSTED) {
                        device_printf(adapter->dev,
                            "this interface is not trusted\n");
-                       error = ENOSPC;
+                       error = EPERM;
+               } else if (error == IXGBE_ERR_FEATURE_NOT_SUPPORTED) {
+                       device_printf(adapter->dev,
+                           "the PF doesn't support allmulti mode\n");
+                       error = EOPNOTSUPP;
                } else if (error) {
                        device_printf(adapter->dev,
                            "number of Ethernet multicast addresses "
@@ -1161,7 +1165,10 @@
        if (!allmulti) {
                error = hw->mac.ops.update_xcast_mode(hw,
                    IXGBEVF_XCAST_MODE_MULTI);
-               if (error) {
+               if (error == IXGBE_ERR_FEATURE_NOT_SUPPORTED) {
+                       /* normal operation */
+                       error = 0;
+               } else if (error) {
                        device_printf(adapter->dev,
                            "failed to set Ethernet multicast address "
                            "operation to normal. error = %d\n", error);
@@ -2993,7 +3000,11 @@
                        if (error == IXGBE_ERR_NOT_TRUSTED) {
                                device_printf(adapter->dev,
                                    "this interface is not trusted\n");
-                               error = ENOSPC;
+                               error = EPERM;
+                       } else if (error == IXGBE_ERR_FEATURE_NOT_SUPPORTED) {
+                               device_printf(adapter->dev,
+                                   "the PF doesn't support allmulti mode\n");
+                               error = EOPNOTSUPP;
                        } else if (error) {
                                device_printf(adapter->dev,
                                    "number of Ethernet multicast addresses "



Home | Main Index | Thread Index | Old Index