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 A8D6AA0032; Fri, 21 Oct 2022 10:04:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E573542C52; Fri, 21 Oct 2022 10:03:00 +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 071BF42C32 for ; Fri, 21 Oct 2022 10:02:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cF5cJEAchJt4+C93dXmHEXcmYchaSdPYySYpYf3E3UXLm/XDYQof7of1F3Owa+ZtQ4uwPlyNVJIvkqDbRhg7s6gUGcurl77F7kcAattiEE0JD498D7Dolea7RzbPwI2LsSX8aYtW8Mxa3OKfyZBshpMGvosSGk036sLVXUNRm3a22tIyuu62Kq2MxdREhqS3Cnyib5KvMvBppyZv2+ZS69YcGl+XowiNQ6iLqT/EnaywxeZnTzJ6vjBqYCNnJD2ZdpjG3TJLlTcEWCqsxDSmL+jd1Q/c13PbxOELsiIeOvnpiCjgCJHf59zXlJRYmsSYNGr70oMihqVLEynsSBkjbA== 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=ZGKapwHA4T7c6KsmiL/apFub/idsrn/J4L5JvBaWX88=; b=LeRP6BB9loGjkFhYYtUtIWAQE3RIYGrXbVrV7Bn4gEFzwAC1FTbHyKYdlevPWXBHDUqav4j3tvccbGAgd6k/dxGMi0MpeLcQaZ266xbMqN3kjRuCPpdxJWAjlQBSKODRaM5nLmv4u0BtJ2eE07gx1lWCMLl/H57o2iHyW8Ze/P98HTifJyH29S/uY4jjWDZQTBlUCU3V8MkmrKsmuvkKpuj9CSPXn1QimBTQvVWX5YNotVcvWPA1t8hzch7rkKsUDDZgCZdKlakoCcSVO9vAKnXez/wb8yv9yBzia2S/YAd3E5zdKZJm9D/Imahgo+pjhBiWM5SHlinLS5mwQzhwWg== 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=ZGKapwHA4T7c6KsmiL/apFub/idsrn/J4L5JvBaWX88=; b=MC2a0cGwvA+YjFf5U/ObwhXuo47c8wygf8mMIA4nLOxkcLAedVms/erklME3wQTpC9PTBrLw5HUmf4cLJfa51BUKmfT99ZRMhMUk23fPag11BhxSfKFYmKw1GeqeKdE0BMOulGA4dNoCRj3d9cWljFFazhgIrh3U8DatDY/ETOY= 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:55 +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:55 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v6 17/27] net/nfp: support pop VLAN flow action Date: Fri, 21 Oct 2022 16:01:53 +0800 Message-Id: <1666339323-24016-18-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: 719af2d0-acde-45ae-8cb1-08dab33aa911 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5c+YpZvAR2COr/XieQ034ZOtr2wG0jVH2L6HH32eN4OTBZFkJ3Qo+e2hR5WLTuqfRHAgnjh/HFFH1L0Ujmbn/HcD42pHXYIrUqCUrUcbFP9hFHwkuUOBUYGPpcY8GQ83im11Y2aSOjpcLUzoO5g20z7wf/4YU1ECZ4y1GtNiWlLOIetYrwDpcg+ro4+2tPJ5TaJ4suO+4YIzNmgUm8EKIaSQZwbPAFHIuf7dub5Qs4EZpZq/a3y+e8mS/aXc8Mv7akD4yJbXt8H6MQVwVBDFVDUWXmv+MIW9b2IiSRzwHNzzHIy0HdX/ItfmBhk+5NB3aCpqmfXAfW6kHDjPGxuLMJ7LIR07q2O4ohVaUEigXLbvhLWQkjVojQCMPeDvfp5Y3GjHL8380Be8vOfWpNRfdG9pBPKZVe72oBN2u41JWyLUKQ/vfQG8Y3dTn0uCgOYR/8LtdmEMGrcXiKXRiHK/pgRaso7Db2UZqTZh6PQenybmL+iXVerIphHDz2661azhXYicQTYfizohErDvm/237V0WlatbsiGBoy1RSfcrosP3JE4kNJxDgxhSbWIZLxiW192cKKkfXv4WUaEw4n3s9hepeOI9l5ls5zC+9hQYASW9lpwRZgdsvgkrOiMMY4eTu6+k80UHDxp96ALmonEUaH/r1QbBTLi8Zu2r0zkcR/5jF3lxtGEkI1isidYdkaiFTpEQD53hhbRj9VGyy1HLwQy72RfbHFXYKR6+fHKb5ohkZPr7Y1Xq6eirGN7JGqqh8IB4BGB2TIvL+bcB/0vQfA== 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?QTZNbjFmVGswbmxpdzBUc2dDNWNWZ28wK01la2w2Y0cwUzEyZThWZ1AwOEZi?= =?utf-8?B?eGEzSXZ5MlEwMk5pSHN4V0swZ2gweXdPenRZRGhJYmpKWFpxVCttZEZxRkdl?= =?utf-8?B?REVQR3FqVE9EZExQRTB0djgwVGZ1K0JpZTRCZ0NKdVk3YjJIcjZBZ3NlYlJ5?= =?utf-8?B?Q0RNZjNGZHY3aThrS0Z5QXFIVTFEL3Z3bS9MSi9uRkVjR1NpVkZUOGdRU3ZE?= =?utf-8?B?dFFtTUtPbUZtV3RVNjAxeXNOYWlvUy94OFBZdDNnZ1YwdktO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W5ZU21YRHA0alBtME5OanJ0dWJJcHhmNU8xUmdMalZmRmJZVUtld0g1WlpD?= =?utf-8?B?ZUdQT0VGc0J0Um5CRS95T01QSFZtWFh3VW9TWnk5RXR3clU0VmJTTkRCaWdy?= =?utf-8?B?Qmc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 719af2d0-acde-45ae-8cb1-08dab33aa911 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:55.5289 (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: N/ux3a53cSBfXdbi4YK+BkSvlfhVBgd1KL2LHn3Wwl/MH/LrgcLIY+xcDVkX+fzTHbR7m0os0OImv6E43lMiKahBvTz59li7xQoOCHyCkog= 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 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 b440c95..d496be7 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -600,6 +600,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; @@ -1248,6 +1252,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[], @@ -1304,6 +1324,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