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 38783A0544; Mon, 10 Oct 2022 08:09:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C2F9427F3; Mon, 10 Oct 2022 08:09:28 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2100.outbound.protection.outlook.com [40.107.100.100]) by mails.dpdk.org (Postfix) with ESMTP id 58E29427EE for ; Mon, 10 Oct 2022 08:09:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=modYk1idKutD/FKZvvn1pg64rgP2aDzH35mxq+uqWyQDyBuE+P/BUxCpHRT8/vwwNEuvZgpZ2UueBIMs0MiKHdtT79HAyiwa/3CkvOPSyZSky6w6eZGu4M7zAE8GXpDbLzILn9en/bPN20Zwisplrr5bHAnKkYL7+ZoM1qf+pV8q950RhdJpoqtRggJMDI9cjv0xkrlCGbN9Q9FXr+QMeBrMa6TMJbu4upN/Gw6bKfAQmL0565e6RoVup2MvNLI2ddBdeyvoRodu8TU88A/wOv2Y0mPRxceC6bJESQobOvX86UQSo7Egh7dfQFdbgFmzcBm5CS/S1xVH5IcMfWwjLw== 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=bgdx50mnZ8iMF60SUxKGuTR0FlsshNdksRgzV0pnGc8=; b=bxFnA3aBdcVdpDnE7gS7nU3z6j6jnKbyIuYUwCcd+PpO4XLmM2E5R1HKo6oQvbG2Qkq3aqSJTkCUEP05Tt48tGPAwGxregig5BMYDVJGfIW92XbLzOQnJebKXhjrF0F2pA9EEmk1USmSBMyxsffOYmCCl6gCwpmYYD0n4dVmaK0yqgCgsBjTGbwVuvdNKqwkQwQmRviqK0UapeMzx2SWB/L5J5mwAX+E3BodRzLqifNzaQBRslKLtN17T8QTELZRyspaZwX5vgnuus8Nh+L8UlYXG2fOZ49Qd8imwUssXs595941wzFGXz5Wzh6A7V26B/iYsFfquCCslG0NrMQqsQ== 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=bgdx50mnZ8iMF60SUxKGuTR0FlsshNdksRgzV0pnGc8=; b=QGh+dMUCZe1U7SlYtyNoYPVUnH6VviBbO5u7NuqE5PqSy2jS5FRN07vLzU24ombQuTGpCvaQZBmbHAS4t3FrZX2sBOVsQRLc5glMoiq5caR9BgCieDyCD3lhNZ1SSAb6rPLAP3aRA8Xgi/CzXUpbinEfwG/GttUCut3t+KKZOqw= 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:25 +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:25 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 03/24] net/nfp: add the flow APIs of nfp PMD Date: Mon, 10 Oct 2022 14:08:41 +0800 Message-Id: <1665382142-21684-4-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: 51933a57-1add-4208-ea58-08daaa85fb8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TIvnDy/YPxZtIa3zAQIQq7ALZM3MXxcp18aXM9WmFfEXsfkegSN7ebLUEfzkuWoyPHGs0C2KuYIy4sKumJ+rpIMURIJW6AN4BXW1QYaxoLy0HxZtyvfkGv4OxLCqOtDu2xSlNONLzIv0QuuAJQtgaUEMlDLPFB1wOstqIHcbzT01SVoakiYEODU6QI9zSlsSICO4PcjhShCb+o6zDeoR/uQz1MuXmmdaaR1/h9HQ6VonuMgy+66rtF+/Gq3f8UnW31hr0s4C+NUnGFKzN30bp80xxZrNA2t6D8u3gsxF45E79PaIeedFXpYiM9T6SoFwWdiOH92g/57PwPrcsxjo2Sf1XvPgJoC96VhoPQbGzipFe9n21EMJnShhKVmwtiNXkQYmmaKEzmGon8o/f3SKuLAZ2mO2C3GGWPXNwMfyiT6A2R8dKTLxArPRLCj92dc5s1u4OdYeHA5b39Jc+WTbVCaVQhsIDsUH2khb9T0cPX87wOQt36DUNya2X0lwGxutqmKYJeYEyiERCs6jQVW7dvbXDG3dMPuYTDaw4OLQWAxdp6olWY9arMYWgr9OIExsqDDD68rfFbpkVUiTYKTJwWpoHz10sNSRyrNd6sQZL0JJeBmN33z26xdy2Kmrb1S+kJGTRAnzlgfLy8LJ4A+BHLRJiwp/xrN1qoSsesRKeLovgAYYnd+BYo6kFDrRXsTXigLBp6mlWLyFhDK/tDvOMnuRM0A85ntW/K/RJzqBMWgrqzm3qY2k1UOjvdgOBdKqFUVkJp3kaLGQpAp//xbBCAt/xtxz+pumxf/yLaeoycCyZ2ZfdVq9K9OyFwOses8f 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)(396003)(346002)(376002)(136003)(39830400003)(451199015)(6916009)(316002)(2906002)(186003)(6486002)(2616005)(66476007)(6666004)(107886003)(66556008)(41300700001)(66946007)(83380400001)(30864003)(8936002)(8676002)(4326008)(5660300002)(66574015)(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?c0VnRmprVzdsbHdtTmhkTWhJZEcwSzZPeWVwRStaN2F3d2trUmYwQWpCdldG?= =?utf-8?B?cGlRN3VIL2Y0clJvb0hZZUo4VllsNk1rMEJBTU94M2dZS2dKSCsrSGNvQTEx?= =?utf-8?B?eXhMWUt6eHFGYXJYRzZaeDZ6TWNoQU1sb0oxMjBRSko2SFlvekRKQ2hZYm5P?= =?utf-8?B?emUxNVI0YUdhNk1xTk95WlRTazRvaWlueFF1NlQ5MTdYTWN5YnlzY3ova1Bv?= =?utf-8?B?K0RhRmlFMEt2SG1HUTAybXp2bkUwdCs0aDFSREVDUFUrZXZscklGUDZkWjZh?= =?utf-8?B?alhNRDhjSEdJQzU1SlpKcGxiVTBtSm5lalgvQ2NmSE44aUpkUzRkb0pERHJY?= =?utf-8?B?bk9hR1Q0blV2MzV4VlhTMm5VQjlkRkRkeHRaRDRDUXI1dGk0c0RNSW0vcVpm?= =?utf-8?B?TFMveDZJUmlmOEl0ZVhPTDBpNWxhWEt1emdJVUE0bkk0SEFZZWJ4YzBYRzZt?= =?utf-8?B?N2t2TURsUkhRZWxkbCtuZVhISFFTaEhuQXNQRGRlTWhjNFUyYVJzY3JRd2RX?= =?utf-8?B?dFMyVHliWWp4bTV5YTZWNlp5WWIrM1FRdzBUclhheEZsTUFnWUJMN3grdDNZ?= =?utf-8?B?SFYrVFVQNkxaWGxGdG1QL1ZscklmbWtBcEd6cHY4V1NhaElZZGNFYnVCc2kv?= =?utf-8?B?Rng5akozeXlLdTQ3TVlDRUNydVVyQm1WRXU2dzgvVG04UVJxajJERytLVWdr?= =?utf-8?B?QkYvN2doMDZQV1V3OE1sb2lsNnpNZVdZdTV2dzRvK2gyWndjVStmQng5NVMw?= =?utf-8?B?dkFxZm1GS2FtcUR5ZE41MmtuMWVnQ3ltc2RvRnQ2MjFOU01xWHkxbHJKSC9y?= =?utf-8?B?SUhJMmRBTU45YzY5RTZzbndyMWE2ejNtbjdZWWd6d2EzdC9tWFZDNGswT09B?= =?utf-8?B?U3ZNQ2hnWUNJUWlBMFROTDZPWCtwTVZFOFBXdVZ2L25pOS81bXNMaHFEZG1L?= =?utf-8?B?V1psSDJzaWFTeVpXc3U0RTB1a1pGUzQvcyt3ZG9aTEZHRmNvb2d5aW1mSms5?= =?utf-8?B?a3VYd20xOGxYSlZJQXp4TFZoWnByM3FqWlRNeWN0eEdtR2Zqb2NKbVRKeVF1?= =?utf-8?B?U1kycmNHODNYbVYxUUI4bjN5elIvUG5sQm50R082SlRqUkpXUlB2R1hkWnRX?= =?utf-8?B?bWQySVcxcXo0Wmhxems3enMyV1ovNkZKczh2d0Yza3hwYndJcHRSejFJQmlJ?= =?utf-8?B?ME0xNXZ4V1p2K0YraEdoQUs4ZGVYQlgyU0lVU2dhRFNiUExoNHFNUE16cWpj?= =?utf-8?B?ZDI5R0R5d2gvd0hVWVNDdnVqS0V3bmV2NGVlOXFKRSs3a0xGbWxJTHVFaHFB?= =?utf-8?B?dGtnTkJhK3UxR0dIdzZFRk5uQko5dXJLSlkyZ2w2ZklsTithWUlyREFSMnhi?= =?utf-8?B?NHRoZnB2TXJvT3YxNHVpOG10R3Y5RW9KNmlWMXlMQ3A3NEhaNHRKQmVJdlZj?= =?utf-8?B?UGJXeHVteWhvS2Fud3U3K2dkTVoybDNIcEZyT0ZVVDRySzZiUXNIemRwcGNy?= =?utf-8?B?eVJIMlM5UnNSWlphcHpaanJPbTExQ0JZWHdGRjQzWlFnZEJsN20xS1gyalZK?= =?utf-8?B?aVdXRzR0SmttbktRS1hjVVVaWENrM3dDREdxUlBWaDByekp6QkVuejIrb2xo?= =?utf-8?B?T3MyUTdpRHNSMjNBTXgwbGl1d1ZHeGs4WUh0U0x3K0FlWFB4cGFSKzJKb0Zx?= =?utf-8?B?bFk1Qi82RlYzdE0vSUdjL2lndTNKRE91TXBnd1BhWmN2d3pnRDBDOG85eFJW?= =?utf-8?B?RDRaMk56cUdJRFVqdnBWTU01eXBmdXI3MjVFT0hsNkxjRXdyY2hzaXYxWlo5?= =?utf-8?B?dkQ2djhZQitWQlNZU251amwvYmFWMnN0WWhzaE56WVpYYmVTa3J4TElzY2Fr?= =?utf-8?B?NXdPMVVOT1ZYNDZiUTZtNjZKRmozR1lNM2ErQTVEanBXaUZFVGFqNG9PclhO?= =?utf-8?B?VHNFalkxcDhOWmlVVHpZWnltdU9OSlpXT0ttV2x3bUlycnJqNG1xdHozbDJH?= =?utf-8?B?bGF2VDRySUZoY1dzeStiaitjNTVtNkRWRmZXdnQzem1GQzB4M3RLaTJDdk1z?= =?utf-8?B?aW01c3BYbERCcjhYTWc4aDhsbmVoOVVLOEl3dVdWVFVydEhpeUdPYjFIK1B6?= =?utf-8?B?clhKNldTYVhJOE1mUEgwSlhSQkpKOEJQMTRNOEEyaHlMOHlUNTFWd1NCWTRZ?= =?utf-8?B?S0E9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51933a57-1add-4208-ea58-08daaa85fb8f 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:25.6263 (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: NYyylJoCGE5VZrR/rh1q1YVwCzo/i6SpFdpoonZKdM7g+ocwBMuPDajafOIMfaFCXBd3Wl4guSdhwKUqg9W8VFENyARw4HZ4M7mktSTINVk= 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 flow validate/create/query/destroy/flush API of nfp PMD. The flow create API construct a control cmsg and send it to firmware, then add this flow to the hash table. The flow query API get flow stats from the flow_priv structure. Note there exist an rte_spin_lock to prevent the update and query action occur at the same time. The flow destroy API construct a control cmsg and send it to firmware, then adelete this flow from the hash table. The flow flush API just iterate the flows in hash table and call the flow destroy API. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/flower/nfp_flower_cmsg.c | 69 +++ drivers/net/nfp/flower/nfp_flower_cmsg.h | 48 ++ drivers/net/nfp/flower/nfp_flower_representor.c | 3 + drivers/net/nfp/nfp_flow.c | 573 +++++++++++++++++++++++- drivers/net/nfp/nfp_flow.h | 28 ++ 5 files changed, 712 insertions(+), 9 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.c b/drivers/net/nfp/flower/nfp_flower_cmsg.c index 750a629..15d8381 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.c +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.c @@ -6,6 +6,7 @@ #include "../nfpcore/nfp_nsp.h" #include "../nfp_logs.h" #include "../nfp_common.h" +#include "../nfp_flow.h" #include "nfp_flower.h" #include "nfp_flower_cmsg.h" #include "nfp_flower_ctrl.h" @@ -177,3 +178,71 @@ return 0; } + +int +nfp_flower_cmsg_flow_delete(struct nfp_app_fw_flower *app_fw_flower, + struct rte_flow *flow) +{ + char *msg; + uint16_t cnt; + uint32_t msg_len; + struct rte_mbuf *mbuf; + struct nfp_fl_rule_metadata *nfp_flow_meta; + + mbuf = rte_pktmbuf_alloc(app_fw_flower->ctrl_pktmbuf_pool); + if (mbuf == NULL) { + PMD_DRV_LOG(DEBUG, "Failed to alloc mbuf for flow delete."); + return -ENOMEM; + } + + /* Copy the flow to mbuf */ + nfp_flow_meta = flow->payload.meta; + msg_len = (nfp_flow_meta->key_len + nfp_flow_meta->mask_len + + nfp_flow_meta->act_len) << NFP_FL_LW_SIZ; + msg_len += sizeof(struct nfp_fl_rule_metadata); + msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_FLOW_DEL, msg_len); + rte_memcpy(msg, flow->payload.meta, msg_len); + + cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf); + if (cnt == 0) { + PMD_DRV_LOG(ERR, "Send cmsg through ctrl vnic failed."); + rte_pktmbuf_free(mbuf); + return -EIO; + } + + return 0; +} + +int +nfp_flower_cmsg_flow_add(struct nfp_app_fw_flower *app_fw_flower, + struct rte_flow *flow) +{ + char *msg; + uint16_t cnt; + uint32_t msg_len; + struct rte_mbuf *mbuf; + struct nfp_fl_rule_metadata *nfp_flow_meta; + + mbuf = rte_pktmbuf_alloc(app_fw_flower->ctrl_pktmbuf_pool); + if (mbuf == NULL) { + PMD_DRV_LOG(DEBUG, "Failed to alloc mbuf for flow add."); + return -ENOMEM; + } + + /* copy the flow to mbuf */ + nfp_flow_meta = flow->payload.meta; + msg_len = (nfp_flow_meta->key_len + nfp_flow_meta->mask_len + + nfp_flow_meta->act_len) << NFP_FL_LW_SIZ; + msg_len += sizeof(struct nfp_fl_rule_metadata); + msg = nfp_flower_cmsg_init(mbuf, NFP_FLOWER_CMSG_TYPE_FLOW_ADD, msg_len); + rte_memcpy(msg, flow->payload.meta, msg_len); + + cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf); + if (cnt == 0) { + PMD_DRV_LOG(ERR, "Send cmsg through ctrl vnic failed."); + rte_pktmbuf_free(mbuf); + return -EIO; + } + + return 0; +} diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 5c28363..6045bb0 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -189,10 +189,58 @@ enum nfp_flower_cmsg_port_vnic_type { return rte_pktmbuf_mtod(m, char *) + 4 + 4 + NFP_FLOWER_CMSG_HLEN; } +/* + * Metadata with L2 (1W/4B) + * ---------------------------------------------------------------- + * 3 2 1 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | key_type | mask_id | PCP |p| vlan outermost VID | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * ^ ^ + * NOTE: | TCI | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +struct nfp_flower_meta_tci { + uint8_t nfp_flow_key_layer; + uint8_t mask_id; + rte_be16_t tci; +}; + +/* + * Extended metadata for additional key_layers (1W/4B) + * ---------------------------------------------------------------- + * 3 2 1 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | nfp_flow_key_layer2 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +struct nfp_flower_ext_meta { + rte_be32_t nfp_flow_key_layer2; +}; + +/* + * L1 Port details (1W/4B) + * ---------------------------------------------------------------- + * 3 2 1 + * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | port_ingress | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ +struct nfp_flower_in_port { + rte_be32_t in_port; +}; + 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); int nfp_flower_cmsg_port_mod(struct nfp_app_fw_flower *app_fw_flower, uint32_t port_id, bool carrier_ok); +int nfp_flower_cmsg_flow_delete(struct nfp_app_fw_flower *app_fw_flower, + struct rte_flow *flow); +int nfp_flower_cmsg_flow_add(struct nfp_app_fw_flower *app_fw_flower, + struct rte_flow *flow); #endif /* _NFP_CMSG_H_ */ diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 0e60f50..f1cd298 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -10,6 +10,7 @@ #include "../nfp_logs.h" #include "../nfp_ctrl.h" #include "../nfp_rxtx.h" +#include "../nfp_flow.h" #include "../nfpcore/nfp_mip.h" #include "../nfpcore/nfp_rtsym.h" #include "../nfpcore/nfp_nsp.h" @@ -590,6 +591,8 @@ .promiscuous_disable = nfp_flower_repr_promiscuous_disable, .mac_addr_set = nfp_flower_repr_mac_addr_set, + + .flow_ops_get = nfp_net_flow_ops_get, }; static uint32_t diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 97f5d1b..114686f 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -7,11 +7,15 @@ #include #include #include +#include #include "nfp_common.h" #include "nfp_flow.h" #include "nfp_logs.h" #include "flower/nfp_flower.h" +#include "flower/nfp_flower_cmsg.h" +#include "flower/nfp_flower_ctrl.h" +#include "flower/nfp_flower_representor.h" #include "nfpcore/nfp_mip.h" #include "nfpcore/nfp_rtsym.h" @@ -21,6 +25,15 @@ struct nfp_mask_id_entry { uint8_t mask_id; }; +static inline struct nfp_flow_priv * +nfp_flow_dev_to_priv(struct rte_eth_dev *dev) +{ + struct nfp_flower_representor *repr; + + repr = (struct nfp_flower_representor *)dev->data->dev_private; + return repr->app_fw_flower->flow_priv; +} + static int nfp_mask_id_alloc(struct nfp_flow_priv *priv, uint8_t *mask_id) { @@ -160,7 +173,7 @@ struct nfp_mask_id_entry { return entry; } -__rte_unused static bool +static bool nfp_check_mask_add(struct nfp_flow_priv *priv, char *mask_data, uint32_t mask_len, @@ -187,7 +200,7 @@ struct nfp_mask_id_entry { return true; } -__rte_unused static bool +static bool nfp_check_mask_remove(struct nfp_flow_priv *priv, char *mask_data, uint32_t mask_len, @@ -215,7 +228,7 @@ struct nfp_mask_id_entry { return true; } -__rte_unused static int +static int nfp_flow_table_add(struct nfp_flow_priv *priv, struct rte_flow *nfp_flow) { @@ -234,7 +247,7 @@ struct nfp_mask_id_entry { return 0; } -__rte_unused static int +static int nfp_flow_table_delete(struct nfp_flow_priv *priv, struct rte_flow *nfp_flow) { @@ -253,7 +266,7 @@ struct nfp_mask_id_entry { return 0; } -__rte_unused static struct rte_flow * +static struct rte_flow * nfp_flow_table_search(struct nfp_flow_priv *priv, struct rte_flow *nfp_flow) { @@ -273,7 +286,7 @@ struct nfp_mask_id_entry { return flow_find; } -__rte_unused static struct rte_flow * +static struct rte_flow * nfp_flow_alloc(struct nfp_fl_key_ls *key_layer) { char *tmp; @@ -306,14 +319,14 @@ struct nfp_mask_id_entry { return NULL; } -__rte_unused static void +static void nfp_flow_free(struct rte_flow *nfp_flow) { rte_free(nfp_flow->payload.meta); rte_free(nfp_flow); } -__rte_unused static int +static int nfp_stats_id_alloc(struct nfp_flow_priv *priv, uint32_t *ctx) { struct circ_buf *ring; @@ -348,7 +361,7 @@ struct nfp_mask_id_entry { return 0; } -__rte_unused static int +static int nfp_stats_id_free(struct nfp_flow_priv *priv, uint32_t ctx) { struct circ_buf *ring; @@ -366,6 +379,548 @@ struct nfp_mask_id_entry { return 0; } +static void +nfp_flower_compile_meta_tci(char *mbuf_off, struct nfp_fl_key_ls *key_layer) +{ + struct nfp_flower_meta_tci *tci_meta; + + tci_meta = (struct nfp_flower_meta_tci *)mbuf_off; + tci_meta->nfp_flow_key_layer = key_layer->key_layer; + tci_meta->mask_id = ~0; + tci_meta->tci = rte_cpu_to_be_16(key_layer->vlan); +} + +static void +nfp_flower_update_meta_tci(char *exact, uint8_t mask_id) +{ + struct nfp_flower_meta_tci *meta_tci; + + meta_tci = (struct nfp_flower_meta_tci *)exact; + meta_tci->mask_id = mask_id; +} + +static void +nfp_flower_compile_ext_meta(char *mbuf_off, struct nfp_fl_key_ls *key_layer) +{ + struct nfp_flower_ext_meta *ext_meta; + + ext_meta = (struct nfp_flower_ext_meta *)mbuf_off; + ext_meta->nfp_flow_key_layer2 = rte_cpu_to_be_32(key_layer->key_layer_two); +} + +static void +nfp_compile_meta_port(char *mbuf_off, + struct nfp_fl_key_ls *key_layer, + bool is_mask) +{ + struct nfp_flower_in_port *port_meta; + + port_meta = (struct nfp_flower_in_port *)mbuf_off; + + if (is_mask) + port_meta->in_port = rte_cpu_to_be_32(~0); + else if (key_layer->tun_type) + port_meta->in_port = rte_cpu_to_be_32(NFP_FL_PORT_TYPE_TUN | + key_layer->tun_type); + else + port_meta->in_port = rte_cpu_to_be_32(key_layer->port); +} + +static void +nfp_flow_compile_metadata(struct nfp_flow_priv *priv, + struct rte_flow *nfp_flow, + struct nfp_fl_key_ls *key_layer, + uint32_t stats_ctx) +{ + struct nfp_fl_rule_metadata *nfp_flow_meta; + char *mbuf_off_exact; + char *mbuf_off_mask; + + /* + * Convert to long words as firmware expects + * lengths in units of NFP_FL_LW_SIZ. + */ + nfp_flow_meta = nfp_flow->payload.meta; + nfp_flow_meta->key_len = key_layer->key_size >> NFP_FL_LW_SIZ; + nfp_flow_meta->mask_len = key_layer->key_size >> NFP_FL_LW_SIZ; + nfp_flow_meta->act_len = key_layer->act_size >> NFP_FL_LW_SIZ; + nfp_flow_meta->flags = 0; + nfp_flow_meta->host_ctx_id = rte_cpu_to_be_32(stats_ctx); + nfp_flow_meta->host_cookie = rte_rand(); + nfp_flow_meta->flow_version = rte_cpu_to_be_64(priv->flower_version); + priv->flower_version++; + + mbuf_off_exact = nfp_flow->payload.unmasked_data; + mbuf_off_mask = nfp_flow->payload.mask_data; + + /* Populate Metadata */ + nfp_flower_compile_meta_tci(mbuf_off_exact, key_layer); + nfp_flower_compile_meta_tci(mbuf_off_mask, key_layer); + mbuf_off_exact += sizeof(struct nfp_flower_meta_tci); + mbuf_off_mask += sizeof(struct nfp_flower_meta_tci); + + /* Populate Extended Metadata if required */ + if (key_layer->key_layer & NFP_FLOWER_LAYER_EXT_META) { + nfp_flower_compile_ext_meta(mbuf_off_exact, key_layer); + nfp_flower_compile_ext_meta(mbuf_off_mask, key_layer); + mbuf_off_exact += sizeof(struct nfp_flower_ext_meta); + mbuf_off_mask += sizeof(struct nfp_flower_ext_meta); + } + + /* Populate Port Data */ + nfp_compile_meta_port(mbuf_off_exact, key_layer, false); + nfp_compile_meta_port(mbuf_off_mask, key_layer, true); + mbuf_off_exact += sizeof(struct nfp_flower_in_port); + mbuf_off_mask += sizeof(struct nfp_flower_in_port); +} + +static int +nfp_flow_key_layers_calculate_items(const struct rte_flow_item items[], + __rte_unused struct nfp_fl_key_ls *key_ls) +{ + const struct rte_flow_item *item; + + for (item = items; item->type != RTE_FLOW_ITEM_TYPE_END; ++item) { + switch (item->type) { + default: + PMD_DRV_LOG(ERR, "Item type %d not supported.", item->type); + return -ENOTSUP; + } + } + + return 0; +} + +static int +nfp_flow_key_layers_calculate_actions(const struct rte_flow_action actions[], + struct nfp_fl_key_ls *key_ls) +{ + int ret = 0; + const struct rte_flow_action *action; + + for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) { + /* Make sure actions length no longer than NFP_FL_MAX_A_SIZ */ + if (key_ls->act_size > NFP_FL_MAX_A_SIZ) { + PMD_DRV_LOG(ERR, "The action list is too long."); + ret = -ERANGE; + break; + } + + switch (action->type) { + case RTE_FLOW_ACTION_TYPE_VOID: + PMD_DRV_LOG(DEBUG, "RTE_FLOW_ACTION_TYPE_VOID detected"); + break; + default: + PMD_DRV_LOG(ERR, "Action type %d not supported.", action->type); + return -ENOTSUP; + } + } + + return ret; +} + +static int +nfp_flow_key_layers_calculate(const struct rte_flow_item items[], + const struct rte_flow_action actions[], + struct nfp_fl_key_ls *key_ls) +{ + int ret = 0; + + key_ls->key_layer_two = 0; + key_ls->key_layer = NFP_FLOWER_LAYER_PORT; + key_ls->key_size = sizeof(struct nfp_flower_meta_tci) + + sizeof(struct nfp_flower_in_port); + key_ls->act_size = 0; + key_ls->port = ~0; + key_ls->vlan = 0; + key_ls->tun_type = NFP_FL_TUN_NONE; + + ret |= nfp_flow_key_layers_calculate_items(items, key_ls); + ret |= nfp_flow_key_layers_calculate_actions(actions, key_ls); + + return ret; +} + +static struct rte_flow * +nfp_flow_process(struct nfp_flower_representor *representor, + const struct rte_flow_item items[], + const struct rte_flow_action actions[]) +{ + int ret; + char *mask_data; + uint32_t mask_len; + uint32_t stats_ctx = 0; + uint8_t new_mask_id = 0; + struct rte_flow *nfp_flow; + struct rte_flow *flow_find; + struct nfp_flow_priv *priv; + struct nfp_fl_key_ls key_layer; + struct nfp_fl_rule_metadata *nfp_flow_meta; + + ret = nfp_flow_key_layers_calculate(items, actions, &key_layer); + if (ret != 0) { + PMD_DRV_LOG(ERR, "Key layers calculate failed."); + return NULL; + } + + if (key_layer.port == (uint32_t)~0) + key_layer.port = representor->port_id; + + priv = representor->app_fw_flower->flow_priv; + ret = nfp_stats_id_alloc(priv, &stats_ctx); + if (ret != 0) { + PMD_DRV_LOG(ERR, "nfp stats id alloc failed."); + return NULL; + } + + nfp_flow = nfp_flow_alloc(&key_layer); + if (nfp_flow == NULL) { + PMD_DRV_LOG(ERR, "Alloc nfp flow failed."); + goto free_stats; + } + + nfp_flow->install_flag = true; + + nfp_flow_compile_metadata(priv, nfp_flow, &key_layer, stats_ctx); + + nfp_flow_meta = nfp_flow->payload.meta; + mask_data = nfp_flow->payload.mask_data; + mask_len = key_layer.key_size; + if (!nfp_check_mask_add(priv, mask_data, mask_len, + &nfp_flow_meta->flags, &new_mask_id)) { + PMD_DRV_LOG(ERR, "nfp mask add check failed."); + goto free_flow; + } + + /* Once we have a mask_id, update the meta tci */ + nfp_flower_update_meta_tci(nfp_flow->payload.unmasked_data, new_mask_id); + + /* Find the flow in hash table */ + flow_find = nfp_flow_table_search(priv, nfp_flow); + if (flow_find != NULL) { + PMD_DRV_LOG(ERR, "This flow is already exist."); + if (!nfp_check_mask_remove(priv, mask_data, mask_len, + &nfp_flow_meta->flags)) { + PMD_DRV_LOG(ERR, "nfp mask del check failed."); + } + goto free_flow; + } + + return nfp_flow; + +free_flow: + nfp_flow_free(nfp_flow); +free_stats: + nfp_stats_id_free(priv, stats_ctx); + + return NULL; +} + +static struct rte_flow * +nfp_flow_setup(struct nfp_flower_representor *representor, + const struct rte_flow_attr *attr, + const struct rte_flow_item items[], + const struct rte_flow_action actions[], + struct rte_flow_error *error) +{ + if (attr->group != 0) + PMD_DRV_LOG(INFO, "Pretend we support group attribute."); + + if (attr->priority != 0) + PMD_DRV_LOG(INFO, "Pretend we support priority attribute."); + + if (attr->transfer != 0) + PMD_DRV_LOG(INFO, "Pretend we support transfer attribute."); + + if (attr->egress != 0) { + rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ATTR_EGRESS, + NULL, "Egress is not supported."); + return NULL; + } + + if (attr->ingress == 0) { + rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, + NULL, "Only ingress is supported."); + return NULL; + } + + return nfp_flow_process(representor, items, actions); +} + +static int +nfp_flow_teardown(struct nfp_flow_priv *priv, struct rte_flow *nfp_flow) +{ + char *mask_data; + uint32_t mask_len; + uint32_t stats_ctx; + struct nfp_fl_rule_metadata *nfp_flow_meta; + + nfp_flow_meta = nfp_flow->payload.meta; + mask_data = nfp_flow->payload.mask_data; + mask_len = nfp_flow_meta->mask_len << NFP_FL_LW_SIZ; + if (!nfp_check_mask_remove(priv, mask_data, mask_len, + &nfp_flow_meta->flags)) { + PMD_DRV_LOG(ERR, "nfp mask del check failed."); + return -EINVAL; + } + + nfp_flow_meta->flow_version = rte_cpu_to_be_64(priv->flower_version); + priv->flower_version++; + + stats_ctx = rte_be_to_cpu_32(nfp_flow_meta->host_ctx_id); + return nfp_stats_id_free(priv, stats_ctx); +} + +static int +nfp_flow_validate(struct rte_eth_dev *dev, + const struct rte_flow_attr *attr, + const struct rte_flow_item items[], + const struct rte_flow_action actions[], + struct rte_flow_error *error) +{ + int ret; + struct rte_flow *nfp_flow; + struct nfp_flow_priv *priv; + struct nfp_flower_representor *representor; + + representor = (struct nfp_flower_representor *)dev->data->dev_private; + priv = representor->app_fw_flower->flow_priv; + + nfp_flow = nfp_flow_setup(representor, attr, items, actions, error); + if (nfp_flow == NULL) { + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "This flow can not be offloaded."); + } + + ret = nfp_flow_teardown(priv, nfp_flow); + if (ret != 0) { + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Flow resource free failed."); + } + + nfp_flow_free(nfp_flow); + + return 0; +} + +static struct rte_flow * +nfp_flow_create(struct rte_eth_dev *dev, + const struct rte_flow_attr *attr, + const struct rte_flow_item items[], + const struct rte_flow_action actions[], + struct rte_flow_error *error) +{ + int ret; + struct rte_flow *nfp_flow; + struct nfp_flow_priv *priv; + struct nfp_app_fw_flower *app_fw_flower; + struct nfp_flower_representor *representor; + + representor = (struct nfp_flower_representor *)dev->data->dev_private; + app_fw_flower = representor->app_fw_flower; + priv = app_fw_flower->flow_priv; + + nfp_flow = nfp_flow_setup(representor, attr, items, actions, error); + if (nfp_flow == NULL) { + rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "This flow can not be offloaded."); + return NULL; + } + + /* Add the flow to hardware */ + if (nfp_flow->install_flag) { + ret = nfp_flower_cmsg_flow_add(app_fw_flower, nfp_flow); + if (ret != 0) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Add flow to firmware failed."); + goto flow_teardown; + } + } + + /* Add the flow to flow hash table */ + ret = nfp_flow_table_add(priv, nfp_flow); + if (ret != 0) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Add flow to the flow table failed."); + goto flow_teardown; + } + + return nfp_flow; + +flow_teardown: + nfp_flow_teardown(priv, nfp_flow); + nfp_flow_free(nfp_flow); + + return NULL; +} + +static int +nfp_flow_destroy(struct rte_eth_dev *dev, + struct rte_flow *nfp_flow, + struct rte_flow_error *error) +{ + int ret; + struct rte_flow *flow_find; + struct nfp_flow_priv *priv; + struct nfp_app_fw_flower *app_fw_flower; + struct nfp_flower_representor *representor; + + representor = (struct nfp_flower_representor *)dev->data->dev_private; + app_fw_flower = representor->app_fw_flower; + priv = app_fw_flower->flow_priv; + + /* Find the flow in flow hash table */ + flow_find = nfp_flow_table_search(priv, nfp_flow); + if (flow_find == NULL) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Flow does not exist."); + ret = -EINVAL; + goto exit; + } + + /* Update flow */ + ret = nfp_flow_teardown(priv, nfp_flow); + if (ret != 0) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Flow teardown failed."); + ret = -EINVAL; + goto exit; + } + + /* Delete the flow from hardware */ + if (nfp_flow->install_flag) { + ret = nfp_flower_cmsg_flow_delete(app_fw_flower, nfp_flow); + if (ret != 0) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Delete flow from firmware failed."); + ret = -EINVAL; + goto exit; + } + } + + /* Delete the flow from flow hash table */ + ret = nfp_flow_table_delete(priv, nfp_flow); + if (ret != 0) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Delete flow from the flow table failed."); + ret = -EINVAL; + goto exit; + } + +exit: + nfp_flow_free(nfp_flow); + + return ret; +} + +static int +nfp_flow_flush(struct rte_eth_dev *dev, + struct rte_flow_error *error) +{ + int ret = 0; + void *next_data; + uint32_t iter = 0; + const void *next_key; + struct nfp_flow_priv *priv; + + priv = nfp_flow_dev_to_priv(dev); + + while (rte_hash_iterate(priv->flow_table, &next_key, &next_data, &iter) >= 0) { + ret = nfp_flow_destroy(dev, (struct rte_flow *)next_data, error); + if (ret != 0) + break; + } + + return ret; +} + +static void +nfp_flow_stats_get(struct rte_eth_dev *dev, + struct rte_flow *nfp_flow, + void *data) +{ + uint32_t ctx_id; + struct rte_flow *flow; + struct nfp_flow_priv *priv; + struct nfp_fl_stats *stats; + struct rte_flow_query_count *query; + + priv = nfp_flow_dev_to_priv(dev); + flow = nfp_flow_table_search(priv, nfp_flow); + if (flow == NULL) { + PMD_DRV_LOG(ERR, "Can not find statistics for this flow."); + return; + } + + query = (struct rte_flow_query_count *)data; + ctx_id = rte_be_to_cpu_32(nfp_flow->payload.meta->host_ctx_id); + stats = &priv->stats[ctx_id]; + + rte_spinlock_lock(&priv->stats_lock); + if (stats->pkts && stats->bytes) { + query->hits = stats->pkts; + query->bytes = stats->bytes; + query->hits_set = 1; + query->bytes_set = 1; + stats->pkts = 0; + stats->bytes = 0; + } + rte_spinlock_unlock(&priv->stats_lock); +} + +static int +nfp_flow_query(struct rte_eth_dev *dev, + struct rte_flow *nfp_flow, + const struct rte_flow_action *actions, + void *data, + struct rte_flow_error *error) +{ + const struct rte_flow_action *action; + + for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; ++action) { + switch (action->type) { + case RTE_FLOW_ACTION_TYPE_VOID: + break; + case RTE_FLOW_ACTION_TYPE_COUNT: + nfp_flow_stats_get(dev, nfp_flow, data); + break; + default: + rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, + NULL, "Unsupported action type for flow query."); + return -ENOTSUP; + } + } + + return 0; +} + +static const struct rte_flow_ops nfp_flow_ops = { + .validate = nfp_flow_validate, + .create = nfp_flow_create, + .destroy = nfp_flow_destroy, + .flush = nfp_flow_flush, + .query = nfp_flow_query, +}; + +int +nfp_net_flow_ops_get(struct rte_eth_dev *dev, + const struct rte_flow_ops **ops) +{ + if ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) == 0) { + *ops = NULL; + PMD_DRV_LOG(ERR, "Port is not a representor."); + return -EINVAL; + } + + *ops = &nfp_flow_ops; + + return 0; +} + int nfp_flow_priv_init(struct nfp_pf_dev *pf_dev) { diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h index 142d7d5..83f9f29 100644 --- a/drivers/net/nfp/nfp_flow.h +++ b/drivers/net/nfp/nfp_flow.h @@ -6,10 +6,36 @@ #ifndef _NFP_FLOW_H_ #define _NFP_FLOW_H_ +#include + +#define NFP_FLOWER_LAYER_EXT_META (1 << 0) +#define NFP_FLOWER_LAYER_PORT (1 << 1) +#define NFP_FLOWER_LAYER_MAC (1 << 2) +#define NFP_FLOWER_LAYER_TP (1 << 3) +#define NFP_FLOWER_LAYER_IPV4 (1 << 4) +#define NFP_FLOWER_LAYER_IPV6 (1 << 5) +#define NFP_FLOWER_LAYER_CT (1 << 6) +#define NFP_FLOWER_LAYER_VXLAN (1 << 7) + +#define NFP_FLOWER_LAYER2_GRE (1 << 0) +#define NFP_FLOWER_LAYER2_QINQ (1 << 4) +#define NFP_FLOWER_LAYER2_GENEVE (1 << 5) +#define NFP_FLOWER_LAYER2_GENEVE_OP (1 << 6) +#define NFP_FLOWER_LAYER2_TUN_IPV6 (1 << 7) + #define NFP_FL_META_FLAG_MANAGE_MASK (1 << 7) #define NFP_MASK_TABLE_ENTRIES 1024 +/* The maximum action list size (in bytes) supported by the NFP. */ +#define NFP_FL_MAX_A_SIZ 1216 + +/* The firmware expects lengths in units of long words */ +#define NFP_FL_LW_SIZ 2 + +/* Tunnel ports */ +#define NFP_FL_PORT_TYPE_TUN 0x50000000 + enum nfp_flower_tun_type { NFP_FL_TUN_NONE = 0, NFP_FL_TUN_GRE = 1, @@ -75,6 +101,7 @@ struct nfp_fl_stats { struct nfp_flow_priv { uint32_t hash_seed; /**< Hash seed for hash tables in this structure. */ + uint64_t flower_version; /**< Flow version, always increase. */ /* mask hash table */ struct nfp_fl_mask_id mask_ids; /**< Entry for mask hash table */ struct rte_hash *mask_table; /**< Hash table to store mask ids. */ @@ -97,5 +124,6 @@ struct rte_flow { int nfp_flow_priv_init(struct nfp_pf_dev *pf_dev); void nfp_flow_priv_uninit(struct nfp_pf_dev *pf_dev); +int nfp_net_flow_ops_get(struct rte_eth_dev *dev, const struct rte_flow_ops **ops); #endif /* _NFP_FLOW_H_ */ -- 1.8.3.1