From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1512A0560; Tue, 18 Oct 2022 13:30:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47D2D42BCD; Tue, 18 Oct 2022 13:28:33 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2105.outbound.protection.outlook.com [40.107.212.105]) by mails.dpdk.org (Postfix) with ESMTP id 2F6E442BC3 for ; Tue, 18 Oct 2022 13:28:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VTRxO+na+iItnjFpo9iBixqlePYtRYdkRkGbFTFkbvHFUZp5PwSskwIFOmDNKmD9jHlfaI19Zq7oY3tI1QgwAU/3BBDYFIR393zvVLMgBFZHfg6geMlwcLfPMKtn0WGdofzsTjA8WeNlK7DMmojd86GmQ4SiqZA715ChpCC3JMZr1UM0MJdI8+TP1BCFP8ynBArGrjzgw5K9C00GmE4123m4qMaaiahR+quNaCgwwTjVMOYyzKFmLt7k1hr8782oVGveqVg3yEP27Pp1CI8ViqLejq2Rpjzeo5vy9Ym1b58hLjzSiy4JTgBc+8KtYfxebjZkg1MhxFlu3EZV+d/bJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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; bh=b057UpqDTVvQIzLlHd8mfsag+1+DXYswnB2eijXG6Zg=; b=je11JTrO8zG1Zju+7LsrIkQSmKk7uR9hxP8v3Es58695uYYqLYQ1EckhS7z5hqIFMJTtDEExbJ65J/F+rYMKcWWY5NaO6Ug1BJmGVemgz2wIlbqgM7AaWPMX5wySuXkDjgF6bLtq1BvNve33EZ05YH9KDUD9ooYtwoF7nVL/NBCQiqO0a/+WG67jj14yyLqtx9XP74NW9/EVtVUX2pTgXh8fW/kU/q7BnohVYFczwfyB2/1nhVtdb9QjrqXWGlgeOLlfvho18jtyYZNUfZSHQQXNLijkdlMBjzmGFoRMbag8TnmfznHfzukL0rPdsucrDZ3xJusU0dBRM7Sn/PZiWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b057UpqDTVvQIzLlHd8mfsag+1+DXYswnB2eijXG6Zg=; b=SLtRYipkUILLZUzvLsuSfATLGht8PxH0/K25uNGnkpNUPvc1yWQWxzPehkRgS3zB7LwpPYQoqKFyFUyywn9weg6YEHBDwpSJEY1cJyB7v10qhjHdNVkTDmG8r007a4kMq94fHpWMlfoucQg9sEgtuo5W8qnb2rUFL5BhpJ0trJM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH0PR13MB5975.namprd13.prod.outlook.com (2603:10b6:510:16e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.22; Tue, 18 Oct 2022 11:28:29 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b%4]) with mapi id 15.20.5723.014; Tue, 18 Oct 2022 11:28:29 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v4 25/25] net/nfp: support IPv6 DSCP flow action Date: Tue, 18 Oct 2022 19:27:14 +0800 Message-Id: <1666092434-10357-26-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666092434-10357-1-git-send-email-chaoyong.he@corigine.com> References: <1666092434-10357-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0052.apcprd02.prod.outlook.com (2603:1096:4:54::16) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB5975:EE_ X-MS-Office365-Filtering-Correlation-Id: 5bc7d9b8-be9f-4a20-4f94-08dab0fbe130 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HHZhraMsMyVG27AGxX9T0miibx20TzIpvpnSbmT05Yr3SlRlJVtxUqLRO481+9PMNMkMm7Fjz8O4c+eZIxO0ORDd0ZgG4gpJ6/elkI0eLFepDXU46/IXR9GAercBjWPtSQRrDnkIFThjFBAzsoYdx6Lo08ExK6snp1rC7ATNcyH9I1VoipB6zWoucUJV5ELCy/MNex9jz4r4sOz+ByAB5hO49SwZGIEIE0QG9AyV48leEx07X3fdl+3eaIn4sYgILMnfJhlXTKGsW9UPuqd0hoHNE+4PGEsWqFmkaSApPGSEW4Y3QkElceVLKPEvrkKxFPhCz++2ymrNQYqlL1eYhNApYbXG5aeNXkjSByMsuZ8+7LM2iOj8lBoHSox8NdGQerMIryZD671VK8fWbv+7tn82XmPhu8I6wzdOxpsZqE2C5GC0z+wA3CF7/+Hr2C7Hy9JMhRAC6GsY+SLFOk7IzZu6kXVbOQ1Qi7bpRLlCY5Yj5kfO0yuwWxp3Z3f62+KdX2fDaqFVa2U1fiovmYfT8eMtT4vnWoVSKui+VKXXQk6I63OuGvbLmlMyzjVVUFbbzZPgivlQ2qpBe8W5BLyqEFAuc90qd+7uiOiy97IJUeNh5ux0c9VVi59Sg6/ZvDSr8+7qXcvPIz3kxvpUnyp0xBZ+UXG9p3cAfMY5JeLwGQiJGb51/3cbTuqfeS35T8Rkz4tKuPD/pNiuBCvRoaDXRYkLOuRRYrxMbHNhKL4bCo6qphHSHeWbzM1xtDlXbgEtPpJTuJtb4qH49i0cj5xCKmLu72P++DD9xogBhLOlhlx++Z3sTO0K3C6q5xH1KMjx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(396003)(376002)(136003)(39840400004)(346002)(451199015)(52116002)(86362001)(186003)(2616005)(83380400001)(26005)(107886003)(6506007)(6512007)(6666004)(44832011)(8676002)(316002)(41300700001)(478600001)(6916009)(2906002)(66476007)(66946007)(4326008)(38100700002)(36756003)(66556008)(5660300002)(6486002)(38350700002)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SnppQWtjTmhLV3NobmNrUmRTdE5vY2VnL2RWc0tzS0ZSUlBkaTdtNndrK1Qw?= =?utf-8?B?cFhaQzFiYy82Kzg0QTQydDFoWDU5OEpHMzZhSWkzemhpeFNiM3dLRGFKdjV1?= =?utf-8?B?Z2RjZWxUeVFhd2xoR0htR042WTBRRHBxLzRIR2ViQ1g0UCtJdnNWQ3h3cit1?= =?utf-8?B?MVYvZzdRcVl1YmRkQ1A4YXFwT3ViZjUwNmNSZFhnd0txbmFwajlDR01VUWVB?= =?utf-8?B?c2hpc0hCY3RCZWg4WGhQVHJ0cTBubnh3Sm8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lMHE2Zitkc1c4RnB6ZEpPT1BYWElodmpFYUFKbEtPTnpDRGVWK1A0?= =?utf-8?B?emt2Q1pvK05paXdXSW84dkpyVXovTUM2L1g5Y3lqbGhLaE04dGNpckNubCsy?= =?utf-8?B?TXc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bc7d9b8-be9f-4a20-4f94-08dab0fbe130 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 11:28:29.0335 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N8QXyC0/+Pi3hmRvmAH0/Nv+xO/uVYSfnD5WAVDR9JAWoPbSF9dzb7KdIX9SC4IE2ZdVrHquQFRM/r2Po8nsD7SY/dY5ONg+VdqifQAeSzM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB5975 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add the corresponding logics to support the offload of set IPv6 DSCP action. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_flow.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index d2b4188..e547774 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -48,6 +48,7 @@ port_id = Y set_ipv4_dscp = Y set_ipv4_dst = Y set_ipv4_src = Y +set_ipv6_dscp = Y set_ipv6_dst = Y set_ipv6_src = Y set_mac_dst = Y diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 6dff973..ceb61bf 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -698,6 +698,14 @@ struct nfp_mask_id_entry { ttl_tos_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP detected"); + if (!tc_hl_flag) { + key_ls->act_size += + sizeof(struct nfp_fl_act_set_ipv6_tc_hl_fl); + tc_hl_flag = true; + } + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -1544,6 +1552,29 @@ struct nfp_mask_id_entry { ttl_tos->reserved = 0; } +static void +nfp_flow_action_set_tc(char *act_data, + const struct rte_flow_action *action, + bool tc_hl_flag) +{ + size_t act_size; + struct nfp_fl_act_set_ipv6_tc_hl_fl *tc_hl; + const struct rte_flow_action_set_dscp *tos_conf; + + if (tc_hl_flag) + tc_hl = (struct nfp_fl_act_set_ipv6_tc_hl_fl *)act_data - 1; + else + tc_hl = (struct nfp_fl_act_set_ipv6_tc_hl_fl *)act_data; + + act_size = sizeof(struct nfp_fl_act_set_ipv6_tc_hl_fl); + tc_hl->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV6_TC_HL_FL; + tc_hl->head.len_lw = act_size >> NFP_FL_LW_SIZ; + + tos_conf = (const struct rte_flow_action_set_dscp *)action->conf; + tc_hl->ipv6_tc = tos_conf->dscp; + tc_hl->reserved = 0; +} + static int nfp_flow_compile_action(__rte_unused struct nfp_flower_representor *representor, const struct rte_flow_action actions[], @@ -1700,6 +1731,14 @@ struct nfp_mask_id_entry { ttl_tos_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP"); + nfp_flow_action_set_tc(position, action, ttl_tos_flag); + if (!tc_hl_flag) { + position += sizeof(struct nfp_fl_act_set_ipv6_tc_hl_fl); + tc_hl_flag = true; + } + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; -- 1.8.3.1