[PATCH v5] net/netvsc: fix parsing of VLAN metadata
Ferruh Yigit
ferruh.yigit at amd.com
Fri Feb 16 12:33:37 CET 2024
On 2/15/2024 6:12 PM, Alan Elder wrote:
> 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.
>
> Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
> Cc: sthemmin at microsoft.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Alan Elder <alan.elder at microsoft.com>
>
Thanks Alan, overall looks good to me.
Can you please make separate the lib/net patch?
As first patch lib/net updates, second updates the net/vetvsc.
> ---
> v5:
> * Move the VLAN parsing macros to rte_ether.h
>
> v4:
> * Make consistent with FreeBSD code
>
> ---
> .mailmap | 1 +
> drivers/net/netvsc/hn_rxtx.c | 8 ++++++--
> lib/net/rte_ether.h | 16 ++++++++++++++++
> 3 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/.mailmap b/.mailmap
> index a0756974e2..eca02318d6 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -33,6 +33,7 @@ Alain Leon <xerebz at gmail.com>
> Alan Brady <alan.brady at intel.com>
> Alan Carew <alan.carew at intel.com>
> Alan Dewar <alan.dewar at att.com> <adewar at brocade.com>
> +Alan Elder <alan.elder at microsoft.com>
> Alan Liu <zaoxingliu at gmail.com>
> Alan Winkowski <walan at marvell.com>
> Alejandro Lucero <alejandro.lucero at netronome.com>
> diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
> index e4f5015aa3..9bf1ec5509 100644
> --- a/drivers/net/netvsc/hn_rxtx.c
> +++ b/drivers/net/netvsc/hn_rxtx.c
> @@ -612,7 +612,9 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb,
> RTE_PTYPE_L4_MASK);
>
> if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) {
> - m->vlan_tci = info->vlan_info;
> + m->vlan_tci = RTE_VLAN_TCI_MAKE(NDIS_VLAN_INFO_ID(info->vlan_info),
> + NDIS_VLAN_INFO_PRI(info->vlan_info),
> + NDIS_VLAN_INFO_CFI(info->vlan_info));
>
Is there a good reason why format is not same as spec format?
More information about the dev
mailing list