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 B9F0EA0544; Mon, 10 Oct 2022 08:11:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31F784282E; Mon, 10 Oct 2022 08:09:58 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id 771D941148 for ; Mon, 10 Oct 2022 08:09:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ohl6XOTIkE/knqHU3EEjQzU48yDkJ1UEnhlBEseSUwxzVSRat4fHDRxklX0WUU02nm8j9IG9rqvnds68xGMJ5Rxqj9RQts+Xq79zFqhkDSLt/p819UL0tvw96vBr+hqwUh+f1fUstJ/cJl+7NRkN6UH5aglBjDt7LgT0dWOziWl+jgmSlFPbbwQkbD+rWonQ2Lxnu/YWbscPv7ZDs++g1Cg0b32UiSU937pWi913QraNqhofZbsWOW4zpJNbKTi+x1NAOFV/6abpXnA6q0OqOo3gC4CTRtDxJLn0JGviAwKyiI2MFAQSfQL534aaDDlSg0Dxp+tMKnrof4WtarwSRw== 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=j0OmSG64C5p8tggLHp6OgPpips5oJiIjC+ymvBcGJsw=; b=YMS7Y54NDJNpLy0Hef4f8XArTgD2T2fdvQze95+7A253uWS6ykxKJYg8V8wxh7A8HAu+e0zelxS3yQW6brgvlk8Q0vnk5TTymv+AXsk3R4YtzfoZEB9D1vZMTNMLrafXAqusLL2jgmnzSv3ujlX6ZZq+/4j4Cpa0444bcz8JidBxn5KaGlfYa6Vb9u2WjRw0kzUly+E9HRIU62DoN3dVtJfB7sSACwPy25mPbwdwjTZsZq9AIxHlQIG3dU3NehwABFVYEkoq5CA3kvK7YIWCodxMBD2NDAGXNARPD++B48ik0Sgp7Y6MWksOUkmnprJCPcvpZMvZGciyAdy4MHFHwQ== 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=j0OmSG64C5p8tggLHp6OgPpips5oJiIjC+ymvBcGJsw=; b=YIGTSsw0gULta38xp7Vrm5/WxbkaOoGxJrjh7CFEPdLxMBQ7gMBsm4h+4sZ7aTk9YXOZb+44htpYS0nt9afb4gQU2nDWtIXH2xorBI/zCADmk9TMeIsOgog26EmxAkm0Eu3ZKUgrdjCcyILOzJCsfX4PsldObeKJwL1qzHBoc2s= 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:09:54 +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:09:53 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 17/24] net/nfp: add the offload support of set DST IPv4 action Date: Mon, 10 Oct 2022 14:08:55 +0800 Message-Id: <1665382142-21684-18-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: 9e18bc8f-a340-418c-57b4-08daaa860c2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yC8vGbEaG5FLNJJ3uw1gkAsby1lAughizMmWCh+jZAoqK+eB2EhPSnm4ZE3qgpxdPhAk0ZYhRnabSJ7nEDrxTWkbeZbqFUD73H3LXKQ7KsUNLFIH0Wkc1gmTDDyCcIvR9V5jQ64CU6ms10vbicVQAInR50A5YwtTLSJlnt1zrmTLMtQJ7Dz/PJqChGskjruIXj2LeTtmbxoOde+lFLxPBl2HMuvNNBRfqaZPCdeg5l8iIVML1pwmVKzm6mYiWZtCo2PbknVgdBCpqoVtT6ACJmQXFk3/ytI1puW/DhGnZ9wPm75dp+i72aJBdoR8YatYI2HoEPZ2yNJvCkHAVpY9XtcOGfAXRDAsWtCTLa4U+txSihPGLmmGf812T/t0BWdo6xCZo6i8JIPfsmjCDYMW53PNOXy2VBBft5hm2dJh2s3B+UqaRpr3HNUP85ShWzJiv8t814aG8ryjKn/pH67RbIozrbFEfFqGNmsp4iJraZ+zf8wXXR84JE9rZcPOf5ihcSF7wRI7egfSfhFjy7ZUsVPU8dqeseXlWfBi2w+bmaT1j3yvgxjxVScJUNEYh2se4fnFMhQWmVR5lMr7xWyIKrVYZvTNoklhTLjtLO7izK6s9RKr20KGwji6UYpAPuEyybE2dDSt+L+XcQTomLD8SbOqjUO8sHgcMgIl2YoBrSN0mzkmfhBK0/FJpYRaI5LXhn+mEdIgMRU1aDeaConVHL0v39HfaJzfG0ypPHltMn7uYlpRyDIuIBdgeiYJIgZhq33erADFJqXwwo/EYF7DdYyXvi8w5U58XsprIAAne2n39NoCSVCPzTDaatlUxuB3 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)(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?RVhITkFmREdtUzNkR0tsbUo3L2kxcWJPbStMdGFFQ1hablZ0RmRlaHZBdjdt?= =?utf-8?B?YldkK2ZiSmkxeXpyNkh5Z0NQcE5sQUhBcVFBNmlrZ2ZFNmE0Y1lJL0JnWmpF?= =?utf-8?B?YnJuczFzNGkvYVZneXZnRlpXTlNuMUZGQ3NqM0xsVUgxeEtrU0FjUm1sZ3Nh?= =?utf-8?B?UXJSVEVna0tZTThkRThtQ2l0SUM0U0xjd3RrWlA4WWI1OHJQQVAza1RuNzNm?= =?utf-8?B?ME40VmFJTzJYcG5qbStwaGsxWjlKSWIyMmZtM1ptTjd1M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WNUU3B3UjhHQk1MQ2JIeUJJQVdi?= =?utf-8?B?UHA4Yk45MzdiVmNWS2pBV0ZSd2k5OFFIRlFXQTVYa3RwcC9LdDQyWFZCVTRm?= =?utf-8?B?eUE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e18bc8f-a340-418c-57b4-08daaa860c2d 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:09:53.5952 (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: Sx8iif7+IcalFBzt8o3MTiaLEgmFy5FrdGfeWJLNgh6OQD7JQDwrOWhj9m3kMoKW/+1Ey7uUe/Tg+NS6zNEd3AvomaLEfbwSMc4coKMOKnQ= 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 dest IPv4 address 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 | 1 + drivers/net/nfp/nfp_flow.c | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index 8f7120b..14a9c18 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -46,6 +46,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/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 5128c0d..cdc4ef6 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -168,6 +168,7 @@ New Features * TTL decrement * Set the MAC address * POP and PUSH VLAN + * Set the IP address of IPv4 * **Updated NXP dpaa2 driver.** diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 54f94e5..aeaf1f4 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -641,6 +641,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; @@ -1458,6 +1466,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