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 6013068CD for ; Wed, 3 Dec 2014 12:35:12 +0100 (CET) Received: by mail-wi0-f179.google.com with SMTP id ex7so24094934wid.12 for ; Wed, 03 Dec 2014 03:35:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=cUhXVo+Hm3y4+3L3LZOdwoPI/epv9HRNr5rsBdCnhNk=; b=JNFFj95M7jUZwNjXBhYY35JX7/w8URAwwQtTdzUzxY+oe9Wq51LuHPR+tAovIplcMp TDhGzUvhfqaOnuef3SiM9CFbAO3x/U3v+kDSe7zDfAWVPm3EVXCDZIFN2CG0c0B0hykB GqqdqQFCw0FWWRdmVumwA+aCXFPAdbbjLQy9mydNF0s+UxvW7hTahfCBr07r1ZZSKJP3 npNjqYrjPSnmsB/UtT0wVLKZHdeA9qJ1dMSKSy/EWCcSE04zdefj35eYH9u9I0Z+/qrz 08bP4B14FcLWeZcuUFLzPm53aq0NZ47jCBzpJaqmaiDLxXCu9v80dd1WNS2yQ/w7xhcb OKDQ== X-Gm-Message-State: ALoCoQmjWjsLVYN6xHovmUzPE7dcZM9EH3gOmOlGDsjgVcTDihFE7i6VqBaNERvLkSNeEz7inGcY X-Received: by 10.180.104.65 with SMTP id gc1mr24442437wib.46.1417606512219; Wed, 03 Dec 2014 03:35:12 -0800 (PST) Received: from [10.16.0.195] (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id fk12sm16184395wic.6.2014.12.03.03.35.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 03:35:11 -0800 (PST) Message-ID: <547EF56F.5010604@6wind.com> Date: Wed, 03 Dec 2014 12:35:11 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0 MIME-Version: 1.0 To: Jijiang Liu , dev@dpdk.org References: <1417532767-1309-1-git-send-email-jijiang.liu@intel.com> <1417532767-1309-2-git-send-email-jijiang.liu@intel.com> In-Reply-To: <1417532767-1309-2-git-send-email-jijiang.liu@intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 1/3] mbuf:redefine three TX ol_flags 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, 03 Dec 2014 11:35:12 -0000 Hi Jijiang, On 12/02/2014 04:06 PM, Jijiang Liu wrote: > The reason of redefining the PKT_TX_IPV4 and the PKT_TX_IPV6 is listed below, > It will avoid to send a packet with a bad info: > - we receive a Ether/IP6/IP4/L4/data packet > - the driver sets PKT_RX_IPV6_HDR > - the stack decapsulates IP6 > - the stack sends the packet, it has the PKT_TX_IPV6 flag but it's an IPv4 packet. > > Signed-off-by: Jijiang Liu > --- > lib/librte_mbuf/rte_mbuf.h | 10 +++++----- > 1 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 2e5fce5..cbadf8e 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -141,13 +141,13 @@ extern "C" { > #define PKT_TX_IP_CKSUM (1ULL << 54) /**< IP cksum of TX pkt. computed by NIC. */ > #define PKT_TX_IPV4_CSUM PKT_TX_IP_CKSUM /**< Alias of PKT_TX_IP_CKSUM. */ > > -/** Tell the NIC it's an IPv4 packet. Required for L4 checksum offload or TSO. */ > -#define PKT_TX_IPV4 PKT_RX_IPV4_HDR > +/** Packet is IPv4 without requiring IP checksum offload. */ > +#define PKT_TX_IPV4 (1ULL << 55) > > -/** Tell the NIC it's an IPv6 packet. Required for L4 checksum offload or TSO. */ > -#define PKT_TX_IPV6 PKT_RX_IPV6_HDR > +/** Tell the NIC it's an IPv6 packet.*/ > +#define PKT_TX_IPV6 (1ULL << 56) > > -#define PKT_TX_VLAN_PKT (1ULL << 55) /**< TX packet is a 802.1q VLAN packet. */ > +#define PKT_TX_VLAN_PKT (1ULL << 57) /**< TX packet is a 802.1q VLAN packet. */ > > /* Use final bit of flags to indicate a control mbuf */ > #define CTRL_MBUF_FLAG (1ULL << 63) /**< Mbuf contains control data */ > Acked-by: Olivier Matz