[dpdk-dev] [PATCH 03/13] rte_ether: set PKT_RX_VLAN_STRIPPED in rte_vlan_strip()

Thomas Monjalon thomas.monjalon at 6wind.com
Mon Jan 30 10:54:08 CET 2017


It is fixing the introduction of the new flag PKT_RX_VLAN_STRIPPED.

Fixes: b37b528d957c ("mbuf: add new Rx flags for stripped VLAN")

This patch is applying the flag to the software emulation case
(currently only for virtio).
So the comment of this flag should be changed:

/**
 * A vlan has been stripped by the hardware and its tci is saved in
 * mbuf->vlan_tci. This can only happen if vlan stripping is enabled
 * in the RX configuration of the PMD.
 */
#define PKT_RX_VLAN_STRIPPED (1ULL << 6)                                                                         


> Signed-off-by: Michał Mirosław <michal.miroslaw at atendesoftware.pl>
[...]
> --- a/lib/librte_net/rte_ether.h
> +++ b/lib/librte_net/rte_ether.h
> @@ -357,7 +357,7 @@ static inline int rte_vlan_strip(struct rte_mbuf *m)
>  		return -1;
>  
>  	struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);
> -	m->ol_flags |= PKT_RX_VLAN_PKT;
> +	m->ol_flags |= PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED;
>  	m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci);
>  
>  	/* Copy ether header over rather than moving whole packet */

I think this flag should also be removed in the function rte_vlan_insert().


More information about the dev mailing list