From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 63A58201 for ; Tue, 13 Nov 2018 03:28:03 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2018 18:28:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,497,1534834800"; d="scan'208";a="86021254" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 12 Nov 2018 18:28:02 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 12 Nov 2018 18:28:02 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 12 Nov 2018 18:28:01 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.161]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.199]) with mapi id 14.03.0415.000; Tue, 13 Nov 2018 10:27:23 +0800 From: "Peng, Yuan" To: "Zhao1, Wei" , Adrien Mazarguil CC: "dev@dpdk.org" Thread-Topic: FW: [PATCH] net/i40e: add parameter check for RSS flow init Thread-Index: AQHUem0VWwRvl6BNnE6F8iBtnvC2jKVLYqIAgABDRICAAL+uAIAAlbvA Date: Tue, 13 Nov 2018 02:27:21 +0000 Message-ID: <67D543A150B29E4CAAE53918F64EDAEA37648A56@SHSMSX103.ccr.corp.intel.com> References: <1542014724-68073-1-git-send-email-wei.zhao1@intel.com> <20181112140305.GD17131@6wind.com> In-Reply-To: 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: [10.239.127.40] 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:28:05 -0000 Hi, Adrien Mazarguil Yes. It's just the problem related to commit a4391f8bae85db0153e1f101c21c61= 151573baad "app/testpmd: set default RSS key as null". You can check the detailed bug information from https://jira01.devtools.int= el.com/browse/DPDK-7136?filter=3D-2 Thank you. Yuan. -----Original Message----- From: Zhao1, Wei=20 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 Hi, Adrien Mazarguil Peng yuan has find this problem, if you use the following test step, You = will find the problem. ./x86_64-native-linuxapp-gcc/app/testpmd -c 1ffff -n 4 - -i --nb-cores=3D8 = --rxq=3D4 --txq=3D4 --port-topology=3Dchained ............... testpmd> start testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp=20 testpmd> end key 67108863 / end Segmentation fault (core dumped) https://patches.dpdk.org/patch/47995/ This is the protection I have add, but you still need fix some bug in rte_f= low CLI. > -----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 >=20 > Hi Wei, >=20 > 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 specif= ic key > from testpmd CLI, I add some protection but you also need fix that bug in= CLI > layer. >=20 > Odd, is that new? You shouldn't need to worry about the pointer if key_le= n is > zero. >=20 > Isn't this problem related to commit a4391f8bae85 "app/testpmd: set defau= lt > RSS key as null"? There's an ongoing discussion to revert this patch [1]. testpmd> flow create 0 ingress pattern end actions rss types ipv4-udp end k= ey 67108863 / end This CLI command key is not NLLL, but i40E PMD get NULL. > [1] https://mails.dpdk.org/archives/dev/2018-November/118633.html >=20 > > > -----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 > > >=20 > -- > Adrien Mazarguil > 6WIND