From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 58E5C68FB for ; Mon, 20 Oct 2014 11:35:00 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 20 Oct 2014 02:32:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="402852249" Received: from gklab-18-011.igk.intel.com ([10.102.18.11]) by FMSMGA003.fm.intel.com with ESMTP; 20 Oct 2014 02:35:22 -0700 From: miroslaw.walukiewicz@intel.com To: dev@dpdk.org Date: Mon, 20 Oct 2014 05:42:52 -0400 Message-ID: <20141020094252.14456.58891.stgit@gklab-18-011.igk.intel.com> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] [PATCH] pmd: Add generic support for TCP TSO (Transmit Segmentation Offload) 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, 20 Oct 2014 09:35:02 -0000 From: Miroslaw Walukiewicz Add new PKT_TX_TCP_SEG flag Add new fields in the tx offload fields indicating MSS and L4 len Signed-off-by: Mirek Walukiewicz --- lib/librte_mbuf/rte_mbuf.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index ddadc21..bcb09b9 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -114,6 +114,9 @@ extern "C" { /* Bit 51 - IEEE1588*/ #define PKT_TX_IEEE1588_TMST (1ULL << 51) /**< TX IEEE1588 packet to timestamp. */ +/* Bit 49 - TCP transmit segmenation offload */ +#define PKT_TX_TCP_SEG (1ULL << 49) /**< TX TSO offload */ + /* Use final bit of flags to indicate a control mbuf */ #define CTRL_MBUF_FLAG (1ULL << 63) /**< Mbuf contains control data */ @@ -189,12 +192,22 @@ struct rte_mbuf { struct rte_mbuf *next; /**< Next segment of scattered packet. */ /* fields to support TX offloads */ - union { - uint16_t l2_l3_len; /**< combined l2/l3 lengths as single var */ - struct { - uint16_t l3_len:9; /**< L3 (IP) Header Length. */ - uint16_t l2_len:7; /**< L2 (MAC) Header Length. */ + /* two bytes - l2/l3 len for compatibility (endian issues) + * two bytes - reseved for alignment + * two bytes - l4 len (TCP/UDP) header len + * two bytes - TCP tso segment size + */ + struct { + union { + uint16_t l2_l3_len; /**< combined l2/l3 len */ + struct { + uint16_t l3_len:9; /**< L3 (IP) Header */ + uint16_t l2_len:7; /**< L2 (MAC) Header */ + }; }; + uint16_t reserved_tx_offload; + uint16_t l4_len; /**< TCP/UDP header len */ + uint16_t tso_segsz; /**< TCP TSO segment size */ }; } __rte_cache_aligned;