From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690045.outbound.protection.outlook.com [40.107.69.45]) by dpdk.org (Postfix) with ESMTP id 9C6171B027 for ; Thu, 13 Sep 2018 15:48:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qouX5Q2NsCabJ7iTvVrpE4zGZ1xizpHCRzdOY3/ngF8=; b=fYGAa084wYRI2rtRyeW8k/CHaAqn6TWKWuOvK1HjPaJJIxn4jDGoq/sNpBM06p9KaHSqV+nhEZbX1D0e4E4Cy3qa3Ks9eJ9C33ENUoBb3cI/1zNUgQdXdlxplDxQSsm5YlHvIJ30Wtc1wwDSBYbYGrLx8qsn43GKgCYX8GsPlzQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.8.8.4.4 (122.178.212.30) by BL0PR07MB4994.namprd07.prod.outlook.com (2603:10b6:208:49::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Thu, 13 Sep 2018 13:48:24 +0000 From: Jerin Jacob To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Olivier Matz Cc: dev@dpdk.org, Jerin Jacob Date: Thu, 13 Sep 2018 19:17:07 +0530 Message-Id: <20180913134707.23698-4-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> References: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [122.178.212.30] X-ClientProxiedBy: BMXPR01CA0021.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::31) To BL0PR07MB4994.namprd07.prod.outlook.com (2603:10b6:208:49::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f708091-61fb-4acc-669b-08d6197f9606 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BL0PR07MB4994; X-Microsoft-Exchange-Diagnostics: 1; BL0PR07MB4994; 3:1WSmvzdiHck/K5cOUD+siDoKNeLwV3RSsnx90xJZUIArsizI2pNeL1IbS6rPFdUZkhvx7hpusP/iTQFfeWXBmSv1KaqqTiRpi2k/+O2OvpzNzEk0T6iOdbjTL4OfKzAsZWNPKA8m/nXOY93T9/vbRE6WNGixq5Lg+PJ6shghbq/6USOIns48VAJEbvTI4MiHNI0oc+cBMJR3XkXHDXXcEg+75ebxj9efEwOt3G3D9ZxbV5FqfhBbTEJMDOBLGkC2; 25:4q2MmdvyL/QeTIsXwcG+onI8SS+pXPLZ6wD6QuHMSwRwbgqf2MY3TjLh6wy8UL144uWgAjWoKHENlHbNAKdCdTGc0iaClEGp9O0W/ke2mLqCh4v1ktEZTAXjMCPSjF8kkX6J8KWZ5S2U0ag2N6iZQKOaDmtDUu3JRcaQ3trgdlZvIdXthpIC1Ja49Te2mGrJX6009nOGTGx+1kuLLy7nfOfNSHaJ1WSVLaFLz7pB2vL5/RcFaL62p+fnNa2ODi0cMdFNo91/3ka72ilJFoW3ZHpPZqm2yqeCzejzrBQcXOXOaFY8+SVLZMzM3HIJceGErOwG0QSyFLPaHgxQ47on5A==; 31:ftqViigDfMbpX8dZitUPw0myD00oK4UOXo6e6na5gWcjxHHDHs5xDu20vT3dAn5DiyPLS7aNt5vZqNUmdCZFn6ij98xr/k/l90Aav87CE8wRHobwOny0wcI3/bN601Kg4S9aveqAJEe7uMdxHGbpGRowaonsMToxze2M1BPJFDybH3PrgHRcjikcKZwGZlVJ5hd0L1gM9klB85oqp1dN5X2iVKq6pVvtIfJomRkoHYM= X-MS-TrafficTypeDiagnostic: BL0PR07MB4994: X-Microsoft-Exchange-Diagnostics: 1; BL0PR07MB4994; 20:LO3237TV0gwb3jofK0jNULfG6+QAMBKn/E0MpTPPbtQ8netTBpLAbYsDNfXPMMrMB520QvDsPRxo+K+wKhORa+P3SHF2DdCmb1S7VDXrgO/qHVYWkDo8L8eEjz9t5lEdKYvopBU8qQMX2jErmu9shR1j8foW0ANDzQlCYPTRsvsai52oXxfDgPld3wca3p4YX0BRFu5drzShiuMnXh2KwMWRqTmGUTE35TSo9AWRCXSHaDAxvgI+Ox1creJ1P3tkXzbtMH0HJ5Z0cD+gZ+r2TNkM0urUGi5FWAn2006FEGyBfnbK4L6gzUVR9qX9Ypu58K7/G4UwjnHIP3HKSKvNMZKskEHv9xQ3DsvJf8TevqxrUlZMNzGW7chAnch2DL3F+r6THYblOgVjXnnNNkS4Edl+52yyEQlhwkBNdVAvMcAe0RHsRrLQLowyQwlh6Hhc40Id/fAFzREqvBpUmV6Cglhaq2JCje6+f8s+Y63zMt646hFkD31glAqPbXuHPE+knRvsqthT0K2Rrq0TpGTzyC7+g+012n/cw5/8mAIE+T301tZkww+l1h3Ptfra0dZ6VhZoWuAR7v1TuYGcsv2QzdYpFBRJ+8lBNNtbPgEd5U8=; 4:b6PKWOVR2vJzpixDsuzqWQ2mBNptnpD6cKv98ykdi49DADNidTvbcbCedsD6qW5qOjDXGRHk7fp0KSZAWkxhGSte06vXM1ibM46E5twWsKNN2XLq5JY6BoeOoZCRNqJEVj6Lupz7xqxZAF3xnMcm8DyPLon6IxknU17B89QoSHD3ftMhjPwo49pZXmWitkJw0/YiEy8TU+z7U/yuI3aT/x8+8NmDTrdtJRTDLkYT6qETc4p5QNTBuWnngmG0kiBudwpmSEn7Tr4oX04eWiOPQA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231311)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050); SRVR:BL0PR07MB4994; BCL:0; PCL:0; RULEID:; SRVR:BL0PR07MB4994; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(136003)(39860400002)(396003)(366004)(346002)(376002)(199004)(189003)(106356001)(81166006)(53936002)(8676002)(52116002)(110136005)(316002)(8936002)(68736007)(4326008)(2870700001)(2906002)(5660300001)(51416003)(50466002)(6666003)(97736004)(6486002)(81156014)(50226002)(105586002)(76176011)(11346002)(446003)(186003)(7416002)(1857600001)(42882007)(25786009)(16526019)(48376002)(476003)(486006)(5024004)(14444005)(44832011)(26005)(478600001)(36756003)(1076002)(305945005)(2616005)(3846002)(47776003)(386003)(6116002)(66066001)(72206003)(107886003)(956004)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR07MB4994; H:jerin.8.8.4.4; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL0PR07MB4994; 23:FUuXMGXyTeSR5Qr1RM/cYPsakST4FtMk5+yv8JqXw?= =?us-ascii?Q?M2xanzmfMIiuF1s6rhGj4TNon11P0yUSNTzEg44QABXok3TALQW467PXBah9?= =?us-ascii?Q?bdhlYiSekstsjxmFqSGaT2CLJ2lOgKbg29HgiUwTmHRselqNlSKQ3hcd9I29?= =?us-ascii?Q?Hv+0BZmvmu+AvNJIUIctWC8iN5N7BCG+91QKa8wqzdDlJGDq/KBlJ699I1kY?= =?us-ascii?Q?/Degsi0wnfKTFuT5xvneQJb9V9GzKVp0snSje0x9TEQUO7iPMc+rtc+xfMor?= =?us-ascii?Q?nv1cN7xsyOQRgJol9jWd0dsZDPWHkF0DOdzFGgjr+UnlaxMEGubnDtYVWCoO?= =?us-ascii?Q?M1wmCJ7QYNWg1su1ykd77SQrBeAggKiUGeEbs/899pbyic0nrYLiIhHz8/OD?= =?us-ascii?Q?T8cria/rPelHumi27fYINe4ngqwDlXdJZha8g9lgv3lGJp8yBrsVLQaqWuoj?= =?us-ascii?Q?c3omIo9nIhVCKr4nL+VD/4KLhztm9dSSSogScj3VQVJeCX/5/iX/bMzO+2tF?= =?us-ascii?Q?RHhi3SYBz6OYBTPCzebOCW9+LLk70wmtYQIuGHeEnTBnCudOd/X6dkgmASr/?= =?us-ascii?Q?vREVl/A2Jl6JfgiteUXB/gfxWE89ap4bbdkiUTUrmojV2p+lXhtqSeMAwT6X?= =?us-ascii?Q?ex/sVMRxC0ES+TK3+TnbNeaORc6ZPB/OshIxSwUGk6I9HvuxOjPSbzVZpK53?= =?us-ascii?Q?m2LVgaWkXumtwCHsFyrPtO8n9LP+1x0c+guLBm7LSG/WYkY/4ZhnlLv20wvY?= =?us-ascii?Q?UmBHibvzwXMFxltfAZFmrsjoGgVp2vNfJdonuHLBQLl3iU/zMSiHr8ceVIxG?= =?us-ascii?Q?DG4ONYQQL66qYQMroDu9NWVfbvRBr5bCJuLjFrtru98d/3nvZMJujqdA9Wyp?= =?us-ascii?Q?S4FzhU75J39uVNEZ5fUmVBFxMT0y/olN6QqxBvERyZm4GVt+3WaYjZJwkbbm?= =?us-ascii?Q?KbJEk7vm5W5X8ihP2zTdu9h597tgObs0DGazZJiRI5zYVzoWBSIT63IAhT06?= =?us-ascii?Q?eKB7AA4qfphCyWEmCMT0+1uKZKxeg4kTTO9tiYqrmYhtXoCQJLHNpA3beUkG?= =?us-ascii?Q?9XBQMR7qfwzvv2LjvmtpdTSLRpw2P+XQiLTDbETSDco/GOR/iMQQWfcNnKRt?= =?us-ascii?Q?YtUHB5ndlLWWoWCz9GK38EJpZzGpOvzM6ZQkVz+gZaUeqrI7OXZ/xYfYhqNl?= =?us-ascii?Q?cjehsj5iKc/dG+oCCceFL7lwt4Jtxq2Gd+YC8XdqmGYDAw246/pcFWVs3ELa?= =?us-ascii?Q?S0MA9TNCg/8ZF6apisaGYd7eD0NZs+LfdeaMfMFPEyBvcgRdg87NOM9LymlB?= =?us-ascii?Q?SosJFDh4KHmq+M6EAsczBY=3D?= X-Microsoft-Antispam-Message-Info: +Ue7DGPbl2pFVVwkt5ll/grjLx+aZj9487X8UEpOD5LK0jM11SgkA6VCF2M5Uuhj5D9JxemDVoWPMvMXKRg6bc01OJuuadGeumrnUaKHad27mYXPEQztvljrVn0vHwpr8TY8ze64uLhOJoSco78k0bTvIpadAt7LHw0TL//osoOgYcuglV+rD0UbRc/zub+NRJmwfSC0eqjEELbe6QJwwAn0AoQJGNqvWNhqXr4hF36/g6foa0TKiqp98ukXQvSzGkiCVlhyCIDkJUlYszx1e7oc/UnQt6lRSQjXvU1nw8Qq1TvNIR18wg3mk++mvDq/pYrkgWbUw04BSwgJPXBvsO/QrORULpTAe8yC8WvlCPk= X-Microsoft-Exchange-Diagnostics: 1; BL0PR07MB4994; 6:0+BAtYy7PkGd4VehGZ9iywChNuv25itbNgdFzHtjxivUVSIl1KI8qXDHcEJDdSROZs8WTArIeHKRV+lXIgrVrWuPikXZ+q/50YT/bLtFDdllY2patiVMnJjSiJ7w0DlrG4skT31mDT3L0SHki1qGBoc+AHAz2n3zAvyVVXSfwlunmj9ht4cWA3RHI1XS/kqptmd1O/rpwnagaZKRzP0azZ262TFOSWhQ5cnWQhtlC3QFG/0ZH7oRATzGLTT3tICQbku5qrLuSI2XjWc53dZvNW/AElm704z4Wtr76QkdVGt3TvfYEijcWpZSqMa96ZUdWtH17d87c/NWgKfhsiX0v+JZ2ayfbxdpKLd2QUlaiHYwnAB83rOFcIPtid/TeXYwWP2i8m6iGFZhrcniROzpzdK8pODbjwnh3gSPbn9IrcAttg1WjRoaWf91mfgwo5qe20/HNCfG4p7rrTzm03z7tA==; 5:b2bfrmA4NwkYdjQwu7oA6VMY1Gi8jLIekG4qJQ2208ANW4Izcu0u+yUfNJWpWqMH8dvDxei+sEm7mEyc+XllAdi4s9EhnRbMChxvY45uNgB2kbIhDjCsCQqQc7UOj8kEfogZqMbgpRhOhRJxuQMn+zufHBzcX+nQ+q2JXZAJGjk=; 7:Oh6nmc+pE2yAgRbiW/A50nKCDMusrqG6qSSTOmFdosFEnwrc1WZ6M+UIIyYf0ZvlS4HpLB6Y0S2hC9IoeCWxgPHJHn/Pd3FgQua36st6WleaamGA7NOfSRorrEMX1vhnZTtUfYjViBNGl3OFmT5lZEkd5S3vG8cdq2ewojOmS6o/Nee3/1yBdl7i1IC7tVjRCysH/KJe6enQitkMbdHxA+3rZOsDwEJAq/Yhuyfqmf7cO2Q/pKzD+Csd9Uwwreas SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 13:48:24.8514 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f708091-61fb-4acc-669b-08d6197f9606 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB4994 Subject: [dpdk-dev] [PATCH 4/4] ethdev: add Tx offload outer L4 checksum definitions 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: , X-List-Received-Date: Thu, 13 Sep 2018 13:48:31 -0000 Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM, DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM offload flags and PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer L4 checksum offload. To use hardware Tx outer L4 checksum offload, the user needs to. # enable following in mbuff: - fill outer_l2_len and outer_l3_len in mbuf - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or PKT_TX_OUTER_UDP_CKSUM - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 # configure DEV_TX_OFFLOAD_OUTER_* offload flags in slow path. Signed-off-by: Jerin Jacob --- app/test-pmd/config.c | 27 +++++++++++++++++++++++++++ doc/guides/nics/features.rst | 6 ++++++ lib/librte_ethdev/rte_ethdev.c | 3 +++ lib/librte_ethdev/rte_ethdev.h | 6 ++++++ lib/librte_mbuf/rte_mbuf.c | 5 +++++ lib/librte_mbuf/rte_mbuf.h | 23 ++++++++++++++++++++++- 6 files changed, 69 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 92a177e29..85f832bf0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -773,6 +773,33 @@ port_offload_cap_display(portid_t port_id) else printf("off\n"); } + + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) { + printf("TX Outer UDP checksum: "); + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) + printf("on\n"); + else + printf("off\n"); + } + + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) { + printf("TX Outer TCP checksum: "); + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_OUTER_TCP_CKSUM) + printf("on\n"); + else + printf("off\n"); + } + + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) { + printf("TX Outer SCTP checksum: "); + if (ports[port_id].dev_conf.txmode.offloads & + DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM) + printf("on\n"); + else + printf("off\n"); + } } int diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index 68420d196..884dbd7a5 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -639,8 +639,14 @@ Inner L4 checksum Supports inner packet L4 checksum. * **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,DEV_RX_OFFLOAD_OUTER_TCP_CKSUM,DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM``. +* **[uses] rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM,DEV_TX_OFFLOAD_OUTER_TCP_CKSUM,DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM``. +* **[uses] mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``. + ``mbuf.ol_flags:PKT_TX_OUTER_L4_NO_CKSUM`` | ``PKT_TX_OUTER_TCP_CKSUM`` | + ``PKT_TX_OUTER_SCTP_CKSUM`` | ``PKT_TX_OUTER_UDP_CKSUM``. +* **[uses] mbuf**: ``mbuf.outer_l2_len``, ``mbuf.outer_l3_len``. * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_EL4_CKSUM_BAD``. * **[provides] rte_eth_dev_info**: ``rx_offload_capa,rx_queue_offload_capa:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM,DEV_RX_OFFLOAD_OUTER_TCP_CKSUM,DEV_RX_OFFLOAD_OUTER_SCTP_CKSUM``, + ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM,DEV_TX_OFFLOAD_OUTER_TCP_CKSUM,DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM``. .. _nic_features_packet_type_parsing: diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 547132a8c..6cc5ad055 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -160,6 +160,9 @@ static const struct { RTE_TX_OFFLOAD_BIT2STR(MULTI_SEGS), RTE_TX_OFFLOAD_BIT2STR(MBUF_FAST_FREE), RTE_TX_OFFLOAD_BIT2STR(SECURITY), + RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), + RTE_TX_OFFLOAD_BIT2STR(OUTER_TCP_CKSUM), + RTE_TX_OFFLOAD_BIT2STR(OUTER_SCTP_CKSUM), }; #undef RTE_TX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 4665bd6f7..a5b33a27f 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -963,6 +963,12 @@ struct rte_eth_conf { * for tunnel TSO. */ #define DEV_TX_OFFLOAD_IP_TNL_TSO 0x00080000 +/** Device supports outer UDP checksum */ +#define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM 0x00100000 +/** Device supports outer TCP checksum */ +#define DEV_TX_OFFLOAD_OUTER_TCP_CKSUM 0x00200000 +/** Device supports outer SCTP checksum */ +#define DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM 0x00400000 #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001 /**< Device supports Rx queue setup after device started*/ diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index 022e92b3c..af14d9273 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -437,6 +437,11 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen) "PKT_TX_TUNNEL_NONE" }, { PKT_TX_MACSEC, PKT_TX_MACSEC, NULL }, { PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL }, + { PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_L4_MASK, NULL }, + { PKT_TX_OUTER_SCTP_CKSUM, PKT_TX_OUTER_L4_MASK, NULL }, + { PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_L4_MASK, NULL }, + { PKT_TX_OUTER_L4_NO_CKSUM, PKT_TX_OUTER_L4_MASK, + "PKT_TX_OUTER_L4_NO_CKSUM" }, }; const char *name; unsigned int i; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 80989483b..541521d7d 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -184,6 +184,26 @@ extern "C" { /* add new TX flags here */ +/** + * Bits 40+41 used for outer L4 packet type with checksum enabled: 00: Reserved, + * 01: Outer TCP checksum, 10: Outer SCTP checksum, 11: Outer UDP checksum. + * To use hardware outer L4 checksum offload, the user needs to: + * - fill outer_l2_len and outer_l3_len in mbuf + * - set the flags PKT_TX_OUTER_TCP_CKSUM, PKT_TX_OUTER_SCTP_CKSUM or + * PKT_TX_OUTER_UDP_CKSUM + * - set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 + */ +#define PKT_TX_OUTER_L4_NO_CKSUM (0ULL << 40) +/**< Disable Outer L4 cksum of TX pkt. */ +#define PKT_TX_OUTER_TCP_CKSUM (1ULL << 40) +/**< Outer TCP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_OUTER_SCTP_CKSUM (2ULL << 40) +/**< Outer SCTP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_OUTER_UDP_CKSUM (3ULL << 40) +/**< Outer UDP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_OUTER_L4_MASK (3ULL << 40) +/**< Mask for Outer L4 cksum offload request. */ + /** * UDP Fragmentation Offload flag. This flag is used for enabling UDP * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used @@ -347,7 +367,8 @@ extern "C" { PKT_TX_TUNNEL_MASK | \ PKT_TX_MACSEC | \ PKT_TX_SEC_OFFLOAD | \ - PKT_TX_UDP_SEG) + PKT_TX_UDP_SEG | \ + PKT_TX_OUTER_L4_MASK) /** * Mbuf having an external buffer attached. shinfo in mbuf must be filled. -- 2.19.0