From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id A9F26FFA for ; Thu, 16 Jul 2015 01:51:32 +0200 (CEST) Received: by widjy10 with SMTP id jy10so1575180wid.1 for ; Wed, 15 Jul 2015 16:51:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=dHvg1CTOemxc1pqK2uEFTwcefJ4k5Q+UpYKMVG5drrk=; b=Ue673wD1ZI2SrHQEKj67OMBBkuSnF/uw6hrpJogWIRNwJ8kTX0Bxv0mUCbdrj301je Ow9hhtMA+PqklUlMT1dZnG5KSnAnkF4UpPO8r7/2zNTtSlhlkdfZQYyhUORCTQhWtyYy CDw236qoBDOZNL7dLQp7WIrU8z4G7bvPwm/mVKd1DorcaF7kuPLrPwrMX7SYlrxEpl1f J/MSK/yLIy/XLjQ+GhZ6smP9kIO3uuGysuiyWZIqOgAqXwDnn0pYxmLme+64hdEZgCXg gGi0TZQJGJ0XXz6+sB1D9zvGSVvdAGRBj7DM8yDJkPhAfK9yz40wchSy4IFdUFE460fv EbWw== X-Gm-Message-State: ALoCoQkn7pZydd1OJo/c+t/dphC/GGepJy+pZ0N3tJm5NjMPc/WvEu1hht7jeRiZc9Kx9ysWsS9i X-Received: by 10.180.77.68 with SMTP id q4mr1145132wiw.22.1437004292512; Wed, 15 Jul 2015 16:51:32 -0700 (PDT) Received: from XPS13.localdomain (guy78-1-82-235-116-147.fbx.proxad.net. [82.235.116.147]) by smtp.gmail.com with ESMTPSA id ck18sm10141457wjb.47.2015.07.15.16.51.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Jul 2015 16:51:31 -0700 (PDT) From: Thomas Monjalon To: helin.zhang@intel.com Date: Thu, 16 Jul 2015 01:50:12 +0200 Message-Id: <1437004212-31646-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.4.2 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] mbuf: fix tunnel flags check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 23:51:32 -0000 A packet is tunnelled if the tunnel type is identified or if it has an inner part. Fix also a typo in RTE_PTYPE_INNER_L3_MASK. Fixes: f295a00a2b44 ("mbuf: add definitions of unified packet types") Signed-off-by: Thomas Monjalon --- app/test-pmd/rxonly.c | 2 +- lib/librte_mbuf/rte_mbuf.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c index 41871d3..ee7fd8d 100644 --- a/app/test-pmd/rxonly.c +++ b/app/test-pmd/rxonly.c @@ -288,7 +288,7 @@ pkt_burst_receive(struct fwd_stream *fs) } /* inner L3 packet type */ - ptype = mb->packet_type & RTE_PTYPE_INNER_INNER_L3_MASK; + ptype = mb->packet_type & RTE_PTYPE_INNER_L3_MASK; switch (ptype) { case RTE_PTYPE_INNER_L3_IPV4: printf(" - Inner L3 type: IPV4"); diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 115c560..dbd9095 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -595,7 +595,7 @@ extern "C" { /** * Mask of inner layer 3 packet types. */ -#define RTE_PTYPE_INNER_INNER_L3_MASK 0x00f00000 +#define RTE_PTYPE_INNER_L3_MASK 0x00f00000 /** * TCP (Transmission Control Protocol) packet type. * It is used for inner packet only. @@ -689,7 +689,10 @@ extern "C" { #define RTE_ETH_IS_IPV6_HDR(ptype) ((ptype) & RTE_PTYPE_L3_IPV6) /* Check if it is a tunneling packet */ -#define RTE_ETH_IS_TUNNEL_PKT(ptype) ((ptype) & RTE_PTYPE_TUNNEL_MASK) +#define RTE_ETH_IS_TUNNEL_PKT(ptype) ((ptype) & (RTE_PTYPE_TUNNEL_MASK | \ + RTE_PTYPE_INNER_L2_MASK | \ + RTE_PTYPE_INNER_L3_MASK | \ + RTE_PTYPE_INNER_L4_MASK)) #endif /* RTE_NEXT_ABI */ /** -- 2.4.2