/* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright (c) 2016-2018 Solarflare Communications Inc.
- * All rights reserved.
+ * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2016-2019 Solarflare Communications Inc.
*
* This software was jointly developed between OKTET Labs (under contract
* for Solarflare) and Solarflare Communications, Inc.
} else if ((sa->state == SFC_ADAPTER_STARTED) &&
((rc = sfc_set_rx_mode(sa)) != 0)) {
*toggle = !(enabled);
- sfc_warn(sa, "Failed to %s %s mode",
- ((enabled) ? "enable" : "disable"), desc);
+ sfc_warn(sa, "Failed to %s %s mode, rc = %d",
+ ((enabled) ? "enable" : "disable"), desc, rc);
+
+ /*
+ * For promiscuous and all-multicast filters a
+ * permission failure should be reported as an
+ * unsupported filter.
+ */
+ if (rc == EPERM)
+ rc = ENOTSUP;
}
}
* has no effect on received traffic, therefore
* we also need to update unicast filters
*/
- rc = sfc_set_rx_mode(sa);
+ rc = sfc_set_rx_mode_unchecked(sa);
if (rc != 0) {
sfc_err(sa, "cannot set filter (rc = %u)", rc);
/* Rollback the old address */
(void)efx_mac_addr_set(sa->nic, old_addr->addr_bytes);
- (void)sfc_set_rx_mode(sa);
+ (void)sfc_set_rx_mode_unchecked(sa);
}
} else {
sfc_warn(sa, "cannot set MAC address with filters installed");