<div dir="auto">Why bother? This is not critical path.<div dir="auto">Original code looked fine </div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, May 8, 2025, 11:34 Sunyang Wu <<a href="mailto:sunyang.wu@jaguarmicro.com">sunyang.wu@jaguarmicro.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Set the values of the promiscuous and all_multicast variables<br>
according to the return value.<br>
<br>
Signed-off-by: Sunyang Wu <<a href="mailto:sunyang.wu@jaguarmicro.com" target="_blank" rel="noreferrer">sunyang.wu@jaguarmicro.com</a>><br>
---<br>
 lib/ethdev/rte_ethdev.c | 9 +++------<br>
 1 file changed, 3 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c<br>
index d4197322a0..b1f593edc4 100644<br>
--- a/lib/ethdev/rte_ethdev.c<br>
+++ b/lib/ethdev/rte_ethdev.c<br>
@@ -3044,10 +3044,8 @@ rte_eth_promiscuous_disable(uint16_t port_id)<br>
        if (dev->dev_ops->promiscuous_disable == NULL)<br>
                return -ENOTSUP;<br>
<br>
-       dev->data->promiscuous = 0;<br>
        diag = dev->dev_ops->promiscuous_disable(dev);<br>
-       if (diag != 0)<br>
-               dev->data->promiscuous = 1;<br>
+       dev->data->promiscuous = (diag == 0) ? 0 : 1;<br>
<br>
        diag = eth_err(port_id, diag);<br>
<br>
@@ -3112,10 +3110,9 @@ rte_eth_allmulticast_disable(uint16_t port_id)<br>
<br>
        if (dev->dev_ops->allmulticast_disable == NULL)<br>
                return -ENOTSUP;<br>
-       dev->data->all_multicast = 0;<br>
+<br>
        diag = dev->dev_ops->allmulticast_disable(dev);<br>
-       if (diag != 0)<br>
-               dev->data->all_multicast = 1;<br>
+       dev->data->all_multicast = (diag == 0) ? 0 : 1;<br>
<br>
        diag = eth_err(port_id, diag);<br>
<br>
-- <br>
2.19.0.rc0.windows.1<br>
<br>
</blockquote></div>