From patchwork Fri Feb 17 15:47:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124125 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 C05D241CC1; Fri, 17 Feb 2023 16:48:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5835340EE3; Fri, 17 Feb 2023 16:48:08 +0100 (CET) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by mails.dpdk.org (Postfix) with ESMTP id D1EA440EE1 for ; Fri, 17 Feb 2023 16:48:07 +0100 (CET) Received: by mail-qv1-f42.google.com with SMTP id fn4so776000qvb.12 for ; Fri, 17 Feb 2023 07:48:07 -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:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FqQjCru+Men6Cl9eZ9QW3zP7vhgpg2FxEGvPPXFQMLU=; b=1uxxPHrQ1GROKOV4IDYpg97hIWELgAIB/j29GttXC1S9c8J0j8NowwdSE4OO2+2g6P z8Ux11P1bOxlQUjv8lTHSXQ+TZ7+52ThbeHkmAhmYNa8/gSonDafVLCFBrlIZEG/lLa0 F5eKHH3+VRAJpWQquGe8jRxFIV2RPj1rbOQYL1ycr0xJ+zM0aVvJRYdPJqpWuaZtils8 50L98+2oYJrGJDXiNYzAVATRHBJWfwJ4/2H5OMqDfJBvvl1523h+/0NTpHbcE8OxjAjg woKuAmXcsFoEd+Q+evHEYyv7P4t4HZkMzgA5Qe0gYSX9P/Y5K7bFAgosC+hAqL5edehP DZUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FqQjCru+Men6Cl9eZ9QW3zP7vhgpg2FxEGvPPXFQMLU=; b=rj4ZUq9tVZFmzP5taZoRo0TfuIl539fke/hWjdsmNRHmiGNTfNpmp/yat/H2k4JJGc uyzBJUtVkWNLQNqqVSimUC4uSiSiqxJt/Gaw4tp1Jfazn2EaoHXuHjCESyqyupG2GM3r 1CAc+0lRY0eheV2Pqy0alkk42YEUjDyIW+JlnV1czspdWwGQ4G9lJ9TlIdBaysfvr8Nr axRbPmRq3LsOREYGjamC229DywFUH4IRXH5Ke4gufUpTkz3mcBTlJRRUDkamW+Phe2+N 0jfqQUV/2tO3GLwNaOvHf+x/GErW4W4nIdKUqMMg1ORuJYPYX9Y1cudAYZ8b+Lb8uQyz MrkA== X-Gm-Message-State: AO0yUKWCCduBPTXGSA1DKQoX8n169XuvbA6MMcFrERObZLz2u8+Ck2P8 Nd4DciK4wBQom2tENKek6Ipv6n6aDEAgUVxk X-Google-Smtp-Source: AK7set9Ecx6E0lyMv9KGkUvTGbepoYdjfdm98tpkFkGaKU3qDnU6vqoJ5FW4PPkBM0cTPErMcYc5BQ== X-Received: by 2002:a05:6214:5091:b0:56c:4c11:553 with SMTP id kk17-20020a056214509100b0056c4c110553mr9127528qvb.19.1676648886606; Fri, 17 Feb 2023 07:48:06 -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 o73-20020a37414c000000b007195af894e7sm3440904qka.76.2023.02.17.07.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 07:48:05 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: John Miller , Shepard Siegel , Anatoly Burakov Subject: [PATCH 1/3] net/ark: support secondary process Date: Fri, 17 Feb 2023 10:47:56 -0500 Message-Id: <20230217154759.2484937-1-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 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 device configuration for secondary processes Signed-off-by: John Miller --- 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..f96722551e 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) + fprintf(stderr, "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 Fri Feb 17 15:47:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124126 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 42DEB41CC1; Fri, 17 Feb 2023 16:48:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1DA042D10; Fri, 17 Feb 2023 16:48:10 +0100 (CET) Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by mails.dpdk.org (Postfix) with ESMTP id 46C1A4161A for ; Fri, 17 Feb 2023 16:48:09 +0100 (CET) Received: by mail-qv1-f51.google.com with SMTP id c10so1499549qvp.4 for ; Fri, 17 Feb 2023 07:48:09 -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=Za96cy54hNnpA2RBCW5VRodHJ7t0VdB4hm0NFPKEBa8=; b=Py0HHUiMDZvehRuauXVQj331aVGiItGdjd9Ft+Nt7ErrcDgHP4btNc9FLZPqaaqtBF lZIZKC9+rPm0SYrEbnnIERCRoqvH+GTiRC6jK5NB4fVR7cyT1umaKI0IyLPj5W/a1rFA uVGQRTWZTq39+J+PvfgJb88jkVFZtReWJwHP0U9zKh6+UNdSfUqOr1vJ20K8CKHAfnR5 y2xIJy7exXJzy88uE6v1hkxAm133IPX3Sg1M7Zi1M+lt+oUDMroKpY+cRFozH3skUy66 u9KzEZOxJH04xhh5vUjDP3/yGm6QAGZ6QL+4UDIhA0DoAkHcbDZ5jTvBrlnIbYlvA9pR P6iw== 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=Za96cy54hNnpA2RBCW5VRodHJ7t0VdB4hm0NFPKEBa8=; b=m/zDSz1jmhLLGyKKJ59cg7j1etSCf8vKbW4BIsf093hxR58POp4WNTy6K7wsIh1TAy Q1f2tX+LFutTqrT0GvS3C4OIt6kGJNLySVT0hkudtkX3bWJMBpJZbT9Rnmjc7SgkydyJ 7UGEqeZAHmNRQPclfBx1JKfz8RukO3tyBS91AJSRc7OMZNsdXIOXV3FgYcfZaemJGO8A 3xQX6xlvU0YUdqj5F4XmqJHUojkT5/qE3ylhTTkZmaMIjOw8G8sxpcK8M93N2VsA70Bv B6cXghHha6DdVc17bao7X+BkcbM42FXvv4ihHk3wHOg5vg+wkJMM/xYpAGYZa4gOz8ki d5lA== X-Gm-Message-State: AO0yUKUrmhdFNYFQxSxbKqVSw/eSDcgtChkFlSWF15cork8oiZS6DDHF vS584FLY5LZ+bXl1ls7hGLQgVgeH0fmX/Ik6 X-Google-Smtp-Source: AK7set8v+CSHL410eKHOTma8IORynyz1BdEaoMg3fDVSYlOPVTj25odoBd3KkDO+0FagZ7m7Hze+gQ== X-Received: by 2002:a05:6214:528d:b0:56e:ace7:6a03 with SMTP id kj13-20020a056214528d00b0056eace76a03mr9667913qvb.6.1676648887961; Fri, 17 Feb 2023 07:48:07 -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 o73-20020a37414c000000b007195af894e7sm3440904qka.76.2023.02.17.07.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 07:48:07 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: Shepard Siegel , John Miller Subject: [PATCH 2/3] net/ark: support for single function with multiple port Date: Fri, 17 Feb 2023 10:47:57 -0500 Message-Id: <20230217154759.2484937-2-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217154759.2484937-1-ed.czeck@atomicrules.com> References: <20230217154759.2484937-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 --- drivers/net/ark/ark_ethdev.c | 14 +++++++++++++- drivers/net/ark/ark_ethdev_rx.c | 6 +++--- drivers/net/ark/ark_ethdev_tx.c | 2 +- drivers/net/ark/ark_global.h | 4 ++++ 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index f96722551e..2fff3cd6ba 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -432,6 +432,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; + ark->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 +458,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 * ark->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..176fbcda17 100644 --- a/drivers/net/ark/ark_global.h +++ b/drivers/net/ark/ark_global.h @@ -112,7 +112,11 @@ struct ark_adapter { ark_pkt_chkr_t pc; ark_pkt_dir_t pd; + /* For single function, multiple ports */ int num_ports; + uint16_t qbase; + uint16_t num_queues; + bool isvf; /* Packet generator/checker args */ From patchwork Fri Feb 17 15:47:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124127 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 4451841CC1; Fri, 17 Feb 2023 16:48:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0476042BB1; Fri, 17 Feb 2023 16:48:13 +0100 (CET) Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) by mails.dpdk.org (Postfix) with ESMTP id CB93742D13 for ; Fri, 17 Feb 2023 16:48:10 +0100 (CET) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-536566d7b16so19124617b3.8 for ; Fri, 17 Feb 2023 07:48:10 -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=kwETrE+7os5Fo0rV8c1H2ObirBpNui0V+mi/fXWIJi4=; b=GSyjBogOXktwwT701FvpLxdjgELcwFz7Lg0gtXAnwqkkiVymZqHFadfTDMmGhOAxBb WGkpTvcSLI00NKnROTWKIyZthPFgz2aoguo8uuzIqzcLjCGbWEU4cYvMVKvQ2A6rIS/N todwY30U89IC7u4+DtJrrHe5ImrwZ+WHPWqpj+yG9wcAyhP0Xk4oaQSNs99Vhm+60k+F TcdFvEjv+3l9Kn/52ksp6dPphc/nJeqWGtm3TFGIyIx+n++UglcQipAfK9GVayCHzPiW tkSW3yoUal0zT84AhQJZJEBhFnKSgiFbrrp1lOpea1xBTMq23q3uHFUap0Mz4bi1IzWw AfIQ== 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=kwETrE+7os5Fo0rV8c1H2ObirBpNui0V+mi/fXWIJi4=; b=zNKo1LqJDrqlKDGOhYdzPG/+8ECDBognz2rYdRfXVyV4YltpZw/Lqy5pozcETUY79L YUMJp/aR8SOZnx/2wgJ+lRA4x2ohSiJIce2Z9VpuZR/GNshL14XmHe/UyWVJ3aR3sQWc Ssxh3dNw7lCjnvkF8+ETflNgwKnITWSxQG4HujBoXOjiDJoaU6Hg1tXDp+8BwvgSAT/1 qL9oNguX//p/rqdg7LfIW7m9VeCWtQQMDzUcjv8o2UzBy/ynUXL/wmEJAWZ6LzWxyGeL f0ZhuHzEtQ7KfwyifGR2TdhiGKm6Mg+QtNnH3eHtNm4lGlTXTaz8Yy9L2YQdUA0IAO60 EsZw== X-Gm-Message-State: AO0yUKXeIm/FYdMJ8PklcBqB60LIVRui+g8z6cr6g0+80RAjSujfvEoy ha8Vv2ia5ebvRPJHU2aibgGcm/RhnRoQ5tA9 X-Google-Smtp-Source: AK7set9Lm62QR+ZlCRc0bRFANMjd42EUqMjfI48fDYSoyCX2L6fAyLmfaDOE6CrWdb9fmwxJxHmTPg== X-Received: by 2002:a81:85c3:0:b0:533:8ac3:1602 with SMTP id v186-20020a8185c3000000b005338ac31602mr5037260ywf.27.1676648889586; Fri, 17 Feb 2023 07:48:09 -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 o73-20020a37414c000000b007195af894e7sm3440904qka.76.2023.02.17.07.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 07:48:08 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: Shepard Siegel , John Miller Subject: [PATCH 3/3] net/ark: resize data field to match fpga access Date: Fri, 17 Feb 2023 10:47:58 -0500 Message-Id: <20230217154759.2484937-3-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217154759.2484937-1-ed.czeck@atomicrules.com> References: <20230217154759.2484937-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 all fpga acces are multiples of 4 bytes Signed-off-by: Ed Czeck --- drivers/net/ark/ark_mpu.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ark/ark_mpu.h b/drivers/net/ark/ark_mpu.h index 9d2b70d35f..10842ba484 100644 --- a/drivers/net/ark/ark_mpu.h +++ b/drivers/net/ark/ark_mpu.h @@ -39,8 +39,7 @@ struct ark_mpu_id_t { #define ARK_MPU_HW 0x010 struct ark_mpu_hw_t { - uint16_t num_queues; - uint16_t reserved; + uint32_t num_queues; uint32_t hw_depth; uint32_t obj_size; uint32_t obj_per_mrr;