diff options
author | John Lo <loj@cisco.com> | 2016-06-02 15:52:21 -0400 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2016-06-02 20:46:12 +0000 |
commit | 4cd850e7b2825335bbaa43ce1fd85f8d16821024 (patch) | |
tree | 8dd14d98361c0280a3b02b33b2eae43b0c725f59 /dpdk/dpdk-16.04_patches | |
parent | e54436005341800f76a584299ef8bf99e8d66227 (diff) |
VPP-106: Patch e40i driver to support VLAN sub-interface
Check packet for presence of VLAN tag in the MAC header and set
the PKT_RX_VLAN_PKT flag to trigger sub-interface lookup in VPP
ethernet-input node.
Change-Id: Iadbfc59d08ef85efb936c88323a90194f3cd656f
Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-16.04_patches')
-rwxr-xr-x | dpdk/dpdk-16.04_patches/0017-i40e-Set-PKT_RX_VLAN_PKT-flag-for-VLAN-packets.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dpdk/dpdk-16.04_patches/0017-i40e-Set-PKT_RX_VLAN_PKT-flag-for-VLAN-packets.patch b/dpdk/dpdk-16.04_patches/0017-i40e-Set-PKT_RX_VLAN_PKT-flag-for-VLAN-packets.patch new file mode 100755 index 00000000000..f8f69b0f274 --- /dev/null +++ b/dpdk/dpdk-16.04_patches/0017-i40e-Set-PKT_RX_VLAN_PKT-flag-for-VLAN-packets.patch @@ -0,0 +1,41 @@ +From af8bfd030fdaa0acb3222296ab7a24bc4ac196f5 Mon Sep 17 00:00:00 2001 +From: Georgi Savov <gsavov@cisco.com> +Date: Tue, 10 May 2016 10:59:55 -0400 +Subject: [PATCH 30/31] i40e Set PKT_RX_VLAN_PKT flag for VLAN packets + +--- + drivers/net/i40e/i40e_rxtx.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c +index 39d94ec..07341df 100644 +--- a/drivers/net/i40e/i40e_rxtx.c ++++ b/drivers/net/i40e/i40e_rxtx.c +@@ -99,7 +99,23 @@ i40e_rxd_to_vlan_tci(struct rte_mbuf *mb, volatile union i40e_rx_desc *rxdp) + PMD_RX_LOG(DEBUG, "Descriptor l2tag1: %u", + rte_le_to_cpu_16(rxdp->wb.qword0.lo_dword.l2tag1)); + } else { +- mb->vlan_tci = 0; ++ struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); ++ u16 eth_type = eth_hdr->ether_type; ++ ++ // The i40e firmware does not flag VLAN tagged packets if ++ // VLAN stripping is disabled so we need to check the ++ // ethernet header to find out if the received packet ++ // is a VLAN packet ++ if ((eth_type == rte_be_to_cpu_16(ETHER_TYPE_VLAN)) || ++ (eth_type == rte_be_to_cpu_16(ETHER_TYPE_VLAN_AD)) || ++ (eth_type == rte_be_to_cpu_16(ETHER_TYPE_VLAN_9100)) || ++ (eth_type == rte_be_to_cpu_16(ETHER_TYPE_VLAN_9200))) { ++ struct vlan_hdr *vhdr = (struct vlan_hdr *)(eth_hdr+1); ++ mb->ol_flags |= PKT_RX_VLAN_PKT; ++ mb->vlan_tci = rte_be_to_cpu_16(vhdr->vlan_tci); ++ } else { ++ mb->vlan_tci = 0; ++ } + } + #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC + if (rte_le_to_cpu_16(rxdp->wb.qword2.ext_status) & +-- +1.9.1 + |