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 21902A0032; Fri, 21 Oct 2022 10:06:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4535242C90; Fri, 21 Oct 2022 10:03:22 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2111.outbound.protection.outlook.com [40.107.93.111]) by mails.dpdk.org (Postfix) with ESMTP id 6B22E42C90 for ; Fri, 21 Oct 2022 10:03:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HD/WeKUBKOdiF54aqXL9FxwCjnkt+dyoCsd0Bg2BckYr6iH9kYyHVrqLrYUzLRH3rd5Eun3ZzvGt/7yibcHAhd16Xkd2Rc9PHS4WEm/lCrYbv/Ka61ui4OVqLGbUdD2AzGjXHGrO5FV1tf388Ih1sYiRZOzFpLce3LErtAIEVmXUK3+8cX3rvTov/yZuqE2GQvwxjp5Dz5juHGzDcOANZgyCchNCjqX4Z7/RFa7DvCGnDh6jrcuvJd2YVpIW9V2NY8OI4bBQa1yXjjQc1EmfGClohweT5Lyl7LLojnf01jmsWAh9EMeEsTFWONWuMWhiz6p+n+pPs+fEbmGQi+26Hg== 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=Un3UZJ7TTCKOuAQWVfQbwKQHvbvvSobTR82Hjz3GBlA=; b=NA4qWFqQUdmSiivRtCWWkLuSVD93bOQklefi9Km0VVt8XQIJnD76KhXdH7ymbC67Lvt4uiFar8T0YjBV14GMWBG4p7yOEy05Q1RLealynRDW7K5G0qmODUIiMTJ5Ci/z2i2aELfOna1oJBbJyi4z2yyNB1slR1TjokM7CfcahYIlI/3M6ccMihkNXG16KUgJJORFSuNeRiTaiTYluSPWEqyJlSm84sm3Vw5g1ugtqwLHd02h69kV4RoxP2MRops8riuQ1p0bCtX0jOQIvKxJPcY8CwPN3oYRxeUtxj2tJpbBojC8sjn/0CfSKarpxTDQAPJDdHEhaRiSqxweRZut6w== 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=Un3UZJ7TTCKOuAQWVfQbwKQHvbvvSobTR82Hjz3GBlA=; b=dHCTpDy7KPgPBM6ezr/urrQ9bAX0+xSqfL4dfVfLs2eq0d+F9rYyW88BTPx1Sbx+DF6sTjsZqA7r13ZP0lsaPRBJXLAsxA7S8OsFkbMyQHGZ6ziA7JHoGMhmiuZpkNbtFuqUMS9a9P4Y9QGY+gwws15ene4c85m3i47G91eeVKk= 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 MW5PR13MB5535.namprd13.prod.outlook.com (2603:10b6:303:196::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Fri, 21 Oct 2022 08:03:16 +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; Fri, 21 Oct 2022 08:03:15 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v6 27/27] net/nfp: support IPv6 DSCP flow action Date: Fri, 21 Oct 2022 16:02:03 +0800 Message-Id: <1666339323-24016-28-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666339323-24016-1-git-send-email-chaoyong.he@corigine.com> References: <1666232391-29152-1-git-send-email-chaoyong.he@corigine.com> <1666339323-24016-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0051.apcprd01.prod.exchangelabs.com (2603:1096:4:193::6) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW5PR13MB5535:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c660eea-80d8-4e8c-18c9-08dab33ab52e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RJg8/s/Pji5ZzurMZiw9A0SbzJ0QZJmOXMK4rkE9i7vMoaUjULU/GNzx75DXmjK/01hpYdsCCSUAsiLpZQoVBUwJ9uR1Jw4l0y8OTgorf3Cf9+AYi9GnouuLRWAfteEbTOKWfzus9TXR0YkzE1NCRwL6ah23b/3kj7D+6HD3oqPzxblp95gAiWaN6ocBh3+EgHb+vyoh1uCytuowTl/nD6QaG7w08HWCacY8biFo8LtJM5DqBE4ikGnH5R3BTocqWP8/nS5RD8UZeIppnUd2xhSJBNa+iSYjj/JjEZpSnXMzOknYbye7MKE480ve5xkN8EGAzv0l9eW20wpykx//Ku9NdIY0fqN+pOAnC3fzJ+wSviFkhjcvlkUDNTtJ23acUk9CxeIppC0bgTjVFo0H+VZ9AE4C7d11lSO1mbCZnTG5OrpUt6vm8En7HXDAxCWZwxRzIocoIAypnUFHbkp5vJLyet2HCH+bEXwsCN8jSH1nss/y6Gvrav9aGYZf27+3As8JlJcD1tiXTdIFKyHweDpJwELkvh8e3o5+sB/ceDiDkA42DZOsMd3KNw+eXjK64UmBlgjy6ABnIghy+lpIdq5hB0AJvcZCbeaC23XtW1zTL1WDkPm0ENhY3UWrJxTs2cZq7VkuX89eQSRnatRIpNgU8E53cAWlA1o43Tn5oZAJcOmw57q+5CGDGptyt0DXZoo20reiek0ZmJadUN6khCQIyVsSb6vcEYQXc985v/rpus/bi6XTjTh2pnNODpJnuYEu3v9+e9s3VOulaB+XQw== 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)(376002)(396003)(366004)(136003)(39840400004)(346002)(451199015)(5660300002)(6486002)(478600001)(83380400001)(36756003)(41300700001)(2906002)(86362001)(8936002)(44832011)(66946007)(66556008)(6916009)(6506007)(316002)(66476007)(26005)(186003)(107886003)(6666004)(6512007)(52116002)(8676002)(2616005)(4326008)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MjZWR1BtamV5eWV6alVBdU8zYmhsNUJrV1BiMkdmZ3VwbThTVi91a0laSTAr?= =?utf-8?B?RmRlUVVvbVlObWhCdkpTb3NFdjh6MGNZWGxLTzBuQWlva3F4dE1LcExVZ1hi?= =?utf-8?B?OU5KbVRQNFVsYm9paFN6ZDI5SmFUZjlKOXUvalB1eGRDM1huek5VNWN6dlZ4?= =?utf-8?B?M1I4NCtSc1cwS1phNWhMVXhsMjhlLzFvNTg2NlZnOGE2UGxQc2hMcis0UmtS?= =?utf-8?B?TW5Mdkd1M08wYVNNVVFldHlNejJXM0dYejBWYXNKcjVFb0NsZ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cGxjOC9BTjVrcG5TVXZTVmJ5MUZhamdmMkZFOS9hLzQ4VFVNRXlC?= =?utf-8?B?MjdJN1VJWkRxM29PUzVMYXl1WXg2THA5ZThOWWw0RlBtLzZqNGNCUmZMWklI?= =?utf-8?B?MlE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c660eea-80d8-4e8c-18c9-08dab33ab52e X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 08:03:15.8972 (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: r5kAVzYX2soPR7drPmrzbu91DKmiPpa0CtdrJ7azCM2GRMMNj0fFVSrFGbekT8lNTQMG7ym9mR1qsAmdVss7Khcd9qN+mwaRbzY/JKlvqiE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR13MB5535 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 596589f..0184980 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -47,6 +47,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 c2f598c..69fc8be 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -680,6 +680,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; @@ -1526,6 +1534,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[], @@ -1676,6 +1707,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