From dd184a454111b54b0e45a3271becc3dd19ec8616 Mon Sep 17 00:00:00 2001 From: Steve Yang Date: Fri, 4 Sep 2020 07:29:04 +0000 Subject: [PATCH] net/iavf: fix port start during configuration restore 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") Cc: stable@dpdk.org Signed-off-by: Steve Yang Acked-by: Beilei Xing --- drivers/net/iavf/iavf_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index ec4b1a1487..5f3aea8a04 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -690,6 +690,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; @@ -711,6 +713,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; @@ -731,6 +735,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; @@ -751,6 +757,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; -- 2.20.1