netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: "Creeley, Brett" <brett.creeley@intel.com>
Cc: "intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"bjorn@kernel.org" <bjorn@kernel.org>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	"Lobakin, Alexandr" <alexandr.lobakin@intel.com>,
	"joamaki@gmail.com" <joamaki@gmail.com>,
	"toke@redhat.com" <toke@redhat.com>
Subject: Re: [PATCH v5 intel-next 2/9] ice: move ice_container_type onto ice_ring_container
Date: Mon, 16 Aug 2021 20:39:33 +0200	[thread overview]
Message-ID: <20210816183933.GA1521@ranger.igk.intel.com> (raw)
In-Reply-To: <CO1PR11MB4835F0FDF2ABA2578B722095F5FD9@CO1PR11MB4835.namprd11.prod.outlook.com>

On Mon, Aug 16, 2021 at 05:51:06PM +0100, Creeley, Brett wrote:
> > -----Original Message-----
> > From: Fijalkowski, Maciej <maciej.fijalkowski@intel.com>
> > Sent: Saturday, August 14, 2021 7:08 AM
> > To: intel-wired-lan@lists.osuosl.org
> > Cc: netdev@vger.kernel.org; bpf@vger.kernel.org; davem@davemloft.net; Nguyen, Anthony L <anthony.l.nguyen@intel.com>;
> > kuba@kernel.org; bjorn@kernel.org; Karlsson, Magnus <magnus.karlsson@intel.com>; Brandeburg, Jesse
> > <jesse.brandeburg@intel.com>; Lobakin, Alexandr <alexandr.lobakin@intel.com>; joamaki@gmail.com; toke@redhat.com; Creeley,
> > Brett <brett.creeley@intel.com>; Fijalkowski, Maciej <maciej.fijalkowski@intel.com>
> > Subject: [PATCH v5 intel-next 2/9] ice: move ice_container_type onto ice_ring_container
> >
> > Currently ice_container_type is scoped only for ice_ethtool.c. Next
> > commit that will split the ice_ring struct onto Rx/Tx specific ring
> > structs is going to also modify the type of linked list of rings that is
> > within ice_ring_container. Therefore, the functions that are taking the
> > ice_ring_container as an input argument will need to be aware of a ring
> > type that will be looked up.
> >
> > Embed ice_container_type within ice_ring_container and initialize it
> > properly when allocating the q_vectors.
> >
> > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> > ---
> >  drivers/net/ethernet/intel/ice/ice_base.c    |  2 ++
> >  drivers/net/ethernet/intel/ice/ice_ethtool.c | 36 ++++++++------------
> >  drivers/net/ethernet/intel/ice/ice_txrx.h    |  6 ++++
> >  3 files changed, 23 insertions(+), 21 deletions(-)
> 
> <snip>
> 
> > +enum ice_container_type {
> > +     ICE_RX_CONTAINER,
> > +     ICE_TX_CONTAINER,
> > +};
> > +
> >  struct ice_ring_container {
> >       /* head of linked-list of rings */
> >       struct ice_ring *ring;
> > @@ -347,6 +352,7 @@ struct ice_ring_container {
> >       u16 itr_setting:13;
> >       u16 itr_reserved:2;
> >       u16 itr_mode:1;
> > +     enum ice_container_type type;
> 
> It may not matter, but should you make sure
> the size of "type" doesn't negativelly affect this
> structure?

Seems that it doesn't matter.

Before:
struct ice_ring_container {
        struct ice_ring *          ring;                 /*     0     8 */
        struct dim                 dim;                  /*     8   120 */

        /* XXX last struct has 2 bytes of padding */

        /* --- cacheline 2 boundary (128 bytes) --- */
        u16                        itr_idx;              /*   128     2 */
        u16                        itr_setting:13;       /*   130: 0  2 */
        u16                        itr_reserved:2;       /*   130:13  2 */
        u16                        itr_mode:1;           /*   130:15  2 */

        /* size: 136, cachelines: 3, members: 6 */
        /* padding: 4 */
        /* paddings: 1, sum paddings: 2 */
        /* last cacheline: 8 bytes */


After:
struct ice_ring_container {
        union {
                struct ice_rx_ring * rx_ring;            /*     0     8 */
                struct ice_tx_ring * tx_ring;            /*     0     8 */
        };                                               /*     0     8 */
        struct dim                 dim;                  /*     8   120 */

        /* XXX last struct has 2 bytes of padding */

        /* --- cacheline 2 boundary (128 bytes) --- */
        u16                        itr_idx;              /*   128     2 */
        u16                        itr_setting:13;       /*   130: 0  2 */
        u16                        itr_reserved:2;       /*   130:13  2 */
        u16                        itr_mode:1;           /*   130:15  2 */
        enum ice_container_type    type;                 /*   132     4 */

        /* size: 136, cachelines: 3, members: 7 */
        /* paddings: 1, sum paddings: 2 */
        /* last cacheline: 8 bytes */

Still 3 cachelines and same sizes.


> 
> >  };
> >
> >  struct ice_coalesce_stored {
> > --
> > 2.20.1
> 

  reply	other threads:[~2021-08-16 18:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14 14:08 [PATCH v5 intel-next 0/9] XDP_TX improvements for ice Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 1/9] ice: remove ring_active from ice_ring Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 2/9] ice: move ice_container_type onto ice_ring_container Maciej Fijalkowski
2021-08-16 16:51   ` Creeley, Brett
2021-08-16 18:39     ` Maciej Fijalkowski [this message]
2021-08-14 14:08 ` [PATCH v5 intel-next 3/9] ice: split ice_ring onto Tx/Rx separate structs Maciej Fijalkowski
2021-08-14 16:18   ` [Intel-wired-lan] " kernel test robot
2021-08-14 14:08 ` [PATCH v5 intel-next 4/9] ice: unify xdp_rings accesses Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 5/9] ice: do not create xdp_frame on XDP_TX Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 6/9] ice: propagate xdp_ring onto rx_ring Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 7/9] ice: optimize XDP_TX workloads Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 8/9] ice: introduce XDP_TX fallback path Maciej Fijalkowski
2021-08-14 14:08 ` [PATCH v5 intel-next 9/9] ice: make use of ice_for_each_* macros Maciej Fijalkowski
2021-08-17 20:59 ` [PATCH v5 intel-next 0/9] XDP_TX improvements for ice Nguyen, Anthony L
2021-08-18  7:52   ` Maciej Fijalkowski
2021-08-18 14:03     ` Maciej Fijalkowski
2021-08-18 16:12       ` Nguyen, Anthony L

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=20210816183933.GA1521@ranger.igk.intel.com \
    --to=maciej.fijalkowski@intel.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brett.creeley@intel.com \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=joamaki@gmail.com \
    --cc=kuba@kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.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).