From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0070.outbound.protection.outlook.com [104.47.42.70]) by dpdk.org (Postfix) with ESMTP id 10ED84CB3 for ; Tue, 2 Oct 2018 21:26:52 +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=k8D/ELxldDu4g11t7a0Unfz6Fz2qevX2hKqRzDNz7WQ=; b=Sq3ZhdiLPKY90/w/Vl4ZWNvTSJ2lAgeyb4oTqBeLW8dVyzeoVfBmfjpkDi94eSn9QlnOetpf4HkJ5jx6LTO80jEmhoMw8K/XaaCHPjiEZnOl0f7MdVfJD/z3p19y6itKNHYKfsYdxSxvBYV4k4Kek3/WzTt3w0im9WRQc5AqQ6w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from localhost.localdomain (115.113.156.3) by DM6PR07MB5001.namprd07.prod.outlook.com (2603:10b6:5:25::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.20; Tue, 2 Oct 2018 19:25:34 +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, shahafs@mellanox.com, Jerin Jacob Date: Wed, 3 Oct 2018 00:54:49 +0530 Message-Id: <20181002192451.19119-2-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002192451.19119-1-jerin.jacob@caviumnetworks.com> References: <20180913134707.23698-1-jerin.jacob@caviumnetworks.com> <20181002192451.19119-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [115.113.156.3] X-ClientProxiedBy: PN1PR0101CA0069.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::31) To DM6PR07MB5001.namprd07.prod.outlook.com (2603:10b6:5:25::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9b36c92-4737-4f45-1195-08d6289cd62e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB5001; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5001; 3:cwuov1jR6A4FdTIwJOHy6pPlSe5/Z0b0myf+H9FMHbq8QQVhJ2O7KQ53zbQK4xCB+sUCx9zIOqxFXQSdSDwKl1vTPZcPkD+C++9Re565RkpSj/ed74oapzNmATDVkl6mNpc91iP9hq05bYaPTyRd+CkHQSUvlU8r9nUDBDd8sUMO4cJMsAmiJYtJKinOV3wxqve6crWB2ABX+0oWn7P4B0M83deJ3IPG33JDsy6sR212SpmNlORGXbj55SdEQVXI; 25:zr9FP7nzqz22R7u25tMA3qikJEEgGAiOu3vrSg9uP/eLpUm2lqJT0IIZcnz4ojecMwjc0ODnnCplPvUWkNlzd86w4xcFRhdlzzqEYekcAOi/B1xJmIEfoDtfEjLu05j0ID0rXL1JjN7ey93Znuq7Ka1xfpdxZ3Zw1YTz1TM3yQ3WssZ6E4TUjPQjN3eHjPSs7uXMANkxEcGw2jQkEqfPS7/YhI92DPYCcH2uktCzHdjp0JD/pbkWbVlt3sB49T2YXWR1ZWdMSkGtZhbRekIeHbNEtbJW2DZfXavp+2QLk9mzPMfozQARm4SRbmF7YL9qYwt8zzXuHlH17tom65sEhw==; 31:48sBBk1vJ0Njjh+dxeVVRFLqwytsdz9p54RSoHlSSWluvahdZvv+Vq+TJACBX7yowiJwBLwRcLj+chFeHU5U0m+cee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mA5tS5HfyUL5qx1yOp4NULBpE1zegS4LpKmcBDBe02cqXLoqX+Me/aWQ== 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)(10201501046)(3002001)(3231355)(944501410)(4982022)(52105095)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051); SRVR:DM6PR07MB5001; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB5001; X-Forefront-PRVS: 0813C68E65 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(346002)(39860400002)(136003)(366004)(396003)(189003)(199004)(14444005)(105586002)(5024004)(2906002)(316002)(106356001)(44832011)(36756003)(2870700001)(1857600001)(26005)(2616005)(11346002)(68736007)(186003)(6116002)(1076002)(476003)(966005)(575784001)(486006)(3846002)(42882007)(50466002)(446003)(386003)(25786009)(53936002)(4326008)(8676002)(81166006)(81156014)(5660300001)(6486002)(48376002)(478600001)(16526019)(956004)(110136005)(6506007)(7736002)(7416002)(305945005)(8936002)(52116002)(97736004)(72206003)(6512007)(6666003)(51416003)(50226002)(6306002)(76176011)(66066001)(55236004)(47776003)(69590400006)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB5001; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB5001; 23:88V1wYkZZNO1ErSQHGEQ0KqeIrok9z9ELqUwFFpQw?= =?us-ascii?Q?LLkY19EsHuYJHLhEugO4uJna6kLXC6EuoK2cwg9uv2+eZXGZity0FwTYoM1Q?= =?us-ascii?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uLzbyjpQ?= =?us-ascii?Q?GjOFnpeuRyntmiMoXeBbZ22Z/bh7c1yc+pepg94Hzur6NkVgp2oVGPiH09P3?= =?us-ascii?Q?DmuApx14VXLbRAnyuaCFSnAI1vWSjSra0WECKM8Djk2mCduhetBGUWaFJuZW?= =?us-ascii?Q?eI+69oGUQNyis/WPmq2mNJWAN9DIwvh8zOar0zaS1d0z2oSU+yl96IDSlmqb?= =?us-ascii?Q?6e0iAIzHGCSjU5l5nW6vSSqD2HelCEdCYCrlFLOG0ePWjjxZYY2GCYzVEYMC?= =?us-ascii?Q?4l5fWB6z0SsfSBMX68j5GfdfglPEzxh+wifM6pO809r0T7CxqE57grcjg83T?= =?us-ascii?Q?vB6Al4sO4G3LPKy3I72T6u6IxerbQzxBkVm+WDtCZTpYP+LBhDM1sKEmxgm8?= =?us-ascii?Q?nmtVH34VgMRtMsWx5h2e4qXq5RgFgrjL5R7gCRAk1/yc/AaWdhCEwgP2lXpq?= =?us-ascii?Q?dGP3OqjQA2p5sx8LXKVpW4nD1AYWXbc8awCLsIY6vuQH2OFC3hv?= X-Microsoft-Antispam-Message-Info: swu7VADhPvDCPBQQU92ebLZw6AyIjzJlYy967v8K1UPn8MVK2MD3lFm+xqBTA4C76S5bzNlCsWH7cEudGNRiDxSeBhQjjDPU5ro4BF17y6MDUyemI8bmYfFG6kiT0pMUErG3J43gEGYaN7vjYt3ZnAUVK9ChUGPqXOBDaS+hnCClaKAzn56Gk+1YXjWsiPgfvqlmDS/M1kSpVzUv7d91URJmY/5dcvy+JFshd4KXiJuEbRwp/MrE0SDwQ+9CZgwysiBvuRvi+tNaZQ2s/vuw9lbaRlGSIWj/2yG9pBOzrN28CteLwAITEI08oMlzVX5qHma+Gb24It3EBFkZ6IwYCVn0IH+3Xudjv2E7FqAiAiE= X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5001; 6:/E9DCQMw3yo7P2s2lueAY3BIQCN4Ii7e5fo7vXyVNObAXWl7yK5agI+/URGe3+MfTXV714sQg1JjRiflv7ShO3pwoNfS1ExQg7RbX35muZxeg5ai6RF9EO2UPqW4u5UF1vTaQhLZS2tk3kCwfj6I9W8HcPBpXugZYQJTOBaIxvo87nsaNEAPUtyiE02dwUqpsDbCsEuPIghJ9Ae0HPkeDrxTdWBpkF+WjJLg+ykIpDstkFSjjJI58y2SlRLWpbKUEKPPEz+f6KdySTArOtxLbcwarYjUvZehYp5ZBhRIiKLOtmDp+Z9sFyCzHiM7LgP4DOseKULyoHzj2FFsBHrhbdvaRX1evmZVaJaMLDX6hut46/jtvwWpH1P70GuD3b1LnfqK9b6Jr+3jECuj+83YoyxZSxWlTaHEncPQ/Fsg8TfGCSZNDeO0BsLwoxaVrr79tTGPsdkWa7gAgib+lejoUQ==; 5:v/4Ka82x1lYIrxez+XA4SpHkqQio6AYkb72HPHgn+ztxKkP4vXtpYK7trcafrGAegX7kpia7/a306OFyuLLNBKKCcJI7k86pDma2lRq2QkEBr3elf8Ayfhb8JBiF2c0wmtSS9dDGakxudQSXxQR1c23mnGY+T2wLk2kOxTr5INc=; 7:t34KlWSZVRhzG8MWl6QtwMx5B52E3/F+nif/BN/hEmiDW5ZzOgmP4u7CsHgeZ0Qd8SJ95PpQcu5WTlcQ7snuiBbwyMIlrJdLxS4AZlULnaog6A/a7vPg3ZrMpe/mN8K4ZN5IWl+SuUnctYoFFd3ZAaCPqFa5ORhbAirv+pM8iH9wBw7wSzQkmmW06nuUiLMjdmH78ttPPXX2JH1mpc8Ii306FtVt/mS2z0fy288ldyFXgYHZcCOsaHFm8mBlQzS3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2018 19:25:34.8949 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f9b36c92-4737-4f45-1195-08d6289cd62e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5001 Subject: [dpdk-dev] [PATCH v2 2/4] ethdev: add Tx offload outer UDP checksum definition 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: Tue, 02 Oct 2018 19:26:52 -0000 Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and PKT_TX_OUTER_TCP_CKSUM mbuf ol_flags to enable Tx outer UDP checksum offload. To use hardware Tx outer UDP checksum offload, the user needs to, - enable following in mbuff: a) fill outer_l2_len and outer_l3_len in mbuf b) set the PKT_TX_OUTER_UDP_CKSUM flag c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path Signed-off-by: Jerin Jacob --- v2: - Removed DEV_TX_OFFLOAD_OUTER_TCP_CKSUM and DEV_TX_OFFLOAD_OUTER_SCTP_CKSUM as there is no realworld use case for it. See: http://patches.dpdk.org/patch/44692/ This patch series is depended on http://patches.dpdk.org/patch/45840/ --- app/test-pmd/config.c | 10 ++++++++++ doc/guides/nics/features.rst | 6 ++++++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 2 ++ lib/librte_mbuf/rte_mbuf.c | 1 + lib/librte_mbuf/rte_mbuf.h | 6 +++++- 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index d53c527e5..5d9745ae5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -773,6 +773,16 @@ 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"); + } + } int diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index 2c2959e0b..1390e9668 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -640,8 +640,14 @@ Inner L4 checksum Supports inner packet L4 checksum. * **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``. +* **[uses] rte_eth_txconf,rte_eth_txmode**: ``offloads:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``. +* **[uses] mbuf**: ``mbuf.ol_flags:PKT_TX_OUTER_IPV4`` | ``PKT_TX_OUTER_IPV6``. + ``mbuf.ol_flags: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``, + ``tx_offload_capa,tx_queue_offload_capa:DEV_TX_OFFLOAD_OUTER_UDP_CKSUM``. + .. _nic_features_packet_type_parsing: diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index a630c4fda..bb48b5a0f 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -159,6 +159,7 @@ static const struct { RTE_TX_OFFLOAD_BIT2STR(SECURITY), RTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO), RTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO), + RTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), }; #undef RTE_TX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 821d371c3..79d0bb1ed 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -944,6 +944,8 @@ 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 #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..9db4317ef 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -437,6 +437,7 @@ 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_UDP_CKSUM, PKT_TX_OUTER_UDP_CKSUM, NULL }, }; const char *name; unsigned int i; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 5c03e98b3..0a2de50ca 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -184,6 +184,9 @@ extern "C" { /* add new TX flags here */ +/**< Outer UDP cksum of TX pkt. computed by NIC. */ +#define PKT_TX_OUTER_UDP_CKSUM (1ULL << 41) + /** * 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 @@ -351,7 +354,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_UDP_CKSUM) /** * Mbuf having an external buffer attached. shinfo in mbuf must be filled. -- 2.19.0