DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Gavin Hu (Arm Technology China)" <Gavin.Hu@arm.com>,
	"Phil Yang (Arm Technology China)" <Phil.Yang@arm.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"jerin.jacob@caviumnetworks.com" <jerin.jacob@caviumnetworks.com>,
	Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	Ola Liljedahl <Ola.Liljedahl@arm.com>
Subject: Re: [dpdk-dev] [PATCH v3 2/4] kni: fix kni fifo synchronization
Date: Wed, 10 Oct 2018 15:42:10 +0100	[thread overview]
Message-ID: <7bbec074-5c98-38a5-4dfd-674c0886ea47@intel.com> (raw)
In-Reply-To: <VI1PR08MB3167C4AA31A898D6FAC9C8F48FE00@VI1PR08MB3167.eurprd08.prod.outlook.com>

On 10/10/2018 11:06 AM, Gavin Hu (Arm Technology China) wrote:
> 
> 
>> -----Original Message-----
>> From: Phil Yang (Arm Technology China)
>> Sent: Wednesday, October 10, 2018 5:59 PM
>> To: Stephen Hemminger <stephen@networkplumber.org>
>> Cc: dev@dpdk.org; jerin.jacob@caviumnetworks.com; Gavin Hu (Arm
>> Technology China) <Gavin.Hu@arm.com>; Honnappa Nagarahalli
>> <Honnappa.Nagarahalli@arm.com>; Ola Liljedahl <Ola.Liljedahl@arm.com>;
>> ferruh.yigit@intel.com
>> Subject: RE: [dpdk-dev] [PATCH v3 2/4] kni: fix kni fifo synchronization
>>
>> Hi Hemminger,
>>
>>> -----Original Message-----
>>> From: Stephen Hemminger <stephen@networkplumber.org>
>>> Sent: Tuesday, October 9, 2018 5:53 AM
>>> To: Phil Yang (Arm Technology China) <Phil.Yang@arm.com>
>>> Cc: dev@dpdk.org; jerin.jacob@caviumnetworks.com; Gavin Hu (Arm
>>> Technology China) <Gavin.Hu@arm.com>; Honnappa Nagarahalli
>>> <Honnappa.Nagarahalli@arm.com>; Ola Liljedahl <Ola.Liljedahl@arm.com>;
>>> ferruh.yigit@intel.com
>>> Subject: Re: [dpdk-dev] [PATCH v3 2/4] kni: fix kni fifo
>>> synchronization
>>>
>>> On Mon,  8 Oct 2018 17:11:44 +0800
>>> Phil Yang <phil.yang@arm.com> wrote:
>>>
>>>> diff --git a/lib/librte_kni/rte_kni_fifo.h
>>>> b/lib/librte_kni/rte_kni_fifo.h index ac26a8c..70ac14e 100644
>>>> --- a/lib/librte_kni/rte_kni_fifo.h
>>>> +++ b/lib/librte_kni/rte_kni_fifo.h
>>>> @@ -28,8 +28,9 @@ kni_fifo_put(struct rte_kni_fifo *fifo, void
>>>> **data, unsigned num)  {
>>>>  unsigned i = 0;
>>>>  unsigned fifo_write = fifo->write;
>>>> -unsigned fifo_read = fifo->read;
>>>>  unsigned new_write = fifo_write;
>>>> +rte_smp_rmb();
>>>> +unsigned fifo_read = fifo->read;
>>>>
>>>
>>> The patch makes sense, but this function should be changed to match
>>> kernel code style.
>>> That means no declarations after initial block, and use 'unsigned int'
>>> rather than 'unsigned'
>>>
>>> Also. why is i initialized? Best practice now is to not do gratitious
>>> initialization since it defeats compiler checks for accidental  use of
>> uninitialized variables.
>>>
>>> What makes sense is something like:
>>>
>>> kni_fifo_put(struct rte_kni_fifo *fifo, void **data, unsigned num) {
>>> unsigned int i, fifo_read, fifo_write, new_write;
>>>
>>> fifo_write = fifo->write;
>>> new_write = fifo_write;
>>> rte_smb_rmb();
>>> fifo_read = fifo->read;
>>>
>>> Sorry, blaming you for issues which are inherited from original KNI code.
>>> Maybe someone should run kernel checkpatch (not DPDK checkpatch) on it
>>> and fix those.
>>
>> Thanks for your comment.
>>
>> I think I can submit a new separate patch to fix this historical issue.
>>
>> Thanks,
>> Phil Yang
> 
> I advised a separate patch to make this patch to the point and clean.

+1 to separate patch for clean up.

  reply	other threads:[~2018-10-10 14:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 13:30 [dpdk-dev] [PATCH 1/3] config: use one single config option for C11 memory model Phil Yang
2018-09-19 13:30 ` [dpdk-dev] [PATCH 2/3] kni: fix kni fifo synchronization Phil Yang
2018-09-19 13:30 ` [dpdk-dev] [PATCH 3/3] kni: fix kni kernel " Phil Yang
2018-09-19 13:42 ` [dpdk-dev] [PATCH v2 1/3] config: use one single config option for C11 memory model Phil Yang
2018-09-19 13:42   ` [dpdk-dev] [PATCH v2 2/3] kni: fix kni fifo synchronization Phil Yang
2018-09-20  8:28     ` Jerin Jacob
2018-09-20 15:20       ` Honnappa Nagarahalli
2018-09-20 15:37         ` Jerin Jacob
2018-09-21  5:48           ` Honnappa Nagarahalli
2018-09-21  5:55             ` Jerin Jacob
2018-09-21  6:37               ` Honnappa Nagarahalli
2018-09-21  9:00                 ` Phil Yang (Arm Technology China)
2018-09-25  4:44                 ` Honnappa Nagarahalli
2018-09-26 11:42                 ` Ferruh Yigit
2018-09-27  9:06                   ` Phil Yang (Arm Technology China)
2018-09-26 11:45     ` Ferruh Yigit
2018-10-01  4:52       ` Honnappa Nagarahalli
2018-09-19 13:42   ` [dpdk-dev] [PATCH v2 3/3] kni: fix kni kernel " Phil Yang
2018-09-20  8:21   ` [dpdk-dev] [PATCH v2 1/3] config: use one single config option for C11 memory model Jerin Jacob
2018-10-08  9:11   ` [dpdk-dev] [PATCH v3 1/4] " Phil Yang
2018-10-08  9:11     ` [dpdk-dev] [PATCH v3 2/4] kni: fix kni fifo synchronization Phil Yang
2018-10-08 21:53       ` Stephen Hemminger
2018-10-10  9:58         ` Phil Yang (Arm Technology China)
2018-10-10 10:06           ` Gavin Hu (Arm Technology China)
2018-10-10 14:42             ` Ferruh Yigit [this message]
2018-10-08  9:11     ` [dpdk-dev] [PATCH v3 3/4] kni: fix kni kernel " Phil Yang
2018-10-08  9:11     ` [dpdk-dev] [PATCH v3 4/4] kni: introduce c11 atomic into kni " Phil Yang
2018-10-10 14:48     ` [dpdk-dev] [PATCH v3 1/4] config: use one single config option for C11 memory model Ferruh Yigit
2018-10-12  9:17       ` Phil Yang (Arm Technology China)
2018-10-26 15:56       ` Thomas Monjalon

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=7bbec074-5c98-38a5-4dfd-674c0886ea47@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=Gavin.Hu@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Ola.Liljedahl@arm.com \
    --cc=Phil.Yang@arm.com \
    --cc=dev@dpdk.org \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=stephen@networkplumber.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).