From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 90A8A1B629; Tue, 6 Feb 2018 03:26:07 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2018 18:26:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,467,1511856000"; d="scan'208";a="16146110" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 05 Feb 2018 18:26:05 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Feb 2018 18:26:05 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Feb 2018 18:26:04 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.253]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.116]) with mapi id 14.03.0319.002; Tue, 6 Feb 2018 10:26:02 +0800 From: "Xing, Beilei" To: "Rybalchenko, Kirill" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Chilikin, Andrey" , "Wu, Jingjing" Thread-Topic: [PATCH v3] net/i40e: fix multiple DDP packages should not be allowed Thread-Index: AQHTm1o/IKiHmOQ+1EqVnZ0sd0oAA6OVo7Ng//+yWACAAVN2cA== Date: Tue, 6 Feb 2018 02:26:01 +0000 Message-ID: <94479800C636CB44BD422CB454846E01320CF3BF@SHSMSX101.ccr.corp.intel.com> References: <1517335797-84501-1-git-send-email-kirill.rybalchenko@intel.com> <1517488985-5264-1-git-send-email-kirill.rybalchenko@intel.com> <94479800C636CB44BD422CB454846E01320CDDEC@SHSMSX101.ccr.corp.intel.com> <696B43C21188DF4F9C9091AAE4789B824E2CE629@IRSMSX108.ger.corp.intel.com> In-Reply-To: <696B43C21188DF4F9C9091AAE4789B824E2CE629@IRSMSX108.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] [PATCH v3] net/i40e: fix multiple DDP packages should not be allowed 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, 06 Feb 2018 02:26:08 -0000 > -----Original Message----- > From: Rybalchenko, Kirill > Sent: Monday, February 5, 2018 9:59 PM > To: Xing, Beilei ; dev@dpdk.org > Cc: stable@dpdk.org; Chilikin, Andrey ; Wu, > Jingjing > Subject: RE: [PATCH v3] net/i40e: fix multiple DDP packages should not be > allowed >=20 > Hi Beilei, >=20 > > -----Original Message----- > > From: Xing, Beilei > > Sent: Monday 5 February 2018 10:41 > > To: Rybalchenko, Kirill ; dev@dpdk.org > > Cc: stable@dpdk.org; Chilikin, Andrey ; Wu, > > Jingjing > > Subject: RE: [PATCH v3] net/i40e: fix multiple DDP packages should not > > be allowed > > > > > @@ -1628,12 +1655,17 @@ > rte_pmd_i40e_process_ddp_package(uint16_t > > > port, uint8_t *buff, > > > > > > if (op =3D=3D RTE_PMD_I40E_PKG_OP_WR_ADD) { > > > if (is_exist) { > > > > How about removing the above if statement since there're 3 if > > statements for is_exist below? >=20 >=20 > This if statement is necessary because these two lines > rte_free(profile_info_sec); > return -EEXIST; > should be executed only if is_exist has non-zero value. > Statements > if (is_exist =3D=3D 1, 2, 3) > are only selector for appropriate log message. >=20 > Or did I misunderstand your idea? Sorry I didn't comment clearly, actually I just think if we can refine the = code here to less indentations. However, the code overall looks OK for me. Will ACK it later. Thanks. >=20 > > > > > - PMD_DRV_LOG(ERR, "Profile already exists."); > > > + if (is_exist =3D=3D 1) > > > + PMD_DRV_LOG(ERR, "Profile already > > > exists."); > > > + else if (is_exist =3D=3D 2) > > > + PMD_DRV_LOG(ERR, "Profile of group 0 > > > already exists."); > > > + else if (is_exist =3D=3D 3) > > > + PMD_DRV_LOG(ERR, "Profile of different > > > group already exists"); > > > rte_free(profile_info_sec); > > > return -EEXIST; > > > } > > > } else if (op =3D=3D RTE_PMD_I40E_PKG_OP_WR_DEL) { > > > - if (!is_exist) { > > > + if (is_exist !=3D 1) { > > > PMD_DRV_LOG(ERR, "Profile does not exist."); > > > rte_free(profile_info_sec); > > > return -EACCES; > > > -- > > > 2.5.5 >=20 > Regards, > Kirill.