DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: handle removed device properly on promisc replay
@ 2019-09-24 17:01 Andrew Rybchenko
  2019-09-26 10:43 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Rybchenko @ 2019-09-24 17:01 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit; +Cc: dev

Promiscuous mode callback may return error if the device is removed.
Use eth_err() helper to check the condition and return appropriate
error code.

Fixes: dff6d544fb3c ("ethdev: do nothing if promiscuous mode is applied again")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index d0da3322e..af823607c 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1401,7 +1401,8 @@ rte_eth_dev_config_restore(struct rte_eth_dev *dev,
 	 */
 	if (rte_eth_promiscuous_get(port_id) == 1 &&
 	    *dev->dev_ops->promiscuous_enable != NULL) {
-		ret = (*dev->dev_ops->promiscuous_enable)(dev);
+		ret = eth_err(port_id,
+			      (*dev->dev_ops->promiscuous_enable)(dev));
 		if (ret != 0 && ret != -ENOTSUP) {
 			RTE_ETHDEV_LOG(ERR,
 				"Failed to enable promiscuous mode for device (port %u): %s\n",
@@ -1410,7 +1411,8 @@ rte_eth_dev_config_restore(struct rte_eth_dev *dev,
 		}
 	} else if (rte_eth_promiscuous_get(port_id) == 0 &&
 		   *dev->dev_ops->promiscuous_disable != NULL) {
-		ret = (*dev->dev_ops->promiscuous_disable)(dev);
+		ret = eth_err(port_id,
+			      (*dev->dev_ops->promiscuous_disable)(dev));
 		if (ret != 0 && ret != -ENOTSUP) {
 			RTE_ETHDEV_LOG(ERR,
 				"Failed to disable promiscuous mode for device (port %u): %s\n",
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: handle removed device properly on promisc replay
  2019-09-24 17:01 [dpdk-dev] [PATCH] ethdev: handle removed device properly on promisc replay Andrew Rybchenko
@ 2019-09-26 10:43 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2019-09-26 10:43 UTC (permalink / raw)
  To: Andrew Rybchenko, Thomas Monjalon; +Cc: dev

On 9/24/2019 6:01 PM, Andrew Rybchenko wrote:
> Promiscuous mode callback may return error if the device is removed.
> Use eth_err() helper to check the condition and return appropriate
> error code.
> 
> Fixes: dff6d544fb3c ("ethdev: do nothing if promiscuous mode is applied again")
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

Squashed into relevant commit in next-net, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-26 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 17:01 [dpdk-dev] [PATCH] ethdev: handle removed device properly on promisc replay Andrew Rybchenko
2019-09-26 10:43 ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).