From patchwork Fri Feb 17 21:59:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124138 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 B5E3F41CC4; Fri, 17 Feb 2023 22:59:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9011940F18; Fri, 17 Feb 2023 22:59:30 +0100 (CET) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mails.dpdk.org (Postfix) with ESMTP id CE78240EE3 for ; Fri, 17 Feb 2023 22:59:28 +0100 (CET) Received: by mail-qt1-f175.google.com with SMTP id r6so2131416qtx.10 for ; Fri, 17 Feb 2023 13:59:28 -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=QmTzqMem0FzNrNF522PJnU3Cu7oGAAMXleMtlUhmjcI=; b=w2YdB/aHEtyotMF3MqjYtSpGcsFaJPEMXyWTFCZue7q1xoSX7fAN8v81DRhaajb6+x bQXf4lAEYyQEDQ/cqCVeu/b648f/VF6S+Vznecdf+DyBy/Y2D6tmiYv7MhWCR9LrYUFJ fjubWHhyDuVUjWKPmkhXYcIR5T11fJ4Eol801rsQCDvK+muJH8RrZkEyzUX8PdKcfxu4 h29QI5sVqs9+rDGuaCp4Geax3wcmn2inUj7LGzhzVfMlkPGJo3cVfd0sUngUThPcyS8t mXXDolMpbgnRJvljz1EpE1/hp+DZ1dzA0Dma6BppvVF1NTJbeKintIMp/3GA21AVo1bw bC0w== 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=QmTzqMem0FzNrNF522PJnU3Cu7oGAAMXleMtlUhmjcI=; b=QupfNN9WQQPJEZaxop8mBftU2GO9L9kefPi++8MXsYjz8YcSgBCJmGB4TVXew7fsQz xJiYtL39zhwWm6Woocb0wCORKRZFuxOyresWa15dwwGCuKV/CeB/BDMYJxq7PopSl7YO LdfiXX28ru9vpFgpXaWy//Gdd26jd0+Ll+yk/Qu75dy5RhoOltacxqFbPEbzG3Ag2jT4 O22MnDVp+Vk33npzHqzBNQ39QmfIy+X/OaMbaM9n+G9p6goDFapHhWduH00zrqSA2J0G WLmDlKgO3NsEjXvoPFEigtiPNktaXPVAjS/0Rchr0g9dAUxZD7gDawDivNMAb+8xYJY7 BIDw== X-Gm-Message-State: AO0yUKVKyFSzfVOCvq4qqdNYsyRqJqi07zzFEH0dvJ7VUrFq0BO4t2Rh FJ98/xjTSOqB9XtwuL48X0wK3VtvjXP9eWrH X-Google-Smtp-Source: AK7set+J/AiGGYepIBPu+UVEq20/KRFdGUc5sNK5TucYzU5D/crvLYIJqWy2um/8lilm6j4Ii5076w== X-Received: by 2002:a05:622a:1104:b0:3b8:4adb:c604 with SMTP id e4-20020a05622a110400b003b84adbc604mr269qty.14.1676671167451; Fri, 17 Feb 2023 13:59:27 -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 m126-20020a378a84000000b0073b587194d0sm4029328qkd.104.2023.02.17.13.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 13:59:26 -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 v2 1/3] net/ark: support secondary process Date: Fri, 17 Feb 2023 16:59:21 -0500 Message-Id: <20230217215923.2561685-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 device configuration for secondary processes Signed-off-by: John Miller --- v2: * Use standard logging --- 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..d237e80cf4 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(DEBUG, "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 21:59:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124139 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 037FF41CC4; Fri, 17 Feb 2023 22:59:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB7B541138; Fri, 17 Feb 2023 22:59:31 +0100 (CET) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mails.dpdk.org (Postfix) with ESMTP id 774A840EE3 for ; Fri, 17 Feb 2023 22:59:30 +0100 (CET) Received: by mail-qt1-f175.google.com with SMTP id bc7so2045594qtb.0 for ; Fri, 17 Feb 2023 13:59:30 -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=2EK2tKwRgWGcc255IDMKctYU1AkNMLdJOpkyeK6Lyro=; b=Jde+11ax0darXYqGj7bkiEUZfLys4FhSmVey9CfoUpdqlFQ3TLzvz0IXfigQ0eHMim UDeQqMORIw4zOT6R0/csxt6WHsXMCbAIqprzZW9eHFecTpLHW+OQkSmdG9DKe9cCaRml zaMOhM8iQV8KI4/VtAw63LC5IieObJBo5f66jMtCDbnXeNe1xzmaMPRel+zDFGZwDex7 BgO6PHgSwbIK6vam6syp3IzFmslvG2F4/1c5H+BcnqhWNcbOSsB/2V9ss2bKvxD07V6s SknJu5qaKCxbZPc414BxIRZI2wThUSf8piwZMdAU50KFVUvST5wFaxTPSk0G//wF0EOW lz2g== 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=2EK2tKwRgWGcc255IDMKctYU1AkNMLdJOpkyeK6Lyro=; b=Gu3dJpIxkLQHNPVygVgfhhJYM0yFg2Ejj4BOlNDM3dSc3FtBjdHXPtEPtfhewwMdl0 WDRmTBhP7dA4VUuPyJrsn+dmPjLnvi0cb1ExCawv+VoMX2ucLSJYVZy+b/ZwDCIDRNbu XboCOOP16LEGBIXS6N87vfpbiZD1wOT5v0CUgmUYdzzp48JgKdWV0EGmXrg7ml8/MRLF T5wuHiMhMCCz9lHfU2gFAPVNEM9/7SCTD9Y1oyvero/S4KWRwp4Bn+un5PVBO6hHH18A 5dmqh3KwipamzMUlOSlS6cWI+53lzww1LAlL9JdzqwIWsfJu3/K24pG6MciIILHdEL8R ATpw== X-Gm-Message-State: AO0yUKVtR7Ha7maMO7g14jEgts042cQAa0Ej8hG8q4I6a/lSjzWJUh0O EER/tjq0UVRm5pL+m4M5lRSSkqtbZuFrde3q X-Google-Smtp-Source: AK7set+F8T/cOi8d6hQFEaqGR6G7fg+BeV2xAAKA7juHy5Mmjt8EicVt7vMMODiqJKlOcSl2xY4kyw== X-Received: by 2002:a05:622a:1194:b0:3ba:266f:103b with SMTP id m20-20020a05622a119400b003ba266f103bmr3466761qtk.47.1676671169369; Fri, 17 Feb 2023 13:59:29 -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 m126-20020a378a84000000b0073b587194d0sm4029328qkd.104.2023.02.17.13.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 13:59:28 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: stephen@networkplumber.org, Shepard Siegel , John Miller Subject: [PATCH v2 2/3] net/ark: support for single function with multiple port Date: Fri, 17 Feb 2023 16:59:22 -0500 Message-Id: <20230217215923.2561685-2-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217215923.2561685-1-ed.czeck@atomicrules.com> References: <20230217160039.2487085-1-ed.czeck@atomicrules.com> <20230217215923.2561685-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 d237e80cf4..96d0c2b0f0 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 21:59:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Czeck X-Patchwork-Id: 124140 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 9ECB241CC4; Fri, 17 Feb 2023 22:59:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBDA541611; Fri, 17 Feb 2023 22:59:33 +0100 (CET) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mails.dpdk.org (Postfix) with ESMTP id EE54441141 for ; Fri, 17 Feb 2023 22:59:31 +0100 (CET) Received: by mail-qt1-f175.google.com with SMTP id r6so2131507qtx.10 for ; Fri, 17 Feb 2023 13:59:31 -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=c4IWdJFwYnergjPZw1qFObMqN+KdP18tyOspeVVD7JA=; b=WVt9FdI151uGOLdWmWU44bKWbOL3Gvn+7MNqAZPS467p/2cI/m+Lhi9zeFW7CRq0q6 sDqmfzHuW6/Vm0k5GruJhXRZfus7wL+uAmnLTm/FD5riPQK3T6a8hd04wPXvjDlwgKMw /wLDjQy3e0NBiKz2JOxucvdzlg74+BmUj2yjjUz/dgdVmjL2HcRGtqGba+ftXSReLG79 WRwDNoMd+4VjgYBxvhaqSCrFzxaBLBiioMftRLvinhoY2WVFb8Tijv4rICZh9vvHcJ6/ qnIQeKsCq3uWQvREkc5U13Jz/LjUhpHmbx6HMYgrmAxC5jvs/5gYSTayAVcbN5gF8N/K WFgQ== 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=c4IWdJFwYnergjPZw1qFObMqN+KdP18tyOspeVVD7JA=; b=x1pr0t5b+GCPIUElE5DyC8fE25xjaIip5PedfkBA+zxENNEvzMKKslxENyBM6VmdWp gq25fOAwitV7ObsHRJtufZ41dg1GxA2Y60kRmuCI25eAaYHCyk21LUMk14UTX9fp9g/w LH53ZxL8FjZe3kuYg1h1B82Dtk650E6EnZwYQKHkDi4V+cZFlVivFq/xODGO21SbBCtL 3yI76b2Cxm8UGnFFx6cgcGPbfB6DKSm5x03WXZKtFJvHatfzDmwdxyvvSNGSsoV8CQYa FaLohtPmCXoDufD/o4x8RoFBZVlGQOq7HDSc3oNjIEikespduHY15lzAJ2O7I6T67GsZ ILaw== X-Gm-Message-State: AO0yUKV+Q9MmyvKKM4PNMJRlDnZ7j8z8yHFrxjUHMVGyNf10ID4Bpx09 0kKULRk7qjItw3z5m2lM0cxU41rSkNHiesLr X-Google-Smtp-Source: AK7set8LrJccqDW+yQxFGtHvA5sdha6jPZCxtmX/vkBMfUv4YaKl4gQ/L+o4p/WXd+3AEq3MD6RSZQ== X-Received: by 2002:ac8:5a43:0:b0:3b8:3391:bde5 with SMTP id o3-20020ac85a43000000b003b83391bde5mr4944716qta.26.1676671170925; Fri, 17 Feb 2023 13:59:30 -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 m126-20020a378a84000000b0073b587194d0sm4029328qkd.104.2023.02.17.13.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 13:59:30 -0800 (PST) From: Ed Czeck To: dev@dpdk.org, ferruh.yigit@amd.com Cc: stephen@networkplumber.org, Shepard Siegel , John Miller Subject: [PATCH v2 3/3] net/ark: resize data field to match fpga access Date: Fri, 17 Feb 2023 16:59:23 -0500 Message-Id: <20230217215923.2561685-3-ed.czeck@atomicrules.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230217215923.2561685-1-ed.czeck@atomicrules.com> References: <20230217160039.2487085-1-ed.czeck@atomicrules.com> <20230217215923.2561685-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 accesses 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;