From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690061.outbound.protection.outlook.com [40.107.69.61]) by dpdk.org (Postfix) with ESMTP id ABB891B111 for ; Wed, 3 Oct 2018 20:18:51 +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=b0tlrVlqgmHjmA5jietcQ+Xv0zaRlk/Ky3BvCirSuE4=; b=VqyW2EU+yzXBLeuzKTPPjsYvM5b3q5UqPU5SXfzFhyfInDYUkP0G94FtVAiFX214E/xeN3g7tnnPH2BazBdvKB81u8h7Waj2FLqRgSS5fGm4xjDFbYFTpmj3pJLHTw/NBEWc3WNI30rQ7TM07hp6jCM7kEP+xhg746/a7Mw8ppw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.8.8.4.4 (106.201.57.251) by BL0PR07MB4996.namprd07.prod.outlook.com (2603:10b6:208:49::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.18; Wed, 3 Oct 2018 18:17:28 +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 23:46:54 +0530 Message-Id: <20181003181657.32236-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: [106.201.57.251] X-ClientProxiedBy: BMXPR01CA0023.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::33) To BL0PR07MB4996.namprd07.prod.outlook.com (2603:10b6:208:49::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0fd17600-8a90-4413-7c65-08d6295c7cd5 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BL0PR07MB4996; X-Microsoft-Exchange-Diagnostics: 1; BL0PR07MB4996; 3:yK0w/XawueDLS7AgcU4r3uXuBYCfGTEsM+cwPdM9Uv8ivEw4KmU9xIJSZqVP/Hyb9yAwri2S2a36cI20nofBy/eBSj86RJwwDmLL2/lB7elkVR9SlJzuAoRu2QxgdxfvCcClH45njWxgaFQIWgr9MrKFf0kJq10IoVlcwxmhivh4jf2DfqH2hu9Xt8i26/ovilmk8cm80v2V8kPJekfvzwbooz1hfJuIoSyoe4cPkyEydXErlqycAYJWNh92HP1l; 25:j5hgrNXPS5ZC4ebywCEIGuksQW+dJzt1XtLnxGSRgwwNgPGxLFA8z4UIYyGWywkkSxHnfi/54okCgllXfTrKUc8VmbdzsCXJxcnL8XyWjPBD5DtOSgmuBm1LoZBU/2GigrmtV+VAsC3pY+3imc+x0JNjIP4XIbimCkX+695Y+orjf5gNTs7MuyMsGWL4+XkOC5iRZ726cXT/N5+hg70irNzfR6QWZCRnM98dWG1NxuVypCPQms8bDpPnLDoEXDt0FFeZG4T+TtPNqP6p4IYF9YhHeX+70IsBChFXjPIpfWRUNE9E+QAMgbZZQeOoLMxylssGeFd1ip55cKA3yVt5IA==; 31:XYKkGSf20rf24EozRJO6uRonlHsMRtI0NCXtlLf++y0ebJPUS2c/lznQb17hqKbLPPLqbOhuv3rDOw8gN9zrbFUqyIv7iX2co4olS+7AUDo/pivNevVjgvTEhQl7wR+446PD3yOMcz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A0tvfQiWx4w== 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)(3231355)(944501410)(4982022)(52105095)(3002001)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(201708071742011)(7699051); SRVR:BL0PR07MB4996; BCL:0; PCL:0; RULEID:; SRVR:BL0PR07MB4996; X-Forefront-PRVS: 0814A2C7A3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(136003)(366004)(396003)(39860400002)(346002)(376002)(189003)(199004)(386003)(110136005)(36756003)(956004)(14444005)(55236004)(2616005)(446003)(97736004)(26005)(105586002)(106356001)(16526019)(186003)(11346002)(107886003)(6486002)(50466002)(48376002)(51416003)(76176011)(1857600001)(52116002)(966005)(7736002)(6306002)(478600001)(72206003)(42882007)(53936002)(66066001)(8676002)(2870700001)(50226002)(305945005)(5660300001)(486006)(81166006)(44832011)(47776003)(8936002)(81156014)(68736007)(5009440100003)(2906002)(6666003)(316002)(1076002)(3846002)(7416002)(6116002)(4326008)(476003)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR07MB4996; H:jerin.8.8.4.4; 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; BL0PR07MB4996; 23:xkfArsWZv4VzSbts8T3zVtxuwL/dc43x9Op74nFH3?= =?us-ascii?Q?WDyn4Dwxc5HRwKF5Z1OsyXWw9vVEdFgLGrjR4kCwD6Vtn2cH9pEYzHIGSknM?= =?us-ascii?Q?4nIpJ71VyMO6nvUe5z6R6M3h7CXUkO/h7op+rIuEHiQjIQKvaUz+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p6gtnmUS3b32EzELh9lL5hSmXKh1pENiLP5K8PUQaSk++Q2ALUwf26fsuj7dBXXaWHeZxHMCJ3dLRaE29bGUSzaQkv2uuRhgWjAV7GQ8wlvvHURQecqdxFOSvamZheevnVAcxL4EImIpPyUs8DI6um8IONyIEXXxe4skYH0FkLbhtGJlpU6Yy3wNPnoy8n65xfYGwuan6sjpTc4wwkXZMvmrkHt9bQZn6BpfVwJY10BD99hh8yy9BfovJ8zv4oDu2EEFjbNueuuhR2VJeIYzWwKNySSYA==; 5:pRVHvbIHDLMS88Kly8j76YFiFRYhg3x+lWIsRPsuhYaSPhUDxgcKzUD5iV0Kw93svxnW5w/wO1UMKpoz4ot/rqjm2/fs6WeUph1xVqqNRkHM/4FSMCR29MnZngai6MZJbFWTGUQYaA38nJ0gxidzZMwKk8lCgWBi21VREaFiVA4=; 7:lHv7gAvGDG4SMshXTp6fqQl2ksFsAh0B8/DiVRVdXvSjLCKJuYuhmd8XExhUfIUDKJ3sj/3MAK+FoEphQDI/ANBrCWjHJY80BdEXwj9JLEd8pUOZnxOOAFf0h2Zpq0aAK6IaUMLgAFZpQVMqGuYncSgrwium++ln2HvVYTZVMppLZbmjUzYHIT8t1lnOfz7XaE0nj0wmmaqPKpesT2BuP/bO1BmYZFLCYMkie+6EcKO8lTl0hfkwtblVeaUZbwkg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2018 18:17:28.9161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fd17600-8a90-4413-7c65-08d6295c7cd5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB4996 Subject: [dpdk-dev] [PATCH v3 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: Wed, 03 Oct 2018 18:18:52 -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 --- This patch series is depended on http://patches.dpdk.org/patch/45840/ v3: - Mention in git commit log that PKT_RX_EL4_CKSUM_BAD based one bit scheme selected based on exiting outer L3 PKT_RX_EIP_CKSUM_BAD one bit flag scheme. - Removed extra empty line in features.rst (Andrew Rybchenko) 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/ -- app/test-pmd/config.c | 9 +++++++++ doc/guides/nics/features.rst | 4 ++++ 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, 20 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..266c9f14b 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -639,6 +639,10 @@ 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