From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0077.outbound.protection.outlook.com [104.47.41.77]) by dpdk.org (Postfix) with ESMTP id 8354D1B1EF for ; Mon, 8 Oct 2018 18:10:34 +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=0ZNxlrMll6V6KVhiFCvtXh2/TU6j/ExhUElSvU5RuN0=; b=J9QwzBr9PTo7tiTcd1CuEJXmLrYn3SpXl2t0z0W1VZjv75ydFwQKINWElLisCwgtqJqkRDl2exHP+LMTbbGRo3rfhMCRaGE22Ad7sm1A9rAQdYVyA5OFgYpAeSKvX/Cl88lzxj0WFmzIt0W77XsR+6GcObrkQVTxlP3R5mvdn1o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.8.8.4.4 (122.167.112.78) by SN6PR07MB5005.namprd07.prod.outlook.com (2603:10b6:805:ac::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.28; Mon, 8 Oct 2018 16:10: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, Jerin Jacob Date: Mon, 8 Oct 2018 21:39:50 +0530 Message-Id: <20181008160953.32510-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003181657.32236-1-jerin.jacob@caviumnetworks.com> References: <20181003181657.32236-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [122.167.112.78] X-ClientProxiedBy: MA1PR01CA0087.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00::27) To SN6PR07MB5005.namprd07.prod.outlook.com (2603:10b6:805:ac::31) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf5fd90e-a030-4a9d-8780-08d62d3892c4 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5005; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5005; 3:+TzjZVMZ1OJZpoEQ9VN9xXvyXSE1tWqFYUwnAtVgTZ6/TjNrGQLVGK9Y4TuFSodw9zUOIWj8JDglFbuh4Xe4apIjXdYr4R6fle0oyh+rCmz1EptZ+un7GCku2fT5yPAgXpgqI0rHt6teSvwDXJnXvrZmqjqhWp4Qa9Okr+lvC+b8MiK9rdKHBp+fLEh8AK+u2pus3D7/eCRZAVzh9BAea5QQAo7WCBno06vWOFQvQB3/0rPMS+GySYm41WNQ5hSl; 25:OsgTqvwGNItP0g3kfjSUogRHJAvbgX9ab39dgZqojra2Ig1vqwRmT/SiOlpQjSIKz4w1LeGTfYHqo09soYx45L7dMWlrwpHxEUp/38SNwKW5hUxGDKdi4UpXdyQ9yuQXFCLQv0GeJEYGZX50gwGkDgd0HJzfiJaMD9pqVUqH7ZplvLjGPnnMa/FaBKpSd153PbID7zICAY+8QIO06CjVP9AHwHG8RigCs+FYdqb6iCSEfVdqrbzx6UI/EApaFXbLDA5+gfGXc57IwThKym7DzRS0ajiMlVDXe2+v71XyQ6qnKtiRGgQe6HkfjA2ULOAjexQ2YWKZrEhKJLPX9SO0PQ==; 31:D9Fevm5jXsgx5iYKn6zLsW2I5JMQ5SVBL6hqJUNQUheOpdSQi9Tdo/XhdhjpIn+f0AZwBWImZdXkqSzWLWujLP9gncMGqN58AmqfAA4NbEfOo6nta06L8xWhv1gTVQ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ft-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)(3231355)(944501410)(4982022)(52105095)(3002001)(10201501046)(93006095)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051); SRVR:SN6PR07MB5005; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5005; X-Forefront-PRVS: 081904387B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6049001)(39860400002)(136003)(366004)(396003)(346002)(376002)(189003)(199004)(36756003)(305945005)(2870700001)(72206003)(25786009)(42882007)(97736004)(956004)(476003)(5660300001)(7736002)(2616005)(11346002)(446003)(478600001)(6666003)(2906002)(44832011)(486006)(4326008)(14444005)(3846002)(6116002)(48376002)(50466002)(105586002)(66066001)(26005)(1857600001)(16526019)(575784001)(186003)(106356001)(47776003)(966005)(1076002)(6306002)(53936002)(107886003)(316002)(76176011)(52116002)(68736007)(51416003)(110136005)(8676002)(50226002)(8936002)(7416002)(81156014)(81166006)(386003)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5005; 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; SN6PR07MB5005; 23:BPPZVTbM9qyz9WXve2Kg3kyZmwu042w490mR4Ecjh?= =?us-ascii?Q?I1hj1rSwGfJ2QiaJ0u/Sx0M1wAP2jVyp3qPogwI74mSp6RIEnFNSBc2HSnQ6?= =?us-ascii?Q?gPMHmh/B52YqC8wXWRgIkmbMTYcGBOTWc18JqYvaBLqBfxO/OS5r9guqRbQ3?= =?us-ascii?Q?/CjEpmWRNY4Iqv51kD1RqOZYe33V0cI2hgKctaM1hmvJOJn19Aaz8fv+zrd7?= =?us-ascii?Q?FdnWyt0Ltq0HakX9XuwmcTcpxTbThD/4tgZquHskLjY/VyPMAn3Zj4DPQ5jo?= =?us-ascii?Q?2gCWTrY2Tsd4uU3YCQWlUjVf/pXcYpF8Pbz9jhAnniE8tuCOX9cglyXNOEHD?= =?us-ascii?Q?nCihkJOiOUL/kAl6LlF636psroAge7AyQAmVoa1yt8Mcj42E70BNKZPnUzTB?= =?us-ascii?Q?97dIbtzpA9fCstKYmfL63OQoz1eHtJ4QYA9oS7R6uAlvDRCcM76DIDJZUT0p?= =?us-ascii?Q?jeHccP6C2N2id84Z18wXc5k9imgTNpg+OxTmrO/T7BsPtw9wC03091okRuUa?= =?us-ascii?Q?C91uoBZbKRk8TBOlgnQlPo1HyseqICrKjSOPBZS+4JHUwGtiYP8eclpLS/R+?= =?us-ascii?Q?VfzWWf3oHHa4G7SldS74d4QsBmHOejyd9bVOiMOVnQUXUrEQU0tifbFZ86rG?= =?us-ascii?Q?gdr09ejexWXujqoh6WmY3VYPQoK0/qAkETkSHpBOe1oThwmub99iXiV/X3kV?= =?us-ascii?Q?1nECVzxoSb4cQm095IQSdqpGJECfi7eHv53yVTfbQlgbSilG7Dzete3rkXae?= =?us-ascii?Q?ru50G3FJHYNmgaWphDRD9fmXF7lENGjT0rusU46wM9dsABA/Sk2OkQ/YcJ1T?= =?us-ascii?Q?BcgPr7DfXMuZ/ADunGcc46AdvoFEaqS54FOWnz1mKDsVcAWIljdC4nTWzVrE?= =?us-ascii?Q?sQwcdXysSJti1MuAPyPeztv6EC7HmJxG/poKPdvkz85yEdEGYSArgufXa2iE?= =?us-ascii?Q?QApj/WhdLmqr49O9GROHEi5+UtOlahr/6EoY+q5SKM/rjBVNnzF685lFk7GL?= =?us-ascii?Q?Bvavf/hWivbe4F+OOPEgCcfvNsEOSkbAaOiygf4ibQxd536RVTK2twIxpAOw?= =?us-ascii?Q?Vj2rJ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btLaek2ZIw1PsyM7A7QbD5xY2QElk5Z+PqOO6nGQvdpK19hp/lc6BO/M8JoRpuRxyF5O55wm7wUSKzrteVloFc4vHpNRDcs3EWFj4nWixhu2cnUST50pqIVdMAVIvJZThKMaWJ/gh+cgBRUdrMAaDUpn/EnLDwQfnFlX8eYmEz2ohY2y/kLJg0KwO/AzCyjg3ROa1GahCEGzA==; 5:OLATDeleAe0Y30VuV1SLRVFP9B/JK0+7kjtLOfgqgPJ098gFOr8t3JOB4CEE7U7qmDpNmpoi+BfkeUpGL3LDhKDk/lN5KnBMl3C/6mT71GcO8ulZU9559fn651Kdb92lxK0T26l2Ud58RPKz9eZTR1eQXj8u2jdeFMIM3MMwplc=; 7:r5MRTl3HmFAlZcGZUGAgNVP5tAIfTk4bMg9MCHQxb61EDYlBrELlLMP4ezarckjGvbs0xo98dURbxKxE4w63YTZF2XvyVRvMgb0DBEwm7jonEwItz0C1rjfqtD7HtfGbGOp5+ASyvi0WCNPy64SzOriY6QCNrcH/H4hbSFytQF4MXrSeHK4XeNefK6brCNxfW/PlDNnqVjcbEWx+Nc8Hjv9J8khH4bqISVcF9dnl/frDWkNakiDoEsqe/bF5synd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2018 16:10:28.2366 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf5fd90e-a030-4a9d-8780-08d62d3892c4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5005 Subject: [dpdk-dev] [PATCH v4 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: Mon, 08 Oct 2018 16:10:35 -0000 Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum status. - 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 checksum status in mbuf ol_flag as PKT_RX_OUTER_L4_CKSUM_* flags. Signed-off-by: Jerin Jacob --- This patch series is depended on http://patches.dpdk.org/patch/45840/ v4: - Replaced PKT_RX_EL4_CKSUM_BAD with PKT_RX_OUTER_L4_CKSUM_* flags 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 | 5 +++++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_ethdev/rte_ethdev.h | 1 + lib/librte_mbuf/rte_mbuf.c | 12 ++++++++++++ lib/librte_mbuf/rte_mbuf.h | 19 +++++++++++++++++++ 6 files changed, 47 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..998f67c8e 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -639,6 +639,11 @@ 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_OUTER_L4_CKSUM_UNKNOWN`` | + ``PKT_RX_OUTER_L4_CKSUM_BAD`` | ``PKT_RX_OUTER_L4_CKSUM_GOOD`` | ``PKT_RX_OUTER_L4_CKSUM_INVALID``. +* **[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..c1740ce0c 100644 --- a/lib/librte_mbuf/rte_mbuf.c +++ b/lib/librte_mbuf/rte_mbuf.c @@ -301,6 +301,11 @@ 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_OUTER_L4_CKSUM_BAD: return "PKT_RX_OUTER_L4_CKSUM_BAD"; + case PKT_RX_OUTER_L4_CKSUM_GOOD: return "PKT_RX_OUTER_L4_CKSUM_GOOD"; + case PKT_RX_OUTER_L4_CKSUM_INVALID: + return "PKT_RX_OUTER_L4_CKSUM_INVALID"; + default: return NULL; } } @@ -339,6 +344,13 @@ 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_OUTER_L4_CKSUM_BAD, PKT_RX_OUTER_L4_CKSUM_MASK, NULL }, + { PKT_RX_OUTER_L4_CKSUM_GOOD, PKT_RX_OUTER_L4_CKSUM_MASK, + NULL }, + { PKT_RX_OUTER_L4_CKSUM_INVALID, PKT_RX_OUTER_L4_CKSUM_MASK, + NULL }, + { PKT_RX_OUTER_L4_CKSUM_UNKNOWN, PKT_RX_OUTER_L4_CKSUM_MASK, + "PKT_RX_OUTER_L4_CKSUM_UNKNOWN" }, }; const char *name; unsigned int i; diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index eb11779e7..a453ec008 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -177,6 +177,25 @@ extern "C" { */ #define PKT_RX_QINQ (1ULL << 20) +/** + * Mask of bits used to determine the status of outer RX L4 checksum. + * - PKT_RX_OUTER_L4_CKSUM_UNKNOWN: no info about the outer RX L4 checksum + * - PKT_RX_OUTER_L4_CKSUM_BAD: the outer L4 checksum in the packet is wrong + * - PKT_RX_OUTER_L4_CKSUM_GOOD: the outer L4 checksum in the packet is valid + * - PKT_RX_OUTER_L4_CKSUM_INVALID: invalid outer L4 checksum state. + * + * The detection of PKT_RX_OUTER_L4_CKSUM_GOOD shall be based on the given + * HW capability, At minimum, the PMD should support + * PKT_RX_OUTER_L4_CKSUM_UNKNOWN and PKT_RX_OUTER_L4_CKSUM_BAD states + * if the DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload is available. + */ +#define PKT_RX_OUTER_L4_CKSUM_MASK ((1ULL << 21) | (1ULL << 22)) + +#define PKT_RX_OUTER_L4_CKSUM_UNKNOWN 0 +#define PKT_RX_OUTER_L4_CKSUM_BAD (1ULL << 21) +#define PKT_RX_OUTER_L4_CKSUM_GOOD (1ULL << 22) +#define PKT_RX_OUTER_L4_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22)) + /* add new RX flags here */ /* add new TX flags here */ -- 2.19.0