From patchwork Mon Feb 20 22:11:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124221 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 CD09041CF1; Mon, 20 Feb 2023 23:11:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7593043105; Mon, 20 Feb 2023 23:11:37 +0100 (CET) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by mails.dpdk.org (Postfix) with ESMTP id EA34840395 for ; Mon, 20 Feb 2023 23:11:35 +0100 (CET) Received: by mail-qv1-f45.google.com with SMTP id y3so2743982qvn.4 for ; Mon, 20 Feb 2023 14:11:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OV33DtmNPm4BsUWZKZpd9tOWrQwZ9Ztp1ZygWbKtae4=; b=c2i2G5n84OsR1+rkutQVZxwEPc2j80IkgBsh/IgOy/ZTLz1IUzRlmDxbx6raBlNxzH 1qiuRQgPIsNHmP65mOGns1thsf1sQvWHSw0GmqnU5CKFEYA2xhsbprWbOgQJyfeaUjun e416Cd+J4C3fItYW1LsrzAvcQGm/8o26qjM23gBLmB3qFZaUxrdAI/7X+/UX8zSwBMUA jqI/xbsuBMU+/4poQM5s5ee/U2YRL/H6V+pj19+mWRauLl9vvgaVya+OkidSItxG8e8g bxmEMukB34bSSSDVIuzrqC8n31Jv+gk/EIq5rj6SMtYMkuTLcVGRRRPVXp4MKt/s38sh qenQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OV33DtmNPm4BsUWZKZpd9tOWrQwZ9Ztp1ZygWbKtae4=; b=3Q434ftfrpwlfzakmSQbKwRPvGvXSjJRZAJHAbYbJAzVKHZGYQp9Rv70IqKYF1FLHv zaEXpKJR0/jfWr1Mw//KgqHGwGhlebu4G0lPgWX/zNThPlNC51Pg6adAQ0pMcO1rXFO2 BnxLF2iOBpwp1tsJB+b0Ib7Fl3DKjSBX92XJGheEFXeSoJBcjO7hiKC9hv0Duvh/N8Xz kJAZMWT404RiisHbBwzRgk+H1B3NFnkQB6ByE4nO16ZtSQnrJLgC4oBeovNcr6WNshxq nWo4ZJT6EJkAR63W/BApfkvDEWbvI5CKmAyiQHWmTg0Vzxx8uQANdoZV372eaEjnPyLH Tc8A== X-Gm-Message-State: AO0yUKW9XudK0vTgY6Mw0RFEEyccgVKdRG2KezvODnv1NB2Y8gP7Mwgb w5kYxseFsJ1rpOsNvQ5TCAGCQcsZQYpgOyCZ X-Google-Smtp-Source: AK7set/glv2naHeTSWYLjCfnnpSXn915UKkZpNWMne9WdUDYCgL/OkDaYHK8pDFWerJH9uBbaa5LZQ== X-Received: by 2002:a05:6214:27e9:b0:56e:9dd8:47f3 with SMTP id jt9-20020a05621427e900b0056e9dd847f3mr2517944qvb.13.1676931094783; Mon, 20 Feb 2023 14:11:34 -0800 (PST) Received: from z690.czeck.local (pool-173-48-111-149.bstnma.fios.verizon.net. [173.48.111.149]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm9757000qkf.100.2023.02.20.14.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 14:11:33 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: stephen@networkplumber.org, John Miller , Shepard Siegel , Anatoly Burakov Subject: [PATCH v3 1/2] net/ark: limited support for secondary processes Date: Mon, 20 Feb 2023 17:11:26 -0500 Message-Id: <20230220221127.2691401-1-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217160039.2487085-1-ed.czeck@atomicrules.com> References: <20230217160039.2487085-1-ed.czeck@atomicrules.com> MIME-Version: 1.0 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 From: John Miller disable fpga device configuration for secondary processes. This is minimum support to avoid unneeded fpga resets Signed-off-by: John Miller Signed-off-by: Ed Czeck --- v2: * Use standard logging v3: * clarify limits on secondary process support --- drivers/net/ark/ark_ethdev.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index b2995427c8..785bb386d7 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -147,6 +147,9 @@ eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, struct rte_eth_dev *eth_dev; int ret; + if (rte_eal_process_type() == RTE_PROC_SECONDARY) + ARK_PMD_LOG(INFO, "ARK probed by secondary process\n"); + eth_dev = rte_eth_dev_pci_allocate(pci_dev, sizeof(struct ark_adapter)); if (eth_dev == NULL) @@ -385,9 +388,11 @@ eth_ark_dev_init(struct rte_eth_dev *dev) 0xcafef00d, ark->sysctrl.t32[4], __func__); /* We are a single function multi-port device. */ - ret = ark_config_device(dev); - if (ret) - return -1; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + ret = ark_config_device(dev); + if (ret) + return -1; + } dev->dev_ops = &ark_eth_dev_ops; dev->rx_queue_count = eth_ark_dev_rx_queue_count; From patchwork Mon Feb 20 22:11:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124222 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 39D8A41CF1; Mon, 20 Feb 2023 23:11:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FC6D4310B; Mon, 20 Feb 2023 23:11:39 +0100 (CET) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by mails.dpdk.org (Postfix) with ESMTP id 835E643106 for ; Mon, 20 Feb 2023 23:11:37 +0100 (CET) Received: by mail-qv1-f54.google.com with SMTP id m4so3769926qvq.3 for ; Mon, 20 Feb 2023 14:11:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mif+zYSiARupRQYx0d8ts35yVCs4oCw4tChIgInuuVk=; b=oFBmTT2l9YB06TLSuMSrnsiO0H4wzvjwQ6hyKXqijRxavYhVQW+qhq+ox412EA53vv Rfju6iD7cssCMiRFOH7dOsANIacooBuwsuWugIy9ldUDrcfG4zVzsItGWNZzfirY1POs 7dtG/ivQENJodpR9423qZygq/RnblwJBtD7M9FlaQM0UGaJ+Dx53Vxadg7s62sqphcBy NQnzeBkVfYZY0INKDEj967kld3DP9UVAkM+/STX+nDgrwVG0YGWL004cRLuhPaYajLr3 uIayFm0eSZy0261EostaHm2frLM7jVur9ai2+Whqrro4C8FpFCGg4y0iMxmWLoDEFr8U v8Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mif+zYSiARupRQYx0d8ts35yVCs4oCw4tChIgInuuVk=; b=MUcV4MB+fA4Q0NXQ77WlPMfL8sHTECMVUS7WM0EyQzZuaMLCsD7GPRgbizEn5jLElT rw6jJbDd5forYtBX0VMsAEtzXPTjAd7xRg7CYCWWv3V+k7jsxUfEDdjcC8jTIDpF95Uz fkzuhsa6vCPXxzVwXHyXjifevQySyAUqplCW54nC8+uxlgB+qXwmbpinzO1/xiGwCjdn 4NiO4ziWdoSMLgO/ELP/OXsNLeXpy8xZsjEaxhwMO5z811p1iORJwFlFqYb5bOPh3AAm 7TPS5mHCJuMyUomquYZ//YxjI5dkkeFojI/5Odi5onO0+zG+/irLR+3PNP/vduHZLMtn u46g== X-Gm-Message-State: AO0yUKXimMxUbMzEfDnb4auiEC/2zjQw18uNZ0i+GBlbgCkTiYP/MVP0 whHAjC3fEj3RITEeKh6Z9S2XR3J8ZFtAGgQz X-Google-Smtp-Source: AK7set8DiMYbtzxI4MUxDW5LMMeHVIqJ3cc7u0yPCDe+Q+k7o3s3FGiwNBMLYNbBzo/86LBXHblKHQ== X-Received: by 2002:a05:6214:528d:b0:56b:edfa:57cc with SMTP id kj13-20020a056214528d00b0056bedfa57ccmr4304737qvb.41.1676931096254; Mon, 20 Feb 2023 14:11:36 -0800 (PST) Received: from z690.czeck.local (pool-173-48-111-149.bstnma.fios.verizon.net. [173.48.111.149]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm9757000qkf.100.2023.02.20.14.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 14:11:35 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: stephen@networkplumber.org, Shepard Siegel , John Miller Subject: [PATCH v3 2/2] net/ark: support for single function with multiple port Date: Mon, 20 Feb 2023 17:11:27 -0500 Message-Id: <20230220221127.2691401-2-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230220221127.2691401-1-ed.czeck@atomicrules.com> References: <20230217160039.2487085-1-ed.czeck@atomicrules.com> <20230220221127.2691401-1-ed.czeck@atomicrules.com> MIME-Version: 1.0 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 Allows the creation of multiple ports from one ark device via the use of ark pmd extension, though the splitting of queues Add unique dev_private data for each port. Signed-off-by: Ed Czeck --- v3: * Backport to LTS version is not recommended since firmware changes are required and limited * remove unused num_queues field from struct ark_adapter --- drivers/net/ark/ark_ethdev.c | 15 ++++++++++++++- drivers/net/ark/ark_ethdev_rx.c | 6 +++--- drivers/net/ark/ark_ethdev_tx.c | 2 +- drivers/net/ark/ark_global.h | 3 +++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 785bb386d7..7077a144de 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -303,6 +303,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) int ret; int port_count = 1; int p; + uint16_t num_queues; bool rqpacing = false; ark->eth_dev = dev; @@ -432,6 +433,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) ark->user_ext.dev_get_port_count(dev, ark->user_data[dev->data->port_id]); ark->num_ports = port_count; + num_queues = ark_api_num_queues_per_port(ark->mpurx.v, port_count); for (p = 0; p < port_count; p++) { struct rte_eth_dev *eth_dev; @@ -457,7 +459,18 @@ eth_ark_dev_init(struct rte_eth_dev *dev) } eth_dev->device = &pci_dev->device; - eth_dev->data->dev_private = ark; + /* Device requires new dev_private data */ + eth_dev->data->dev_private = + rte_zmalloc_socket(name, + sizeof(struct ark_adapter), + RTE_CACHE_LINE_SIZE, + rte_socket_id()); + + memcpy(eth_dev->data->dev_private, ark, + sizeof(struct ark_adapter)); + ark = eth_dev->data->dev_private; + ark->qbase = p * num_queues; + eth_dev->dev_ops = ark->eth_dev->dev_ops; eth_dev->tx_pkt_burst = ark->eth_dev->tx_pkt_burst; eth_dev->rx_pkt_burst = ark->eth_dev->rx_pkt_burst; diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index cbc0416bc2..38bc69dff4 100644 --- a/drivers/net/ark/ark_ethdev_rx.c +++ b/drivers/net/ark/ark_ethdev_rx.c @@ -68,7 +68,7 @@ struct ark_rx_queue { static int eth_ark_rx_hw_setup(struct rte_eth_dev *dev, struct ark_rx_queue *queue, - uint16_t rx_queue_id __rte_unused, uint16_t rx_queue_idx) + uint16_t rx_queue_idx) { rte_iova_t queue_base; rte_iova_t phys_addr_q_base; @@ -124,7 +124,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, uint32_t i; int status; - int qidx = queue_idx; + int qidx = ark->qbase + queue_idx; /* We may already be setup, free memory prior to re-allocation */ if (dev->data->rx_queues[queue_idx] != NULL) { @@ -215,7 +215,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, } /* MPU Setup */ if (status == 0) - status = eth_ark_rx_hw_setup(dev, queue, qidx, queue_idx); + status = eth_ark_rx_hw_setup(dev, queue, queue_idx); if (unlikely(status != 0)) { struct rte_mbuf **mbuf; diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c index 5940a592a2..4792754f19 100644 --- a/drivers/net/ark/ark_ethdev_tx.c +++ b/drivers/net/ark/ark_ethdev_tx.c @@ -229,7 +229,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev, struct ark_tx_queue *queue; int status; - int qidx = queue_idx; + int qidx = ark->qbase + queue_idx; if (!rte_is_power_of_2(nb_desc)) { ARK_PMD_LOG(ERR, diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h index 71d0b53e03..2f198edfe4 100644 --- a/drivers/net/ark/ark_global.h +++ b/drivers/net/ark/ark_global.h @@ -112,7 +112,10 @@ struct ark_adapter { ark_pkt_chkr_t pc; ark_pkt_dir_t pd; + /* For single function, multiple ports */ int num_ports; + uint16_t qbase; + bool isvf; /* Packet generator/checker args */