Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/136634/?format=api
http://patchwork.dpdk.org/api/patches/136634/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240213114727.550209-1-vignesh.purushotham.srinivas@ericsson.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240213114727.550209-1-vignesh.purushotham.srinivas@ericsson.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240213114727.550209-1-vignesh.purushotham.srinivas@ericsson.com", "date": "2024-02-13T11:47:27", "name": "[RFC] ip_frag: support IPv6 reassembly with extensions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b9d0201ca6bb2e5220e86ed6aee02b8af0e7f1e9", "submitter": { "id": 3232, "url": "http://patchwork.dpdk.org/api/people/3232/?format=api", "name": "Vignesh Purushotham Srinivas", "email": "vignesh.purushotham.srinivas@ericsson.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240213114727.550209-1-vignesh.purushotham.srinivas@ericsson.com/mbox/", "series": [ { "id": 31085, "url": "http://patchwork.dpdk.org/api/series/31085/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31085", "date": "2024-02-13T11:47:27", "name": "[RFC] ip_frag: support IPv6 reassembly with extensions", "version": 1, "mbox": "http://patchwork.dpdk.org/series/31085/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/136634/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/136634/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 71A3743B04;\n\tTue, 13 Feb 2024 12:48:43 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E579D4029C;\n\tTue, 13 Feb 2024 12:48:42 +0100 (CET)", "from EUR05-AM6-obe.outbound.protection.outlook.com\n (mail-am6eur05on2077.outbound.protection.outlook.com [40.107.22.77])\n by mails.dpdk.org (Postfix) with ESMTP id CF9FB4027B\n for <dev@dpdk.org>; Tue, 13 Feb 2024 12:48:41 +0100 (CET)", "from AM6P193CA0079.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::20)\n by AS8PR07MB7414.eurprd07.prod.outlook.com (2603:10a6:20b:2ae::7) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.38; Tue, 13 Feb\n 2024 11:48:40 +0000", "from AMS0EPF0000019F.eurprd05.prod.outlook.com\n (2603:10a6:209:88:cafe::51) by AM6P193CA0079.outlook.office365.com\n (2603:10a6:209:88::20) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.39 via Frontend\n Transport; Tue, 13 Feb 2024 11:48:40 +0000", "from oa.msg.ericsson.com (192.176.1.74) by\n AMS0EPF0000019F.mail.protection.outlook.com (10.167.16.251) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.7292.25 via Frontend Transport; Tue, 13 Feb 2024 11:48:40 +0000", "from seroius18815.sero.gic.ericsson.se (153.88.142.248) by\n smtp-central.internal.ericsson.com (100.87.178.60) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1258.12; Tue, 13 Feb 2024 12:48:40 +0100", "from seroiuts03116.sero.gic.ericsson.se\n (seroiuts03116.sero.gic.ericsson.se [10.210.134.60])\n by seroius18815.sero.gic.ericsson.se (Postfix) with ESMTP id 64B77C0006ED;\n Tue, 13 Feb 2024 12:48:15 +0100 (CET)", "by seroiuts03116.sero.gic.ericsson.se (Postfix, from userid 7401342)\n id 3789E61A72B5; Tue, 13 Feb 2024 12:48:15 +0100 (CET)" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=dfIueByE2JEJ8knC/VTKUk3pxqKuv2ny7sJW+qysLL9SuFqWcsPapUkILqXpq4tArULjehwoRyBHo3Q4N9RWT1UAJhG44ZY2vLvg21t6HO23I4QmOJwT5zAjhZ95tgLRRhJrnCRt7otGVroi0cC0sf0ibCC4BS8E7IAHb2B/Edr5KTPQuUGM8iqp0C8iKnBxRjors6zS7xmhA6e8m5yQ66Xh6jhPFOAs5hP9/H/ogWMV4FsO+drZQSbRjLQW6BYzLhVEyi/YtJ+KCMUxKshrk/u81fv6o6rkIBV0y+OJpkVI/XzMUWgLqvqGYtoFahDuJG/VsNTiKVL6fyAxzlYAXQ==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=j0H6RQqkcK/vfnpXJNa3WIAARV0kL5i6Nadclu/rQq8=;\n b=dcCfgKHI/bHwgvjKlt/xWWZMlXr5vCvSQ8GePejq+OqONq/12nTOx6AS9tNzr/FGlfTXOE75R3nyfdZuEUS0iivo5jXug6pfCpDearPP63UEfWE0P5oxyztvd0zQ5isXDAUJbHDRaYoY7Zyd3xT1Ii5ueEAebKBTfjD53udSE9ueTDFwK7xxqzTdpbGgyZIbTZuYgsOn+8LubDrLkhkAXW/iUgJvOSQnReBqxefaKqbkuq1J0M7QqZKLzyN73PHgWSJs8fvEIeB8vx1yfGs+oC3eWj3OX2vMIW2Y2XzY/LhQUR5vXRN+YwRjXdB4CKLMyWVeye6Sd/Em1BfyBmsAgQ==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 192.176.1.74) smtp.rcpttodomain=dpdk.org smtp.mailfrom=ericsson.com;\n dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ericsson.com;\n dkim=none (message not signed); arc=none (0)", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=j0H6RQqkcK/vfnpXJNa3WIAARV0kL5i6Nadclu/rQq8=;\n b=woBa2vVsSGQFMsKPhDbArzn3KLyUaLPCjDuGVDo3r8cidFVDTB9UwrU1yaAzFRo6RKirQOIc+9D+Dtew/1nJRkfs1Cq8ZTSlpBqVkypHJZhrmlB7QRebpWzPBZrch6DaaTr/jT68L418pJFToglrttYqQfJYVvE6IhUMfWXh8GSK6t+2MZFd+3gp1NCmTRrZJTp7vZP5d16OVqbAmamL2LpXHyJmdXKcz/6Jfnn1Zsmh2kx7r8mDZY9rYRlKd7+aYXYdkW06uD+mJZBQz087lUp+8sEIYRkFBY9nrC6Y2XxIl/k6jhN+NuztWaNeQU0d5v+sFmYjEuiNDoqx3FR9KQ==", "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 192.176.1.74)\n smtp.mailfrom=ericsson.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=ericsson.com;", "Received-SPF": "Pass (protection.outlook.com: domain of ericsson.com designates\n 192.176.1.74 as permitted sender)\n receiver=protection.outlook.com;\n client-ip=192.176.1.74; helo=oa.msg.ericsson.com; pr=C", "From": "<vignesh.purushotham.srinivas@ericsson.com>", "To": "<konstantin.v.ananyev@yandex.ru>", "CC": "<dev@dpdk.org>, Vignesh PS <vignesh.purushotham.srinivas@ericsson.com>", "Subject": "[RFC] ip_frag: support IPv6 reassembly with extensions", "Date": "Tue, 13 Feb 2024 12:47:27 +0100", "Message-ID": "\n <20240213114727.550209-1-vignesh.purushotham.srinivas@ericsson.com>", "X-Mailer": "git-send-email 2.40.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-EOPAttributedMessage": "0", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "AMS0EPF0000019F:EE_|AS8PR07MB7414:EE_", "X-MS-Office365-Filtering-Correlation-Id": "2363f2d9-5c6f-4f19-3cb1-08dc2c89b904", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n ijdoHd1WlW0OkX2iZiIrK3JsIS+2MOhDU0WC3CI2BKNWhxq7VEn19o8jWr9XsClltM8ZWtcDYqq/gTpWmr3+ymXY93O8MsgdqYEJNbqYrrlQjQ6Lnel+WbGJiu6wnZW9MrzqG0zzWfNP1jDWpuZVw9OCLf7eh6yRxe8/H21P/sCw+cC/S8NiTAwXpNI3i1wD/RvFpYcOvXk5r2aBioSOaNzivtydGVCbroqgFVS8zdm8ovzFReiIBE6rO6gSrNkjizUTieHPbe+nGHK9A+Q8NYq5ZhjiUkmR+sSu9tL++ZKJ+byRrqx2tNPByGGv7GEKI8uiPx1pEHEVfxjWEDuAi0bU2Vo3Ey2dA2zoxsczqnA4nTxM7RtBTU0unAyBG4LQVFbB0F8hCk+2E9h2E2N2gu0ho9pfYwPDtVGW9kpjAAlaEaBDzCl3ihmFpSxvs4zBJ6YSe+6gQnZL/ayUkCGQSTntnmYBIlfX+iPeLqMBCE809tTeVZIl7T2Mq6DKMBYPdWltFvZ0oXqw6vY6Tc9JE4svUZ9YhmC4VsblgUDjJ9fVRNauky6lqY/D4t4wcupVt5CS3s89BLwcJdSXiwqeRG21LJB8But7oLRlsTYrvtk=", "X-Forefront-Antispam-Report": "CIP:192.176.1.74; CTRY:SE; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:oa.msg.ericsson.com; PTR:office365.se.ericsson.net;\n CAT:NONE;\n SFS:(13230031)(4636009)(376002)(396003)(39860400002)(136003)(346002)(230922051799003)(64100799003)(451199024)(82310400011)(186009)(1800799012)(40470700004)(36840700001)(46966006)(2906002)(2876002)(41300700001)(6266002)(478600001)(26005)(2616005)(1076003)(4326008)(336012)(54906003)(5660300002)(6916009)(42186006)(8676002)(70206006)(8936002)(70586007)(83380400001)(36756003)(103116003)(316002)(107886003)(6666004)(82960400001)(7636003)(356005)(82740400003);\n DIR:OUT; SFP:1101;", "X-OriginatorOrg": "ericsson.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "13 Feb 2024 11:48:40.5347 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 2363f2d9-5c6f-4f19-3cb1-08dc2c89b904", "X-MS-Exchange-CrossTenant-Id": "92e84ceb-fbfd-47ab-be52-080c6b87953f", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=92e84ceb-fbfd-47ab-be52-080c6b87953f; Ip=[192.176.1.74];\n Helo=[oa.msg.ericsson.com]", "X-MS-Exchange-CrossTenant-AuthSource": "\n AMS0EPF0000019F.eurprd05.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AS8PR07MB7414", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "From: Vignesh PS <vignesh.purushotham.srinivas@ericsson.com>\n\nAdd support to ip_frag library to perform IPv6 reassembly\nwhen extension headers are present before the fragment\nextension in the packet.\n\nSigned-off-by: Vignesh PS <vignesh.purushotham.srinivas@ericsson.com>\n---\n .mailmap | 1 +\n lib/ip_frag/ip_frag_common.h | 2 +\n lib/ip_frag/ip_reassembly.h | 2 +\n lib/ip_frag/rte_ipv6_reassembly.c | 64 ++++++++++++++++++++++++++-----\n 4 files changed, 60 insertions(+), 9 deletions(-)", "diff": "diff --git a/.mailmap b/.mailmap\nindex de339562f4..6c068d5af3 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -1476,6 +1476,7 @@ Viacheslav Ovsiienko <viacheslavo@nvidia.com> <viacheslavo@mellanox.com>\n Victor Kaplansky <victork@redhat.com>\n Victor Raj <victor.raj@intel.com>\n Vidya Sagar Velumuri <vvelumuri@marvell.com>\n+Vignesh PS <vignesh.purushotham.srinivas@ericsson.com> <vig.vigneshps1995@gmail.com>\n Vignesh Sridhar <vignesh.sridhar@intel.com>\n Vijayakumar Muthuvel Manickam <mmvijay@gmail.com>\n Vijaya Mohan Guvva <vijay1054@gmail.com>\ndiff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h\nindex c766154dbe..e671246898 100644\n--- a/lib/ip_frag/ip_frag_common.h\n+++ b/lib/ip_frag/ip_frag_common.h\n@@ -169,6 +169,8 @@ ip_frag_reset(struct ip_frag_pkt *fp, uint64_t tms)\n \tfp->total_size = UINT32_MAX;\n \tfp->frag_size = 0;\n \tfp->last_idx = IP_MIN_FRAG_NUM;\n+\tfp->exts_len = 0;\n+\tfp->next_proto = NULL;\n \tfp->frags[IP_LAST_FRAG_IDX] = zero_frag;\n \tfp->frags[IP_FIRST_FRAG_IDX] = zero_frag;\n }\ndiff --git a/lib/ip_frag/ip_reassembly.h b/lib/ip_frag/ip_reassembly.h\nindex a9f97aefca..4605e1291f 100644\n--- a/lib/ip_frag/ip_reassembly.h\n+++ b/lib/ip_frag/ip_reassembly.h\n@@ -54,6 +54,8 @@ struct ip_frag_pkt {\n \tuint32_t total_size; /* expected reassembled size */\n \tuint32_t frag_size; /* size of fragments received */\n \tuint32_t last_idx; /* index of next entry to fill */\n+\tuint32_t exts_len; /* length of extension hdrs for first fragment */\n+\tuint8_t *next_proto; /* pointer of the next_proto field */\n \tstruct ip_frag frags[IP_MAX_FRAG_NUM]; /* fragments */\n } __rte_cache_aligned;\n \ndiff --git a/lib/ip_frag/rte_ipv6_reassembly.c b/lib/ip_frag/rte_ipv6_reassembly.c\nindex 88863a98d1..4e862fb55a 100644\n--- a/lib/ip_frag/rte_ipv6_reassembly.c\n+++ b/lib/ip_frag/rte_ipv6_reassembly.c\n@@ -91,19 +91,19 @@ ipv6_frag_reassemble(struct ip_frag_pkt *fp)\n \t/* update ipv6 header for the reassembled datagram */\n \tip_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *, m->l2_len);\n \n+\tpayload_len += fp->exts_len;\n \tip_hdr->payload_len = rte_cpu_to_be_16(payload_len);\n \n \t/*\n \t * remove fragmentation header. note that per RFC2460, we need to update\n \t * the last non-fragmentable header with the \"next header\" field to contain\n-\t * type of the first fragmentable header, but we currently don't support\n-\t * other headers, so we assume there are no other headers and thus update\n-\t * the main IPv6 header instead.\n+\t * type of the first fragmentable header.\n \t */\n-\tmove_len = m->l2_len + m->l3_len - sizeof(*frag_hdr);\n-\tfrag_hdr = (struct rte_ipv6_fragment_ext *) (ip_hdr + 1);\n-\tip_hdr->proto = frag_hdr->next_header;\n+\tfrag_hdr = (struct rte_ipv6_fragment_ext *)\n+\t\t((uint8_t *) (ip_hdr + 1) + fp->exts_len);\n+\t*fp->next_proto = frag_hdr->next_header;\n \n+\tmove_len = m->l2_len + m->l3_len - sizeof(*frag_hdr);\n \tip_frag_memmove(rte_pktmbuf_mtod_offset(m, char *, sizeof(*frag_hdr)),\n \t\t\trte_pktmbuf_mtod(m, char*), move_len);\n \n@@ -112,6 +112,35 @@ ipv6_frag_reassemble(struct ip_frag_pkt *fp)\n \treturn m;\n }\n \n+/*\n+ * Function to crawl through the extension header stack.\n+ * This function breaks as soon a the fragment header is\n+ * found and returns the total length the traversed exts\n+ * and the last extension before the fragment header\n+ */\n+static inline uint32_t\n+ip_frag_get_last_exthdr(struct rte_ipv6_hdr *ip_hdr, uint8_t **last_ext)\n+{\n+\tuint32_t total_len = 0;\n+\tsize_t ext_len = 0;\n+\t*last_ext = (uint8_t *)(ip_hdr + 1);\n+\tint next_proto = ip_hdr->proto;\n+\n+\twhile (next_proto != IPPROTO_FRAGMENT &&\n+\t\t(next_proto = rte_ipv6_get_next_ext(\n+\t\t*last_ext, next_proto, &ext_len)) >= 0) {\n+\n+\t\ttotal_len += ext_len;\n+\n+\t\tif (next_proto == IPPROTO_FRAGMENT)\n+\t\t\treturn total_len;\n+\n+\t\t*last_ext += ext_len;\n+\t}\n+\n+\treturn total_len;\n+}\n+\n /*\n * Process new mbuf with fragment of IPV6 datagram.\n * Incoming mbuf should have its l2_len/l3_len fields setup correctly.\n@@ -139,6 +168,8 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,\n {\n \tstruct ip_frag_pkt *fp;\n \tstruct ip_frag_key key;\n+\tuint8_t *last_ipv6_ext;\n+\tuint32_t exts_len;\n \tuint16_t ip_ofs;\n \tint32_t ip_len;\n \tint32_t trim;\n@@ -154,10 +185,10 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,\n \t/*\n \t * as per RFC2460, payload length contains all extension headers\n \t * as well.\n-\t * since we don't support anything but frag headers,\n-\t * this is what we remove from the payload len.\n+\t * so we remove the extension len from the payload len.\n \t */\n-\tip_len = rte_be_to_cpu_16(ip_hdr->payload_len) - sizeof(*frag_hdr);\n+\texts_len = ip_frag_get_last_exthdr(ip_hdr, &last_ipv6_ext);\n+\tip_len = rte_be_to_cpu_16(ip_hdr->payload_len) - exts_len - sizeof(*frag_hdr);\n \ttrim = mb->pkt_len - (ip_len + mb->l3_len + mb->l2_len);\n \n \tIP_FRAG_LOG(DEBUG, \"%s:%d:\\n\"\n@@ -201,6 +232,21 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,\n \t/* process the fragmented packet. */\n \tmb = ip_frag_process(fp, dr, mb, ip_ofs, ip_len,\n \t\t\tMORE_FRAGS(frag_hdr->frag_data));\n+\n+\t/* store extension stack info, only for first fragment */\n+\tif (ip_ofs == 0) {\n+\t\t/*\n+\t\t * fp->next_proto points to either the IP's next header\n+\t\t * or th next header of the extension before the fragment\n+\t\t * extension\n+\t\t */\n+\t\tfp->next_proto = (uint8_t *)&ip_hdr->proto;\n+\t\tif (exts_len > 0) {\n+\t\t\tfp->exts_len = exts_len;\n+\t\t\tfp->next_proto = last_ipv6_ext;\n+\t\t}\n+\t}\n+\n \tip_frag_inuse(tbl, fp);\n \n \tIP_FRAG_LOG(DEBUG, \"%s:%d:\\n\"\n", "prefixes": [ "RFC" ] }{ "id": 136634, "url": "