[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+sq2Cd480FWab9hJKaYxEK2L_HR9oLmqokbqrJwez0FE63txA@mail.gmail.com>
Date: Fri, 9 Nov 2018 09:59:44 +0530
From: Sunil Kovvuri <sunil.kovvuri@...il.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Linux Netdev List <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>, linux-soc@...r.kernel.org,
Tomasz Duszynski <tduszynski@...vell.com>,
Sunil Goutham <sgoutham@...vell.com>
Subject: Re: [PATCH 11/20] octeontx2-af: Add support for stripping STAG/CTAG
On Fri, Nov 9, 2018 at 2:17 AM Arnd Bergmann <arnd@...db.de> wrote:
>
> On Thu, Nov 8, 2018 at 7:37 PM <sunil.kovvuri@...il.com> wrote:
>
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/npc.h b/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > index f98b011..3f7e5e6 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > @@ -259,4 +259,34 @@ struct nix_rx_action {
> > #endif
> > };
> >
> > +struct nix_rx_vtag_action {
> > +#if defined(__BIG_ENDIAN_BITFIELD)
> > + u64 rsvd_63_48 :16;
> > + u64 vtag1_valid :1;
> > + u64 vtag1_type :3;
> > + u64 rsvd_43 :1;
> > + u64 vtag1_lid :3;
> > + u64 vtag1_relptr :8;
> > + u64 rsvd_31_16 :16;
> > + u64 vtag0_valid :1;
> > + u64 vtag0_type :3;
> > + u64 rsvd_11 :1;
> > + u64 vtag0_lid :3;
> > + u64 vtag0_relptr :8;
> > +#else
> > + u64 vtag0_relptr :8;
> > + u64 vtag0_lid :3;
> > + u64 rsvd_11 :1;
> > + u64 vtag0_type :3;
> > + u64 vtag0_valid :1;
> > + u64 rsvd_31_16 :16;
> > + u64 vtag1_relptr :8;
> > + u64 vtag1_lid :3;
> > + u64 rsvd_43 :1;
> > + u64 vtag1_type :3;
> > + u64 vtag1_valid :1;
> > + u64 rsvd_63_48 :16;
> > +#endif
> > +};
>
> Here is another instance of bitfields in an interface structure. As
> before, please try to avoid doing that and use bit shifts and masks
> instead.
>
> Arnd
No, this struct is not part of communication interface.
This is used to fill up a register in a bit more readable fashion
instead of plain bit shifts.
===
struct nix_rx_vtag_action vtag_action;
*(u64 *)&vtag_action = 0;
vtag_action.vtag0_valid = 1;
/* must match type set in NIX_VTAG_CFG */
vtag_action.vtag0_type = 0;
vtag_action.vtag0_lid = NPC_LID_LA;
vtag_action.vtag0_relptr = 12;
entry.vtag_action = *(u64 *)&vtag_action;
/* Set TAG 'action' */
rvu_write64(rvu, blkaddr, NPC_AF_MCAMEX_BANKX_TAG_ACT(index, actbank),
entry->vtag_action);
===
Thanks,
Sunil.
Powered by blists - more mailing lists