From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Adrien Mazarguil <adrien.mazarguil@6wind.com>,
Ilya Matveychikov <matvejchikov@gmail.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] A question about (poor) rte_ethdev internal rx/tx callbacks design
Date: Mon, 13 Nov 2017 10:58:58 +0000 [thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772585FABC9F3@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <20171113103927.GP24849@6wind.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Adrien Mazarguil
> Sent: Monday, November 13, 2017 10:39 AM
> To: Ilya Matveychikov <matvejchikov@gmail.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] A question about (poor) rte_ethdev internal rx/tx callbacks design
>
> On Sat, Nov 11, 2017 at 09:18:45PM +0400, Ilya Matveychikov wrote:
> > Folks,
> >
> > Are you serious with it:
> >
> > typedef uint16_t (*eth_rx_burst_t)(void *rxq,
> > struct rte_mbuf **rx_pkts,
> > uint16_t nb_pkts);
> > typedef uint16_t (*eth_tx_burst_t)(void *txq,
> > struct rte_mbuf **tx_pkts,
> > uint16_t nb_pkts);
> >
> > I’m not surprised that every PMD stores port_id in every and each queue as having just the queue as an argument doesn’t allow to get the
> device. So the question is - why not to use something like:
> >
> > typedef uint16_t (*eth_rx_burst_t)(void *dev, uint16_t queue_id,
> > struct rte_mbuf **rx_pkts,
> > uint16_t nb_pkts);
> > typedef uint16_t (*eth_tx_burst_t)(void *dev, uint16_t queue_id,
> > struct rte_mbuf **tx_pkts,
> > uint16_t nb_pkts);
>
> I assume it's since the rte_eth_[rt]x_burst() wrappers already pay the price
> for that indirection, doing it twice would be redundant.
>
> Basically the cost of storing a back-pointer to dev or a queue index in each
> Rx/Tx queue structure is minor compared to saving a couple of CPU cycles
> wherever we can.
For many PMDs we don't need that pointer at all to do RX/TX -
information stored inside the queue is sufficient.
Konstantin
>
> I'm not saying its the only solution nor the right approach, it's only one
> possible explanation for this API.
>
> --
> Adrien Mazarguil
> 6WIND
prev parent reply other threads:[~2017-11-13 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-11 17:18 Ilya Matveychikov
2017-11-12 2:43 ` Thomas Monjalon
2017-11-13 10:39 ` Adrien Mazarguil
2017-11-13 10:56 ` Ilya Matveychikov
2017-11-13 17:15 ` Adrien Mazarguil
2017-11-13 19:33 ` Ilya Matveychikov
2017-11-14 6:24 ` Andrew Rybchenko
2017-11-13 10:58 ` Ananyev, Konstantin [this message]
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=2601191342CEEE43887BDE71AB9772585FABC9F3@irsmsx105.ger.corp.intel.com \
--to=konstantin.ananyev@intel.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=matvejchikov@gmail.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).