DPDK patches and discussions
 help / color / mirror / Atom feed
From: zhoumin <zhoumin@loongson.cn>
To: Ferruh Yigit <ferruh.yigit@amd.com>,
	aman.deep.singh@intel.com, yuying.zhang@intel.com
Cc: dev@dpdk.org, maobibo@loongson.cn,
	Qiming Yang <qiming.yang@intel.com>,
	Wenjun Wu <wenjun1.wu@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>
Subject: Re: [RFC] app/testpmd: use RSS conf from software when configuring DCB
Date: Wed, 14 Jun 2023 10:22:45 +0800	[thread overview]
Message-ID: <7c4a1290-f47b-2648-4c67-085f8e58ac14@loongson.cn> (raw)
In-Reply-To: <38f4bfd4-fced-bd0b-6261-1b34cd894dda@amd.com>

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

Hi Ferruh,

On Wed, June 7, 2023 at 2:09AM, Ferruh Yigit wrote:
> On 5/8/2023 2:21 AM, zhoumin wrote:
>> Kindly ping.
>>
> Hi Min,
>
> Sorry for the delay.
>
>> Should we solve this problem by modifying PMDs?
>>
>> Is it suitable to maintain the RSS configurations for NIC by testpmd in
>> order to set DCB?
>>
>>
>> On Thur, Apr 27, 2023 at 4:33PM, zhoumin wrote:
>>> Kindly ping.
>>>
>>> Any comments or suggestions will be appreciated.
>>>
>>> Best regards
>>> Min
>>>
>>>
>>> On 2023/4/12 下午5:52, Min Zhou wrote:
>>>> In the testpmd command, we have to stop the port firstly before
>>>> configuring
>>>> the DCB. However, some PMDs may execute a hardware reset during the port
>>>> stop, such as ixgbe. Some kind of reset operations of PMD could clear
>>>> the
>>>> configurations of RSS in the hardware register. This would cause the
>>>> loss
>>>> of RSS configurations that were set during the testpmd
>>>> initialization. As
>>>> a result, I find that I cannot enable RSS and DCB at the same time in
>>>> the
>>>> testpmd command when using Intel 82599 NIC.
>>>>
> cc'ed ixgbe maintainers too.
OK, thanks.
>
> @Qiming, @Wenjun, are you testing DCB with RSS configuration?
>
>
> Min,
>
> Can you please give more detail on the problem, do you have in only on
> device reset, or is there a generic problem on enabling DCB with RSS?

Yes, I will give more details on the problem blow.

I think it is not a generic problem on enabling DCB with RSS. It depends 
on the implementation of "port stop" in the driver's codes. I can 
successfully enable DCB with RSS in the testpmd when it uses the i40e 
driver.

It's very easy to reproduce this problem. I will demonstrate the process 
below:

1. First we start the testpmd program with enabling  RSS using 82599 NICs:

$ ./build/app/dpdk-testpmd -l 0-6 -- -i --rss-ip --rxq=6 --txq=6 
--nb-cores=6

2. Then show the RSS configuration in the testpmd:

testpmd> show port 0 rss-hash

RSS functions:
   ipv4  ipv6  ipv6-ex

3. The above outputs are normal and then we try to enable DCB:

testpmd> port config 0 dcb vt off 4 pfc on
Please stop port 0 first

4. So we have to stop the port before enabling DCB:

testpmd> port stop 0
Stopping ports...
Checking link statuses...
ixgbe_dev_link_update_share(): Other link thread is running now!
Done

5. However, we will find that the RSS was disabled after stopping the port:

testpmd> show port 0 rss-hash
RSS disabled


RSS is enabled in the MRQC register of 82599. The MRQC register supplied 
in section 8.2.3.7.12 of the Intel 82599 datasheet.

I added some outputs before and after port reset in the port stop 
process of ixgbe driver as follows:

diff --git a/drivers/net/ixgbe/base/ixgbe_82599.c 
b/drivers/net/ixgbe/base/ixgbe_82599.c
index c6e8b7e976..b13431a43f 100644
--- a/drivers/net/ixgbe/base/ixgbe_82599.c
+++ b/drivers/net/ixgbe/base/ixgbe_82599.c
@@ -1053,6 +1053,7 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
                 if (link_up)
                         ctrl = IXGBE_CTRL_RST;
         }
+       printf("%s: MRQC = 0x%x\n", __func__, IXGBE_READ_REG(hw, 
IXGBE_MRQC));

         ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
         IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
@@ -1065,6 +1066,7 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
                 if (!(ctrl & IXGBE_CTRL_RST_MASK))
                         break;
         }
+       printf("%s: MRQC = 0x%x\n", __func__, IXGBE_READ_REG(hw, 
IXGBE_MRQC));

         if (ctrl & IXGBE_CTRL_RST_MASK) {
                 status = IXGBE_ERR_RESET_FAILED;

We could find that the RSS configurations will be cleared after port 
reset as follows:

testpmd> port stop 0
Stopping ports...
ixgbe_reset_hw_82599: MRQC = 0x1a0001
ixgbe_reset_hw_82599: MRQC = 0x0
Checking link statuses...
ixgbe_dev_link_update_share(): Other link thread is running now!
Done

However, I have not find the exact descriptions about this behavior in 
the 82599 datasheet. Could @Qiming, @Wenjun give me some indications ?

So, if we want to get the RSS configurations by reading from the 
register after the port stop, we will get nothing.

> Also can you please describe how/why removing RSS configuration (this
> patch) helps on the problem?

As above said, I'm concerned whether we could reuse the RSS 
configurations recorded in the testpmd if the port reset cannot be 
avoided in the driver.

So, this patch wants to reuse the RSS configurations maintained by 
testpmd instead of reading from the register.

I'm not sure if this is a reasonable method to solve this problem.

> Thanks,
> ferruh

[...]

Best regards,

Min



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

      reply	other threads:[~2023-06-14  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  9:52 Min Zhou
2023-04-27  8:33 ` zhoumin
2023-05-08  1:21   ` zhoumin
2023-06-06 18:09     ` Ferruh Yigit
2023-06-14  2:22       ` zhoumin [this message]

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=7c4a1290-f47b-2648-4c67-085f8e58ac14@loongson.cn \
    --to=zhoumin@loongson.cn \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=maobibo@loongson.cn \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=wenjun1.wu@intel.com \
    --cc=yuying.zhang@intel.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).