DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
To: Jerin Jacob <jerinjacobk@gmail.com>,
	Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Cc: "Mattias Rönnblom" <hofors@lysator.liu.se>,
	"Jerin Jacob Kollanukkaran" <jerinj@marvell.com>,
	"Jay Jayatheerthan" <jay.jayatheerthan@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"erik.g.carrillo@intel.com" <erik.g.carrillo@intel.com>,
	"abhinandan.gujjar@intel.com" <abhinandan.gujjar@intel.com>,
	"timothy.mcdaniel@intel.com" <timothy.mcdaniel@intel.com>,
	"Shijith Thotton" <sthotton@marvell.com>,
	"hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
	"nipun.gupta@nxp.com" <nipun.gupta@nxp.com>,
	"harry.van.haaren@intel.com" <harry.van.haaren@intel.com>,
	"liangma@liangbit.com" <liangma@liangbit.com>,
	"peter.mccarthy@intel.com" <peter.mccarthy@intel.com>
Subject: Re: [EXT] Re: [PATCH 1/3] eventdev: add element offset to event vector
Date: Wed, 14 Sep 2022 14:55:58 +0000	[thread overview]
Message-ID: <05ebb64d-99e2-3b43-dab0-c858aaa42214@ericsson.com> (raw)
In-Reply-To: <CALBAE1NGHKFKxogL0ABM5Bu0CNqJ=+=WsspUxCotnKi5F+tpvQ@mail.gmail.com>

On 2022-09-14 15:02, Jerin Jacob wrote:
>>>>>>     struct rte_event_vector {
>>>>>>            uint16_t nb_elem;
>>>>>> - /**< Number of elements in this event vector. */
>>>>>> - uint16_t rsvd : 15;
>>>>>> + /**< Total number of elements in this event vector. */
>>>>>
>>>>> I'm not sure "total" adds anything here. Didn't the old nb_elem also
>>>>> include the total number of elements?
>>>>>
>>>>
>>>> Yes, I added it to clarify that it includes slots that don’t have valid elements.
>>>> I will update the comment to convey that it includes elements before
>>> offset.
>>>>
>>>
>>> The issue is that it doesn't clarify anything. Change the name, or
>>> change the semantics to fit the name, instead of explaining a poor name
>>> in a comment.
>>>
>>
>> Names are always subjective and will confuse someone or the other.
>> But we can do our best to communicate the semantics, how about
>> total_(elements|slots|lanes) and valid_(element|slot|lane)_offset.
>>
>> I will send the next version once we agree upon the naming.
> 
> In order to make forward progress, @Mattias Rönnblom Do you have
> specific name suggestions for the next version?
> If not, I suggest to pick total_elements

I may be missing something here, but I would suggest keeping the old 
name and old semantics. I.e, nb_elem is the number of elements actually 
used. New is only that they may start at index elem_offset, as opposed 
to the old always-at-index-0.

Instead of changes like:
-		for (i = 0; i < vec->nb_elem; i++) {
+		for (i = vec->elem_offset; i < vec->nb_elem; i++) {
    			port = mbufs[i]->port;
    			queue =

You would have:
		for (i = 0; i < vec->nb_elem; i++) {
-   			port = mbufs[i]->port;
+   			port = mbufs[i + vec->elem_offset]->port;
    			queue =


If you for some reason want to have the start index and the end index 
(like the patch suggested), you could replace the original nb_elem with 
two fields, elem_start (what patch calls elem_offset) and elem_end (what 
patch call nb_elem). I think having only an offset and a length is more 
straightforward though. In the elem_end case, you will have people 
asking themselves if it is the last index used, or the first index not 
used (i.e., last index + 1).


  reply	other threads:[~2022-09-14 14:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 15:49 pbhagavatula
2022-08-16 15:49 ` [PATCH 2/3] examples: update event vector free routine pbhagavatula
2022-08-16 15:49 ` [PATCH 3/3] event/cnxk: update event vector Tx routine pbhagavatula
2022-08-18 16:28 ` [PATCH 1/3] eventdev: add element offset to event vector Mattias Rönnblom
2022-08-23 20:39   ` [EXT] " Pavan Nikhilesh Bhagavatula
2022-08-24  8:41     ` Mattias Rönnblom
2022-08-29  8:47       ` Pavan Nikhilesh Bhagavatula
2022-09-14 13:02         ` Jerin Jacob
2022-09-14 14:55           ` Mattias Rönnblom [this message]
2022-09-21 16:43 ` [PATCH v2 " pbhagavatula
2022-09-21 16:43   ` [PATCH v2 2/3] examples: update event vector free routine pbhagavatula
2022-09-21 16:43   ` [PATCH v2 3/3] event/cnxk: update event vector Tx routine pbhagavatula
2022-09-22  5:40   ` [PATCH v2 1/3] eventdev: add element offset to event vector Mattias Rönnblom
2022-09-27 13:42     ` Jerin Jacob

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=05ebb64d-99e2-3b43-dab0-c858aaa42214@ericsson.com \
    --to=mattias.ronnblom@ericsson.com \
    --cc=abhinandan.gujjar@intel.com \
    --cc=dev@dpdk.org \
    --cc=erik.g.carrillo@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hofors@lysator.liu.se \
    --cc=jay.jayatheerthan@intel.com \
    --cc=jerinj@marvell.com \
    --cc=jerinjacobk@gmail.com \
    --cc=liangma@liangbit.com \
    --cc=nipun.gupta@nxp.com \
    --cc=pbhagavatula@marvell.com \
    --cc=peter.mccarthy@intel.com \
    --cc=sthotton@marvell.com \
    --cc=timothy.mcdaniel@intel.com \
    /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).