DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: David Marchand <david.marchand@redhat.com>, <dev@dpdk.org>
Subject: Re: [RFC PATCH 00/21] Reduce code duplication across Intel NIC drivers
Date: Tue, 26 Nov 2024 15:27:58 +0000	[thread overview]
Message-ID: <Z0Xo_o2nAL8AAWNK@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <4660096.iZASKD2KPV@thomas>

On Tue, Nov 26, 2024 at 03:57:42PM +0100, Thomas Monjalon wrote:
> 25/11/2024 17:31, Bruce Richardson:
> > On Mon, Nov 25, 2024 at 05:25:47PM +0100, David Marchand wrote:
> > > Hello Bruce,
> > > 
> > > On Fri, Nov 22, 2024 at 1:54 PM Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > This RFC attempts to reduce the amount of code duplication across a
> > > > number of Intel NIC drivers, specifically: ixgbe, i40e, iavf, and ice.
> > > 
> > > Thanks for starting this effort!
> > > 
> > > >
> > > > The first patch extract a function from the Rx side, otherwise the
> > > > majority of the changes are on the Tx side, leading to a converged Tx
> > > > queue structure across the 4 drivers, and a large number of common
> > > > functions.
> > > >
> > > > Open question:
> > > > * How should common code across drivers within a single device class be
> > > >   managed?
> > > >   - For now, I've created an "intel_eth" folder within the "common"
> > > >     driver directory, thinking about it after, it  implies to me that
> > > >     it is common across driver classes.
> > > >   - Would it be better to create an "intel_common" directory within the
> > > >     "net" folder?
> > > 
> > > common/ drivers currently host code that is device class agnostic,
> > > like providing helpers to talk with hw.
> > > No common/ driver has a dependency on some device class library.
> > > 
> > > This series adds code that is not built into a library so there is no
> > > need to express dependencies in meson.
> > > But if the need arises, could it become a problem? (adding a
> > > dependency to lib/ethdev to some drivers/common/xx/).
> > > 
> > > 
> > > For now, I prefer the second proposition and have this code hosted in
> > > drivers/net/.
> > > 
> > Thanks for the feedback. While when I started this prototyping I felt that
> > common was the right place for it, at this point I'm now tending towards
> > this second location - keeping it in net.
> > Any other thoughts on the relative merits of the various locations?
> 
> We just need to know in which order building the common directory.
> It can be before bus drivers or later, but you cannot have bus common code,
> and some ethdev code at the same time.
> If you just want to share code inside drivers/net/, I suppose it is OK to keep it there.
> In any choice you do, you will have to maintain some restrictions on the content due to the location.
> 
Yes, good point. However, that would only apply if the common code was
being built into a separate component to be linked into the other
components using it. The initial prototype work has resulted in header
files only, and my thinking was that even if .c files are added, they would
not be compiled into a .a file, but rather compiled as source into each
individual driver using them. This would allow for a certain amount of
ifdef usage, for example, where things may have slight differences.
However, I think we cross that bridge when we come to it.

/Bruce

      reply	other threads:[~2024-11-26 15:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22 12:53 Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 01/21] common/intel_eth: add pkt reassembly fn for intel drivers Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 02/21] common/intel_eth: provide common Tx entry structures Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 03/21] common/intel_eth: add Tx mbuf ring replenish fn Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 04/21] drivers/net: align Tx queue struct field names Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 05/21] drivers/net: add prefix for driver-specific structs Bruce Richardson
2024-11-22 12:53 ` [RFC PATCH 06/21] common/intel_eth: merge ice and i40e Tx queue struct Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 07/21] net/iavf: use common Tx queue structure Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 08/21] net/ixgbe: convert Tx queue context cache field to ptr Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 09/21] net/ixgbe: use common Tx queue structure Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 10/21] common/intel_eth: pack " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 11/21] common/intel_eth: add post-Tx buffer free function Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 12/21] common/intel_eth: add Tx buffer free fn for AVX-512 Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 13/21] net/iavf: use common Tx " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 14/21] net/ice: move Tx queue mbuf cleanup fn to common Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 15/21] net/i40e: use common Tx queue mbuf cleanup fn Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 16/21] net/ixgbe: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 17/21] net/iavf: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 18/21] net/ice: use vector SW ring for all vector paths Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 19/21] net/i40e: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 20/21] net/iavf: " Bruce Richardson
2024-11-22 12:54 ` [RFC PATCH 21/21] net/ixgbe: use common Tx backlog entry fn Bruce Richardson
2024-11-25 16:25 ` [RFC PATCH 00/21] Reduce code duplication across Intel NIC drivers David Marchand
2024-11-25 16:31   ` Bruce Richardson
2024-11-26 14:57     ` Thomas Monjalon
2024-11-26 15:27       ` Bruce Richardson [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=Z0Xo_o2nAL8AAWNK@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).