From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by dpdk.org (Postfix) with ESMTP id 3C2E058F4 for ; Mon, 8 Dec 2014 11:51:04 +0100 (CET) Received: by mail-wi0-f177.google.com with SMTP id l15so4338908wiw.16 for ; Mon, 08 Dec 2014 02:51:04 -0800 (PST) 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:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=tr7fZWOD1XlvlffH+NjdqyqkehpNcGvOTvzSBrLD7Oo=; b=EQOG3Po3By/omdQ2cD8OQHSgNp30Xv2NMsmRpRuX1wcokaQoP6Ew7ESKQoWnp3joH8 LS4RPUD/3SFvVtJNWVqjMvZ61gvtDiYgaC/IiXLpOvYCtQ7RBY99VuTky/1pcQU5aeGt KdUXbcLCPYxYCuyvprrVxFBh4gIjjjWcPXsNz0/5B2zA2KgsNFmWmuuU0Mov7fhIEK4f S3r/956FHXPbqrgzmpTmuuLKFq1ygtIennzvSCH009rh/RtHf7RNk1nfo2d9wjHSX6v0 Xnl+Mp2ovnHSxqIUvlqvfSc74KF8pbXOVXnqVUGYE01Y+9WoyiGO+rJs1olhZ9V+eMtC DANw== X-Gm-Message-State: ALoCoQkJvl/LcVNuzU+cq/0h9BDUiXgi7HKt6z56PHXFWnZ2A9Tv8j1G9e14iGOkNwXfUzuBlnlj X-Received: by 10.180.11.140 with SMTP id q12mr23236487wib.45.1418035863785; Mon, 08 Dec 2014 02:51:03 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id dm10sm9282831wib.18.2014.12.08.02.51.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Dec 2014 02:51:02 -0800 (PST) From: Thomas Monjalon To: Helin Zhang Date: Mon, 08 Dec 2014 11:50:36 +0100 Message-ID: <5137902.VTrfHmozET@xps13> Organization: 6WIND User-Agent: KMail/4.14.3 (Linux/3.17.4-1-ARCH; KDE/4.14.3; x86_64; ; ) In-Reply-To: <1417829617-7185-1-git-send-email-helin.zhang@intel.com> References: <1417743988-15604-1-git-send-email-helin.zhang@intel.com> <1417829617-7185-1-git-send-email-helin.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3] mbuf: fix of enabling all newly added RX error 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: Mon, 08 Dec 2014 10:51:04 -0000 Hi Helin, 2014-12-06 09:33, Helin Zhang: > Before redefining mbuf structure, there was lack of free bits in 'ol_flags' > (32 bits in total) for new RX or TX flags. So it tried to reuse existant > bits as most as possible, or even assigning 0 to some of bit flags. After > new mbuf structure defined, there are quite a lot of free bits. So those > newly added bit flags should be assigned with correct and valid bit values, > and getting their names should be enabled as well. Note that 'RECIP' should > be removed, as nowhere will use it. 'PKT_RX_ERR' is defined to replace all > other error bit flags, e.g. MAC error, Oversize error, header buffer > overflow error. > > Signed-off-by: Helin Zhang [...] > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -84,11 +84,6 @@ extern "C" { > #define PKT_RX_FDIR (1ULL << 2) /**< RX packet with FDIR match indicate. */ > #define PKT_RX_L4_CKSUM_BAD (1ULL << 3) /**< L4 cksum of RX pkt. is not OK. */ > #define PKT_RX_IP_CKSUM_BAD (1ULL << 4) /**< IP cksum of RX pkt. is not OK. */ > -#define PKT_RX_EIP_CKSUM_BAD (0ULL << 0) /**< External IP header checksum error. */ > -#define PKT_RX_OVERSIZE (0ULL << 0) /**< Num of desc of an RX pkt oversize. */ > -#define PKT_RX_HBUF_OVERFLOW (0ULL << 0) /**< Header buffer overflow. */ > -#define PKT_RX_RECIP_ERR (0ULL << 0) /**< Hardware processing error. */ > -#define PKT_RX_MAC_ERR (0ULL << 0) /**< MAC error. */ > #define PKT_RX_IPV4_HDR (1ULL << 5) /**< RX packet with IPv4 header. */ > #define PKT_RX_IPV4_HDR_EXT (1ULL << 6) /**< RX packet with extended IPv4 header. */ > #define PKT_RX_IPV6_HDR (1ULL << 7) /**< RX packet with IPv6 header. */ > @@ -99,6 +94,8 @@ extern "C" { > #define PKT_RX_TUNNEL_IPV6_HDR (1ULL << 12) /**< RX tunnel packet with IPv6 header. */ > #define PKT_RX_FDIR_ID (1ULL << 13) /**< FD id reported if FDIR match. */ > #define PKT_RX_FDIR_FLX (1ULL << 14) /**< Flexible bytes reported if FDIR match. */ > +#define PKT_RX_EIP_CKSUM_BAD (1ULL << 15) /**< External IP header checksum error. */ Could PKT_RX_EIP_CKSUM_BAD be aggregated with PKT_RX_IP_CKSUM_BAD? The conclusion is the same: the packet is corrupted. And some hardwares could not detect the encapsulation and use PKT_RX_IP_CKSUM_BAD. Another interesting improvement would be to have PKT_RX_IP_CKSUM_OK. I think we'll have to think about this kind of flag for next version. Note that this patch is an API change and shouldn't be applied for 1.8.0. But we can do an exception as it has no impact on existing applications and fixes the 0 flags. -- Thomas