[PATCH] net/enic: avoid extra unlock when setting MTU in enic

John Daley (johndale) johndale at cisco.com
Thu Nov 2 02:25:15 CET 2023


Reviewed-by: John Daley <johndale at cisco.com>

Thanks,
John

From: Weiguo Li <liwg06 at foxmail.com>
Date: Wednesday, November 1, 2023 at 12:28 AM
To: John Daley (johndale) <johndale at cisco.com>
Cc: dev at dpdk.org <dev at dpdk.org>, stable at dpdk.org <stable at dpdk.org>, Weiguo Li <liweiguo at xencore.cn>
Subject: [PATCH] net/enic: avoid extra unlock when setting MTU in enic
The 'set_mtu_done' goto statement is being executed in a context
where the 'mtu_lock' has not been previously locked.

To avoid the extra unlocking operation, replace the goto statement
with a return statement.

Fixes: c3e09182bcd6 ("net/enic: support scatter Rx in MTU update")
Cc: stable at dpdk.org

Signed-off-by: Weiguo Li <liweiguo at xencore.cn>
---
 .mailmap                     | 2 +-
 drivers/net/enic/enic_main.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.mailmap b/.mailmap
index 3f5bab26a8..b4f0ae26b8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1500,7 +1500,7 @@ Waterman Cao <waterman.cao at intel.com>
 Weichun Chen <weichunx.chen at intel.com>
 Wei Dai <wei.dai at intel.com>
 Weifeng Li <liweifeng96 at 126.com>
-Weiguo Li <liwg06 at foxmail.com>
+Weiguo Li <liwg06 at foxmail.com> <liweiguo at xencore.cn>
 Wei Huang <wei.huang at intel.com>
 Wei Hu <weh at microsoft.com>
 Wei Hu (Xavier) <xavier.huwei at huawei.com>
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 19a99a82c5..a6aaa760ca 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1639,7 +1639,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)
          * packet length.
          */
         if (!eth_dev->data->dev_started)
-               goto set_mtu_done;
+               return rc;

         /*
          * The device has started, re-do RQs on the fly. In the process, we
--
2.34.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/stable/attachments/20231102/c88e513f/attachment.htm>


More information about the stable mailing list