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 7F3C7A0544; Mon, 10 Oct 2022 08:10:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E895B42BAD; Mon, 10 Oct 2022 08:09:48 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2111.outbound.protection.outlook.com [40.107.96.111]) by mails.dpdk.org (Postfix) with ESMTP id C25B242B71 for ; Mon, 10 Oct 2022 08:09:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZZIvdIERoN/Vk1RhQOwC+iBDaQ/Jmhwu7UJmN68EJWzDv4xCjzJc0+fZ4MgWVNyWadKgC0L46ATH20utCjphBsAmUIBq0tawzPYsgwYFvouDiXceLjcvXzLBCevByB9d/eIAvulz4gH48xTckbkNI2FDF2HgBrd9jQ/4khhPo6P7qUL3wzJPLjdQ7vMoYEMI6jD2LMd4TcmsXM8KPrlFFxsYoSrgxJH0KP6SKvOfwrd06yC7nGUznMBJ/Q+lDKe/69xpO4JXPtsu2Hi9/q789lz/G9FZwnk3AmMFP1PgU3pqBzs48iZecLSXHhB9h1WeNb6UIbMPswVSIgU8Mlw0mw== 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=/nqBeqPJ7x7bBcYAG+XCeqIqH/ObmkxiREJhKybTn0U=; b=cSGUXz0CknrsQUsnqDyDjNZ/Gc/V/Vyk3TBVvqvXjvtDCcDJwMy1eVhT4YSHHugnGoXZsFGBfzFS7o5EawRQ64OeGwHap0eImp7e3dizO9+tdbQFI1R3o+KjoseMNGPo0M1RhWVWkEU/z211dmb8/N87reAwZfmFurS3Kx1YYLZrSjjuKldeAuDRxS3YBk5rM17yx9LyLsaJUJEXFe49LXwzG/vg2YawFmyLvUH2sQbrJm0bkMbMMMRZ12sUS5aARxzAxlMeTdG34DMgBxCJgJBZuVudrGavgeGwDUE1SsWN8UAmb50P4es0dzMJut8QaaTlOfT/1+l/fOc6xSJVpQ== 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=/nqBeqPJ7x7bBcYAG+XCeqIqH/ObmkxiREJhKybTn0U=; b=aDG/ZXH/sEht2DR4PezdDyuKfjKASnXDcmy9XFKer3r1DDJVkQlulVVCoS+agaHehZGNts+HKmC5+EjSHVYQHURQmV+edUZuX1RVkzFgswja5iDNgA4WQ0kNqoQOmmJyoFcT3Soh/mz6Dqe8I5cTEUafgq3joUjqUIQjoA5cccg= 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 SN4PR13MB5296.namprd13.prod.outlook.com (2603:10b6:806:207::14) 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:45 +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:45 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 13/24] net/nfp: add the offload support of set DST MAC action Date: Mon, 10 Oct 2022 14:08:51 +0800 Message-Id: <1665382142-21684-14-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_|SN4PR13MB5296:EE_ X-MS-Office365-Filtering-Correlation-Id: e6497b44-276d-4519-23c9-08daaa86077d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h/2LgfDZE1C2XcejPPxmaI+MLq271EBuWJuMx+ywbG9G+rVeK9UeA9Xi+4haRCvKDIPUiMLCMB1P/KnGodaVVjgDjChdjKl59LZTgIbqQExIVfkAN7mSBwnMoaLacQ/6ddLuJDrB2yfpxkp9MjPbXM5o7/qrybsRSzwFpkvebIeRa6SorWc3CvWyPiR4PfB5uVs99bV9T6FQaYij3pQx6Mp/Gf3GDi3vf+MA3kJdf9Yo4zhxWtYwK+fquBTfVvIuTVFD8/6qGvQT/tXRLviXSX8szUqz01uND4BBpfkBYJe+NsYckvLmXKQL7GiVnHpo+62k9QB6t/lgF/Z5utVoN7LB8RRFpa+Noaq+DDAYZvDE1aEVBMRYuTLWyOvHvzayIAbTALnLEW64JY/k1bnXq5AOvms4/2YjrxLf1YNGOBbTgeEu9ThNHY4WKw82OA8WIyfmww2l/xY4D6PH+bl+bPAbmrDK3LHZLjgn4ukXbOGXgAhQmHkz/DbXNordCdKmJvnDheFiMRc8rTSQB9PtlYQnDSimPYT9fIcc8ustoafrEz+1TVIRyoJhScixL9v0P8QUL2AXWdf0UU0ClZjhltQ2Pn79RAdknhglE6dLxmGRuMZUkIO1l+dyk+1t5pA5iEB/yYKfgTd7zZQLfpm+T409AVIEBYP++q/c+lvWSKa1O+NsWwzdfxTUvS1mFwvp8UAjoEXNT+UF1ADZl9MpRseZ4yxJpcrtwEmg0Fi9xhufSA50+bqCqn5VoWxXgtFO+SDoMz4NNF3Ouib5jDXJmLFmLZdhdzdBL+Uk9k/umEdgmVKkJU+nHEnMFSf/GxoC 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)(366004)(39840400004)(396003)(346002)(376002)(136003)(451199015)(6916009)(316002)(2906002)(186003)(6486002)(2616005)(66476007)(6666004)(107886003)(66556008)(41300700001)(66946007)(83380400001)(8936002)(8676002)(4326008)(5660300002)(44832011)(26005)(6506007)(6512007)(52116002)(86362001)(478600001)(36756003)(38350700002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d0dGeGFnVHM5SDRWZ0xTR3F1K3RQT05udEVGNy9xM3Y1NzNSL01wOEYzUHZD?= =?utf-8?B?RDhDMWVYN0tGZktoNmN2YWphU3F4b1A0cjdPakQvUVBuZlFTbHEvR25CWjFC?= =?utf-8?B?Y0c5eHZIdEh5aVN6UmtkUlVHNTVraDZQZHdnUFk0RCtsOUs4MXhCM3pzM2xL?= =?utf-8?B?VDV1M0NCUUlXMG9ianNFU3A2N3grQWhuNENJb20zNHFvQzFWeUJWZlN2UU4y?= =?utf-8?B?VUZoTGhXMXZUWUxaS01PUkVRZmdzZ2hW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utf-8?B?L0lPcEtsNXAyQVZaTzlkMmU5U2RjckY5bGdza3RqbE5NUzRVNHBJR1NMZlhi?= =?utf-8?B?MXFydzFrZnJ6c25Jamd3TnVnTzRDblZnL0VoRmtmMFpDNkJBamRlb2pJQ3pT?= =?utf-8?B?QXc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6497b44-276d-4519-23c9-08daaa86077d 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:45.7139 (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: J2/rXTR9GJ5q9Ms+VYZ7BJjoZRY7Kseci3YyCCh1S7SpJJxk7qcp/P5p5IJW31Acoq6uGbSXKqTMPz43Rj/JrAbq/FCf7eF6Lp7A+jb9Kp0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR13MB5296 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 + doc/guides/rel_notes/release_22_11.rst | 1 + drivers/net/nfp/nfp_flow.c | 15 +++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index ab6ddab..578c35e 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -42,4 +42,5 @@ count = Y dec_ttl = Y drop = Y port_id = 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 f51fb1f..1a2caf4 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -166,6 +166,7 @@ New Features * Count * Drop * TTL decrement + * Set the MAC address * **Updated NXP dpaa2 driver.** diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 431c212..68032b5 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -611,6 +611,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; @@ -1313,6 +1320,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