From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id 1747F5B38 for ; Tue, 2 Oct 2018 21:26:55 +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=3DlxH3QwSCuoXfecrsByLrhoTAx2ks0EQFgFxbmlro4=; b=jESy4oH2t9iLAS8P9EnvMPvr5bu4yT4qWVea90QAcE9be8/E3GSu7N4oE/RyPaQMBtW7i6p2/Piyblpb/WeXJBfjV3kDWRdhWgCsUaW+nS49H6xqaXAmEtsPBHGkT0Zi8rrtUUsKAYlpo5AFQttHNKR/G2wwg/ZLDKQPNn/4ZeI= 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:29 +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:48 +0530 Message-Id: <20181002192451.19119-1-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: [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: ff15fb33-d40a-465d-0b89-08d6289cd320 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:RnctYwrK8gSMq8Ur7/gIPRyVhr10A+UXePtGdy9R5jfwGnu79cK/+PudiyH6fGM7DQVJGja8R28VJ3etTJ4OD54GhOom73wgQCZm20Er5KSQesQA7YLgE3XdDIi9uBRGx8B04sk/DfOhhpPrd1norHHha1UWwrdJjlNRb3Z2HXZmg23tIAnTSczTcJ4M0wv7SU020Hg5HwOx8AC6B9e59PXb+jHPFqRqnw+6UMMsx9hJpYeql58s/SfAnVPo/NSt; 25:OChaU/j6ZcqHce82WHtlC1yFhph07h3Eit/Vj+a/IYe5M+qqPhNGfCcqqS+pIHiv0cj+PzbH7rt+MRnmxPXpKthy06SAtDesd4bkT6RAiKxGKmnWltus99AY11eS3G0FqbRx+FrDW32KCah+RzwjSHyw1wWoyyULkcE++6vEN+x7TD77m/rhDvmqfwsut9yBl3Djfo/vg7x42KtlH/bz+OzEYhLZF6fqYg2zp3oB533+YzaJWKcumXknl8B0F9/BaXwqKh9q28qCZCmAWDAG6og09OpxKShUFsEWYhiIWaUxzV27LwXJawtbJ9YSvOiN+MghcnUsQS/TN/o9ZS4p+Q==; 31:cUZm2bByeyTZCc7vltyR2Y09arq8h44ILqvMwOgKmXGGFydtoR+aAmUjfDKbTxb7KXvFrf0ln6P8WLRCKiw4c1EMRmX/oIXg5c0rwKg/lIscvGsQWsUcT5qS7oZ8HU0/DjKI9XY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Wp72FNWevKTKJDcPn+Q== 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)(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:YomGXLA9CMvoxEbKDPFNeBkaL+q0gDCFmlMgPz2kY?= =?us-ascii?Q?DiR7M7mQnF7+HSu10/B9dGhi1Zn6wSPNu8FobsIJNnqivxsghdXm4oSL6wCI?= =?us-ascii?Q?vwdjH6Yhlk3qHhRaFhpSYAIuRCXZVW+gNrNI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5gUX0VHPSeZVkA1qR+ak77A3aVLIke99EnLOvEHo+XjuH9/+LdQWymhkCwXRsSwEpquhqjL6St0Lx523CcagG1SCx1yMRKmQEAYUp501XklyBzNCzvzzVfZDBbRtjWVpDZQ/ldI9QQTG4Y3iNUeRaYs8BkDnlr0dF9hnUu9CmN18QFCJxvPChfE1yHSBWW4RUPwsg2sktbn3b+/v+LQrVLlPU+Ar5Ny397BK7gAywTxyV5U93HknHjR+tO6DHke+sSd/O1wl0l7SjfPDfqkh+RwcQ56HXLZwKv9UxM++2OpfTkPWLpoSG3kYDHwVeleapkTdSEgYnNWc8d162R3nvBczPe0wgOnXI+TgzxepY6UV+kGrmnr1REtEkLYMQ==; 5:1sEZuNzW/BJC+y9ETEh1O+l8CaXbJRzE8HPTxo/DkavU+XGLLRIZE6wmRIaTCWG4QaWvb2wCrgrk9EFKm5CqJDALYQQw+GSUpS42BqO7WlJ1OX4FGj7VRrZOvyytWAReY+abB1jC6nYapk4P3jy7lbSA+SmgEee7nR8ILj4axqQ=; 7:pPCh5gCUvEL6t1OkpdR6+yp1NcCxcMkiZUXRU7ku01BX6EiwLRb5zKVbTMdQtRmd5YEYYGqwcPt3LtFn/OM5S3sW42N7386PZsLJgzMcIpIYl06/Uz0H7HrZbFoE+qR1ulI/og6pFWhdo1oBY7v2XxOCInRaMg8xPUK1eKSmBhrntw/MQDubFUKyUvOc0ayAMZZHz+wMH8VKttUgGvHPHYZ1bGe0/9sHtNWTjN2WlUU1/iRwpxZk8NZpGb0MjBeN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2018 19:25:29.8011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff15fb33-d40a-465d-0b89-08d6289cd320 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 1/4] ethdev: add Rx 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:55 -0000 Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and PKT_RX_EL4_CKSUM_BAD mbuf ol_flags to detect outer UDP checksum failure. - To use hardware Rx outer UDP checksum offload, the user needs to configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath. - Driver updates the PKT_RX_EL4_CKSUM_BAD mbuf ol_flag on checksum failure similar to the outer L3 PKT_RX_EIP_CKSUM_BAD flag. Signed-off-by: Jerin Jacob --- v2: - Removed DEV_RX_OFFLOAD_OUTER_TCP_CKSUM and DEV_RX_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 | 9 +++++++++ doc/guides/nics/features.rst | 3 +++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + lib/librte_mbuf/rte_mbuf.c | 2 ++ lib/librte_mbuf/rte_mbuf.h | 3 +++ 6 files changed, 19 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 1adc9b94b..d53c527e5 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -594,6 +594,15 @@ port_offload_cap_display(portid_t port_id) printf("off\n"); } + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) { + printf("RX Outer UDP checksum: "); + if (ports[port_id].dev_conf.rxmode.offloads & + DEV_RX_OFFLOAD_OUTER_UDP_CKSUM) + printf("on\n"); + else + printf("off\n"); + } + if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) { printf("Large receive offload: "); if (ports[port_id].dev_conf.rxmode.offloads & diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index d42489b6d..2c2959e0b 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -639,6 +639,9 @@ Inner L4 checksum Supports inner packet L4 checksum. +* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_OUTER_UDP_CKSUM``. +* **[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``, .. _nic_features_packet_type_parsing: diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index e9a82fe7f..a630c4fda 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -127,6 +127,7 @@ static const struct { RTE_RX_OFFLOAD_BIT2STR(SECURITY), RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC), RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM), + RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), }; #undef RTE_RX_OFFLOAD_BIT2STR diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index d02db14ad..821d371c3 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -889,6 +889,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_SECURITY 0x00008000 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 +#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \ diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c index e714c5a59..022e92b3c 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -301,6 +301,7 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask) case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP"; case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD"; case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED"; + case PKT_RX_EL4_CKSUM_BAD: return "PKT_RX_EL4_CKSUM_BAD"; default: return NULL; } } @@ -339,6 +340,7 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen) { PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL }, { PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL }, { PKT_RX_QINQ, PKT_RX_QINQ, NULL }, + { PKT_RX_EL4_CKSUM_BAD, PKT_RX_EL4_CKSUM_BAD, NULL }, }; const char *name; unsigned int i; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eb11779e7..5c03e98b3 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -177,6 +177,9 @@ extern "C" { */ #define PKT_RX_QINQ (1ULL << 20) +/**< External/Outer Layer4 header checksum error. */ +#define PKT_RX_EL4_CKSUM_BAD (1ULL << 21) + /* add new RX flags here */ /* add new TX flags here */ -- 2.19.0