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 5C79AA0A02; Thu, 20 Oct 2022 04:22:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1DA942C80; Thu, 20 Oct 2022 04:21:30 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2104.outbound.protection.outlook.com [40.107.101.104]) by mails.dpdk.org (Postfix) with ESMTP id 63E6F42CAC for ; Thu, 20 Oct 2022 04:21:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5XIs7Moia8e/cL4jvtemHpaY9+pLgOxX/FjwgdCQ7quWEyz5169+94z1/9we7WS89hjRmIsCs84nZi7KbUam3V5RnFsxl+XZBp0G2MoZp5bDQrolAjF5J9ZIP6j7hz+nn1wcUcaBFNxxfI6LrnkgXpibBFwfcNweKWDWBcnq5omheITBGxkmIOJigeIwsNCbfi5N5uKYTIYTt0ae5YLj9VTnNap3laszJ4IEE8fCBjrJKrfPURGpZC4rgvg82seMgwbAXH15czLMLTCH8Q1XO4i3K4Krz1C6jxsBAGHkuBcfMg7SDxONMiTU53lx365ayOVfxlZuhxgqY55ApCQNg== 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=1hSPpYhAE6nW5pKF/EQ5LhOhdhsejeFvJrb86ErVBIY=; b=N2VXrLMjK3rViSBJTMXo1n7idRXHgwwQgWtiiMddjZDLQqRMuNwVdVZpphUBU2IY0EIqe7Cw8Fa9u7Hvo7gCM4E6qZbGWTmII2DQtC3VL2UDCx/rerFGd+gBJKn/R/lmUonBT/4I/mhsyH8Oe2LkTt9nCOQm9cw+XN+l+W/eqTYMp5Muummp53gMi1gpN+JFevBqVM8daAf94iZpX16Rzwfm8VaA+OBpfk3O1sJ4W/863rw9CfZL8UrmmJyH9KXEuaF3pXgFFbXn9ILqgu7iVsEi9C2epUDoExbHrVuLHUKYlBg90jFPWXktPGhoW4jGbGODnrxHAw3G/TL2fGVysw== 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=1hSPpYhAE6nW5pKF/EQ5LhOhdhsejeFvJrb86ErVBIY=; b=TxkSBLYURK3lQYXAQtnLW9JQ6m6PM7G4JQqOzhyyl9KvnLOPbbkvqa5UpjH68ju9IHfA7G+EMjLTaNixiq3r+xYJJ+2glyIAihxG1GOvAYLeoOmF4J/DE7C6LRAbGgVC7ftJTDJl41SR0RHRJ/Ia8LcpF08gC6QGUBeLnyatj6M= 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 DM4PR13MB5906.namprd13.prod.outlook.com (2603:10b6:8:4c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16; Thu, 20 Oct 2022 02:21:24 +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:24 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v5 15/25] net/nfp: support pop VLAN flow action Date: Thu, 20 Oct 2022 10:19:41 +0800 Message-Id: <1666232391-29152-16-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_|DM4PR13MB5906:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fd2d574-4cf8-4ef5-83f4-08dab241c93c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rOju0oCIIWI9AlmDZMWzObznh87Y9gi+TupVYRgtCofeuSOn9BWE14o6O3ykYYoOPB0EHZfWSulFD+D8uvc3bGGLjBlgsqVdwi6eGawRDvuQjBmA1TbW7+A1TgvS7AGURtlwuno5sloTktU65retrWioKJelDiKGiphEb8X9Rf3emv11ty7GYtwgyuGUFNupA3eSvSlodXxjweky82gFMxcqCvbU5Pb8O6gK1xLx1mj7CBOBgmHtZULI9jm7AZFVEybC1F6FQfwbTu+EBEHkv1APV16KidO2K/qCOl2au3azdO1rb2xU2Ta9aT4iJ+tdCrbRyWgJKOYt+nvo8kpgQFPV2eGK0xMWlOu6I4KLyVnEfVpe1939onV/L4eWtupg40O588VSYpKeY18rpAtV5Vdk/jKkfg8SY9NmFiKL8O537SGw1tIYU8jpoEIQhh/f3SW6xBxV7fjJjocEuLAOxXJlhjED8IptuUMIpnv2QJ4sLwAHN+dp4NRbDvQo8H8+OgiGZlaLfTjp8AfuLScwsHH086rU803I/6zBt3DGO1aNJOuVnHU1t2QbSlkL2TylOTZZHn7Gmu9SB0kDxeWwRYlY7zGevEi+VwkgvkGWfXecw1lz5GGJVq4Avb8JDbmxseEgPF+MdRhrh1Hi+N3LWE6eYL5EI8Lk1qnrETVLNSTX7u1vn8tx3EWaA5VEyO35h94/tZrPig0U2o+3ooi8vlJkBnqa3m9uzlSTGNSZSPIRv1MaZFGUzllwEDMF2HgO8qoMemjznhe2Ze2kayOQc0IsJzBQBTniAaKiqMVYwhd1QwzSDNWoqgSeZuwqFVKw 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)(39840400004)(346002)(396003)(366004)(451199015)(38100700002)(478600001)(38350700002)(316002)(6916009)(2906002)(186003)(66476007)(52116002)(66556008)(6666004)(66946007)(107886003)(4326008)(6506007)(2616005)(41300700001)(5660300002)(36756003)(8676002)(6486002)(8936002)(26005)(44832011)(86362001)(83380400001)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NkpFazc4aGVnVitwVFdsUzNaQ3V4a0lPVFVBWm1zT0QrdzhNRnRPSzRabUli?= =?utf-8?B?alZZZ245M3JaSkNNVGhkeWhhelFFSTJTT0Q0TSs2S25DNmErVjJHL2lYMlhS?= =?utf-8?B?Vzc3UzRweGExbU13bjhicWhRbktQdFZSYnhldTF6K29vMSs5aGZQdEgxcUxW?= =?utf-8?B?VDBwOWwzMTFWeldUYnFWcHV3bFpjbkRBSDFGNU5JOVllVXkvUW11TFB3STB3?= =?utf-8?B?OGdOSVNsVXNFdCthZERIakY2Tk5B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p3cUxQdUJKREhReWt2YXRtUWNQN1NINWdFOUxBaUZPMGFDQU5W?= =?utf-8?B?ZU1YNVZJVk51eFVuNzBuc2RuZzVGNCt4ZU0vdXg1K09JTjlyYk93bWlkWUJk?= =?utf-8?B?bHc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fd2d574-4cf8-4ef5-83f4-08dab241c93c 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:24.8133 (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: L3lpv62iD4l3zztnGXBdaMZPuR4xD/mjvXjdWMPxMvwioWZ/w6/84/qDJRoyiraT4cighwuwWvm2mn1PVTD13sM2uM8RTHCcdTZQzOxLK9c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR13MB5906 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 data structure and logics, to support the offload of pop_vlan action. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- doc/guides/nics/features/nfp.ini | 1 + drivers/net/nfp/flower/nfp_flower_cmsg.h | 5 +++++ drivers/net/nfp/nfp_flow.c | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/doc/guides/nics/features/nfp.ini b/doc/guides/nics/features/nfp.ini index 9e86164..2c5d173 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -39,6 +39,7 @@ vlan = Y [rte_flow actions] count = Y drop = Y +of_pop_vlan = Y port_id = Y set_mac_dst = Y set_mac_src = Y diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index b61342e..4ce03da 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -362,6 +362,11 @@ struct nfp_fl_act_set_eth { uint8_t eth_addr[RTE_ETHER_ADDR_LEN * 2]; }; +struct nfp_fl_act_pop_vlan { + struct nfp_fl_act_head head; + rte_be16_t reserved; +}; + int nfp_flower_cmsg_mac_repr(struct nfp_app_fw_flower *app_fw_flower); int nfp_flower_cmsg_repr_reify(struct nfp_app_fw_flower *app_fw_flower, struct nfp_flower_representor *repr); diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 7348574..3a63239 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -606,6 +606,10 @@ struct nfp_mask_id_entry { mac_set_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_OF_POP_VLAN detected"); + key_ls->act_size += sizeof(struct nfp_fl_act_pop_vlan); + break; default: PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); return -ENOTSUP; @@ -1254,6 +1258,22 @@ struct nfp_mask_id_entry { } } +static void +nfp_flow_action_pop_vlan(char *act_data, + struct nfp_fl_rule_metadata *nfp_flow_meta) +{ + size_t act_size; + struct nfp_fl_act_pop_vlan *pop_vlan; + + act_size = sizeof(struct nfp_fl_act_pop_vlan); + pop_vlan = (struct nfp_fl_act_pop_vlan *)act_data; + pop_vlan->head.jump_id = NFP_FL_ACTION_OPCODE_POP_VLAN; + pop_vlan->head.len_lw = act_size >> NFP_FL_LW_SIZ; + pop_vlan->reserved = 0; + + nfp_flow_meta->shortcut = rte_cpu_to_be_32(NFP_FL_SC_ACT_POPV); +} + static int nfp_flow_compile_action(__rte_unused struct nfp_flower_representor *representor, const struct rte_flow_action actions[], @@ -1316,6 +1336,11 @@ struct nfp_mask_id_entry { mac_set_flag = true; } break; + case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN: + PMD_DRV_LOG(DEBUG, "Process RTE_FLOW_ACTION_TYPE_OF_POP_VLAN"); + nfp_flow_action_pop_vlan(position, nfp_flow_meta); + position += sizeof(struct nfp_fl_act_pop_vlan); + break; default: PMD_DRV_LOG(ERR, "Unsupported action type: %d", action->type); return -ENOTSUP; -- 1.8.3.1