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 8EEFBA0544; Mon, 10 Oct 2022 08:12:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E82C642BDC; Mon, 10 Oct 2022 08:10:10 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2128.outbound.protection.outlook.com [40.107.94.128]) by mails.dpdk.org (Postfix) with ESMTP id 627EF42BD7 for ; Mon, 10 Oct 2022 08:10:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XsKnKncErW9QiHJj3czxSTsDoAcF8KCh2T/9jx2V3uPzBQRufLQpTZDrASTae9kIhCqmT2WFq7MI6jlwLiABu6zbJiuZ+VcbqD5zRDzCd6ClN5kXHBBguQdJYh15RVvqkn+tKfVodM+x4kw3dX/cZURNpK9R1dxm+8Q0WUFEmpp8WCajc9Yxlv319k2ww+jqAZ6J4H8MTFugcfFB70gVZac2KdZMRBiqudaUat89DPumcK2B/R/ETPCQMoSEhSEO0BlCcGbVzWLKNFaEBrmemUTgP4Umr230OEylh5ptcSZ8pVY9VThY7S8mme2Fsq9cetavdcT3/DCZjUPBPRTTnA== 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=LuqDZbsVgyyFeygeQDQwMYPDlJ9dCFHhAdFiYBwOTZc=; b=cp6GQSz7sl+RqHn+RzGE60bZ2TGlLl9He/R6cL2MVXgVBvAvohnNQR9yp9o7acRXnNCnZ4TiIu4TcYl0BpBQ/g5QxvFlvOhj4/HoDXtokcqCYSS7S/4FcTyex0ph9yMv6L4gsP5vitxYzl+0XQW1WCyTgdtY/Ohq62XUtSdT40Tsp5elTNlkszz2mSgIdNQiahYZiPkeaW3r1jnZ0pytSfzgJ8Cdt8P9LNrTa+TPqog8nniDYAs4QUcGvKSSZqXcSfL35MWnQPetCGpGPGLS4hXssKpCt5opbUzaOJ9h1t/sBuZkBY/OayJ7M7TrRJFnKZN9ScDY/djXX+Yzq1F3aw== 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=LuqDZbsVgyyFeygeQDQwMYPDlJ9dCFHhAdFiYBwOTZc=; b=M3HJKZ7UPDA3nuYKhOqZzIknds2u/5N1OatFbTO6H+u15Ml/ABphW98cuRDvBMxjVd5m1qNh1wL3pdpdkeNaGZYDHldyUUjB9J5JkB/WEdOc8F8DHNeDVZuJQLBRdw7nBaoll6OzbmN7oBictfuOGJpfR9apemKlkrWjbzKhU8E= 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 CH2PR13MB3877.namprd13.prod.outlook.com (2603:10b6:610:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.14; Mon, 10 Oct 2022 06:10:08 +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; Mon, 10 Oct 2022 06:10:08 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 24/24] net/nfp: add the offload support of set IPv6 DSCP action Date: Mon, 10 Oct 2022 14:09:02 +0800 Message-Id: <1665382142-21684-25-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1665382142-21684-1-git-send-email-chaoyong.he@corigine.com> References: <1665382142-21684-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_|CH2PR13MB3877:EE_ X-MS-Office365-Filtering-Correlation-Id: c1207047-f073-4034-0b7f-08daaa8614bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CFmvA1+S7/Gs557IXLBR5v1ER5m8mQyd/+Nk0PTL1E0g9S13YqrSVgZSRY2+j8DDf5GLX45mwgImyUb4o6xFhAYD5w6aAmQbRoKCRx3MWiLjKMQU9A4+WG2a0pMVAhP+eT2jN8o3+muEmNz8yoz8E3zRZiIrxnxM8G+CfGdZrYnz/MAIjsyDcyINwnIQvxyuBXPHlC+K1bUot/uwwsPX+zmQjy+qLn4gtGf8+/mEs1cHRztyfQqPDEAoshzSyNqrl+/2sbSLEsweUQUvCLwcVmjDT+WaQCbgNlDZOXtCV9n7uyZIDTZqgxha5QdG4OuU2xLqHgrHeTb2p/XKQXPstfMk7m33a0oF/ufOvGuPCDRY4uviST/rlvaxldEfKy88clfDnl6ftkYC/sBewKCJ9fyxyD7SCAmlgcviZnbaX2WT5lemB3mN5pslVf9yX4DQcklDPB80m4E4S8vPXm44Pdp6MsHp49pJwV8NoIgMkU3m72gZyCXF6Gci2GPbZn7BKsyYAsE173Wy6wmrh663TVJEkrqr7h1o2zP+53kcWWTk52TQ5ZF2u02yoT/iSVh4zp45edLdOThMntOLY28LoYmsj1J9bQBHBOZJXEV2ufbS4WkYnnvshnGANPXhhJ0ZAIFa4M1u2AoUb+2fEfk8zstUFaig6T3ZikKJsHHOch/wTujnl5gefZmeu5YpSSfWRJO7VT57ofmrI6287Ge/DNDB/+55/fDOg8RzlNbEpQJokJEwcKTlUCYS/QveP3l4MnL0Yh5kPG3V9R5QEPvM1x8eKmb+kOA8/bawhDasWiH9dlEvnuwn/iEFOldvi4c0 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)(136003)(376002)(366004)(39830400003)(346002)(396003)(451199015)(36756003)(4326008)(2906002)(8936002)(44832011)(5660300002)(41300700001)(83380400001)(66574015)(6666004)(52116002)(2616005)(107886003)(26005)(6512007)(86362001)(8676002)(66476007)(66556008)(6486002)(478600001)(6916009)(66946007)(316002)(6506007)(38350700002)(186003)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U0h3ci8xZExpT1NsSXJ3K3BrWDN3ZEZEYytuRXprZ29zRlZZYmJCMjRVMjdL?= =?utf-8?B?NFNhUm9IR3B6VjlCMzhVVW1aSnc5QTZPa0tlZnovWnVQNlB0OFp5cGxrVVAz?= =?utf-8?B?SWtacVdlbCtlRmp6YWdrRVVzTmVSd3hjUzdNZzYvb1o4UEVSMWltOGRpL3RS?= =?utf-8?B?MWNFeWRwTjdMWFlhNGhqby9NQ1lEZW1lZHVwWDJHdWdjbVRzaElWVmc1UjZR?= =?utf-8?B?c08vdVFYcmxpeTgvQ3E3Z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B?SmVMR3kxOEl5QlcwdmtrZ2tKTnVSVUxYRUVodFFqMTBHdFB1MUlBUk9sZXF1?= =?utf-8?B?UjYvZkFDWFdKbXFzTmdlZVJGVFppMmx3dUFDenBUK2E4M3JFbVFaeFZNWVV4?= =?utf-8?B?Y2c9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1207047-f073-4034-0b7f-08daaa8614bb X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 06:10:07.9300 (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: KqzKErchpH/STaKZKdl3P9yjWMjsDBoRaYYD6qF++U/1r5wc1a5lqd/4gpp1O1opDZWTbOqZH3MWniOqiNa+mPo/Z4Rng0NKbTHTjjBoIiY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR13MB3877 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 + doc/guides/rel_notes/release_22_11.rst | 2 +- drivers/net/nfp/nfp_flow.c | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index 7cb68b5..1ad6c2c 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -49,6 +49,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/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 8e19f18..b79cffa 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -171,7 +171,7 @@ New Features * Set the IP address of IPv4 and IPv6 * Set the port number * Set the TTL - * Set the DSCP of IPv4 + * Set the DSCP of IPv4 and IPv6 * **Updated NXP dpaa2 driver.** diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 283b4b1..3f3ac4c 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