From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 8360591 for ; Tue, 13 Nov 2018 03:41:14 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2018 18:41:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,497,1534834800"; d="scan'208";a="86023369" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by fmsmga008.fm.intel.com with ESMTP; 12 Nov 2018 18:41:12 -0800 Received: from pgsmsx109.gar.corp.intel.com (10.221.44.109) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 13 Nov 2018 10:41:11 +0800 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.114]) by PGSMSX109.gar.corp.intel.com ([169.254.14.66]) with mapi id 14.03.0415.000; Tue, 13 Nov 2018 10:41:11 +0800 From: "Zhao1, Wei" To: "ophirmu@mellanox.com" CC: "dev@dpdk.org" , "Peng, Yuan" , Adrien Mazarguil Thread-Topic: FW: [PATCH] net/i40e: add parameter check for RSS flow init Thread-Index: AQHUem0X7hI/fkPBY0iQ1soVNyEexqVL599Q//++B4CAAUNWsP//jJyAgACJkSA= Date: Tue, 13 Nov 2018 02:41:11 +0000 Message-ID: References: <1542014724-68073-1-git-send-email-wei.zhao1@intel.com> <20181112140305.GD17131@6wind.com> <67D543A150B29E4CAAE53918F64EDAEA37648A56@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <67D543A150B29E4CAAE53918F64EDAEA37648A56@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] FW: [PATCH] net/i40e: add parameter check for RSS flow init X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2018 02:41:15 -0000 Add Ophir Munk for discussion. > -----Original Message----- > From: Peng, Yuan > Sent: Tuesday, November 13, 2018 10:27 AM > To: Zhao1, Wei ; Adrien Mazarguil > > Cc: dev@dpdk.org > Subject: RE: FW: [PATCH] net/i40e: add parameter check for RSS flow init >=20 > Hi, Adrien Mazarguil >=20 > Yes. It's just the problem related to commit > a4391f8bae85db0153e1f101c21c61151573baad "app/testpmd: set default RSS > key as null". > You can check the detailed bug information from > https://jira01.devtools.intel.com/browse/DPDK-7136?filter=3D-2 >=20 > Thank you. > Yuan. >=20 > -----Original Message----- > From: Zhao1, Wei > Sent: Tuesday, November 13, 2018 9:29 AM > To: Adrien Mazarguil > Cc: Peng, Yuan ; dev@dpdk.org > Subject: RE: FW: [PATCH] net/i40e: add parameter check for RSS flow init >=20 > Hi, Adrien Mazarguil >=20 > Peng yuan has find this problem, if you use the following test step, > You will find the problem. >=20 > ./x86_64-native-linuxapp-gcc/app/testpmd -c 1ffff -n 4 - -i --nb-cores=3D= 8 -- > rxq=3D4 --txq=3D4 --port-topology=3Dchained ............... > testpmd> start > testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp > testpmd> end key 67108863 / end > Segmentation fault (core dumped) >=20 >=20 > https://patches.dpdk.org/patch/47995/ > This is the protection I have add, but you still need fix some bug in rte= _flow > CLI. >=20 >=20 > > -----Original Message----- > > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > > Sent: Monday, November 12, 2018 10:03 PM > > To: Zhao1, Wei > > Cc: Peng, Yuan > > Subject: Re: FW: [PATCH] net/i40e: add parameter check for RSS flow > > init > > > > Hi Wei, > > > > On Mon, Nov 12, 2018 at 10:02:20AM +0000, Zhao1, Wei wrote: > > > Hi, adrien.mazarguil > > > > > > There is some error in CML layer for config this parameter, in > > > i40e PMD it will get NULL of in->key even if tester config Some > > > specific key > > from testpmd CLI, I add some protection but you also need fix that bug > > in CLI layer. > > > > Odd, is that new? You shouldn't need to worry about the pointer if > > key_len is zero. > > > > Isn't this problem related to commit a4391f8bae85 "app/testpmd: set > > default RSS key as null"? There's an ongoing discussion to revert this = patch > [1]. >=20 > testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp > testpmd> end key 67108863 / end >=20 > This CLI command key is not NLLL, but i40E PMD get NULL. >=20 > > [1] https://mails.dpdk.org/archives/dev/2018-November/118633.html > > > > > > -----Original Message----- > > > > From: Zhao1, Wei > > > > Sent: Monday, November 12, 2018 5:25 PM > > > > To: dev@dpdk.org > > > > Cc: Zhang, Qi Z ; stable@dpdk.org; Peng, > > > > Yuan ; Zhao1, Wei > > > > Subject: [PATCH] net/i40e: add parameter check for RSS flow init > > > > > > > > There need an parameter check for RSS flow init, or it may cause > > > > core dump if pointer is NULL in memory copy. > > > > > > > > Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow > > > > API") > > > > > > > > Signed-off-by: Wei Zhao > > > > --- > > > > drivers/net/i40e/i40e_ethdev.c | 5 ++++- > > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > > > b/drivers/net/i40e/i40e_ethdev.c index 1c77906..217a8dc 100644 > > > > --- a/drivers/net/i40e/i40e_ethdev.c > > > > +++ b/drivers/net/i40e/i40e_ethdev.c > > > > @@ -12552,13 +12552,16 @@ i40e_rss_conf_init(struct > > > > i40e_rte_flow_rss_conf *out, > > > > if (in->key_len > RTE_DIM(out->key) || > > > > in->queue_num > RTE_DIM(out->queue)) > > > > return -EINVAL; > > > > + if (!in->key && in->key_len) > > > > + return -EINVAL; > > > > + if (out->key && in->key) > > > > + out->conf.key =3D memcpy(out->key, in->key, in->key_len); > > > > out->conf =3D (struct rte_flow_action_rss){ > > > > .func =3D in->func, > > > > .level =3D in->level, > > > > .types =3D in->types, > > > > .key_len =3D in->key_len, > > > > .queue_num =3D in->queue_num, > > > > - .key =3D memcpy(out->key, in->key, in->key_len), > > > > .queue =3D memcpy(out->queue, in->queue, > > > > sizeof(*in->queue) * in->queue_num), > > > > }; > > > > -- > > > > 2.7.5 > > > > > > > -- > > Adrien Mazarguil > > 6WIND