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 0CB411B383; Mon, 5 Feb 2018 14:58:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2018 05:58:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,464,1511856000"; d="scan'208";a="32096714" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga002.jf.intel.com with ESMTP; 05 Feb 2018 05:58:43 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.9]) by IRSMSX104.ger.corp.intel.com ([169.254.5.101]) with mapi id 14.03.0319.002; Mon, 5 Feb 2018 13:58:42 +0000 From: "Rybalchenko, Kirill" To: "Xing, Beilei" , "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: AQHTm1o4Ve4SECy0r0GCbBjOxqJ80qOVpPaAgAA1aOA= Date: Mon, 5 Feb 2018 13:58:42 +0000 Message-ID: <696B43C21188DF4F9C9091AAE4789B824E2CE629@IRSMSX108.ger.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> In-Reply-To: <94479800C636CB44BD422CB454846E01320CDDEC@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDJkNGMwMTMtYmVjNC00ZTFhLWIwZDUtZjk0ZmUwMDJkYmE5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImV6M3ZjbHlkMzZVWWhockErQkhcLzZ0OUlVZjI2aW5VaFl5UFVOeVZaZFUwPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] 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: Mon, 05 Feb 2018 13:58:46 -0000 Hi Beilei, > -----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 >=20 > > @@ -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) { >=20 > How about removing the above if statement since there're 3 if statements > for is_exist below? 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. Or did I misunderstand your idea?=20 >=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 Regards, Kirill.