[dpdk-dev] [PATCH v3] net/i40e: fix multiple DDP packages should not be allowed
Xing, Beilei
beilei.xing at intel.com
Tue Feb 6 03:26:01 CET 2018
> -----Original Message-----
> From: Rybalchenko, Kirill
> Sent: Monday, February 5, 2018 9:59 PM
> To: Xing, Beilei <beilei.xing at intel.com>; dev at dpdk.org
> Cc: stable at dpdk.org; Chilikin, Andrey <andrey.chilikin at intel.com>; Wu,
> Jingjing <jingjing.wu at intel.com>
> Subject: RE: [PATCH v3] net/i40e: fix multiple DDP packages should not be
> allowed
>
> Hi Beilei,
>
> > -----Original Message-----
> > From: Xing, Beilei
> > Sent: Monday 5 February 2018 10:41
> > To: Rybalchenko, Kirill <kirill.rybalchenko at intel.com>; dev at dpdk.org
> > Cc: stable at dpdk.org; Chilikin, Andrey <andrey.chilikin at intel.com>; Wu,
> > Jingjing <jingjing.wu at intel.com>
> > 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 == 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?
>
>
> 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 == 1, 2, 3)
> are only selector for appropriate log message.
>
> 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.
>
> >
> > > - PMD_DRV_LOG(ERR, "Profile already exists.");
> > > + if (is_exist == 1)
> > > + PMD_DRV_LOG(ERR, "Profile already
> > > exists.");
> > > + else if (is_exist == 2)
> > > + PMD_DRV_LOG(ERR, "Profile of group 0
> > > already exists.");
> > > + else if (is_exist == 3)
> > > + PMD_DRV_LOG(ERR, "Profile of different
> > > group already exists");
> > > rte_free(profile_info_sec);
> > > return -EEXIST;
> > > }
> > > } else if (op == RTE_PMD_I40E_PKG_OP_WR_DEL) {
> > > - if (!is_exist) {
> > > + if (is_exist != 1) {
> > > PMD_DRV_LOG(ERR, "Profile does not exist.");
> > > rte_free(profile_info_sec);
> > > return -EACCES;
> > > --
> > > 2.5.5
>
> Regards,
> Kirill.
More information about the dev
mailing list