diff mbox series

[3/7] net/iavf: fix port start during configuration restore

Message ID 20200811075910.20954-4-stevex.yang@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series Bugs Porting from I40evf For IAVF Feature | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Steve Yang Aug. 11, 2020, 7:59 a.m. UTC
If configuring VF promiscuous mode is not supported,
return -ENOTSUP error code in .promiscuous_enable/disable dev_ops.
This is to fix the port start during configuration restore,
where if .promiscuous_enable/disable dev_ops exists
and return any value other than -ENOTSUP, start will fail.

Same is done for .allmulticast_enable/disable dev_ops.

Fixes: ca041cd44fcc ("ethdev: change allmulticast callbacks to return status")
Fixes: 9039c8125730 ("ethdev: change promiscuous callbacks to return status")

Signed-off-by: SteveX Yang <stevex.yang@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index ae508f2f0..349c82cae 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -648,6 +648,8 @@  iavf_dev_promiscuous_enable(struct rte_eth_dev *dev)
 	ret = iavf_config_promisc(adapter, true, vf->promisc_multicast_enabled);
 	if (!ret)
 		vf->promisc_unicast_enabled = true;
+	else if (ret == IAVF_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -669,6 +671,8 @@  iavf_dev_promiscuous_disable(struct rte_eth_dev *dev)
 				  vf->promisc_multicast_enabled);
 	if (!ret)
 		vf->promisc_unicast_enabled = false;
+	else if (ret == IAVF_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -689,6 +693,8 @@  iavf_dev_allmulticast_enable(struct rte_eth_dev *dev)
 	ret = iavf_config_promisc(adapter, vf->promisc_unicast_enabled, true);
 	if (!ret)
 		vf->promisc_multicast_enabled = true;
+	else if (ret == IAVF_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;
 
@@ -709,6 +715,8 @@  iavf_dev_allmulticast_disable(struct rte_eth_dev *dev)
 	ret = iavf_config_promisc(adapter, vf->promisc_unicast_enabled, false);
 	if (!ret)
 		vf->promisc_multicast_enabled = false;
+	else if (ret == IAVF_NOT_SUPPORTED)
+		ret = -ENOTSUP;
 	else
 		ret = -EAGAIN;