From patchwork Sun Mar 3 17:38:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harman Kalra X-Patchwork-Id: 739 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7CD843C3E; Sun, 3 Mar 2024 18:38:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F07740687; Sun, 3 Mar 2024 18:38:42 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 9184240151 for ; Sun, 3 Mar 2024 18:38:40 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4236Qu57005556 for ; Sun, 3 Mar 2024 09:38:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=pfpt0220; bh=yGwVrPVv2zFloV0ImJv4E fdx9o+BGyU6Sx0H+ONqJ8g=; b=VK4mLSYB/XI5iyEDlCNaJAcavkrUxH8odrmSK 4hSevc0UrpcHdIEnMOR/2n3UoB5cZCpw6iKaukje0qfZSQfKIu7MW5MUWNuHnPs1 0VizLEkrdtOYeJNG4UvYuGdGFpMxhZ5vAwI9NokKQWKShGj9l2hmyAQ52+XVhKdT U8vCAIqYEDDollJYt8dXchmGCgH7sMyDT30UaVL0QskOrW9DMVXZgIAn3p2vR9WC xTxegUqPp9Rc0gBaZCAGlIji8HuuyjDMIssd1z0wISSfqnKSYJq8AZA7DYXOg/4J yS2s7XgjASQTOng9QkYPsEVtBbmvt8BN0aujZtw531MvEAsfg== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3wm2bptrs6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 03 Mar 2024 09:38:39 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Sun, 3 Mar 2024 09:38:38 -0800 Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 3 Mar 2024 09:38:37 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Sun, 3 Mar 2024 09:38:37 -0800 Received: from localhost.localdomain (unknown [10.29.52.211]) by maili.marvell.com (Postfix) with ESMTP id D07283F718E; Sun, 3 Mar 2024 09:38:36 -0800 (PST) From: Harman Kalra To: CC: , Harman Kalra Subject: [PATCH v6 00/23] net/cnxk: support for port representors Date: Sun, 3 Mar 2024 23:08:10 +0530 Message-ID: <20240303173833.100039-1-hkalra@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230811163419.165790-1-hkalra@marvell.com> References: <20230811163419.165790-1-hkalra@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: zTjln2n4mFYhmaVoDtJxPsvalhliRZba X-Proofpoint-ORIG-GUID: zTjln2n4mFYhmaVoDtJxPsvalhliRZba X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-03_08,2024-03-01_03,2023-05-22_02 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 Introducing port representor support to CNXK drivers by adding virtual ethernet ports providing a logical representation in DPDK for physical function(PF) or SR-IOV virtual function (VF) devices for control and monitoring. These port representor ethdev instances can be spawned on an as needed basis through configuration parameters passed to the driver of the underlying base device using devargs ``-a ,representor=pf*vf*`` In case of exception path (i.e. until the flow definition is offloaded to the hardware), packets transmitted by the VFs shall be received by these representor port, while packets transmitted by representor ports shall be received by respective VFs. On receiving the VF traffic via these representor ports, applications holding these representor ports can decide to offload the traffic flow into the HW. Henceforth the matching traffic shall be directly steered to the respective VFs without being received by the application. Current virtual representor port PMD supports following operations: - Get represented port statistics - Flow operations - create, validate, destroy, query, flush, dump Changes since V5: * Fixed check-doc-vs-code.sh issue Changes since V4: * Fixed build issues * Updated release notes Changes since V3: * Added support for more platforms * Added xstats support for representor port stats Changes since V2: * Moved devargs parsing logic to common code and sent as separate series * Documentation updated * Addressed comments from V2 Changes since V1: * Updated communication layer between representor and represented port. * Added support for native represented ports * Port representor and represented port item and action support * Build failure fixes Harman Kalra (21): common/cnxk: add support for representors net/cnxk: implementing eswitch device net/cnxk: eswitch HW resource configuration net/cnxk: eswitch devargs parsing net/cnxk: probing representor ports common/cnxk: common NPC changes for eswitch common/cnxk: interface to update VLAN TPID net/cnxk: eswitch flow configurations net/cnxk: eswitch fastpath routines net/cnxk: add representor control plane common/cnxk: representee notification callback net/cnxk: handling representee notification net/cnxk: representor ethdev ops common/cnxk: get representees ethernet stats net/cnxk: ethernet statistics for representor common/cnxk: base support for eswitch VF net/cnxk: eswitch VF as ethernet device net/cnxk: add representor port pattern and action net/cnxk: generalise flow operation APIs net/cnxk: flow create on representor ports net/cnxk: other flow operations Kiran Kumar K (2): common/cnxk: support port representor and represented port net/cnxk: add represented port pattern and action MAINTAINERS | 1 + doc/guides/nics/cnxk.rst | 41 ++ doc/guides/nics/features/cnxk.ini | 5 + doc/guides/nics/features/cnxk_vec.ini | 6 + doc/guides/nics/features/cnxk_vf.ini | 6 + doc/guides/rel_notes/release_24_03.rst | 1 + drivers/common/cnxk/meson.build | 1 + drivers/common/cnxk/roc_api.h | 3 + drivers/common/cnxk/roc_constants.h | 2 + drivers/common/cnxk/roc_dev.c | 71 ++ drivers/common/cnxk/roc_dev_priv.h | 3 + drivers/common/cnxk/roc_eswitch.c | 389 +++++++++++ drivers/common/cnxk/roc_eswitch.h | 59 ++ drivers/common/cnxk/roc_mbox.c | 2 + drivers/common/cnxk/roc_mbox.h | 91 ++- drivers/common/cnxk/roc_nix.c | 46 +- drivers/common/cnxk/roc_nix.h | 4 + drivers/common/cnxk/roc_nix_priv.h | 12 +- drivers/common/cnxk/roc_nix_vlan.c | 23 +- drivers/common/cnxk/roc_npc.c | 110 ++- drivers/common/cnxk/roc_npc.h | 24 +- drivers/common/cnxk/roc_npc_mcam.c | 67 +- drivers/common/cnxk/roc_npc_parse.c | 28 +- drivers/common/cnxk/roc_npc_priv.h | 5 +- drivers/common/cnxk/roc_platform.c | 2 + drivers/common/cnxk/roc_platform.h | 4 + drivers/common/cnxk/version.map | 14 + drivers/net/cnxk/cn10k_ethdev.c | 3 + drivers/net/cnxk/cnxk_eswitch.c | 800 ++++++++++++++++++++++ drivers/net/cnxk/cnxk_eswitch.h | 212 ++++++ drivers/net/cnxk/cnxk_eswitch_devargs.c | 125 ++++ drivers/net/cnxk/cnxk_eswitch_flow.c | 454 +++++++++++++ drivers/net/cnxk/cnxk_eswitch_rxtx.c | 211 ++++++ drivers/net/cnxk/cnxk_ethdev.c | 41 +- drivers/net/cnxk/cnxk_ethdev.h | 3 + drivers/net/cnxk/cnxk_ethdev_ops.c | 4 + drivers/net/cnxk/cnxk_flow.c | 826 +++++++++++++++++++---- drivers/net/cnxk/cnxk_flow.h | 27 +- drivers/net/cnxk/cnxk_link.c | 3 +- drivers/net/cnxk/cnxk_rep.c | 618 +++++++++++++++++ drivers/net/cnxk/cnxk_rep.h | 150 +++++ drivers/net/cnxk/cnxk_rep_flow.c | 815 +++++++++++++++++++++++ drivers/net/cnxk/cnxk_rep_msg.c | 827 +++++++++++++++++++++++ drivers/net/cnxk/cnxk_rep_msg.h | 169 +++++ drivers/net/cnxk/cnxk_rep_ops.c | 848 ++++++++++++++++++++++++ drivers/net/cnxk/meson.build | 8 + 46 files changed, 6944 insertions(+), 220 deletions(-) create mode 100644 drivers/common/cnxk/roc_eswitch.c create mode 100644 drivers/common/cnxk/roc_eswitch.h create mode 100644 drivers/net/cnxk/cnxk_eswitch.c create mode 100644 drivers/net/cnxk/cnxk_eswitch.h create mode 100644 drivers/net/cnxk/cnxk_eswitch_devargs.c create mode 100644 drivers/net/cnxk/cnxk_eswitch_flow.c create mode 100644 drivers/net/cnxk/cnxk_eswitch_rxtx.c create mode 100644 drivers/net/cnxk/cnxk_rep.c create mode 100644 drivers/net/cnxk/cnxk_rep.h create mode 100644 drivers/net/cnxk/cnxk_rep_flow.c create mode 100644 drivers/net/cnxk/cnxk_rep_msg.c create mode 100644 drivers/net/cnxk/cnxk_rep_msg.h create mode 100644 drivers/net/cnxk/cnxk_rep_ops.c