ipsec: remove dependency on DPDK > 0
[vpp.git] / dpdk / dpdk-16.04_patches / 0014-enic-Set-PKT_RX_VLAN_PKT-iff-returned-packet-has-VLA.patch
1 From 6a7a9e52ed2ccfa86c2def3a66a368a5577f2fc2 Mon Sep 17 00:00:00 2001
2 From: John Daley <johndale@cisco.com>
3 Date: Tue, 3 May 2016 13:56:05 -0700
4 Subject: [PATCH] enic: Set PKT_RX_VLAN_PKT iff returned packet has VLAN tag
5
6 Only set the ol_flags PKT_RX_VLAN_PKT bit if the packet being passed
7 to the application contains a VLAN tag. This is true whether
8 stripping is enabled or disabled.
9
10 This area of the API is in flux, so behaviour may change in the
11 future.
12
13 Signed-off-by: John Daley <johndale@cisco.com>
14 ---
15  drivers/net/enic/enic_rxtx.c | 7 +++++--
16  1 file changed, 5 insertions(+), 2 deletions(-)
17
18 diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
19 index 02b54dd..6a95389 100644
20 --- a/drivers/net/enic/enic_rxtx.c
21 +++ b/drivers/net/enic/enic_rxtx.c
22 @@ -206,12 +206,15 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf)
23         if (unlikely(!enic_cq_rx_desc_eop(ciflags)))
24                 goto mbuf_flags_done;
25  
26 -       /* VLAN stripping */
27 +       /* VLAN stripping. Set PKT_RX_VLAN_PKT only if there is a vlan tag
28 +        * in the packet passed up
29 +        */
30         if (bwflags & CQ_ENET_RQ_DESC_FLAGS_VLAN_STRIPPED) {
31 -               pkt_flags |= PKT_RX_VLAN_PKT;
32                 mbuf->vlan_tci = enic_cq_rx_desc_vlan(cqrd);
33         } else {
34                 mbuf->vlan_tci = 0;
35 +               if (enic_cq_rx_desc_vlan(cqrd))
36 +                       pkt_flags |= PKT_RX_VLAN_PKT;
37         }
38  
39         /* RSS flag */
40 -- 
41 2.7.0
42