From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id 20CB37D19
 for <dev@dpdk.org>; Wed, 21 Mar 2018 20:47:34 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 21 Mar 2018 12:47:34 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.48,341,1517904000"; d="scan'208";a="25903689"
Received: from silpixa00399777.ir.intel.com (HELO
 silpixa00399777.ger.corp.intel.com) ([10.237.222.236])
 by fmsmga007.fm.intel.com with ESMTP; 21 Mar 2018 12:47:33 -0700
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Neil Horman <nhorman@tuxdriver.com>,
 John McNamara <john.mcnamara@intel.com>,
 Marko Kovacevic <marko.kovacevic@intel.com>,
 Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org,
	Ferruh Yigit <ferruh.yigit@intel.com>
Date: Wed, 21 Mar 2018 19:47:30 +0000
Message-Id: <20180321194730.52068-2-ferruh.yigit@intel.com>
X-Mailer: git-send-email 2.13.6
In-Reply-To: <20180321194730.52068-1-ferruh.yigit@intel.com>
References: <20180320112631.107105-1-ferruh.yigit@intel.com>
 <20180321194730.52068-1-ferruh.yigit@intel.com>
Subject: [dpdk-dev] [PATCH v2 2/2] ethdev: add new offload flag to keep CRC
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 21 Mar 2018 19:47:35 -0000

DEV_RX_OFFLOAD_KEEP_CRC offload flag added.

DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release but default
behavior in PMDs is to strip the CRC independent from this flag.

Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed:
- Setting both KEEP_CRC & CRC_STRIP is INVALID
- Setting only CRC_STRIP PMD should strip the CRC
- Setting only KEEP_CRC PMD should keep the CRC
- Not setting both PMD should strip the CRC

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_ether/rte_ethdev.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 5e13dca6a..ab1030d42 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -939,6 +939,9 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_SCATTER		0x00002000
 #define DEV_RX_OFFLOAD_TIMESTAMP	0x00004000
 #define DEV_RX_OFFLOAD_SECURITY         0x00008000
+/* Invalid to set both DEV_RX_OFFLOAD_CRC_STRIP and DEV_RX_OFFLOAD_KEEP_CRC
+ * No DEV_RX_OFFLOAD_CRC_STRIP flag means stripping CRC */
+#define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
 				 DEV_RX_OFFLOAD_TCP_CKSUM)
-- 
2.13.6