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 6A532A0A02; Thu, 20 Oct 2022 04:22:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E420742CB2; Thu, 20 Oct 2022 04:21:36 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2101.outbound.protection.outlook.com [40.107.237.101]) by mails.dpdk.org (Postfix) with ESMTP id 96C6842CB3 for ; Thu, 20 Oct 2022 04:21:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUdcjFppNKTjD/dxPGyJ/Le8deX/raB0RJMcIpgVmFJwVv+9208o9d1iVFnEduh/eR/wdmVaH+OyuuEvEK36ieAlUd274wJ3yXovXmqhFV5tknNmt43T88pcG5spfs8VDxjFT8nUhyoCOgn0/79qpaCljF2zC/R3oYm4zxFFq+lvaOrQIg6r9K2ObWklUTuBeF5/ee2ASbrJ/Lnh+MdoOako+8aJlwLwtN4oBefUCd/LsIyxBd27fwILTOqM8Dsof4h5nAiylsRGEuj7eM3fFa8GFLnWDPSjqEpMLMaryAzCyER1gcHIWZjwstAlqfxPyQPYbh81NGq1U+9Jxyz9bQ== 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=mpeFqhsKnist7CyUnfhS5Z9C6zM0KBNGed4121GNXRE=; b=nXQL0PVbrFj2FgTif8LdHvCUumpgxE2+pdC68tCUdEqDEJtoxHbUZwaU3zs/k5q22ShD5TSXgNRq2meSIMYc27rzR7Cx45GXItoEh10ECGoUhJnqIavlMD8+TWmoMdDkTeLQzUAJjgpfhS6aDlsvJv9ArPdFsLWLiJOwSOM1RW5wASg9C4p8QK9LjCmbf8GWOu44vNBX8XSgekGMAOuO7H+5YVGsEvuk0Atpe6ZB7hhWeOveNnVjDXPewKhpIDtfWZbK9lxXvsLYx77vU1emKGjLlT96ksC6M3RM1bikQ5igbQAiLwAQoXbsxLEIJGAqbRu/EDEncKNrI8oD7bzVmw== 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=mpeFqhsKnist7CyUnfhS5Z9C6zM0KBNGed4121GNXRE=; b=RdCzjqmWdBp+/38slh+UoO/lZKpqN5+5ychGEn2gpHzIVW8RHcvEJveFdLpgUPx+3JqOQ2XlpIbubV5jvrdeSxIIZf+W12thpmy1FgDpsmOYFYQcN6frSP0Jd38u2ce8fiP3n/pi7haqEZ7Y0hJfS4q19W+mAwKfyNxsKyO1vJ0= 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 CO3PR13MB5784.namprd13.prod.outlook.com (2603:10b6:303:167::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Thu, 20 Oct 2022 02:21:31 +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; Thu, 20 Oct 2022 02:21:31 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v5 18/25] net/nfp: support DST IPv4 flow action Date: Thu, 20 Oct 2022 10:19:44 +0800 Message-Id: <1666232391-29152-19-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666232391-29152-1-git-send-email-chaoyong.he@corigine.com> References: <1666092434-10357-1-git-send-email-chaoyong.he@corigine.com> <1666232391-29152-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR02CA0048.apcprd02.prod.outlook.com (2603:1096:4:196::23) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO3PR13MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: 24dd5d5a-d0fc-40dc-b60d-08dab241cd15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S1ahIUW3tYDGlBG8cNdnjFd8sJ+kgrw3+gZILDPwRHSYfjsKXma2vMvjr9suDFexFt0dsqNgkUEcIJ4bQDRnR81eQxcA5Ou5Ttd4gX/I3euJ6zxrr+x8z4njuu4q9Mz3O7Yl/foOv38xv0cs00RrbU+Y5aSW5o5utYEzXJ2PqDnQRFB43+s5mCX+qPrNPJSbTvAMGmCQAfEf9IzSHde4GJHJ+GRPXANS1ELWIHbc0R+e5k4mAftbNbhcLfVNAtzrMNnlGLmSd4B2LZsE2+7Sfvc5Wn6/xel73ZK9imUTzYGtJB+WniN0uRBpy5mr9dF+6/DH9fb5b/kfxrZP0mzW5KnUCmzNEEDK3u5w7G71AeBIazItqY9qIaIWhyaPGTvEu8FIYL5FqgE2+eIlpqWvybIG5p1/0pXlbyiGjgv/GKrRW7Bdygn8YqbpoyCIhjpeowwtJH4sv+Q1BmTi//0tx36wt2vgdiTRNTJJ8MAgCEq7fDyffMUomul6gdhT3MMEc0gZn4QJDHmK2e2DJuKzx73vNWeLeQ9RVGwzH/VmjEwvMf0n6ZG/qeljuQ3sxf6ieYCAbFeoegedEUYrdWIV5nT+aZR7J9NCaf0e3mOEDuh29dqWBY8kmWIAjgjgTfaedPjfb1GhBuv6mmoGtm+qZcqvKXwrL82fBi+pyhw0wB7OQH5XV1jy6gDrwShWVOUKCR1giLSJza6QpLuzYbxd6ALFMn2kbAPZpt+mbSn1YhARJKULoLPbhxVIFv5aoOUuXwXTgFszfbb4iQ9e7W/Dxg== 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)(346002)(396003)(39840400004)(366004)(376002)(451199015)(6916009)(44832011)(2906002)(316002)(8676002)(478600001)(41300700001)(66556008)(66476007)(6486002)(36756003)(4326008)(66946007)(5660300002)(38100700002)(8936002)(38350700002)(2616005)(6512007)(52116002)(186003)(86362001)(6506007)(6666004)(107886003)(83380400001)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MDc0U0hmcy9RRTNtZlJNS1k1TUViNUJtUTEzLzNwV0dYbjlOeW95NjBOSTho?= =?utf-8?B?K3hKZlo1WGQ4Ump2aVdMTEhJN3pUc3ZUdFZ2bW42SU1qU21mK2RPc3hZTE10?= =?utf-8?B?QVp1RGF0eS9jaWtWNGpkMTNjQTJDeVJaeFN6YnNVVW9DZS9VV1BuNjZWLzRt?= =?utf-8?B?Uk1yVDZCdjBwRnEvUWZMK29INFFJTWVqSDkreHB5Wkg1d3Q5OU5DSWN1ZnpD?= =?utf-8?B?MjFOcnEwZFlWb0JuOFU2MlRrNmli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cWxKRVhGT3dyTldQRlU1eFVqd3BXV2dtZzlxQmd3cWVvU01HMHR0aTE3?= =?utf-8?B?OWFkNTJTYXl1SlVWRFpnUkJJOTdKYnBtOXBmdFo4am1kM2pKVnNud0ExdUUv?= =?utf-8?B?Smc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24dd5d5a-d0fc-40dc-b60d-08dab241cd15 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 02:21:31.2997 (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: ofo6ePYfkbm15fD1Yvx7lxjDhuum66U+OFsnBynJuJUx0UJzPWICRtMg+RPoV20OP2F/W3WkVrHfrbUNhPa7xh7khrrQlI+IiUbBI9+Uj8E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5784 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 dest IPv4 address action. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_flow.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index e62b3f7..ddc457f 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -44,6 +44,7 @@ of_push_vlan = Y of_set_vlan_pcp = Y of_set_vlan_vid = Y port_id = Y +set_ipv4_dst = Y set_ipv4_src = Y set_mac_dst = Y set_mac_src = Y diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 8b9e153..5bd1eec 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -629,6 +629,14 @@ struct nfp_mask_id_entry { ip_set_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_SET_IPV4_DST: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_SET_IPV4_DST detected"); + if (!ip_set_flag) { + key_ls->act_size += + sizeof(struct nfp_fl_act_set_ip4_addrs); + ip_set_flag = true; + } + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -1446,6 +1454,14 @@ struct nfp_mask_id_entry { ip_set_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_SET_IPV4_DST: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_SET_IPV4_DST"); + nfp_flow_action_set_ip(position, action, false, ip_set_flag); + if (!ip_set_flag) { + position += sizeof(struct nfp_fl_act_set_ip4_addrs); + ip_set_flag = true; + } + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; -- 1.8.3.1