[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a3qJVhDq1Jp6mNiy-pgXWVxDvuGuKOZPFpYhZvt94pabw@mail.gmail.com>
Date: Thu, 8 Nov 2018 21:47:25 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Sunil Kovvuri <sunil.kovvuri@...il.com>
Cc: Networking <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>, linux-soc@...r.kernel.org,
tduszynski@...vell.com, Sunil Goutham <sgoutham@...vell.com>
Subject: Re: [PATCH 11/20] octeontx2-af: Add support for stripping STAG/CTAG
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
Powered by blists - more mailing lists