patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>,
	Ting Xu <ting.xu@intel.com>,
	dev@dpdk.org
Cc: thomas@monjalon.net, Heinrich Kuhn <heinrich.kuhn@netronome.com>,
	stable@dpdk.org
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v5] ethdev: fix DCB set failure
Date: Mon, 18 May 2020 17:20:25 +0100	[thread overview]
Message-ID: <ff18606a-e43d-51a3-b6ed-801e79245460@intel.com> (raw)
In-Reply-To: <13617e23-5b0a-5fe8-1c5e-06f59faf2951@solarflare.com>

On 5/18/2020 2:32 PM, Andrew Rybchenko wrote:
> CC net/nfp maintainer
> 
> On 5/13/20 8:16 PM, Ting Xu wrote:
>> When rte_eth_dev_rss_hash_conf_get() is called, if the variable
>> rss_conf is not initialized, the pointer member variable rss_key
>> may have a random address, which leads to an error in the following
>> processing. This patch initialized the variable rss_conf to avoid
>> this situation.
>>
>> Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ting Xu <ting.xu@intel.com>
>>
>> ---
>> v4->v5: modify commit log
>> V3->v4: fix build failure
>> v2->v3: move memset to rte_eth_dev_rss_hash_conf_get from testpmd
>> v1->v2: modify commit log, move memset to else leg
>> ---
>>  lib/librte_ethdev/rte_ethdev.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>> index 8e10a6fc3..b20c6bb2d 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -3552,6 +3552,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
>>  	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>>  	dev = &rte_eth_devices[port_id];
>>  	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP);
>> +	memset(rss_conf, 0, sizeof(*rss_conf));
>>  	return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
>>  								   rss_conf));
>>  }
>>
> 
> The patch breaks getting of RSS key since it resets rss_conf->rss_key to
> NULL, but all drivers treat it as
> a  pointer to buffer to copy RSS key to.

:(
Of course it is a pointer to copy the RSS key, no idea what I was thinking.

Thanks for catching this before goes into main repo.

> Almost all driver just skip RSS key copy if the pointer
> is NULL.
> 
> I think it should be removed from next-net or improved

+1, I will drop the ethdev patch, and replace it with the testpmd one.

> to reset rss_hf only since rss_key_len may be treated
> as a size of rss_key buffer. The API is not clear at
> the place.
> 
> It looks like net/nfp is the only driver which does
> not check that that pointer is not NULL before coping
> key to it.
> 


      parent reply	other threads:[~2020-05-18 16:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11 10:25 [dpdk-stable] [PATCH v1] app/testpmd: fix DCB set failure in FreeBSD by clang Ting Xu
2020-05-11  5:12 ` Xing, Beilei
2020-05-11  7:50 ` [dpdk-stable] [dpdk-dev] " Huang, ZhiminX
2020-05-11 16:29 ` Ferruh Yigit
2020-05-12  2:17   ` Xu, Ting
2020-05-12 11:42     ` Iremonger, Bernard
2020-05-12 10:13 ` [dpdk-stable] [PATCH v2] app/testpmd: fix DCB set failure Ting Xu
2020-05-18 17:06   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2020-05-13  9:50 ` [dpdk-stable] [PATCH v3] " Ting Xu
2020-05-13 10:07 ` [dpdk-stable] [PATCH v4] " Ting Xu
2020-05-13  8:54   ` [dpdk-stable] [dpdk-dev] " Iremonger, Bernard
2020-05-13 12:58     ` Thomas Monjalon
2020-05-13 17:16 ` [dpdk-stable] [PATCH v5] ethdev: " Ting Xu
2020-05-13 13:28   ` Ferruh Yigit
2020-05-18 16:24     ` Ferruh Yigit
2020-05-13 15:54   ` [dpdk-stable] [dpdk-dev] " Iremonger, Bernard
2020-05-18 13:32   ` Andrew Rybchenko
2020-05-18 14:57     ` Matan Azrad
2020-05-18 16:21       ` Ferruh Yigit
2020-05-18 16:20     ` Ferruh Yigit [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=ff18606a-e43d-51a3-b6ed-801e79245460@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=heinrich.kuhn@netronome.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=ting.xu@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).