From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Rybalchenko, Kirill" <kirill.rybalchenko@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>,
"Chilikin, Andrey" <andrey.chilikin@intel.com>,
"Wu, Jingjing" <jingjing.wu@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix multiple DDP packages should not be allowed
Date: Tue, 6 Feb 2018 02:26:01 +0000 [thread overview]
Message-ID: <94479800C636CB44BD422CB454846E01320CF3BF@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <696B43C21188DF4F9C9091AAE4789B824E2CE629@IRSMSX108.ger.corp.intel.com>
> -----Original Message-----
> From: Rybalchenko, Kirill
> Sent: Monday, February 5, 2018 9:59 PM
> To: Xing, Beilei <beilei.xing@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Chilikin, Andrey <andrey.chilikin@intel.com>; Wu,
> Jingjing <jingjing.wu@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@intel.com>; dev@dpdk.org
> > Cc: stable@dpdk.org; Chilikin, Andrey <andrey.chilikin@intel.com>; Wu,
> > Jingjing <jingjing.wu@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.
next prev parent reply other threads:[~2018-02-06 2:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-30 18:09 [dpdk-dev] [PATCH v2] " Kirill Rybalchenko
2018-02-01 12:43 ` [dpdk-dev] [PATCH v3] " Kirill Rybalchenko
2018-02-01 13:27 ` Chilikin, Andrey
2018-02-05 10:41 ` Xing, Beilei
2018-02-05 13:58 ` Rybalchenko, Kirill
2018-02-06 2:26 ` Xing, Beilei [this message]
2018-02-06 2:27 ` Xing, Beilei
2018-02-06 15:17 ` Zhang, Helin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=94479800C636CB44BD422CB454846E01320CF3BF@SHSMSX101.ccr.corp.intel.com \
--to=beilei.xing@intel.com \
--cc=andrey.chilikin@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=kirill.rybalchenko@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).