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 DBC97A0560; Tue, 18 Oct 2022 13:29:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D11242B96; Tue, 18 Oct 2022 13:28:10 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2112.outbound.protection.outlook.com [40.107.93.112]) by mails.dpdk.org (Postfix) with ESMTP id 8519441147 for ; Tue, 18 Oct 2022 13:28:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LAhD3IKiSqf8YR5xKnJCcd7Kvv686O2bq2OvvTDTZSZoO6dMlwPJeYJsmSFvA+eMWC3tuPlqNZOgCnwfQeHAmp9hSoXCCh1d1m/fZw1tZ0aAaEBu6+wqyBB1X6eWl6Cu/IcsiShB417DXfNT09YB9LmMsUkrKkjfaOffhelz9ujRmBaBEBrdLmcjUxR9ph7FVIdJ2IVP8MFDhQ3iorHSjiZgnhZWDVSET2IbY/9Cj+pP5VK8lfX317q1cDJvEVc0SRT80ZCeZYV/Yq2xi+8CQ2ML2s105hmyJvIP2WNcnG++Xz5vUfjfdVU9bDX1vVWDQswb4WgwcohXv5ShB9DALA== 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=lTdawRE6XbAE4FOSB5qgvkDxlTtg4v5CelM7YqUYV68=; b=SZM7VobQpVxda4ggRy22A47IBZyTzFySXZKS5RPRPOocYZ6tmQf8NCXeFllveHP41tUe+Z867qZE2f1h3P37gczTCScKpqmMD2w2U+SvWnwLCQfg/G2p5saXS47TgsKrh5qa9m8B7Ffz2k0R3uH61ZuiEGC8rJMBd5DVmfrOA73+QKJkC3Iyn/o2l8PB+ANMj3pLY3QBvPDqFhVNRMBmEyjCRRgl4gThQDqlBTAEFvx0khh5gxNMigXIHqvOiXnn4bGSdzQ7/8OSOK5oEXt21+YRknDaGwbB4Ce3vx48Kw0hvfNL44X1mzjd/gyGIPI8QkSTQxUGAiaJQDGnU1jrlg== 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=lTdawRE6XbAE4FOSB5qgvkDxlTtg4v5CelM7YqUYV68=; b=E52TFnSoNNUjD4JBgXy0Fh85sBo5U51qg/sOyqEA+miqgYFPkBoOEtcaxT+4bzIXTcohAV+Vtw5iawk7YRqmkHdPBnxXbhb254phfx7civQmT/f/S0yqchlf/mLGO98Du74Bd0t5tvMqWG0dQFuri/04KRg6TQ8Nvcs9aUItxLA= 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 SA0PR13MB4160.namprd13.prod.outlook.com (2603:10b6:806:93::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20; Tue, 18 Oct 2022 11:28:05 +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:05 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v4 15/25] net/nfp: support pop VLAN flow action Date: Tue, 18 Oct 2022 19:27:04 +0800 Message-Id: <1666092434-10357-16-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_|SA0PR13MB4160:EE_ X-MS-Office365-Filtering-Correlation-Id: 47d26b02-9138-48b0-ef7f-08dab0fbd30a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T3XvsM3KxXK6TdHoaygb1RxVc+yuX83z3hlCClTCxq+LPqWb8ZK/3IVPI5m+PMbwj7Msboqdu5ZoRUgSl76SZ/GDRDnLoR9yzqtqnAsO8y2Z3q+597+Fz+2vdZe6QfmUkXAwUro3HOrpTk6HqjkQZn6qsuz0ODJVLyxRf7+vtjjkm9BZYuL+nO3ZN9CX19MAstsuWVHyaiD5khd93Qqkb+xsHCF8jDyOVZI8Vj81H4B3oo/qFNCrHhAWpfJ/snhl3G9Z1LxmhXOQgL+yFzVsgtKkCPLP8ay7MJgHdF3OB1htf11TXTiCh5huhcPCoASdm/WG6G2j/zkrKbDS9BlUQy4odwWiArWVdp3+TBbZFWBMcEA5FeAx0FB2Khznp0kctXiHIJiaRkput79d34lUl0aIYv3cethoiI5GyarfFMbe4GL65Eg2NpKaigaTdOtbW04R1OkLIhqvrRvTbAr2/aoRjL9mSInCxMTlYdU6PyBR9J/gwazxFVFheIif178jwJDHiA+x7RTp1tR2wjN/AVafHGuGZ+8czDGuvZiPe5DbK/TKBFmM6hPN2+JNAYU06N57+STfhSC78SavGsaulkdjpR7pWtKLcfc7iSimI39C93B5pk0S/0RD5bmKzcIUwP+nvySHPbAP/GGdwl1psmYUl/ps31rADCqq5+RFma5zOHCs0Lk2HqC9WSSi1RcFJgQDepgik77vCCWnY8HrlZ9Hvvvy3UIvIxygxBtW4OV9ic9w6KKBxSCa/4bjPf+xFDuztq6CI9KkRPQJlhMKihBDWWAImCMzrQVrxR4EciEI5eC01yP8FX6k8AIAoOMg 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)(6486002)(36756003)(41300700001)(4326008)(38350700002)(8676002)(66556008)(66946007)(107886003)(6506007)(6512007)(66476007)(5660300002)(2616005)(44832011)(8936002)(26005)(478600001)(86362001)(186003)(6916009)(52116002)(83380400001)(316002)(2906002)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cHFwMmN3a215MmQ0WU5rTUdYNGVxZ2JuLzh3WmtaM1JmRnNHcXVYTGlCc0s3?= =?utf-8?B?Y0doYyt0SVJUT3AxRUtWSGVRUlFNbU00OWhsMnQyNHk4N0NyNjZTOS9LN2x3?= =?utf-8?B?aXRvRldmNmVJcklmQlBkWTI3TDZtcWlvbUpRZTc5YWVGcUZMeCtIY0VLMVRL?= =?utf-8?B?NXNzVTIvZGtlcjNsOER1djdYbXRUTHE3T2xuMDJpSERBbkFSQzBXWmNtUUZ6?= =?utf-8?B?Vk5IVVZFeHBVQ2IwMjdiTTZsRFlVT293SDJ5ZzNtL1RGUl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KZlJ3cmxrT3dneTh3WUdScjRlOVhWaXJTTENoNWUvR3ZGUmQ2?= =?utf-8?B?bWNNcGtuK3hPVzhlY2YyNXdJSG56MkdnSDVmNDhocngrRmV0NTI1T053NG9L?= =?utf-8?B?SFE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47d26b02-9138-48b0-ef7f-08dab0fbd30a 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:05.3147 (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: 5on/WDR916Y9EXaXLmX1iN4cPmKkLNzT1UpigOLOLgb00n7/cdFlCUBclk6gm7Xy+bduZfRTRxqYTnID4RLFjLem5TouhYdo7GbCSvuk+o8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR13MB4160 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 9948d42..ef089fb 100644 --- a/doc/guides/nics/features/nfp.ini +++ b/doc/guides/nics/features/nfp.ini @@ -40,6 +40,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 46a9732..18867fd 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -618,6 +618,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; @@ -1266,6 +1270,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[], @@ -1328,6 +1348,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