DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/enic: avoid extra unlock when setting MTU in enic
@ 2023-11-01  7:28 Weiguo Li
  2023-11-01 19:55 ` Ferruh Yigit
  2023-11-02  1:25 ` John Daley (johndale)
  0 siblings, 2 replies; 3+ messages in thread
From: Weiguo Li @ 2023-11-01  7:28 UTC (permalink / raw)
  To: johndale; +Cc: dev, stable, Weiguo Li

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@dpdk.org

Signed-off-by: Weiguo Li <liweiguo@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@intel.com>
 Weichun Chen <weichunx.chen@intel.com>
 Wei Dai <wei.dai@intel.com>
 Weifeng Li <liweifeng96@126.com>
-Weiguo Li <liwg06@foxmail.com>
+Weiguo Li <liwg06@foxmail.com> <liweiguo@xencore.cn>
 Wei Huang <wei.huang@intel.com>
 Wei Hu <weh@microsoft.com>
 Wei Hu (Xavier) <xavier.huwei@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


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

* Re: [PATCH] net/enic: avoid extra unlock when setting MTU in enic
  2023-11-01  7:28 [PATCH] net/enic: avoid extra unlock when setting MTU in enic Weiguo Li
@ 2023-11-01 19:55 ` Ferruh Yigit
  2023-11-02  1:25 ` John Daley (johndale)
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2023-11-01 19:55 UTC (permalink / raw)
  To: Weiguo Li, johndale; +Cc: dev, stable, Weiguo Li

On 11/1/2023 7:28 AM, Weiguo Li wrote:
> 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@dpdk.org
> 
> Signed-off-by: Weiguo Li <liweiguo@xencore.cn>
>

<...>

>
> diff --git a/.mailmap b/.mailmap
> index 3f5bab26a8..b4f0ae26b8 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -1500,7 +1500,7 @@ Waterman Cao <waterman.cao@intel.com>
>  Weichun Chen <weichunx.chen@intel.com>
>  Wei Dai <wei.dai@intel.com>
>  Weifeng Li <liweifeng96@126.com>
> -Weiguo Li <liwg06@foxmail.com>
> +Weiguo Li <liwg06@foxmail.com> <liweiguo@xencore.cn>
>

As this patch signed-off with new email address, I assume intention is
to make it default address, so I will update accordingly while merging.


Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied to dpdk-next-net/main, thanks.

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

* Re: [PATCH] net/enic: avoid extra unlock when setting MTU in enic
  2023-11-01  7:28 [PATCH] net/enic: avoid extra unlock when setting MTU in enic Weiguo Li
  2023-11-01 19:55 ` Ferruh Yigit
@ 2023-11-02  1:25 ` John Daley (johndale)
  1 sibling, 0 replies; 3+ messages in thread
From: John Daley (johndale) @ 2023-11-02  1:25 UTC (permalink / raw)
  To: Weiguo Li; +Cc: dev, stable, Weiguo Li

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

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

Thanks,
John

From: Weiguo Li <liwg06@foxmail.com>
Date: Wednesday, November 1, 2023 at 12:28 AM
To: John Daley (johndale) <johndale@cisco.com>
Cc: dev@dpdk.org <dev@dpdk.org>, stable@dpdk.org <stable@dpdk.org>, Weiguo Li <liweiguo@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@dpdk.org

Signed-off-by: Weiguo Li <liweiguo@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@intel.com>
 Weichun Chen <weichunx.chen@intel.com>
 Wei Dai <wei.dai@intel.com>
 Weifeng Li <liweifeng96@126.com>
-Weiguo Li <liwg06@foxmail.com>
+Weiguo Li <liwg06@foxmail.com> <liweiguo@xencore.cn>
 Wei Huang <wei.huang@intel.com>
 Wei Hu <weh@microsoft.com>
 Wei Hu (Xavier) <xavier.huwei@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

[-- Attachment #2: Type: text/html, Size: 4830 bytes --]

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

end of thread, other threads:[~2023-11-02  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01  7:28 [PATCH] net/enic: avoid extra unlock when setting MTU in enic Weiguo Li
2023-11-01 19:55 ` Ferruh Yigit
2023-11-02  1:25 ` John Daley (johndale)

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).