DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dongdong Liu <liudongdong3@huawei.com>
To: <dev@dpdk.org>
Cc: <stable@dpdk.org>, Huisong Li <lihuisong@huawei.com>,
	Dongdong Liu <liudongdong3@huawei.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	Lijun Ou <oulijun@huawei.com>,
	Chengwen Feng <fengchengwen@huawei.com>
Subject: [PATCH 1/2] net/hns3: fix fail to obtain VF LSC capability
Date: Sat, 11 Jun 2022 15:42:26 +0800	[thread overview]
Message-ID: <20220611074227.30276-2-liudongdong3@huawei.com> (raw)
In-Reply-To: <20220611074227.30276-1-liudongdong3@huawei.com>

From: Huisong Li <lihuisong@huawei.com>

Currently, the VF LSC capability is obtained from PF driver in
the interrupt mailbox interrupt thread, it is asynchronous.
The VF driver waits for 500ms to get this capability in probe
process.

The primary process will receive a message and do probe in the
interrupt thread context when attach a device in the secondary
process. At this case, VF driver never obtains this capability
from PF.

The root cause is that 'vf->pf_push_lsc_cap' is not updated by
the handling mailbox thread until finishing probe. The reason
this update wouldn't be done is that the handling mailbox interrupt
thread and the probe alarm thread are both in epool thread, and
the probe alarm thread is before the mailbox interrupt thread.

Fixes: 9bc2289fe5ea ("net/hns3: refactor VF LSC event report")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index bebfaa6417..3abd4aafcb 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -777,6 +777,14 @@ hns3vf_get_push_lsc_cap(struct hns3_hw *hw)
 
 	while (remain_ms > 0) {
 		rte_delay_ms(HNS3_POLL_RESPONE_MS);
+		/*
+		 * The probe process may perform in interrupt thread context.
+		 * For example, users attach a device in the secondary process.
+		 * At the moment, the handling mailbox task will be blocked. So
+		 * driver has to actively handle the HNS3_MBX_LINK_STAT_CHANGE
+		 * mailbox from PF driver to get this capability.
+		 */
+		hns3_dev_handle_mbx_msg(hw);
 		if (__atomic_load_n(&vf->pf_push_lsc_cap, __ATOMIC_ACQUIRE) !=
 			HNS3_PF_PUSH_LSC_CAP_UNKNOWN)
 			break;
-- 
2.22.0


  reply	other threads:[~2022-06-11  7:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11  7:42 [PATCH 0/2] net/hns3: support backplane media type Dongdong Liu
2022-06-11  7:42 ` Dongdong Liu [this message]
2022-06-24 12:01   ` [PATCH 1/2] net/hns3: fix fail to obtain VF LSC capability Ferruh Yigit
2022-06-11  7:42 ` [PATCH 2/2] net/hns3: support backplane media type Dongdong Liu
2022-06-21 12:57   ` Ferruh Yigit
2022-06-22  2:45     ` Dongdong Liu
2022-06-22  3:09   ` [PATCH V2 " Dongdong Liu
2022-06-22 10:06     ` Ferruh Yigit
2022-06-22 10:29       ` Dongdong Liu
2022-06-22 10:59   ` [PATCH V3 " Dongdong Liu
2022-06-24 12:02     ` Ferruh Yigit

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=20220611074227.30276-2-liudongdong3@huawei.com \
    --to=liudongdong3@huawei.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=humin29@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=oulijun@huawei.com \
    --cc=stable@dpdk.org \
    --cc=yisen.zhuang@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).