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 546CFA054D; Tue, 7 Jun 2022 17:50:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B6F44282A; Tue, 7 Jun 2022 17:49:46 +0200 (CEST) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by mails.dpdk.org (Postfix) with ESMTP id 2343641153 for ; Tue, 7 Jun 2022 17:49:43 +0200 (CEST) Received: by mail-qk1-f176.google.com with SMTP id n197so6440563qke.1 for ; Tue, 07 Jun 2022 08:49:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5mwpz7O+AH+JWA+TdOThhylx8qHeN2AS1FhOvmiGgFQ=; b=rx7KQae6yZjIhsSN0kXcmgwi4zIJm36PgdkA+/gPCKNfdL+D55DIWjyJmL4ZdWZ10Y iHBzQoiOprkzi9DTbmyvQe00pB4BZnCwC8TcqrrCqzsMhyb28UTduFQ8Dc9iouWXC6eT V/xxOXzT+lE0sz1m+fGgxKUcjoArnCH84FfHBZ2Cwm0Z3UUujvn2Zy6zmv+onrpIjBXN mSV+SNZwckFqyftWcVMAamlQUz61Oircsln5YKjVcSRr+Pjs97QY0p0U73xNy1U2KUS/ 81ESyGQO+4BlI8os43A6cNVtUTJmbDtK8uYdpMHwpUvjvKbqEWbxrxLPWeHBs4mD/eJ8 AlWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5mwpz7O+AH+JWA+TdOThhylx8qHeN2AS1FhOvmiGgFQ=; b=OIq1j73ZTyAIs2PTILIsWlHOAnUGuEB185Ww/+j8ICNvDJTnHz4usReBZjg+myou25 dyIyUvw8otodQM918g8nRnOsU3HLFxjlW1nzb4jj/wKMOU8/uCnArETr+jvYhg8hqGqP Ffjm9RUgDxu4p8S4UNAitTTuQLwWDU/9YntrLsKsLJK1L1uPgY+Kt/ni88OP1ELMdHeb RqIZNrSy4htFd5CK3txQOdPywqfek92ecUNRrMQhxiN6fm/F4PeSCaWeveOxK7N1g9po imV9jJg+4GUjH3EWttcyya9lWK1x/wXgCyCzMu9rodx1ZsZackV5xXzLizAsYaqSpzbm fcag== X-Gm-Message-State: AOAM532Tocx6UhJYmz5Ha8kCovaLgvNGp5oDvyqCBr6mwdneVxkaqXQc 9xUqIVqTJh1Mf7fX7YTKWh4Hnt3afDKqZA== X-Google-Smtp-Source: ABdhPJzQ2ZyD8qn+V022erpPBoXta2Ng7GFnlLdTJx/yMx7Sua3JEFQ0KuIXE7B4H1CxG0n/VW3oQQ== X-Received: by 2002:a37:42d3:0:b0:69c:830d:6e51 with SMTP id p202-20020a3742d3000000b0069c830d6e51mr20413543qka.302.1654616982369; Tue, 07 Jun 2022 08:49:42 -0700 (PDT) Received: from z390.czeck.local (pool-173-48-102-189.bstnma.fios.verizon.net. [173.48.102.189]) by smtp.gmail.com with ESMTPSA id e185-20020a3769c2000000b006a5d4f32e5dsm14030266qkc.128.2022.06.07.08.49.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 08:49:41 -0700 (PDT) From: Ed Czeck To: dev@dpdk.org Cc: ferruh.yigit@xilinx.com, ktraynor@redhat.com, bluca@debian.org, Shepard Siegel , John Miller Subject: [PATCH v3 7/7] net/ark: add PMD support for devices as virtual functions Date: Tue, 7 Jun 2022 11:49:17 -0400 Message-Id: <20220607154917.1871118-7-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220607154917.1871118-1-ed.czeck@atomicrules.com> References: <20220502212232.1283-1-ed.czeck@atomicrules.com> <20220607154917.1871118-1-ed.czeck@atomicrules.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 capabilities field isvf to dev struct Disable configuration calls as required by vf Signed-off-by: Ed Czeck --- v2: feature Arkville vf support in release notes v3: feature new PCI device ids in release notes --- doc/guides/rel_notes/release_22_07.rst | 5 ++ drivers/net/ark/ark_ethdev.c | 83 +++++++++++++++----------- drivers/net/ark/ark_global.h | 1 + 3 files changed, 54 insertions(+), 35 deletions(-) diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst index e49cacecef..4b90293f14 100644 --- a/doc/guides/rel_notes/release_22_07.rst +++ b/doc/guides/rel_notes/release_22_07.rst @@ -104,6 +104,11 @@ New Features * ``RTE_EVENT_QUEUE_ATTR_WEIGHT`` * ``RTE_EVENT_QUEUE_ATTR_AFFINITY`` +* **Updated Atomic Rules' Arkville PMD.** + + Added support for Atomic Rules PCI device IDs ``0x101a, 0x101b, 0x101c``. + + Added PMD support for virtual functions and vfio_pci driver. Removed Items ------------- diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 377631e66e..e8e4092be6 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -113,28 +113,29 @@ static const struct rte_pci_id pci_id_ark_map[] = { */ struct ark_caps { bool rqpacing; + bool isvf; }; struct ark_dev_caps { uint32_t device_id; struct ark_caps caps; }; -#define SET_DEV_CAPS(id, rqp) \ - {id, {.rqpacing = rqp} } +#define SET_DEV_CAPS(id, rqp, vf) \ + {id, {.rqpacing = rqp, .isvf = vf} } static const struct ark_dev_caps ark_device_caps[] = { - SET_DEV_CAPS(0x100d, true), - SET_DEV_CAPS(0x100e, true), - SET_DEV_CAPS(0x100f, true), - SET_DEV_CAPS(0x1010, false), - SET_DEV_CAPS(0x1017, true), - SET_DEV_CAPS(0x1018, true), - SET_DEV_CAPS(0x1019, true), - SET_DEV_CAPS(0x101a, true), - SET_DEV_CAPS(0x101b, true), - SET_DEV_CAPS(0x101c, false), - SET_DEV_CAPS(0x101e, false), - SET_DEV_CAPS(0x101f, false), + SET_DEV_CAPS(0x100d, true, false), + SET_DEV_CAPS(0x100e, true, false), + SET_DEV_CAPS(0x100f, true, false), + SET_DEV_CAPS(0x1010, false, false), + SET_DEV_CAPS(0x1017, true, false), + SET_DEV_CAPS(0x1018, true, false), + SET_DEV_CAPS(0x1019, true, false), + SET_DEV_CAPS(0x101a, true, false), + SET_DEV_CAPS(0x101b, true, false), + SET_DEV_CAPS(0x101c, true, true), + SET_DEV_CAPS(0x101e, false, false), + SET_DEV_CAPS(0x101f, false, false), {.device_id = 0,} }; @@ -317,6 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) while (ark_device_caps[p].device_id != 0) { if (pci_dev->id.device_id == ark_device_caps[p].device_id) { rqpacing = ark_device_caps[p].caps.rqpacing; + ark->isvf = ark_device_caps[p].caps.isvf; break; } p++; @@ -498,20 +500,21 @@ ark_config_device(struct rte_eth_dev *dev) * Make sure that the packet director, generator and checker are in a * known state */ - ark->start_pg = 0; - ark->pg_running = 0; - ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1); - if (ark->pg == NULL) - return -1; - ark_pktgen_reset(ark->pg); - ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1); - if (ark->pc == NULL) - return -1; - ark_pktchkr_stop(ark->pc); - ark->pd = ark_pktdir_init(ark->pktdir.v); - if (ark->pd == NULL) - return -1; - + if (!ark->isvf) { + ark->start_pg = 0; + ark->pg_running = 0; + ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1); + if (ark->pg == NULL) + return -1; + ark_pktgen_reset(ark->pg); + ark->pc = ark_pktchkr_init(ark->pktchkr.v, 0, 1); + if (ark->pc == NULL) + return -1; + ark_pktchkr_stop(ark->pc); + ark->pd = ark_pktdir_init(ark->pktdir.v); + if (ark->pd == NULL) + return -1; + } /* Verify HW */ if (ark_udm_verify(ark->udm.v)) return -1; @@ -533,7 +536,7 @@ ark_config_device(struct rte_eth_dev *dev) mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET); } - if (ark->rqpacing) + if (!ark->isvf && ark->rqpacing) ark_rqp_stats_reset(ark->rqpacing); return 0; @@ -551,8 +554,10 @@ eth_ark_dev_uninit(struct rte_eth_dev *dev) ark->user_ext.dev_uninit(dev, ark->user_data[dev->data->port_id]); - ark_pktgen_uninit(ark->pg); - ark_pktchkr_uninit(ark->pc); + if (!ark->isvf) { + ark_pktgen_uninit(ark->pg); + ark_pktchkr_uninit(ark->pc); + } return 0; } @@ -588,10 +593,10 @@ eth_ark_dev_start(struct rte_eth_dev *dev) dev->rx_pkt_burst = ð_ark_recv_pkts; dev->tx_pkt_burst = ð_ark_xmit_pkts; - if (ark->start_pg) + if (!ark->isvf && ark->start_pg) ark_pktchkr_run(ark->pc); - if (ark->start_pg && !ark->pg_running) { + if (!ark->isvf && ark->start_pg && !ark->pg_running) { pthread_t thread; /* Delay packet generatpr start allow the hardware to be ready @@ -635,7 +640,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) ark->user_data[dev->data->port_id]); /* Stop the packet generator */ - if (ark->start_pg && ark->pg_running) { + if (!ark->isvf && ark->start_pg && ark->pg_running) { ark_pktgen_pause(ark->pg); ark->pg_running = 0; } @@ -665,7 +670,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev) eth_ark_rx_dump_queue(dev, i, __func__); /* Stop the packet checker if it is running */ - if (ark->start_pg) { + if (!ark->isvf && ark->start_pg) { ark_pktchkr_dump_stats(ark->pc); ark_pktchkr_stop(ark->pc); } @@ -694,6 +699,10 @@ eth_ark_dev_close(struct rte_eth_dev *dev) if (ark->rqpacing) ark_rqp_dump(ark->rqpacing); + /* return to power-on state */ + if (ark->pd) + ark_pktdir_setup(ark->pd, ARK_PKT_DIR_INIT_VAL); + for (i = 0; i < dev->data->nb_tx_queues; i++) { eth_ark_tx_queue_release(dev->data->tx_queues[i]); dev->data->tx_queues[i] = 0; @@ -978,6 +987,10 @@ eth_ark_check_args(struct ark_adapter *ark, const char *params) goto free_kvlist; } + if (ark->isvf) { + ret = 0; + goto free_kvlist; + } ARK_PMD_LOG(INFO, "packet director set to 0x%x\n", ark->pkt_dir_v); /* Setup the packet director */ ark_pktdir_setup(ark->pd, ark->pkt_dir_v); diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h index 3c3a712bc8..748db590c1 100644 --- a/drivers/net/ark/ark_global.h +++ b/drivers/net/ark/ark_global.h @@ -113,6 +113,7 @@ struct ark_adapter { ark_pkt_dir_t pd; int num_ports; + bool isvf; /* Packet generator/checker args */ char pkt_gen_args[ARK_MAX_ARG_LEN]; -- 2.25.1