From patchwork Tue Jan 9 14:11:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xueming Li X-Patchwork-Id: 33242 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 69EF11B1DB; Tue, 9 Jan 2018 16:00:19 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B45721B00B for ; Tue, 9 Jan 2018 16:00:16 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@mellanox.com) with ESMTPS (AES256-SHA encrypted); 9 Jan 2018 17:00:11 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx [10.12.205.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w09F07Ph017506; Tue, 9 Jan 2018 17:00:10 +0200 Received: from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1]) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id w09EBffU146312; Tue, 9 Jan 2018 22:11:41 +0800 Received: (from xuemingl@localhost) by dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id w09EBffu146311; Tue, 9 Jan 2018 22:11:41 +0800 From: Xueming Li To: Olivier MATZ , Thomas Monjalon , Jingjing Wu , Yongseok Koh Cc: Xueming Li , Shahaf Shuler , dev@dpdk.org Date: Tue, 9 Jan 2018 22:11:08 +0800 Message-Id: <20180109141110.146250-5-xuemingl@mellanox.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20180109141110.146250-1-xuemingl@mellanox.com> References: <20180109141110.146250-1-xuemingl@mellanox.com> Subject: [dpdk-dev] [PATCH 4/6] ethdev: introduce TX common tunnel offloads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch introduce new DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO flag for devices that support tunnel agnostic TX checksum and tso offloading. Checksum offset and TSO header length are calculated based on mbuf inner length l*_len, outer_l*_len and tx offload flags PKT_TX_*, tunnel header length is part of inner l2_len, so device HW do cheksum and TSO calculation w/o knowledge of perticular tunnel type. When set application must guarantee that correct header types and lengths for each inner and outer headers in mbuf header, no need to specify tunnel type. Signed-off-by: Xueming Li Acked-by: Ferruh Yigit --- lib/librte_ether/rte_ethdev.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 57b61ed41..8457d01be 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1003,6 +1003,15 @@ struct rte_eth_conf { * the same mempool and has refcnt = 1. */ #define DEV_TX_OFFLOAD_SECURITY 0x00020000 +/**< Device supports arbitrary tunnel chksum and tso offloading w/o knowing + * tunnel detail. Checksum and TSO are calculated based on mbuf fields: + * l*_len, outer_l*_len + * PKT_TX_OUTER_IPV6, PKT_TX_IPV6 + * PKT_TX_IP_CKSUM, PKT_TX_TCP_CKSUM, PKT_TX_UDP_CKSUM + * When set application must guarantee correct header fields, no need to + * specify tunnel type PKT_TX_TUNNEL_* for HW. + */ +#define DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO 0x00040000 struct rte_pci_device;