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 1A9D2A0560; Tue, 18 Oct 2022 13:29:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 663FB42B7E; Tue, 18 Oct 2022 13:28:05 +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 4A68541147 for ; Tue, 18 Oct 2022 13:28:04 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eElt7xHcr7rmJSxv/QZZ+DxQxmo3Rj/6usvca8jSbF7okr/bSo2w05p0tuWOvHdCCqRWTwxMaSg7GP4dutIXK3v/sn95op73kyTqKJ9QZSsGxDpx2wUCEf98empMBpSw63deLvpr1IaPcACg50XJycORZhr27OV/FIIxn7yddumgt1do2jF3sTHV14A1O7pVy4NfC7XXOlY5gPWv6NNBTZPRMrB+j8vudeQRwJEPnxI+SEF8FDWCr9aIW8eH6VROQWCLH7S9sSjham9Uogs1NLsIWLVSnWYOB6WGI13CZzYITEhtNQjCqPJqHo/e1KhVPsQuibfRtnJYl0JDdVWCEA== 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=l7U2iOxzV0fRcTtLz1TEPfbD7zd+1ZFuclLES/jwjq4=; b=H56fmpHSNXHDEfpZTSxl9gvcXryOBjl0Oh3WIhQEuPP6PzgVX5Nf5nfgr42I3Mkx5pzsQISRR8gDQQCE9yEjs1IXXStt/5l0atU53cF44+l0mH/K6gnSbCt+F9U9bdXv1idFrc/x6N/FWVtaRbPiQHgE4U8saZZJzJTDZgiQbKZcmDizbMj5rjxhXWXURD8nGHXVHMquwmNI7NGcwBY2X7Boky3HbBFggZmfu2hjbYsRQKBVnSB5rEolboD7X4FZAhVlK0WUHrW75vm8NRVnQKRsp16/FzQ8D/aku71E+5QpRvQ0WWalcCW/zPGfr4CV7ncTyu4MkPjy/Q3J6DvtDw== 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=l7U2iOxzV0fRcTtLz1TEPfbD7zd+1ZFuclLES/jwjq4=; b=kHkk2fdx2udst0/P6XVKg2NpNV/jTzGTCFk0VzSaZaW1f5NDHnJGFpB8R/3GeqoUpQ67iAV8i27vrsX+EjlG54mUj8ej6fn88ZzEdkQ/AVOAZXaPEY9+O2koMGN0ZrbeGyate2H1auKQRwXeiELLgTV7xBNUVe48iimLPGlqHDw= 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 CO3PR13MB5686.namprd13.prod.outlook.com (2603:10b6:303:179::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16; Tue, 18 Oct 2022 11:28:03 +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; Tue, 18 Oct 2022 11:28:03 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v4 14/25] net/nfp: support DST MAC flow action Date: Tue, 18 Oct 2022 19:27:03 +0800 Message-Id: <1666092434-10357-15-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666092434-10357-1-git-send-email-chaoyong.he@corigine.com> References: <1666092434-10357-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR02CA0052.apcprd02.prod.outlook.com (2603:1096:4:54::16) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO3PR13MB5686:EE_ X-MS-Office365-Filtering-Correlation-Id: 17db1fea-80a6-4bd6-f9a1-08dab0fbd1a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dBg7W8La4Hw2/l4Bg4FOQfmEivfFekBbnrd/WqKogKwHsYMW3WeGIczUNZp+eRkFf0VphYlQyhwe4xb68tkBbG083t0T1EyxMc9uip2TNa/lIHBg8ug+iiWoPRW6jLLvo4YBd6QSXmrhdwyISy7P+Rjz6bY2avKcQrngrlqtVh3WrBWG+SbOstjbF/IP84bNyDY05v+R35n5t1xZAQXG8d2sUK6138+St1V+fc4N97g6jMrlEwIqExTzm+bb0HLAuEwCK4NvrA93feOGZzzTpz/9FBRA3oMJ7Vu0GIa2JsCWIEM1yMS4i7fhDn9RMP3NjObJO/uRt58d5iF3dCmqh9xwq+s9zhcAh1aEc1FeowbP9W45EsenZZJpoNvqpJGw92ff9qrnJ8D9W33oAC899ZjbnxGbSjQJ7rlMVRS/Onc9+bd6SlrTBWbE9Ae+SZIeIUIJmfDIKMaFUT0CrK/swJs23NmY4UXpzqJCAtuMp+IgN7lraNiOkwYKFS3kB4ql8caENV5JX9JH8m8vl2FT7SU7oNxTxbA3L9qdBlFAVWiFI1/43ZMrSp0V1Zfh/6Hs8gp8ws8zb0k+/0+FW1MNRy5liouZqxDxdqWaGiHGBXxwtFMUFV8TtN7zKISjuBJ9aoZPeenpCwN0IfjT0scdMWk6V80cFmCWMftDXPN9K5jMsQPDwlkM2nQNG35umNcaOveAMI5efLnLfmt8wyQqnfU3iCI8mgVqTl62AiSTC3EFYd9aAaih1A0vvj1oM4/m7MIUNFJqSWpCKYuLeteHWVBYq6wd6ClmrmYFmEPCY0VJlm7J5vyRhdTiqSFzydKf 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)(346002)(366004)(39840400004)(396003)(136003)(376002)(451199015)(38350700002)(38100700002)(2906002)(41300700001)(316002)(66946007)(66556008)(66476007)(83380400001)(4326008)(8676002)(6916009)(86362001)(44832011)(2616005)(8936002)(186003)(36756003)(5660300002)(6506007)(107886003)(6486002)(478600001)(26005)(6512007)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T24xQWxJL3labE5sZm10NkI5TTd6dkRCTzNxcWc3SWxHZ2g4Q01KSGFWbVN1?= =?utf-8?B?OS9xdVpXcytKT0ZERFBueXVvU3hUYlFQNCtScUZna0EyWllFQllqUDJmOWZw?= =?utf-8?B?WkFRcjdRUFBSTnFDWHkzQmJmenRmTndDYktML3g5eERuMGtvRHhBOGxvSEpi?= =?utf-8?B?SjFJTHVvVkdIWXZKZXJPU0dsWjJEamYzNXh1Ym56QnhnU2oyRFpkQjhVSVlt?= =?utf-8?B?YlN1em11dS9HWW9QOE8xanhGL04vSzlyNXRqNHRDOERSZnJ6L0NpUzdkL0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ZCNHNodDNYT3NoN2FwZURad1J5U0Nw?= =?utf-8?B?VXNqVkkvYk5JNmRZWTB6QWFJYTR4YnFvQldrSmhBM0hyeE85TXg4QlA5UEtM?= =?utf-8?B?cUE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 17db1fea-80a6-4bd6-f9a1-08dab0fbd1a4 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 11:28:02.9700 (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: /jSDzbayEZ2MtYawjBVGAMUyIT9FOFB+AMpDZeV438aroDDtPA69F9YqvPcjB3sBqoBFjaW4aijLkyh+B8KLvKXpZfY3ZonuKJl6hBNtYbc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR13MB5686 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 ed43b1f..9948d42 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -41,4 +41,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 a0a8c7b..46a9732 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