Show a patch.

GET /api/patches/332/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 332,
    "url": "http://patches.dpdk.org/api/patches/332/",
    "web_url": "http://patches.dpdk.org/patch/332/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<1410273656-4567-1-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-09-09T14:40:56",
    "name": "[dpdk-dev,v3,6/6] mbuf: flatten struct vlan_macip into mbuf struct",
    "commit_ref": "",
    "pull_url": "",
    "state": "accepted",
    "archived": true,
    "hash": "09d3ffd00f107487f95e84a91ad2867effc1b99a",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/332/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/332/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/332/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<540D71BF.8050006@6wind.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,491,1406617200\"; d=\"scan'208\";a=\"588599893\"",
        "Date": "Tue,  9 Sep 2014 15:40:56 +0100",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1410273656-4567-1-git-send-email-bruce.richardson@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\r\n\tby dpdk.org (Postfix) with ESMTP id 9F2C8B368;\r\n\tTue,  9 Sep 2014 16:36:30 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\r\n\tby dpdk.org (Postfix) with ESMTP id 4D41BAF87\r\n\tfor <dev@dpdk.org>; Tue,  9 Sep 2014 16:36:25 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\r\n\tby fmsmga101.fm.intel.com with ESMTP; 09 Sep 2014 07:40:59 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby fmsmga001.fm.intel.com with ESMTP; 09 Sep 2014 07:40:57 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\r\n\t[10.237.217.46])\r\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\r\n\ts89Eevab019539; Tue, 9 Sep 2014 15:40:57 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s89EevuT004793;\r\n\tTue, 9 Sep 2014 15:40:57 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s89EeugW004789;\r\n\tTue, 9 Sep 2014 15:40:56 +0100"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v3 6/6] mbuf: flatten struct vlan_macip into mbuf\r\n\tstruct",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "Precedence": "list",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<540D71BF.8050006@6wind.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "The vlan_macip structure combined a vlan tag id with l2 and l3 headers\nlengths for tracking offloads. However, this structure was only used as\na unit by the e1000 and ixgbe drivers, not generally.\n\nThis patch removes the structure from the mbuf header and places the\nfields into the mbuf structure directly at the required point, without\nany net effect on the structure layout. This allows us to treat the vlan\ntags and header length fields as separate for future mbuf changes. The\ndrivers which were written to use the combined structure still do so,\nusing a driver-local definition of it.\n\nChanges in V2:\n* None\n\nChanges in V3:\n* minor comment cleanup following review by Olivier\n* reduce perf regression caused by splitting vlan_macip field. This is\n  done by providing a single uint16_t value to allow writing/clearing\n  the l2 and l3 lengths together. There is still a small perf hit to the\n  slow path TX due to the reads from vlan_tci and l2/l3 lengths being\n  separated. (<5% in my tests with testpmd with no extra params). \n  Unfortunately, this cannot be eliminated, without restoring the vlan\n  tags and l2/l3 lengths as a combined 32-bit field. This would prevent\n  us from ever looking to move those fields about and is an artificial tie\n  that applies only for performance in igb and ixgbe drivers. Therefore,\n  this patch keeps the vlan_tci field separate from the lengths as the\n  best solution going forward.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\nV2 Acked-by: Olivier Matz <olivier.matz@6wind.com>\n\nfixup cleanup\n---\n app/test-pmd/csumonly.c                     |  4 +--\n app/test-pmd/flowgen.c                      | 14 ++++-----\n app/test-pmd/macfwd.c                       |  6 ++--\n app/test-pmd/macswap.c                      |  6 ++--\n app/test-pmd/rxonly.c                       |  3 +-\n app/test-pmd/testpmd.c                      |  3 +-\n app/test-pmd/txonly.c                       |  6 ++--\n app/test/packet_burst_generator.c           | 10 +++----\n examples/ip_fragmentation/main.c            |  2 +-\n examples/ip_pipeline/pipeline_rx.c          |  4 +--\n examples/ip_pipeline/pipeline_tx.c          |  2 +-\n examples/ip_reassembly/main.c               |  8 +++---\n examples/ipv4_multicast/main.c              |  3 +-\n examples/vhost/main.c                       |  6 ++--\n lib/librte_ip_frag/ip_frag_common.h         |  3 +-\n lib/librte_ip_frag/rte_ipv4_fragmentation.c |  2 +-\n lib/librte_ip_frag/rte_ipv4_reassembly.c    |  6 ++--\n lib/librte_ip_frag/rte_ipv6_reassembly.c    |  5 ++--\n lib/librte_mbuf/rte_mbuf.h                  | 36 ++++++++---------------\n lib/librte_pmd_e1000/em_rxtx.c              | 44 +++++++++++++++++++++--------\n lib/librte_pmd_e1000/igb_rxtx.c             | 37 ++++++++++++++++++------\n lib/librte_pmd_i40e/i40e_rxtx.c             | 14 ++++-----\n lib/librte_pmd_ixgbe/ixgbe_rxtx.c           | 17 ++++++-----\n lib/librte_pmd_ixgbe/ixgbe_rxtx.h           | 22 ++++++++++++++-\n lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c       |  6 ++--\n 25 files changed, 158 insertions(+), 111 deletions(-)",
    "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\r\nindex 655b6d8..28b66f5 100644\r\n--- a/app/test-pmd/csumonly.c\r\n+++ b/app/test-pmd/csumonly.c\r\n@@ -432,8 +432,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\r\n \t\t}\r\n \r\n \t\t/* Combine the packet header write. VLAN is not consider here */\r\n-\t\tmb->vlan_macip.f.l2_len = l2_len;\r\n-\t\tmb->vlan_macip.f.l3_len = l3_len;\r\n+\t\tmb->l2_len = l2_len;\r\n+\t\tmb->l3_len = l3_len;\r\n \t\tmb->ol_flags = ol_flags;\r\n \t}\r\n \tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);\r\ndiff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c\r\nindex 17dbf83..b091b6d 100644\r\n--- a/app/test-pmd/flowgen.c\r\n+++ b/app/test-pmd/flowgen.c\r\n@@ -205,13 +205,13 @@ pkt_burst_flow_gen(struct fwd_stream *fs)\r\n \t\tudp_hdr->dgram_len\t= RTE_CPU_TO_BE_16(pkt_size -\r\n \t\t\t\t\t\t\t   sizeof(*eth_hdr) -\r\n \t\t\t\t\t\t\t   sizeof(*ip_hdr));\r\n-\t\tpkt->nb_segs\t\t\t= 1;\r\n-\t\tpkt->pkt_len\t\t\t= pkt_size;\r\n-\t\tpkt->ol_flags\t\t\t= ol_flags;\r\n-\t\tpkt->vlan_macip.f.vlan_tci\t= vlan_tci;\r\n-\t\tpkt->vlan_macip.f.l2_len\t= sizeof(struct ether_hdr);\r\n-\t\tpkt->vlan_macip.f.l3_len\t= sizeof(struct ipv4_hdr);\r\n-\t\tpkts_burst[nb_pkt]\t\t= pkt;\r\n+\t\tpkt->nb_segs\t\t= 1;\r\n+\t\tpkt->pkt_len\t\t= pkt_size;\r\n+\t\tpkt->ol_flags\t\t= ol_flags;\r\n+\t\tpkt->vlan_tci\t\t= vlan_tci;\r\n+\t\tpkt->l2_len\t\t= sizeof(struct ether_hdr);\r\n+\t\tpkt->l3_len\t\t= sizeof(struct ipv4_hdr);\r\n+\t\tpkts_burst[nb_pkt]\t= pkt;\r\n \r\n \t\tnext_flow = (next_flow + 1) % cfg_n_flows;\r\n \t}\r\ndiff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c\r\nindex 999c8e3..4b905cd 100644\r\n--- a/app/test-pmd/macfwd.c\r\n+++ b/app/test-pmd/macfwd.c\r\n@@ -116,9 +116,9 @@ pkt_burst_mac_forward(struct fwd_stream *fs)\r\n \t\tether_addr_copy(&ports[fs->tx_port].eth_addr,\r\n \t\t\t\t&eth_hdr->s_addr);\r\n \t\tmb->ol_flags = txp->tx_ol_flags;\r\n-\t\tmb->vlan_macip.f.l2_len = sizeof(struct ether_hdr);\r\n-\t\tmb->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n-\t\tmb->vlan_macip.f.vlan_tci = txp->tx_vlan_id;\r\n+\t\tmb->l2_len = sizeof(struct ether_hdr);\r\n+\t\tmb->l3_len = sizeof(struct ipv4_hdr);\r\n+\t\tmb->vlan_tci = txp->tx_vlan_id;\r\n \t}\r\n \tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);\r\n \tfs->tx_packets += nb_tx;\r\ndiff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c\r\nindex 731f487..c5b3a0c 100644\r\n--- a/app/test-pmd/macswap.c\r\n+++ b/app/test-pmd/macswap.c\r\n@@ -118,9 +118,9 @@ pkt_burst_mac_swap(struct fwd_stream *fs)\r\n \t\tether_addr_copy(&addr, &eth_hdr->s_addr);\r\n \r\n \t\tmb->ol_flags = txp->tx_ol_flags;\r\n-\t\tmb->vlan_macip.f.l2_len = sizeof(struct ether_hdr);\r\n-\t\tmb->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n-\t\tmb->vlan_macip.f.vlan_tci = txp->tx_vlan_id;\r\n+\t\tmb->l2_len = sizeof(struct ether_hdr);\r\n+\t\tmb->l3_len = sizeof(struct ipv4_hdr);\r\n+\t\tmb->vlan_tci = txp->tx_vlan_id;\r\n \t}\r\n \tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_rx);\r\n \tfs->tx_packets += nb_tx;\r\ndiff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c\r\nindex c34a5e1..5bc74da 100644\r\n--- a/app/test-pmd/rxonly.c\r\n+++ b/app/test-pmd/rxonly.c\r\n@@ -165,8 +165,7 @@ pkt_burst_receive(struct fwd_stream *fs)\r\n \t\t\tprintf(\" - FDIR hash=0x%x - FDIR id=0x%x \",\r\n \t\t\t       mb->hash.fdir.hash, mb->hash.fdir.id);\r\n \t\tif (ol_flags & PKT_RX_VLAN_PKT)\r\n-\t\t\tprintf(\" - VLAN tci=0x%x\",\r\n-\t\t\t\tmb->vlan_macip.f.vlan_tci);\r\n+\t\t\tprintf(\" - VLAN tci=0x%x\", mb->vlan_tci);\r\n \t\tprintf(\"\\n\");\r\n \t\tif (ol_flags != 0) {\r\n \t\t\tint rxf;\r\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\r\nindex d13a53a..b426dfc 100644\r\n--- a/app/test-pmd/testpmd.c\r\n+++ b/app/test-pmd/testpmd.c\r\n@@ -406,7 +406,8 @@ testpmd_mbuf_ctor(struct rte_mempool *mp,\r\n \tmb->ol_flags     = 0;\r\n \tmb->data         = (char *) mb->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \tmb->nb_segs      = 1;\r\n-\tmb->vlan_macip.data = 0;\r\n+\tmb->l2_l3_len       = 0;\r\n+\tmb->vlan_tci     = 0;\r\n \tmb->hash.rss     = 0;\r\n }\r\n \r\ndiff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c\r\nindex 1b2f661..8135264 100644\r\n--- a/app/test-pmd/txonly.c\r\n+++ b/app/test-pmd/txonly.c\r\n@@ -263,9 +263,9 @@ pkt_burst_transmit(struct fwd_stream *fs)\r\n \t\tpkt->nb_segs = tx_pkt_nb_segs;\r\n \t\tpkt->pkt_len = tx_pkt_length;\r\n \t\tpkt->ol_flags = ol_flags;\r\n-\t\tpkt->vlan_macip.f.vlan_tci  = vlan_tci;\r\n-\t\tpkt->vlan_macip.f.l2_len = sizeof(struct ether_hdr);\r\n-\t\tpkt->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n+\t\tpkt->vlan_tci  = vlan_tci;\r\n+\t\tpkt->l2_len = sizeof(struct ether_hdr);\r\n+\t\tpkt->l3_len = sizeof(struct ipv4_hdr);\r\n \t\tpkts_burst[nb_pkt] = pkt;\r\n \t}\r\n \tnb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt);\r\ndiff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c\r\nindex 8740348..db7f023 100644\r\n--- a/app/test/packet_burst_generator.c\r\n+++ b/app/test/packet_burst_generator.c\r\n@@ -260,19 +260,19 @@ nomore_mbuf:\r\n \t\t */\r\n \t\tpkt->nb_segs = tx_pkt_nb_segs;\r\n \t\tpkt->pkt_len = tx_pkt_length;\r\n-\t\tpkt->vlan_macip.f.l2_len = eth_hdr_size;\r\n+\t\tpkt->l2_len = eth_hdr_size;\r\n \r\n \t\tif (ipv4) {\r\n-\t\t\tpkt->vlan_macip.f.vlan_tci  = ETHER_TYPE_IPv4;\r\n-\t\t\tpkt->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n+\t\t\tpkt->vlan_tci  = ETHER_TYPE_IPv4;\r\n+\t\t\tpkt->l3_len = sizeof(struct ipv4_hdr);\r\n \r\n \t\t\tif (vlan_enabled)\r\n \t\t\t\tpkt->ol_flags = PKT_RX_IPV4_HDR | PKT_RX_VLAN_PKT;\r\n \t\t\telse\r\n \t\t\t\tpkt->ol_flags = PKT_RX_IPV4_HDR;\r\n \t\t} else {\r\n-\t\t\tpkt->vlan_macip.f.vlan_tci  = ETHER_TYPE_IPv6;\r\n-\t\t\tpkt->vlan_macip.f.l3_len = sizeof(struct ipv6_hdr);\r\n+\t\t\tpkt->vlan_tci  = ETHER_TYPE_IPv6;\r\n+\t\t\tpkt->l3_len = sizeof(struct ipv6_hdr);\r\n \r\n \t\t\tif (vlan_enabled)\r\n \t\t\t\tpkt->ol_flags = PKT_RX_IPV6_HDR | PKT_RX_VLAN_PKT;\r\ndiff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c\r\nindex ac8d4f7..6d309b5 100644\r\n--- a/examples/ip_fragmentation/main.c\r\n+++ b/examples/ip_fragmentation/main.c\r\n@@ -413,7 +413,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,\r\n \t\t\trte_panic(\"No headroom in mbuf.\\n\");\r\n \t\t}\r\n \r\n-\t\tm->vlan_macip.f.l2_len = sizeof(struct ether_hdr);\r\n+\t\tm->l2_len = sizeof(struct ether_hdr);\r\n \r\n \t\t/* 02:00:00:00:00:xx */\r\n \t\td_addr_bytes = &eth_hdr->d_addr.addr_bytes[0];\r\ndiff --git a/examples/ip_pipeline/pipeline_rx.c b/examples/ip_pipeline/pipeline_rx.c\r\nindex 7a8309c..8f1f781 100644\r\n--- a/examples/ip_pipeline/pipeline_rx.c\r\n+++ b/examples/ip_pipeline/pipeline_rx.c\r\n@@ -255,8 +255,8 @@ app_pkt_metadata_fill(struct rte_mbuf *m)\r\n \t/* Pop Ethernet header */\r\n \tif (app.ether_hdr_pop_push) {\r\n \t\trte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));\r\n-\t\tm->vlan_macip.f.l2_len = 0;\r\n-\t\tm->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n+\t\tm->l2_len = 0;\r\n+\t\tm->l3_len = sizeof(struct ipv4_hdr);\r\n \t}\r\n }\r\n \r\ndiff --git a/examples/ip_pipeline/pipeline_tx.c b/examples/ip_pipeline/pipeline_tx.c\r\nindex b9491e3..64904b2 100644\r\n--- a/examples/ip_pipeline/pipeline_tx.c\r\n+++ b/examples/ip_pipeline/pipeline_tx.c\r\n@@ -66,7 +66,7 @@ app_pkt_metadata_flush(struct rte_mbuf *pkt)\r\n \tether_addr_copy(&pkt_meta->nh_arp, &ether_hdr->d_addr);\r\n \tether_addr_copy(&local_ether_addr, &ether_hdr->s_addr);\r\n \tether_hdr->ether_type = rte_bswap16(ETHER_TYPE_IPv4);\r\n-\tpkt->vlan_macip.f.l2_len = sizeof(struct ether_hdr);\r\n+\tpkt->l2_len = sizeof(struct ether_hdr);\r\n }\r\n \r\n static int\r\ndiff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c\r\nindex 8184aad..b6b4f59 100644\r\n--- a/examples/ip_reassembly/main.c\r\n+++ b/examples/ip_reassembly/main.c\r\n@@ -412,8 +412,8 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue,\r\n \t\t\tdr = &qconf->death_row;\r\n \r\n \t\t\t/* prepare mbuf: setup l2_len/l3_len. */\r\n-\t\t\tm->vlan_macip.f.l2_len = sizeof(*eth_hdr);\r\n-\t\t\tm->vlan_macip.f.l3_len = sizeof(*ip_hdr);\r\n+\t\t\tm->l2_len = sizeof(*eth_hdr);\r\n+\t\t\tm->l3_len = sizeof(*ip_hdr);\r\n \r\n \t\t\t/* process this fragment. */\r\n \t\t\tmo = rte_ipv4_frag_reassemble_packet(tbl, dr, m, tms, ip_hdr);\r\n@@ -455,8 +455,8 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue,\r\n \t\t\tdr  = &qconf->death_row;\r\n \r\n \t\t\t/* prepare mbuf: setup l2_len/l3_len. */\r\n-\t\t\tm->vlan_macip.f.l2_len = sizeof(*eth_hdr);\r\n-\t\t\tm->vlan_macip.f.l3_len = sizeof(*ip_hdr) + sizeof(*frag_hdr);\r\n+\t\t\tm->l2_len = sizeof(*eth_hdr);\r\n+\t\t\tm->l3_len = sizeof(*ip_hdr) + sizeof(*frag_hdr);\r\n \r\n \t\t\tmo = rte_ipv6_frag_reassemble_packet(tbl, dr, m, tms, ip_hdr, frag_hdr);\r\n \t\t\tif (mo == NULL)\r\ndiff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c\r\nindex 2232851..35bd842 100644\r\n--- a/examples/ipv4_multicast/main.c\r\n+++ b/examples/ipv4_multicast/main.c\r\n@@ -338,7 +338,8 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)\r\n \r\n \t/* copy metadata from source packet*/\r\n \thdr->port = pkt->port;\r\n-\thdr->vlan_macip = pkt->vlan_macip;\r\n+\thdr->vlan_tci = pkt->vlan_tci;\r\n+\thdr->l2_l3_len = pkt->l2_l3_len;\r\n \thdr->hash = pkt->hash;\r\n \r\n \thdr->ol_flags = pkt->ol_flags;\r\ndiff --git a/examples/vhost/main.c b/examples/vhost/main.c\r\nindex f0f8cfa..4e1c103 100644\r\n--- a/examples/vhost/main.c\r\n+++ b/examples/vhost/main.c\r\n@@ -2690,9 +2690,9 @@ virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m,\r\n \t\tmbuf->buf_addr = m->buf_addr;\r\n \t}\r\n \tmbuf->ol_flags = PKT_TX_VLAN_PKT;\r\n-\tmbuf->vlan_macip.f.vlan_tci = vlan_tag;\r\n-\tmbuf->vlan_macip.f.l2_len = sizeof(struct ether_hdr);\r\n-\tmbuf->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n+\tmbuf->vlan_tci = vlan_tag;\r\n+\tmbuf->l2_len = sizeof(struct ether_hdr);\r\n+\tmbuf->l3_len = sizeof(struct ipv4_hdr);\r\n \tMBUF_HEADROOM_UINT32(mbuf) = (uint32_t)desc_idx;\r\n \r\n \ttx_q->m_table[len] = mbuf;\r\ndiff --git a/lib/librte_ip_frag/ip_frag_common.h b/lib/librte_ip_frag/ip_frag_common.h\r\nindex 81ca23a..210f409 100644\r\n--- a/lib/librte_ip_frag/ip_frag_common.h\r\n+++ b/lib/librte_ip_frag/ip_frag_common.h\r\n@@ -173,8 +173,7 @@ ip_frag_chain(struct rte_mbuf *mn, struct rte_mbuf *mp)\r\n \tstruct rte_mbuf *ms;\r\n \r\n \t/* adjust start of the last fragment data. */\r\n-\trte_pktmbuf_adj(mp, (uint16_t)(mp->vlan_macip.f.l2_len +\r\n-\t\tmp->vlan_macip.f.l3_len));\r\n+\trte_pktmbuf_adj(mp, (uint16_t)(mp->l2_len + mp->l3_len));\r\n \r\n \t/* chain two fragments. */\r\n \tms = rte_pktmbuf_lastseg(mn);\r\ndiff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c\r\nindex 0b10310..6b9f07d 100644\r\n--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c\r\n+++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c\r\n@@ -198,7 +198,7 @@ rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in,\r\n \t\t    out_pkt->pkt_len - sizeof(struct ipv4_hdr));\r\n \r\n \t\tout_pkt->ol_flags |= PKT_TX_IP_CKSUM;\r\n-\t\tout_pkt->vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);\r\n+\t\tout_pkt->l3_len = sizeof(struct ipv4_hdr);\r\n \r\n \t\t/* Write the fragment to the output list */\r\n \t\tpkts_out[out_pkt_pos] = out_pkt;\r\ndiff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c\r\nindex 06c37af..0b8ceeb 100644\r\n--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c\r\n+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c\r\n@@ -87,10 +87,10 @@ ipv4_frag_reassemble(const struct ip_frag_pkt *fp)\r\n \r\n \t/* update ipv4 header for the reassmebled packet */\r\n \tip_hdr = (struct ipv4_hdr*)(rte_pktmbuf_mtod(m, uint8_t *) +\r\n-\t\tm->vlan_macip.f.l2_len);\r\n+\t\tm->l2_len);\r\n \r\n \tip_hdr->total_length = rte_cpu_to_be_16((uint16_t)(fp->total_size +\r\n-\t\tm->vlan_macip.f.l3_len));\r\n+\t\tm->l3_len));\r\n \tip_hdr->fragment_offset = (uint16_t)(ip_hdr->fragment_offset &\r\n \t\trte_cpu_to_be_16(IPV4_HDR_DF_FLAG));\r\n \tip_hdr->hdr_checksum = 0;\r\n@@ -137,7 +137,7 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,\r\n \r\n \tip_ofs *= IPV4_HDR_OFFSET_UNITS;\r\n \tip_len = (uint16_t)(rte_be_to_cpu_16(ip_hdr->total_length) -\r\n-\t\tmb->vlan_macip.f.l3_len);\r\n+\t\tmb->l3_len);\r\n \r\n \tIP_FRAG_LOG(DEBUG, \"%s:%d:\\n\"\r\n \t\t\"mbuf: %p, tms: %\" PRIu64\r\ndiff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c\r\nindex dee3425..71cf721 100644\r\n--- a/lib/librte_ip_frag/rte_ipv6_reassembly.c\r\n+++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c\r\n@@ -109,7 +109,7 @@ ipv6_frag_reassemble(const struct ip_frag_pkt *fp)\r\n \r\n \t/* update ipv6 header for the reassembled datagram */\r\n \tip_hdr = (struct ipv6_hdr *) (rte_pktmbuf_mtod(m, uint8_t *) +\r\n-\t\t\t\t\t\t\t\t  m->vlan_macip.f.l2_len);\r\n+\t\t\t\t\t\t\t\t  m->l2_len);\r\n \r\n \tip_hdr->payload_len = rte_cpu_to_be_16(payload_len);\r\n \r\n@@ -120,8 +120,7 @@ ipv6_frag_reassemble(const struct ip_frag_pkt *fp)\r\n \t * other headers, so we assume there are no other headers and thus update\r\n \t * the main IPv6 header instead.\r\n \t */\r\n-\tmove_len = m->vlan_macip.f.l2_len + m->vlan_macip.f.l3_len -\r\n-\t\t\tsizeof(*frag_hdr);\r\n+\tmove_len = m->l2_len + m->l3_len - sizeof(*frag_hdr);\r\n \tfrag_hdr = (struct ipv6_extension_fragment *) (ip_hdr + 1);\r\n \tip_hdr->proto = frag_hdr->next_header;\r\n \r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex 047a5a7..a523d82 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -111,27 +111,6 @@ extern \"C\" {\r\n  */\r\n #define PKT_TX_OFFLOAD_MASK (PKT_TX_VLAN_PKT | PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)\r\n \r\n-/** Offload features */\r\n-union rte_vlan_macip {\r\n-\tuint32_t data;\r\n-\tstruct {\r\n-\t\tuint16_t l3_len:9; /**< L3 (IP) Header Length. */\r\n-\t\tuint16_t l2_len:7; /**< L2 (MAC) Header Length. */\r\n-\t\tuint16_t vlan_tci;\r\n-\t\t/**< VLAN Tag Control Identifier (CPU order). */\r\n-\t} f;\r\n-};\r\n-\r\n-/*\r\n- * Compare mask for vlan_macip_len.data,\r\n- * should be in sync with rte_vlan_macip.f layout.\r\n- * */\r\n-#define TX_VLAN_CMP_MASK        0xFFFF0000  /**< VLAN length - 16-bits. */\r\n-#define TX_MAC_LEN_CMP_MASK     0x0000FE00  /**< MAC length - 7-bits. */\r\n-#define TX_IP_LEN_CMP_MASK      0x000001FF  /**< IP  length - 9-bits. */\r\n-/**< MAC+IP  length. */\r\n-#define TX_MACIP_LEN_CMP_MASK   (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK)\r\n-\r\n /**\r\n  * The generic rte_mbuf, containing a packet mbuf.\r\n  */\r\n@@ -170,7 +149,14 @@ struct rte_mbuf {\r\n \tuint32_t pkt_len;       /**< Total pkt len: sum of all segment data_len. */\r\n \r\n \t/* offload features, valid for first segment only */\r\n-\tunion rte_vlan_macip vlan_macip;\r\n+\tunion {\r\n+\t\tuint16_t l2_l3_len; /**< combined l2/l3 lengths as single var */\r\n+\t\tstruct {\r\n+\t\t\tuint16_t l3_len:9;      /**< L3 (IP) Header Length. */\r\n+\t\t\tuint16_t l2_len:7;      /**< L2 (MAC) Header Length. */\r\n+\t\t};\r\n+\t};\r\n+\tuint16_t vlan_tci;      /**< VLAN Tag Control Identifier (CPU order). */\r\n \tunion {\r\n \t\tuint32_t rss;       /**< RSS hash result if RSS enabled */\r\n \t\tstruct {\r\n@@ -540,7 +526,8 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)\r\n \r\n \tm->next = NULL;\r\n \tm->pkt_len = 0;\r\n-\tm->vlan_macip.data = 0;\r\n+\tm->l2_l3_len = 0;\r\n+\tm->vlan_tci = 0;\r\n \tm->nb_segs = 1;\r\n \tm->port = 0xff;\r\n \r\n@@ -607,7 +594,8 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *md)\r\n \tmi->data = md->data;\r\n \tmi->data_len = md->data_len;\r\n \tmi->port = md->port;\r\n-\tmi->vlan_macip = md->vlan_macip;\r\n+\tmi->vlan_tci = md->vlan_tci;\r\n+\tmi->l2_l3_len = md->l2_l3_len;\r\n \tmi->hash = md->hash;\r\n \r\n \tmi->next = NULL;\r\ndiff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c\r\nindex 074c9b3..ba7e3a9 100644\r\n--- a/lib/librte_pmd_e1000/em_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/em_rxtx.c\r\n@@ -144,13 +144,34 @@ enum {\r\n \tEM_CTX_NUM  = 1, /**< CTX NUM */\r\n };\r\n \r\n+/** Offload features */\r\n+union em_vlan_macip {\r\n+\tuint32_t data;\r\n+\tstruct {\r\n+\t\tuint16_t l3_len:9; /**< L3 (IP) Header Length. */\r\n+\t\tuint16_t l2_len:7; /**< L2 (MAC) Header Length. */\r\n+\t\tuint16_t vlan_tci;\r\n+\t\t/**< VLAN Tag Control Identifier (CPU order). */\r\n+\t} f;\r\n+};\r\n+\r\n+/*\r\n+ * Compare mask for vlan_macip_len.data,\r\n+ * should be in sync with em_vlan_macip.f layout.\r\n+ * */\r\n+#define TX_VLAN_CMP_MASK        0xFFFF0000  /**< VLAN length - 16-bits. */\r\n+#define TX_MAC_LEN_CMP_MASK     0x0000FE00  /**< MAC length - 7-bits. */\r\n+#define TX_IP_LEN_CMP_MASK      0x000001FF  /**< IP  length - 9-bits. */\r\n+/** MAC+IP  length. */\r\n+#define TX_MACIP_LEN_CMP_MASK   (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK)\r\n+\r\n /**\r\n  * Structure to check if new context need be built\r\n  */\r\n struct em_ctx_info {\r\n-\tuint16_t flags;               /**< ol_flags related to context build. */\r\n-\tuint32_t cmp_mask;            /**< compare mask */\r\n-\tunion rte_vlan_macip hdrlen;  /**< L2 and L3 header lenghts */\r\n+\tuint16_t flags;              /**< ol_flags related to context build. */\r\n+\tuint32_t cmp_mask;           /**< compare mask */\r\n+\tunion em_vlan_macip hdrlen;  /**< L2 and L3 header lenghts */\r\n };\r\n \r\n /**\r\n@@ -219,7 +240,7 @@ static inline void\r\n em_set_xmit_ctx(struct em_tx_queue* txq,\r\n \t\tvolatile struct e1000_context_desc *ctx_txd,\r\n \t\tuint16_t flags,\r\n-\t\tunion rte_vlan_macip hdrlen)\r\n+\t\tunion em_vlan_macip hdrlen)\r\n {\r\n \tuint32_t cmp_mask, cmd_len;\r\n \tuint16_t ipcse, l2len;\r\n@@ -285,7 +306,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,\r\n  */\r\n static inline uint32_t\r\n what_ctx_update(struct em_tx_queue *txq, uint16_t flags,\r\n-\t\tunion rte_vlan_macip hdrlen)\r\n+\t\tunion em_vlan_macip hdrlen)\r\n {\r\n \t/* If match with the current context */\r\n \tif (likely (txq->ctx_cache.flags == flags &&\r\n@@ -391,7 +412,7 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \tuint16_t tx_ol_req;\r\n \tuint32_t ctx;\r\n \tuint32_t new_ctx;\r\n-\tunion rte_vlan_macip hdrlen;\r\n+\tunion em_vlan_macip hdrlen;\r\n \r\n \ttxq = tx_queue;\r\n \tsw_ring = txq->sw_ring;\r\n@@ -421,7 +442,9 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \t\ttx_ol_req = (uint16_t)(ol_flags & (PKT_TX_IP_CKSUM |\r\n \t\t\t\t\t\t\tPKT_TX_L4_MASK));\r\n \t\tif (tx_ol_req) {\r\n-\t\t\thdrlen = tx_pkt->vlan_macip;\r\n+\t\t\thdrlen.f.vlan_tci = tx_pkt->vlan_tci;\r\n+\t\t\thdrlen.f.l2_len = tx_pkt->l2_len;\r\n+\t\t\thdrlen.f.l3_len = tx_pkt->l3_len;\r\n \t\t\t/* If new context to be built or reuse the exist ctx. */\r\n \t\t\tctx = what_ctx_update(txq, tx_ol_req, hdrlen);\r\n \r\n@@ -516,8 +539,7 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \t\t/* Set VLAN Tag offload fields. */\r\n \t\tif (ol_flags & PKT_TX_VLAN_PKT) {\r\n \t\t\tcmd_type_len |= E1000_TXD_CMD_VLE;\r\n-\t\t\tpopts_spec = tx_pkt->vlan_macip.f.vlan_tci <<\r\n-\t\t\t\tE1000_TXD_VLAN_SHIFT;\r\n+\t\t\tpopts_spec = tx_pkt->vlan_tci << E1000_TXD_VLAN_SHIFT;\r\n \t\t}\r\n \r\n \t\tif (tx_ol_req) {\r\n@@ -784,7 +806,7 @@ eth_em_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t\t\trx_desc_error_to_pkt_flags(rxd.errors));\r\n \r\n \t\t/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */\r\n-\t\trxm->vlan_macip.f.vlan_tci = rte_le_to_cpu_16(rxd.special);\r\n+\t\trxm->vlan_tci = rte_le_to_cpu_16(rxd.special);\r\n \r\n \t\t/*\r\n \t\t * Store the mbuf address into the next entry of the array\r\n@@ -1010,7 +1032,7 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t\t\t\trx_desc_error_to_pkt_flags(rxd.errors));\r\n \r\n \t\t/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */\r\n-\t\trxm->vlan_macip.f.vlan_tci = rte_le_to_cpu_16(rxd.special);\r\n+\t\trxm->vlan_tci = rte_le_to_cpu_16(rxd.special);\r\n \r\n \t\t/* Prefetch data of first segment, if configured to do so. */\r\n \t\trte_packet_prefetch(first_seg->data);\r\ndiff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c\r\nindex 8b33b6d..d4a803e 100644\r\n--- a/lib/librte_pmd_e1000/igb_rxtx.c\r\n+++ b/lib/librte_pmd_e1000/igb_rxtx.c\r\n@@ -153,13 +153,33 @@ enum igb_advctx_num {\r\n \tIGB_CTX_NUM  = 2, /**< CTX_NUM */\r\n };\r\n \r\n+/** Offload features */\r\n+union igb_vlan_macip {\r\n+\tuint32_t data;\r\n+\tstruct {\r\n+\t\tuint16_t l2_l3_len; /**< 7bit L2 and 9b L3 lengths combined */\r\n+\t\tuint16_t vlan_tci;\r\n+\t\t/**< VLAN Tag Control Identifier (CPU order). */\r\n+\t} f;\r\n+};\r\n+\r\n+/*\r\n+ * Compare mask for vlan_macip_len.data,\r\n+ * should be in sync with igb_vlan_macip.f layout.\r\n+ * */\r\n+#define TX_VLAN_CMP_MASK        0xFFFF0000  /**< VLAN length - 16-bits. */\r\n+#define TX_MAC_LEN_CMP_MASK     0x0000FE00  /**< MAC length - 7-bits. */\r\n+#define TX_IP_LEN_CMP_MASK      0x000001FF  /**< IP  length - 9-bits. */\r\n+/** MAC+IP  length. */\r\n+#define TX_MACIP_LEN_CMP_MASK   (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK)\r\n+\r\n /**\r\n  * Strucutre to check if new context need be built\r\n  */\r\n struct igb_advctx_info {\r\n \tuint16_t flags;           /**< ol_flags related to context build. */\r\n \tuint32_t cmp_mask;        /**< compare mask for vlan_macip_lens */\r\n-\tunion rte_vlan_macip vlan_macip_lens; /**< vlan, mac & ip length. */\r\n+\tunion igb_vlan_macip vlan_macip_lens; /**< vlan, mac & ip length. */\r\n };\r\n \r\n /**\r\n@@ -342,6 +362,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \tvolatile union e1000_adv_tx_desc *txd;\r\n \tstruct rte_mbuf     *tx_pkt;\r\n \tstruct rte_mbuf     *m_seg;\r\n+\tunion igb_vlan_macip vlan_macip_lens;\r\n \tuint64_t buf_dma_addr;\r\n \tuint32_t olinfo_status;\r\n \tuint32_t cmd_type_len;\r\n@@ -355,7 +376,6 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \tuint16_t tx_ol_req;\r\n \tuint32_t new_ctx = 0;\r\n \tuint32_t ctx = 0;\r\n-\tuint32_t vlan_macip_lens;\r\n \r\n \ttxq = tx_queue;\r\n \tsw_ring = txq->sw_ring;\r\n@@ -380,13 +400,14 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \t\ttx_last = (uint16_t) (tx_id + tx_pkt->nb_segs - 1);\r\n \r\n \t\tol_flags = tx_pkt->ol_flags;\r\n-\t\tvlan_macip_lens = tx_pkt->vlan_macip.data;\r\n+\t\tvlan_macip_lens.f.vlan_tci = tx_pkt->vlan_tci;\r\n+\t\tvlan_macip_lens.f.l2_l3_len = tx_pkt->l2_l3_len;\r\n \t\ttx_ol_req = (uint16_t)(ol_flags & PKT_TX_OFFLOAD_MASK);\r\n \r\n \t\t/* If a Context Descriptor need be built . */\r\n \t\tif (tx_ol_req) {\r\n \t\t\tctx = what_advctx_update(txq, tx_ol_req,\r\n-\t\t\t\tvlan_macip_lens);\r\n+\t\t\t\tvlan_macip_lens.data);\r\n \t\t\t/* Only allocate context descriptor if required*/\r\n \t\t\tnew_ctx = (ctx == IGB_CTX_NUM);\r\n \t\t\tctx = txq->ctx_curr;\r\n@@ -502,7 +523,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \t\t\t\t}\r\n \r\n \t\t\t\tigbe_set_xmit_ctx(txq, ctx_txd, tx_ol_req,\r\n-\t\t\t\t    vlan_macip_lens);\r\n+\t\t\t\t    vlan_macip_lens.data);\r\n \r\n \t\t\t\ttxe->last_id = tx_last;\r\n \t\t\t\ttx_id = txe->next_id;\r\n@@ -764,8 +785,7 @@ eth_igb_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\trxm->hash.rss = rxd.wb.lower.hi_dword.rss;\r\n \t\thlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);\r\n \t\t/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */\r\n-\t\trxm->vlan_macip.f.vlan_tci =\r\n-\t\t\trte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n+\t\trxm->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n \r\n \t\tpkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);\r\n \t\tpkt_flags = (uint16_t)(pkt_flags |\r\n@@ -1001,8 +1021,7 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t * The vlan_tci field is only valid when PKT_RX_VLAN_PKT is\r\n \t\t * set in the pkt_flags field.\r\n \t\t */\r\n-\t\tfirst_seg->vlan_macip.f.vlan_tci =\r\n-\t\t\trte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n+\t\tfirst_seg->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n \t\thlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);\r\n \t\tpkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);\r\n \t\tpkt_flags = (uint16_t)(pkt_flags |\r\ndiff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c\r\nindex c481976..e41e8d0 100644\r\n--- a/lib/librte_pmd_i40e/i40e_rxtx.c\r\n+++ b/lib/librte_pmd_i40e/i40e_rxtx.c\r\n@@ -613,7 +613,7 @@ i40e_rx_scan_hw_ring(struct i40e_rx_queue *rxq)\r\n \t\t\t\tI40E_RXD_QW1_LENGTH_PBUF_SHIFT) - rxq->crc_len;\r\n \t\t\tmb->data_len = pkt_len;\r\n \t\t\tmb->pkt_len = pkt_len;\r\n-\t\t\tmb->vlan_macip.f.vlan_tci = rx_status &\r\n+\t\t\tmb->vlan_tci = rx_status &\r\n \t\t\t\t(1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT) ?\r\n \t\t\trte_le_to_cpu_16(\\\r\n \t\t\t\trxdp[j].wb.qword0.lo_dword.l2tag1) : 0;\r\n@@ -850,7 +850,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\trxm->data_len = rx_packet_len;\r\n \t\trxm->port = rxq->port_id;\r\n \r\n-\t\trxm->vlan_macip.f.vlan_tci = rx_status &\r\n+\t\trxm->vlan_tci = rx_status &\r\n \t\t\t(1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT) ?\r\n \t\t\trte_le_to_cpu_16(rxd.wb.qword0.lo_dword.l2tag1) : 0;\r\n \t\tpkt_flags = i40e_rxd_status_to_pkt_flags(qword1);\r\n@@ -1003,7 +1003,7 @@ i40e_recv_scattered_pkts(void *rx_queue,\r\n \t\t}\r\n \r\n \t\tfirst_seg->port = rxq->port_id;\r\n-\t\tfirst_seg->vlan_macip.f.vlan_tci = (rx_status &\r\n+\t\tfirst_seg->vlan_tci = (rx_status &\r\n \t\t\t(1 << I40E_RX_DESC_STATUS_L2TAG1P_SHIFT)) ?\r\n \t\t\trte_le_to_cpu_16(rxd.wb.qword0.lo_dword.l2tag1) : 0;\r\n \t\tpkt_flags = i40e_rxd_status_to_pkt_flags(qword1);\r\n@@ -1105,8 +1105,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\r\n \t\tRTE_MBUF_PREFETCH_TO_FREE(txe->mbuf);\r\n \r\n \t\tol_flags = tx_pkt->ol_flags;\r\n-\t\tl2_len = tx_pkt->vlan_macip.f.l2_len;\r\n-\t\tl3_len = tx_pkt->vlan_macip.f.l3_len;\r\n+\t\tl2_len = tx_pkt->l2_len;\r\n+\t\tl3_len = tx_pkt->l3_len;\r\n \r\n \t\t/* Calculate the number of context descriptors needed. */\r\n \t\tnb_ctx = i40e_calc_context_desc(ol_flags);\r\n@@ -1142,8 +1142,8 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\r\n \r\n \t\t/* Descriptor based VLAN insertion */\r\n \t\tif (ol_flags & PKT_TX_VLAN_PKT) {\r\n-\t\t\ttx_flags |= tx_pkt->vlan_macip.f.vlan_tci <<\r\n-\t\t\t\t\t\tI40E_TX_FLAG_L2TAG1_SHIFT;\r\n+\t\t\ttx_flags |= tx_pkt->vlan_tci <<\r\n+\t\t\t\t\tI40E_TX_FLAG_L2TAG1_SHIFT;\r\n \t\t\ttx_flags |= I40E_TX_FLAG_INSERT_VLAN;\r\n \t\t\ttd_cmd |= I40E_TX_DESC_CMD_IL2TAG1;\r\n \t\t\ttd_tag = (tx_flags & I40E_TX_FLAG_L2TAG1_MASK) >>\r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\nindex eec1458..575a014 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c\r\n@@ -540,6 +540,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \tvolatile union ixgbe_adv_tx_desc *txd;\r\n \tstruct rte_mbuf     *tx_pkt;\r\n \tstruct rte_mbuf     *m_seg;\r\n+\tunion ixgbe_vlan_macip vlan_macip_lens;\r\n \tuint64_t buf_dma_addr;\r\n \tuint32_t olinfo_status;\r\n \tuint32_t cmd_type_len;\r\n@@ -551,7 +552,6 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \tuint16_t nb_tx;\r\n \tuint16_t nb_used;\r\n \tuint16_t tx_ol_req;\r\n-\tuint32_t vlan_macip_lens;\r\n \tuint32_t ctx = 0;\r\n \tuint32_t new_ctx;\r\n \r\n@@ -579,14 +579,15 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \t\t * are needed for offload functionality.\r\n \t\t */\r\n \t\tol_flags = tx_pkt->ol_flags;\r\n-\t\tvlan_macip_lens = tx_pkt->vlan_macip.data;\r\n+\t\tvlan_macip_lens.f.vlan_tci = tx_pkt->vlan_tci;\r\n+\t\tvlan_macip_lens.f.l2_l3_len = tx_pkt->l2_l3_len;\r\n \r\n \t\t/* If hardware offload required */\r\n \t\ttx_ol_req = (uint16_t)(ol_flags & PKT_TX_OFFLOAD_MASK);\r\n \t\tif (tx_ol_req) {\r\n \t\t\t/* If new context need be built or reuse the exist ctx. */\r\n \t\t\tctx = what_advctx_update(txq, tx_ol_req,\r\n-\t\t\t\tvlan_macip_lens);\r\n+\t\t\t\tvlan_macip_lens.data);\r\n \t\t\t/* Only allocate context descriptor if required*/\r\n \t\t\tnew_ctx = (ctx == IXGBE_CTX_NUM);\r\n \t\t\tctx = txq->ctx_curr;\r\n@@ -728,7 +729,7 @@ ixgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\r\n \t\t\t\t}\r\n \r\n \t\t\t\tixgbe_set_xmit_ctx(txq, ctx_txd, tx_ol_req,\r\n-\t\t\t\t    vlan_macip_lens);\r\n+\t\t\t\t    vlan_macip_lens.data);\r\n \r\n \t\t\t\ttxe->last_id = tx_last;\r\n \t\t\t\ttx_id = txe->next_id;\r\n@@ -939,7 +940,7 @@ ixgbe_rx_scan_hw_ring(struct igb_rx_queue *rxq)\r\n \t\t\t\t\t\t\trxq->crc_len);\r\n \t\t\tmb->data_len = pkt_len;\r\n \t\t\tmb->pkt_len = pkt_len;\r\n-\t\t\tmb->vlan_macip.f.vlan_tci = rxdp[j].wb.upper.vlan;\r\n+\t\t\tmb->vlan_tci = rxdp[j].wb.upper.vlan;\r\n \t\t\tmb->hash.rss = rxdp[j].wb.lower.hi_dword.rss;\r\n \r\n \t\t\t/* convert descriptor fields to rte mbuf flags */\r\n@@ -1257,8 +1258,7 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \r\n \t\thlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);\r\n \t\t/* Only valid if PKT_RX_VLAN_PKT set in pkt_flags */\r\n-\t\trxm->vlan_macip.f.vlan_tci =\r\n-\t\t\trte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n+\t\trxm->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n \r\n \t\tpkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);\r\n \t\tpkt_flags = (uint16_t)(pkt_flags |\r\n@@ -1502,8 +1502,7 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\r\n \t\t * The vlan_tci field is only valid when PKT_RX_VLAN_PKT is\r\n \t\t * set in the pkt_flags field.\r\n \t\t */\r\n-\t\tfirst_seg->vlan_macip.f.vlan_tci =\r\n-\t\t\t\trte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n+\t\tfirst_seg->vlan_tci = rte_le_to_cpu_16(rxd.wb.upper.vlan);\r\n \t\thlen_type_rss = rte_le_to_cpu_32(rxd.wb.lower.lo_dword.data);\r\n \t\tpkt_flags = rx_desc_hlen_type_rss_to_pkt_flags(hlen_type_rss);\r\n \t\tpkt_flags = (uint16_t)(pkt_flags |\r\ndiff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\nindex 4c9cb74..41042ac 100644\r\n--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\n+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h\r\n@@ -153,6 +153,26 @@ enum ixgbe_advctx_num {\r\n \tIXGBE_CTX_NUM  = 2, /**< CTX NUMBER  */\r\n };\r\n \r\n+/** Offload features */\r\n+union ixgbe_vlan_macip {\r\n+\tuint32_t data;\r\n+\tstruct {\r\n+\t\tuint16_t l2_l3_len; /**< combined 9-bit l3, 7-bit l2 lengths */\r\n+\t\tuint16_t vlan_tci;\r\n+\t\t/**< VLAN Tag Control Identifier (CPU order). */\r\n+\t} f;\r\n+};\r\n+\r\n+/*\r\n+ * Compare mask for vlan_macip_len.data,\r\n+ * should be in sync with ixgbe_vlan_macip.f layout.\r\n+ * */\r\n+#define TX_VLAN_CMP_MASK        0xFFFF0000  /**< VLAN length - 16-bits. */\r\n+#define TX_MAC_LEN_CMP_MASK     0x0000FE00  /**< MAC length - 7-bits. */\r\n+#define TX_IP_LEN_CMP_MASK      0x000001FF  /**< IP  length - 9-bits. */\r\n+/** MAC+IP  length. */\r\n+#define TX_MACIP_LEN_CMP_MASK   (TX_MAC_LEN_CMP_MASK | TX_IP_LEN_CMP_MASK)\r\n+\r\n /**\r\n  * Structure to check if new context need be built\r\n  */\r\n@@ -160,7 +180,7 @@ enum ixgbe_advctx_num {\r\n struct ixgbe_advctx_info {\r\n \tuint16_t flags;           /**< ol_flags for context build. */\r\n \tuint32_t cmp_mask;        /**< compare mask for vlan_macip_lens */\r\n-\tunion rte_vlan_macip vlan_macip_lens; /**< vlan, mac ip length. */\r\n+\tunion ixgbe_vlan_macip vlan_macip_lens; /**< vlan, mac ip length. */\r\n };\r\n \r\n /**\r\ndiff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\nindex 4afb116..e74b6fd 100644\r\n--- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n+++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c\r\n@@ -551,8 +551,8 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\t\t\t\t       rte_pktmbuf_mtod(rxm, void *));\r\n #endif\r\n \t\t\t\t/* Copy vlan tag in packet buffer */\r\n-\t\t\t\trxm->vlan_macip.f.vlan_tci =\r\n-\t\t\t\t\trte_le_to_cpu_16((uint16_t)rcd->tci);\r\n+\t\t\t\trxm->vlan_tci = rte_le_to_cpu_16(\r\n+\t\t\t\t\t\t(uint16_t)rcd->tci);\r\n \r\n \t\t\t} else\r\n \t\t\t\trxm->ol_flags = 0;\r\n@@ -564,7 +564,7 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\r\n \t\t\trxm->pkt_len = (uint16_t)rcd->len;\r\n \t\t\trxm->data_len = (uint16_t)rcd->len;\r\n \t\t\trxm->port = rxq->port_id;\r\n-\t\t\trxm->vlan_macip.f.vlan_tci = 0;\r\n+\t\t\trxm->vlan_tci = 0;\r\n \t\t\trxm->data = (char *)rxm->buf_addr + RTE_PKTMBUF_HEADROOM;\r\n \r\n \t\t\trx_pkts[nb_rx++] = rxm;\r\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "6/6"
    ]
}