From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CA2C43ADF; Thu, 8 Feb 2024 15:42:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A52D64028B; Thu, 8 Feb 2024 15:42:48 +0100 (CET) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2110.outbound.protection.outlook.com [40.107.247.110]) by mails.dpdk.org (Postfix) with ESMTP id 573BD40278 for ; Thu, 8 Feb 2024 15:42:47 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bV7IL8oc5170A26r2VhfC3F/ujyY2al264Jjyen+DqkOOHZxWFyJzIGFt9wyH8tn2nWIsHomYVwy/kpVS47Iww6YfcJaOfLggsB2robmVugm1dDeec0sfGPzIj1ZbY/O2jbO8rNhSLyZQ2aLfGQSOLrrP8nbUHznfHWsZPq+8W85sUNNUY1Jm905dNZqO9+6cwLw7na3PTeVvVrMOxNatVr19svGr8+Cb0mjiWtOFHkDGoziWQVd0dDjKNDOx97g9UrdmShk2tz8gWgF55fwS6y3IeZKv40DZjt81VstM+TJIg+U7bEpq3flYb4D/RnpdmiWLrHKu1WWYe+hsYIenA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GaqzVTWBmRWd+RhgqneTrq69HrHrGSPJmb5EKOQLNp0=; b=JbBgub1k0a8sN49NJTD1R2whG/sVbB4gE7TQMfO03H7l0yGpzBFBg+zbed7agrP2pQFoQiue9n3axs5UtfsdoNmqHdLO6/gaGqNYUCfGRqyBKswEbyTqe0T7FZcpNBAjHslulRDAnLt5NDiinAI7wu6LMS66Q404v9o5V/R9uPuYPImdUIvuAllCetvSq/quY+qU98ZkZgprHuLPswU4hcJhHi3rjkAq6UvS8s7Ak3403SSPcNExrBmMIrIK2UpPtGkuMO2f46MQ2opZA8tNd8/KI6MvPC8SskK2/89w1GnsVrLuOMjRV6Wt51gwOIS9BAS+uIP94Glp4a6HSNlj/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GaqzVTWBmRWd+RhgqneTrq69HrHrGSPJmb5EKOQLNp0=; b=SXCzxkyQIFEyTVXLcYbAtqS66Bk05TNB6arkvIFBQsEVYwHsRjeTjER2goi2jdRttyXNysSzyH1fILCUwbvP6PUCgtRM+mF35B/TJy6B9RmSnpmA9eGQVAZJ/F+H1W0rd1ab7+IO+WxIQpdnKwjfbBH/3io0KhyPla5ySKl9XzE= Received: from PA4PR83MB0526.EURPRD83.prod.outlook.com (2603:10a6:102:26b::17) by PAXPR83MB0557.EURPRD83.prod.outlook.com (2603:10a6:102:244::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.4; Thu, 8 Feb 2024 14:42:44 +0000 Received: from PA4PR83MB0526.EURPRD83.prod.outlook.com ([fe80::b55f:3890:59e4:b623]) by PA4PR83MB0526.EURPRD83.prod.outlook.com ([fe80::b55f:3890:59e4:b623%7]) with mapi id 15.20.7292.009; Thu, 8 Feb 2024 14:42:44 +0000 From: Alan Elder To: Long Li CC: "dev@dpdk.org" Subject: [PATCH v2] net/netvsc: fix parsing of VLAN metadata Thread-Topic: [PATCH v2] net/netvsc: fix parsing of VLAN metadata Thread-Index: AQHaWp0TMGSiFTLuGUqaByCYqdQdUA== Date: Thu, 8 Feb 2024 14:42:44 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=eac44bd7-4986-4a28-b743-886125979211; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-02-08T13:54:50Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PA4PR83MB0526:EE_|PAXPR83MB0557:EE_ x-ms-office365-filtering-correlation-id: 3478cae6-af3d-4c8a-abca-08dc28b435fe x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: maS0NWAYVqsab1EndsRk0EERQbHaqvKd7RNZIsarGnI9zlxoVYNngMK/lCfYDdkS/AZNWfX6fobwCX1hG17iTzhYqSuxwEhXemaxA6o9m5SOygEARQsIAU8T9+f9C5w/MGoDI5bkscMb7pwJgL/MFDqmcjmcvyu9Vux+2cCcQnAiZv1Cw+7w09U5PaTmoSvzZtDHoZJmUasD6jkh++zK7NJ3lFadX5glnkOwwTas3Z79judgddPUXEnf3Hk0XAH82T6ZS9h8jAWU2rYsDJC7CVNDAvuF/7F/rKwwJQ9Qe8GY1Hmf/MMYA1mULzKF+gku4GPnh0RvEtqFiTArC9KIji2IOeupkpICUCvIdcONGEyAYbzDlIgBdQ7v90lPlWhUlEOJt/8iSItTfF60xGmXQxinlZw+eQ6GAl2vLQgeeFwcWj7TZVrm9XNwf4AlWN4YO88TQWGRT57nl0K6zwoEO6cnR4XEQRffgDOsnIwgq4YIsRyZ4eOM9Smr/ch2ikng0/G3tdsXauZRWPnYBFl/5poLSEqn14qg+CmcM6t6GmPKr0/ubeWCs2hK3tqxSe0MpVmt/L002VMng5JMtooJa8FMF2rih6ksibqKVKNRcJ/q1QCjFifafJDjTlkRk6+k x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR83MB0526.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(39860400002)(376002)(346002)(366004)(396003)(230922051799003)(1800799012)(451199024)(64100799003)(186009)(5660300002)(41300700001)(83380400001)(316002)(6506007)(64756008)(71200400001)(82960400001)(7696005)(6636002)(10290500003)(478600001)(33656002)(66446008)(38070700009)(52536014)(66946007)(66556008)(66476007)(76116006)(8676002)(4326008)(38100700002)(26005)(6862004)(82950400001)(8936002)(122000001)(2940100002)(86362001)(9686003)(8990500004)(44832011)(2906002)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OPrNbjQH7IfBy5ZGipRpCbXF6bH25Soqy3BRer6rLFiIKTJGY/ddiOG+4Zgu?= =?us-ascii?Q?jx47I2fse2ONgNj+YEb7Y+SdyNgBsG/FWow00zS3V4gaNtw0MoT89m7YgnRj?= =?us-ascii?Q?GK3RDhb/2Kttd07d8ST4WX9EhqaRUubB9tykocusH5b/CbvM911JceKXQzj/?= =?us-ascii?Q?RyrJ1Hcl9a7SpxeURVj8VAdMck6JuEdg+kSz/16IOkiMVGikPKK6egJ1FSKU?= =?us-ascii?Q?cEBYLsdwfgY/0njMgyMbDsKoPB8bKH5cNJepez7KCEy2ReuHSUnKVJL9N79R?= =?us-ascii?Q?b39gIslunB7fFJ+gdiYLDsosY3LrzJYMF8Jvz/zCjnS8c2yPSb6o9nRQ3Ep6?= =?us-ascii?Q?oshPkCc/ETWe9gMmDF7XkX4khkhXosbMosXUSIWSYuqIOZTt5x3Mgn6EJABj?= =?us-ascii?Q?IB0GAQUfF/lhQwZQAMkrAgpmVzLi1xLfLCZbGJb7RQGQ9KOm2ixsvjeGUcMA?= =?us-ascii?Q?MkytjBxYVvPDhEY71diiEdhVuk+aXNhWWdV+N7S6YxAK6GvFDlfJFXsFVjB6?= =?us-ascii?Q?DwF/jHYwMdIEfwbkYV3zPq0J4M5SiTefx2dyfxsfv8M4f3KdTSpaKO0CWLy/?= =?us-ascii?Q?4AyjjG9d7QNtQGcRsaAbUXty5zHAROWOgRRDa3qYgeqFVOuprxa0b8id+VP5?= =?us-ascii?Q?Y6gFuQfD/sGKDPqwPHipUhkXFf0RzftF/ZMOMcYQD/23Tz17b2Fh30do+7nd?= =?us-ascii?Q?QmgfLmLO7mraOwxBIhP16E97nhz570b3vvF3W/54o0ebYCSIUIIpSXJDASLH?= =?us-ascii?Q?oPbGBSTf+sGhkv02lhrACwXUde2tiaU76IOwp2RIN3e1/NNCsPTjFLJmf79T?= =?us-ascii?Q?jQSTY4pqRUcboM6upRxCvqmg1UDla2AkhI0bFp2FtNoMvofEYEHvVm9hGaDY?= =?us-ascii?Q?CcztPqaSH/nJZZoXyr/4yD5sV5v+OlJodKjOuNdyFmsko6mbzx2AsCA5nHDu?= =?us-ascii?Q?hxWzYMnZgbOrV9/OI/BHkr1Vl4ZFuw8+foDjY0k+IcV4BUPm1rEXedsHO8jY?= =?us-ascii?Q?ZKzf249M6QdCENdxYobTITFsWeUqYUQPtKN55WzN4HD3aTMo3NumysiBAKyk?= =?us-ascii?Q?zEPui5yagRh/ckFZCGzwjRrtjxAvwwNM6aGlU6eWqjLXov0joCZo8rAb3sQW?= =?us-ascii?Q?Mz6ZinEOON098rxHcAm1cx55t5lEctYP3myHnzEmDiY/DqeaYaDwINtTvYmW?= =?us-ascii?Q?2wq7FqNtoSR+4xPzJHyxpqFxXHhEOKicxkkKd6n3flalnvwoUpeLIbv7WAWy?= =?us-ascii?Q?RpKlcdXvlJYOkktTOyn8W7Fr6v/eH6r/EhbF9pzkibjYc/DL+1ULdILIH63G?= =?us-ascii?Q?Jft/G/OQOFV2GIC750Fe6YOGxdpQoEL0yggc13z4atSiIets2HvVB0eF/ZXc?= =?us-ascii?Q?PttYXrxKwoEI9ogtJ5KAO5nPvBP8hKyjuwhr5GusSPRFjHn38XsoMrKlcNOm?= =?us-ascii?Q?n8FqxbS5BCUbSpJHWq9aTBdxpdmAGR46ZknV4bHO20yhIPD2Ib0UtMgIEGAQ?= =?us-ascii?Q?LPTgHCufB4ZH22QyeD1BMhravzX12W0TX3dN?= Content-Type: multipart/alternative; boundary="_000_PA4PR83MB052682FE39BDC7283F4E181497442PA4PR83MB0526EURP_" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR83MB0526.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3478cae6-af3d-4c8a-abca-08dc28b435fe X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2024 14:42:44.4769 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bssm2J6rHuI5ehpS2T9bbzLRT7Okqg+oZ+1lms8E2yALNAXLrFb2rdyEULZTaXCccLzbkAhCZiuUgj+iQFgKAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR83MB0557 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_PA4PR83MB052682FE39BDC7283F4E181497442PA4PR83MB0526EURP_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The previous code incorrectly parsed the VLAN ID and priority. If the 16-bits of VLAN ID and priority/CFI on the wire was 0123456789ABCDEF the code parsed it as 456789ABCDEF3012. There were macros defined to handle this conversion but they were not used. This fix takes an approach similar to the Linux netvsc driver and defines an explicit structure to use for parsing. Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") Cc: sthemmin@microsoft.com Cc: stable@dpdk.org Signed-off-by: Alan Elder --- .mailmap | 1 + drivers/net/netvsc/hn_rxtx.c | 23 +++++++++++++++++------ drivers/net/netvsc/ndis.h | 23 +++++++++++++---------- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.mailmap b/.mailmap index a0756974e2..eca02318d6 100644 --- a/.mailmap +++ b/.mailmap @@ -33,6 +33,7 @@ Alain Leon Alan Brady Alan Carew Alan Dewar +Alan Elder Alan Liu Alan Winkowski Alejandro Lucero diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index e4f5015aa3..e3b9899f1e 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -42,8 +42,13 @@ #define HN_TXD_CACHE_SIZE 32 /* per cpu tx_descriptor pool cac= he */ #define HN_RXQ_EVENT_DEFAULT 2048 +#define HN_VLAN_PRIO_MASK 0xe000 /* Priority Code Point */ +#define HN_VLAN_PRIO_SHIFT 13 +#define HN_VLAN_CFI_MASK 0x1000 /* Canonical Format Indicato= r / Drop Eligible Indicator */ +#define HN_VLAN_VID_MASK 0x0fff /* VLAN Identifier */ + struct hn_rxinfo { - uint32_t vlan_info; + struct ndis_pkt_vlan_info vlan_info; uint32_t csum_info; uint32_t hash_info; uint32_t hash_value; @@ -477,7 +482,7 @@ hn_rndis_rxinfo(const void *info_data, unsigned int inf= o_dlen, case NDIS_PKTINFO_TYPE_VLAN: if (unlikely(dlen < NDIS_VLA= N_INFO_SIZE)) return -EINV= AL; - info->vlan_info =3D *((const= uint32_t *)data); + info->vlan_info =3D *((const = struct ndis_pkt_vlan_info *)data); mask |=3D HN_RXINFO_VLAN; break; @@ -611,8 +616,10 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct h= n_rx_bufinfo *rxb, = RTE_PTYPE_L3_MASK | = RTE_PTYPE_L4_MASK); - if (info->vlan_info !=3D HN_NDIS_VLAN_INFO_INVALID) { - m->vlan_tci =3D info->vlan_info; + if (info->vlan_info.value !=3D HN_NDIS_VLAN_INFO_INVALID) { + m->vlan_tci =3D info->vlan_info.vlanid | + (info->vlan_i= nfo.pri << HN_VLAN_PRIO_SHIFT) | + (info->vlan_i= nfo.cfi ? HN_VLAN_CFI_MASK : 0); m->ol_flags |=3D RTE_MBUF_F_RX_VLAN_STRIPPED= | RTE_MBUF_F_RX_VLAN; /* NDIS always strips tag, put it back if n= ecessary */ @@ -669,7 +676,7 @@ static void hn_rndis_rx_data(struct hn_rx_queue *rxq, unsigned int pktinfo_off, pktinfo_len; const struct rndis_packet_msg *pkt =3D data; struct hn_rxinfo info =3D { - .vlan_info =3D HN_NDIS_VLAN_INFO_INVALID, + .vlan_info.value =3D HN_NDIS_VLAN_INFO_INVALI= D, .csum_info =3D HN_NDIS_RXCSUM_INFO_INVALID, .hash_info =3D HN_NDIS_HASH_INFO_INVALID, }; @@ -1332,7 +1339,11 @@ static void hn_encap(struct rndis_packet_msg *pkt, if (m->ol_flags & RTE_MBUF_F_TX_VLAN) { pi_data =3D hn_rndis_pktinfo_append(pkt, NDI= S_VLAN_INFO_SIZE, = NDIS_PKTINFO_TYPE_VLAN); - *pi_data =3D m->vlan_tci; + struct ndis_pkt_vlan_info *vlan =3D (struct n= dis_pkt_vlan_info *)pi_data; + vlan->value =3D 0; + vlan->vlanid =3D (m->vlan_tci & HN_VLAN_VID_M= ASK); + vlan->cfi =3D (!!(m->vlan_tci & HN_VLAN_CFI_M= ASK)); + vlan->pri =3D ((m->vlan_tci & HN_VLAN_PRIO_MA= SK) >> HN_VLAN_PRIO_SHIFT); } if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) { diff --git a/drivers/net/netvsc/ndis.h b/drivers/net/netvsc/ndis.h index d97a397a86..a1e587c738 100644 --- a/drivers/net/netvsc/ndis.h +++ b/drivers/net/netvsc/ndis.h @@ -316,16 +316,19 @@ struct ndis_offload { */ /* VLAN */ -#define NDIS_VLAN_INFO_SIZE size= of(uint32_t) -#define NDIS_VLAN_INFO_PRI_MASK 0x0007 -#define NDIS_VLAN_INFO_CFI_MASK 0x0008 -#define NDIS_VLAN_INFO_ID_MASK 0xfff0 -#define NDIS_VLAN_INFO_MAKE(id, pri, cfi) \ - (((pri) & NDIS_VLAN_INFO_PRI_MASK) | \ - (((cfi) & 0x1) << 3) | (((id) & 0xfff) << 4)) -#define NDIS_VLAN_INFO_ID(inf) (((in= f) & NDIS_VLAN_INFO_ID_MASK) >> 4) -#define NDIS_VLAN_INFO_CFI(inf) (((inf= ) & NDIS_VLAN_INFO_CFI_MASK) >> 3) -#define NDIS_VLAN_INFO_PRI(inf) ((inf)= & NDIS_VLAN_INFO_PRI_MASK) +struct ndis_pkt_vlan_info { + union { + struct { + uint32_t pri:3; /* User Prior= ity */ + uint32_t cfi:1; /* Canonical = Format ID / DEI */ + uint32_t vlanid:12; /* VLAN I= D */ + uint32_t reserved:16; + }; + uint32_t value; + }; +}; + +#define NDIS_VLAN_INFO_SIZE sizeo= f(struct ndis_pkt_vlan_info) /* Reception checksum */ #define NDIS_RXCSUM_INFO_SIZE sizeof(uin= t32_t) -- 2.25.1 --_000_PA4PR83MB052682FE39BDC7283F4E181497442PA4PR83MB0526EURP_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

The previous code incorrectly parsed the VLAN ID and= priority.

If the 16-bits of VLAN ID and priority/CFI on the wi= re was

0123456789ABCDEF the code parsed it as 456789ABCDEF3= 012.  There

were macros defined to handle this conversion but th= ey were not

used.

 

This fix takes an approach similar to the Linux netv= sc driver and

defines an explicit structure to use for parsing.

 

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V n= etwork device")

Cc: sthemmin@microsoft.com

Cc: stable@dpdk.org

 

Signed-off-by: Alan Elder <alan.elder@microsoft.c= om>

---

.mailmap       &n= bsp;            = ; |  1 +

drivers/net/netvsc/hn_rxtx.c | 23 +++++++++++++++++-= -----

drivers/net/netvsc/ndis.h    | 23 +++= ++++++++++----------

3 files changed, 31 insertions(+), 16 deletions(-)

 

diff --git a/.mailmap b/.mailmap

index a0756974e2..eca02318d6 100644

--- a/.mailmap

+++ b/.mailmap

@@ -33,6 +33,7 @@ Alain Leon <xerebz@gmail.com>= ;

Alan Brady <alan.brady@intel.com>

Alan Carew <alan.carew@intel.com>

Alan Dewar <alan.dewar@att.com> <adewar@bro= cade.com>

+Alan Elder <alan.elder@microsoft.com>

Alan Liu <zaoxingliu@gmail.com>

Alan Winkowski <walan@marvell.com><= /p>

Alejandro Lucero <alejandro.lucero@netronome.com&= gt;

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/= net/netvsc/hn_rxtx.c

index e4f5015aa3..e3b9899f1e 100644

--- a/drivers/net/netvsc/hn_rxtx.c

+++ b/drivers/net/netvsc/hn_rxtx.c

@@ -42,8 +42,13 @@

#define HN_TXD_CACHE_SIZE    &nb= sp;         32 /* per cpu tx_descri= ptor pool cache */

#define HN_RXQ_EVENT_DEFAULT    = 2048

+#define HN_VLAN_PRIO_MASK    &n= bsp;      0xe000 /* Priority Code Point */

+#define HN_VLAN_PRIO_SHIFT    &= nbsp;      13

+#define HN_VLAN_CFI_MASK    &nb= sp;          0x1000 /* Canonic= al Format Indicator / Drop Eligible Indicator */

+#define HN_VLAN_VID_MASK    &nb= sp;         0x0fff /* VLAN Identifi= er */

+

struct hn_rxinfo {

-        &nb= sp;     uint32_t      &nb= sp;       vlan_info;

+        &nb= sp;    struct ndis_pkt_vlan_info vlan_info;

        &nbs= p;      uint32_t     &nbs= p;        csum_info;

        &nbs= p;      uint32_t     &nbs= p;        hash_info;

        &nbs= p;      uint32_t     &nbs= p;        hash_value;

@@ -477,7 +482,7 @@ hn_rndis_rxinfo(const void *info= _data, unsigned int info_dlen,

        &nbs= p;            &= nbsp;         case NDIS_PKTINFO_TYP= E_VLAN:

        &nbs= p;            &= nbsp;           &nbs= p;             = if (unlikely(dlen < NDIS_VLAN_INFO_SIZE))

        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;    return -EINVAL;

-        &nb= sp;            =             &nb= sp;            info-= >vlan_info =3D *((const uint32_t *)data);

+        &nb= sp;            =             &nb= sp;           info->vl= an_info =3D *((const struct ndis_pkt_vlan_info *)data);

        &nbs= p;            &= nbsp;           &nbs= p;             = mask |=3D HN_RXINFO_VLAN;

        &nbs= p;            &= nbsp;           &nbs= p;             = break;

@@ -611,8 +616,10 @@ static void hn_rxpkt(struct hn_= rx_queue *rxq, struct hn_rx_bufinfo *rxb,

        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;          RTE_PTYPE_L3_MA= SK |

        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;          RTE_PTYPE_L4_MA= SK);

-        &nb= sp;     if (info->vlan_info !=3D HN_NDIS_VLAN_INFO_I= NVALID) {

-        &nb= sp;            =          m->vlan_tci =3D info-&g= t;vlan_info;

+        &nb= sp;    if (info->vlan_info.value !=3D HN_NDIS_VLAN_INFO_I= NVALID) {

+        &nb= sp;            =         m->vlan_tci =3D info->vlan= _info.vlanid |

+        &nb= sp;            =             &nb= sp;            =             &nb= sp;  (info->vlan_info.pri << HN_VLAN_PRIO_SHIFT) |=

+        &nb= sp;            =             &nb= sp;            =             &nb= sp;  (info->vlan_info.cfi ? HN_VLAN_CFI_MASK : 0);

        &nbs= p;            &= nbsp;         m->ol_flags |=3D R= TE_MBUF_F_RX_VLAN_STRIPPED | RTE_MBUF_F_RX_VLAN;

        &nbs= p;            &= nbsp;          /* NDIS always = strips tag, put it back if necessary */

@@ -669,7 +676,7 @@ static void hn_rndis_rx_data(str= uct hn_rx_queue *rxq,

        &nbs= p;      unsigned int pktinfo_off, pktinfo_len;

        &nbs= p;      const struct rndis_packet_msg *pkt =3D dat= a;

        &nbs= p;      struct hn_rxinfo info =3D {

-        &nb= sp;            =          .vlan_info =3D HN_NDIS_VLA= N_INFO_INVALID,

+        &nb= sp;            =         .vlan_info.value =3D HN_NDIS_VLA= N_INFO_INVALID,

        &nbs= p;            &= nbsp;         .csum_info =3D HN_NDI= S_RXCSUM_INFO_INVALID,

        &nbs= p;            &= nbsp;         .hash_info =3D HN_NDI= S_HASH_INFO_INVALID,

        &nbs= p;      };

@@ -1332,7 +1339,11 @@ static void hn_encap(struct r= ndis_packet_msg *pkt,

        &nbs= p;      if (m->ol_flags & RTE_MBUF_F_TX_VLA= N) {

        &nbs= p;            &= nbsp;         pi_data =3D hn_rndis_= pktinfo_append(pkt, NDIS_VLAN_INFO_SIZE,

        &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;             = NDIS_PKTINFO_TYPE_VLAN);

-        &nb= sp;            =          *pi_data =3D m->vlan_tc= i;

+        &nb= sp;            =         struct ndis_pkt_vlan_info *vlan = =3D (struct ndis_pkt_vlan_info *)pi_data;

+        &nb= sp;            =         vlan->value =3D 0;=

+        &nb= sp;            =         vlan->vlanid =3D (m->vlan_= tci & HN_VLAN_VID_MASK);

+        &nb= sp;            =         vlan->cfi =3D (!!(m->vlan_= tci & HN_VLAN_CFI_MASK));

+        &nb= sp;            =         vlan->pri =3D ((m->vlan_tc= i & HN_VLAN_PRIO_MASK) >> HN_VLAN_PRIO_SHIFT);

        &nbs= p;      }

        &nbs= p;       if (m->ol_flags & RTE_MBUF_F_= TX_TCP_SEG) {

diff --git a/drivers/net/netvsc/ndis.h b/drivers/net= /netvsc/ndis.h

index d97a397a86..a1e587c738 100644

--- a/drivers/net/netvsc/ndis.h

+++ b/drivers/net/netvsc/ndis.h

@@ -316,16 +316,19 @@ struct ndis_offload {

  */

 /* VLAN */

-#define       &n= bsp;      NDIS_VLAN_INFO_SIZE   &nb= sp;            =             &nb= sp; sizeof(uint32_t)

-#define       &n= bsp;      NDIS_VLAN_INFO_PRI_MASK   = ;            &n= bsp; 0x0007

-#define       &n= bsp;      NDIS_VLAN_INFO_CFI_MASK   = ;            &n= bsp; 0x0008

-#define       &n= bsp;      NDIS_VLAN_INFO_ID_MASK   =             &nb= sp;    0xfff0

-#define       &n= bsp;      NDIS_VLAN_INFO_MAKE(id, pri, cfi) &= nbsp;   \

-        &nb= sp;     (((pri) & NDIS_VLAN_INFO_PRI_MASK) | &= nbsp;            \

-        &nb= sp;     (((cfi) & 0x1) << 3) | (((id) & 0= xfff) << 4))

-#define       &n= bsp;      NDIS_VLAN_INFO_ID(inf)   =             &nb= sp;          (((inf) & NDI= S_VLAN_INFO_ID_MASK) >> 4)

-#define       &n= bsp;      NDIS_VLAN_INFO_CFI(inf)   = ;            &n= bsp;        (((inf) & NDIS_VLAN_INFO= _CFI_MASK) >> 3)

-#define       &n= bsp;      NDIS_VLAN_INFO_PRI(inf)   = ;            &n= bsp;        ((inf) & NDIS_VLAN_INFO_= PRI_MASK)

+struct ndis_pkt_vlan_info {

+        &nb= sp;    union {

+        &nb= sp;            =         struct {

+        &nb= sp;            =             &nb= sp;           uint32_t pr= i:3; /* User Priority */

+        &nb= sp;            =             &nb= sp;           uint32_t cf= i:1; /* Canonical Format ID / DEI */

+        &nb= sp;            =             &nb= sp;           uint32_t vl= anid:12; /* VLAN ID */

+        &nb= sp;            =             &nb= sp;           uint32_t re= served:16;

+        &nb= sp;            =         };

+        &nb= sp;            =         uint32_t value;

+        &nb= sp;    };

+};

+

+#define       &n= bsp;     NDIS_VLAN_INFO_SIZE    &nb= sp;            =              si= zeof(struct ndis_pkt_vlan_info)

 /* Reception checksum */

#define       &nb= sp;       NDIS_RXCSUM_INFO_SIZE  &n= bsp;            = ;       sizeof(uint32_t)

--

2.25.1

 

--_000_PA4PR83MB052682FE39BDC7283F4E181497442PA4PR83MB0526EURP_--