DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dengdui Huang <huangdengdui@huawei.com>
Cc: <dev@dpdk.org>, <lihuisong@huawei.com>, <fengchengwen@huawei.com>,
	<liuyonglong@huawei.com>
Subject: Re: [PATCH 1/3] net/hns3: fix inconsistent lock
Date: Wed, 13 Aug 2025 14:06:46 -0700	[thread overview]
Message-ID: <20250813140646.48a2ff16@hermes.local> (raw)
In-Reply-To: <20250813073317.1352274-2-huangdengdui@huawei.com>

On Wed, 13 Aug 2025 15:33:15 +0800
Dengdui Huang <huangdengdui@huawei.com> wrote:

> The hns3 driver supports configuring RSS through both ops API and
> rte_flow API. The ops API uses spink lock, while the rte_flow API uses
> pthread mutex lock. When concurrent calls occur, issues may arise.
> This patch replaces the lock in the flow API with spink lock.
> 
> Fixes: 1bdcca8006e4 ("net/hns3: fix flow director lock")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> ---

With that mutex removed, you can also go farther and remove all references to pthread.

$ git diff
diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h
index a63ab99edc..f6bb1b5d43 100644
--- a/drivers/net/hns3/hns3_ethdev.h
+++ b/drivers/net/hns3/hns3_ethdev.h
@@ -5,7 +5,6 @@
 #ifndef HNS3_ETHDEV_H
 #define HNS3_ETHDEV_H
 
-#include <pthread.h>
 #include <ethdev_driver.h>
 #include <rte_byteorder.h>
 #include <rte_io.h>
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 458d4ffbf1..f2d1e4ec3a 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -2853,13 +2853,10 @@ void
 hns3_flow_init(struct rte_eth_dev *dev)
 {
        struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-       pthread_mutexattr_t attr;
 
        if (rte_eal_process_type() != RTE_PROC_PRIMARY)
                return;
 
-       pthread_mutexattr_init(&attr);
-       pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
        dev->data->dev_flags |= RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE;
 
        TAILQ_INIT(&hw->flow_fdir_list);

  reply	other threads:[~2025-08-13 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-13  7:33 [PATCH 0/3] net/hns3: bugfix for hns3 Dengdui Huang
2025-08-13  7:33 ` [PATCH 1/3] net/hns3: fix inconsistent lock Dengdui Huang
2025-08-13 21:06   ` Stephen Hemminger [this message]
2025-08-13  7:33 ` [PATCH 2/3] net/hns3: fix unrelease VLAN resource when init fail Dengdui Huang
2025-08-13 14:51   ` Stephen Hemminger
2025-08-13  7:33 ` [PATCH 3/3] net/hns3: fix overwrite mbuf in vector path Dengdui Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250813140646.48a2ff16@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=huangdengdui@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=liuyonglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).