[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <PH7PR21MB31165940B8063AEE647846B6CA53A@PH7PR21MB3116.namprd21.prod.outlook.com>
Date: Wed, 7 Jun 2023 20:44:57 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: Dexuan Cui <decui@...rosoft.com>,
KY Srinivasan <kys@...rosoft.com>,
Paul Rosswurm <paulros@...rosoft.com>,
"olaf@...fle.de" <olaf@...fle.de>,
"vkuznets@...hat.com" <vkuznets@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"wei.liu@...nel.org" <wei.liu@...nel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"leon@...nel.org" <leon@...nel.org>,
Long Li <longli@...rosoft.com>,
"ssengar@...ux.microsoft.com" <ssengar@...ux.microsoft.com>,
"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"john.fastabend@...il.com" <john.fastabend@...il.com>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"ast@...nel.org" <ast@...nel.org>,
Ajay Sharma <sharmaajay@...rosoft.com>,
"hawk@...nel.org" <hawk@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"shradhagupta@...ux.microsoft.com" <shradhagupta@...ux.microsoft.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next] net: mana: Add support for vlan tagging
> -----Original Message-----
> From: LKML haiyangz <lkmlhyz@...rosoft.com> On Behalf Of Haiyang Zhang
> Sent: Wednesday, June 7, 2023 2:38 PM
> To: linux-hyperv@...r.kernel.org; netdev@...r.kernel.org
> Cc: Haiyang Zhang <haiyangz@...rosoft.com>; Dexuan Cui
> <decui@...rosoft.com>; KY Srinivasan <kys@...rosoft.com>; Paul Rosswurm
> <paulros@...rosoft.com>; olaf@...fle.de; vkuznets@...hat.com;
> davem@...emloft.net; wei.liu@...nel.org; edumazet@...gle.com;
> kuba@...nel.org; pabeni@...hat.com; leon@...nel.org; Long Li
> <longli@...rosoft.com>; ssengar@...ux.microsoft.com; linux-
> rdma@...r.kernel.org; daniel@...earbox.net; john.fastabend@...il.com;
> bpf@...r.kernel.org; ast@...nel.org; Ajay Sharma
> <sharmaajay@...rosoft.com>; hawk@...nel.org; tglx@...utronix.de;
> shradhagupta@...ux.microsoft.com; linux-kernel@...r.kernel.org
> Subject: [PATCH net-next] net: mana: Add support for vlan tagging
>
> To support vlan, use MANA_LONG_PKT_FMT if vlan tag is present in TX
> skb. Then extract the vlan tag from the skb struct or the frame, and
> save it to tx_oob for the NIC to transmit.
>
> For RX, extract the vlan tag from CQE and put it into skb.
>
> Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_en.c | 36
> +++++++++++++++++--
> 1 file changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c
> b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index d907727c7b7a..1d76ac66908c 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -179,6 +179,31 @@ netdev_tx_t mana_start_xmit(struct sk_buff *skb,
> struct net_device *ndev)
> pkg.tx_oob.s_oob.short_vp_offset = txq->vp_offset;
> }
>
> + /* When using AF_PACKET we need to move VLAN header from
> + * the frame to the SKB struct to allow the NIC to xmit
> + * the 802.1Q packet.
> + */
> + if (skb->protocol == htons(ETH_P_8021Q)) {
> + u16 vlan_tci;
> +
> + skb_reset_mac_header(skb);
> + if (eth_type_vlan(eth_hdr(skb)->h_proto)) {
> + if (unlikely(__skb_vlan_pop(skb, &vlan_tci)))
> + goto tx_drop_count;
> +
> + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
> + vlan_tci);
> + }
> + }
Not necessary to extract inband tag, because our NIC accepts inband tags too.
The change is in the next version.
Powered by blists - more mailing lists