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 513CCA0032; Fri, 21 Oct 2022 10:04:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A02042C45; Fri, 21 Oct 2022 10:03:00 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2136.outbound.protection.outlook.com [40.107.243.136]) by mails.dpdk.org (Postfix) with ESMTP id F3EB042BFE for ; Fri, 21 Oct 2022 10:02:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iclq3NwnfA8c2tK2tegRnOKZAFhRJn5BG6/Lk6cy4DIwapvuFgl7Jc64lD/RwpefErrhgNIMCWQvAxO3Xwcb1T+DOT7Rfc8kng9isC4Gb/N3feH3jYbbMQt1t5METEgoql9PXIc9fJffEo3xHXysYnK7q0V/UlI4bqSNXEKGeeAEfGXNC6ttyFfHSThL0sRwNvvYKD2gEPJgzDv+FRY1FCuipMXNFw7SYwZ/PSMlg2o3Bl/R1Oe4BsJW1SgAsO1MwcMPcSUIfs3WSF4alJhH2GS9NzVnqzPJJIfD36Iy/qCe/1cVi6dHYtu0Pjy7Ga3rdzPUymGJq5ifk1bPIWm1/w== 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=FTc34zeVKidK4xOd9tNhZDo3MNNUROzNMq5A4fPXRig=; b=bsa5DiQoz6wUHo4JbACN2k3FbbttMT2Wz/kEucWGNeeKT1wn5hROdtkr9GZMtW0kVM9qvHg9MdbaA26gONIW9quOvgF6P6/sHjwjG2ANP62ztZVLOAX9fXscPOIMs+nsGQRl2D+vyE9ZQVjTSYKsYzAcQDIncIbHnoM44AMJOGHB0m2ESCm/oXjBOScuRuOPNG/fwAD2FbmPkpHEfx2SARpdRDZe1NaYe6ububM9scHIKOsHqgYfEMa0sOTWouOczMugHvYNXTOlIIEohywV1gqhyjN71YtKTGmApkp1lVErMs4z/8ei6+N7dgnfEOgv0f81dq6agCfywgjAWm1Pqg== 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=FTc34zeVKidK4xOd9tNhZDo3MNNUROzNMq5A4fPXRig=; b=g1zjxH3hY1kIMVvwVUs96Faehym5D6YsCjEPlxHgLfDvF2WZvaEPrBIEnsFD36B6lse3XLFw8XXQGpSFQQo0jpgaK64wrAf7JADksmzqQKsE3xwf/yWOZQIH9H49Sd2GDUCISlz22+QCEIDsQ58dAPrZ/Kk+Z1eaNDypqbEm2Sw= 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 BL3PR13MB5162.namprd13.prod.outlook.com (2603:10b6:208:339::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.17; Fri, 21 Oct 2022 08:02:53 +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:02:53 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v6 16/27] net/nfp: support DST MAC flow action Date: Fri, 21 Oct 2022 16:01:52 +0800 Message-Id: <1666339323-24016-17-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_|BL3PR13MB5162:EE_ X-MS-Office365-Filtering-Correlation-Id: 6faee4c7-8112-403f-7d08-08dab33aa7d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jrk37X/wLQlFM68vAKpYNXmYQhdB5doJh/azNBkDyI2ylda7+oAqC9jeBv1fEGIBv7HRNIwoZxSEjqTqCkxCaQa5wpAB/SV5GjjwXT0qMJHcRiuigIdTAgYhFClibi01UWy3vf52wVjivB1xu5RU7+BGvkJ3q9ZhsAYhI26bCfUpDT7eQS2hduqAFiU61QL7bue/xk0nPJEPoj+ypEqoirR/VnLeiJMjf9+R20ZnaNsZpuxBFUQuKSG2ev5YHo7YYM+h6+AvUmzcmeu4CbD++7opji1j9utLIrfsFgYOGD1+YFxgheIu1OjL1G7ohOzlMbNNUxWY3YqDwr/73+guvBiT87JPvSTnWUjIBQsIKUvpJLoYmeFnhX0iXjXP+GyOekoMf8hShkkJIxMYI9r9nof3t4YVR0Zj2yuAcEzPktSeMscUBnVw2QyMYAsmv5y91nQDg3Hp0nPcQMq+CVqWeukF7qHPm6Oqa37JS2hGySki8h1M7etrEdevuGrObnXmMcft9+8gyqi3X/oYezcUnav+nSCvhXJkiEsBkp7aNjZwMxfciXYlaiC27Ag6QB38qKpPmkRdVQs1mUtyrly9Isw9lNTVyEEYnAs/KCpNQ5lmyzE5Lcwb/6yP1AfD5BbTSCKOyIujYnSyT9M7TtidC8I1y29cXBWY774jvzZmLo7kJZ74OnqOWUxgDMnlF+6td0HQ+gRvopIRU5leWqVVNJuUlR8RXImQ6jG+DZKIXCaup+QaI92WHogqZxyP3Omjuq/BldcuSRD1LxaOdDSqmA== 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)(346002)(136003)(39840400004)(366004)(451199015)(2616005)(6916009)(38350700002)(6512007)(6506007)(52116002)(8936002)(66946007)(4326008)(186003)(107886003)(8676002)(41300700001)(2906002)(66556008)(316002)(66476007)(38100700002)(44832011)(26005)(5660300002)(83380400001)(478600001)(6486002)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c2NFVmtmUFVvSlJ0SjZpTDBIM1pKejUxUWZwUWw4Q2pKU0lUT0JYWEZxV2ZI?= =?utf-8?B?VExmSUY0QXZWTWFCRm0xTWxKclhGRkorRVFmdVlBWkhvMk5rYVFyUVJOL2lV?= =?utf-8?B?dlVvT3c5S21JSjl3WU1YU0hwQkZDY05PU1FRVVA3NUVuRjJNRXIvbUlFbGs3?= =?utf-8?B?djc4L29YN1NNcHJpRlhSU0tQMU9nMFVOM1lrMDVud01yUjVtR3VLTUJWOEZ6?= =?utf-8?B?NFE4SEZVcktIZWJPN1ZVUmtrTXF6TDJkanRXNkRudHJ0NjYzN3d6bGtES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JiRzNtN05nMFVibHhPcHpjeHVPelFo?= =?utf-8?B?QmJJK25OYzcrd05oN2dTUnJIYTdWdUFMUFE4WUpUK0o2cHowajZHTU1LQVl2?= =?utf-8?B?VkE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6faee4c7-8112-403f-7d08-08dab33aa7d6 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:02:53.4953 (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: rRwLxrm85vyqse+fFFO3uqJH2Goe7Bn6Mg122yffqIcrLQdASHJyDoyE0FPwofKQTLKOJ4FpMDMa1qEDX3c4J08ZyEn3gQdRN9cgPp4UktI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR13MB5162 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 MAC action. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/nfp_flow.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index f7cd070..9e86164 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -40,4 +40,5 @@ vlan = Y count = Y drop = Y port_id = 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 8c065c4..b440c95 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -593,6 +593,13 @@ struct nfp_mask_id_entry { mac_set_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_SET_MAC_DST: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_SET_MAC_DST detected"); + if (!mac_set_flag) { + key_ls->act_size += sizeof(struct nfp_fl_act_set_eth); + mac_set_flag = true; + } + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -1289,6 +1296,14 @@ struct nfp_mask_id_entry { mac_set_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_SET_MAC_DST: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_SET_MAC_DST"); + nfp_flow_action_set_mac(position, action, false, mac_set_flag); + if (!mac_set_flag) { + position += sizeof(struct nfp_fl_act_set_eth); + mac_set_flag = true; + } + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; -- 1.8.3.1