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 29276A00C2; Wed, 19 Jan 2022 20:13:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2F8E4122E; Wed, 19 Jan 2022 20:13:13 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 3FFE741229 for ; Wed, 19 Jan 2022 20:13:12 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id c3so3115953pls.5 for ; Wed, 19 Jan 2022 11:13:12 -0800 (PST) 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=MvvomVVCPtyzO8zbs7u6ncn4HVWVVhueldJWqg0c3/Y=; b=YSgp2scGaNp5tQgQgIXv5BSSbqEYTriR2OyYmEj9FQil1QNNVDLAIDgonc2lKzPk7B sWnIiCoQdLJNWWpOaeiY3YplFPd1FiDDhJ4feIoZud+bdz6GDbW33TLYumzHfIG+lIHN Pay+I2G2c32GwKYvFz8PrhmwjjIbNcKX6pdFfW/xWbgdE6CNTrNjU84EMZ6FWBAt/YAn hyEDasMa8ntIvuxS2HZJrDZLOrxmii9EC974B0sK+x7oxA6Z+Of4bRNah8kYMiGm7wFz I6bWdbLissaBHqfnzQ6X49YxNORlDpjashqD2IGQxVXFH6RvUMlkGhBxzg0uMkkR2HB1 06SQ== 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=MvvomVVCPtyzO8zbs7u6ncn4HVWVVhueldJWqg0c3/Y=; b=Xd5HAQXwxDg1+St/bBwl50bO6Uh4F4WFGfgcvYldIHt0FmXc7ZKg0l3UjV7v7+LJLQ yHfXyr3athHxX6j/nVFKwJOPMEJtxPscx9mLfwpWe64sEABcYhZvhaLi02wnJsW2KR13 lG8VgGQBrjnP042Ig0APMxNneI/pJ0QoYb2jYUvjqe5XhkMUBsZVSQXALYG+YNJexUp4 Dpj4yJIufg2Lw32mEYQoCIM3A7L8UaBJ7kS0AoKZdUfyymj77RWgAJSPf6/dL2zbmSQ/ X/yi2P+uj/aX4bp7QTur2bZZRg/96bBP3DyLpBn3I7Ot622Vo4d1oOfz0wBlqWkIa5H2 2StQ== X-Gm-Message-State: AOAM532psDq97FX2asSx2Cvrk7bIXyLPABwBWYK1813laRCkhKDImXZr ivLpmeN98gpafdQRKQbhhw7ZGzaUh+zs+g== X-Google-Smtp-Source: ABdhPJw4vZ0FdbDZPJKst0Sx07StdSAxjRZL2TeSEBeW+rwVRxVXkUGokRy0CPs9rM2s+iJ/khIi/g== X-Received: by 2002:a17:90b:4a45:: with SMTP id lb5mr6030991pjb.220.1642619591310; Wed, 19 Jan 2022 11:13:11 -0800 (PST) Received: from john-All-Series.tds (h75-100-85-216.cntcnh.broadband.dynamic.tds.net. [75.100.85.216]) by smtp.gmail.com with ESMTPSA id c17sm399845pfc.171.2022.01.19.11.13.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 11:13:10 -0800 (PST) From: John Miller To: dev@dpdk.org, ferruh.yigit@intel.com Cc: John Miller Subject: [PATCH 4/4] net/ark: support chunk DMA transfers Date: Wed, 19 Jan 2022 13:12:55 -0600 Message-Id: <20220119191255.273988-4-john.miller@atomicrules.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119191255.273988-1-john.miller@atomicrules.com> References: <20220119191255.273988-1-john.miller@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 support for chunk DMA transfers. Signed-off-by: John Miller --- drivers/net/ark/ark_ddm.c | 1 + drivers/net/ark/ark_ethdev_rx.c | 16 +++++++++------- drivers/net/ark/ark_mpu.c | 1 + drivers/net/ark/ark_pktchkr.c | 2 +- drivers/net/ark/ark_pktgen.c | 2 +- drivers/net/ark/ark_udm.c | 3 +++ 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/net/ark/ark_ddm.c b/drivers/net/ark/ark_ddm.c index 2321371572..b16c739d50 100644 --- a/drivers/net/ark/ark_ddm.c +++ b/drivers/net/ark/ark_ddm.c @@ -55,6 +55,7 @@ ark_ddm_stop(struct ark_ddm_t *ddm, const int wait) int cnt = 0; ddm->cfg.command = 2; + rte_wmb(); while (wait && (ddm->cfg.stop_flushed & 0x01) == 0) { if (cnt++ > 1000) return 1; diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index 1000f50be0..49134ea08f 100644 --- a/drivers/net/ark/ark_ethdev_rx.c +++ b/drivers/net/ark/ark_ethdev_rx.c @@ -12,6 +12,7 @@ #define ARK_RX_META_SIZE 32 #define ARK_RX_META_OFFSET (RTE_PKTMBUF_HEADROOM - ARK_RX_META_SIZE) +#define ARK_RX_MPU_CHUNK (64U) /* Forward declarations */ struct ark_rx_queue; @@ -104,7 +105,7 @@ static inline void eth_ark_rx_update_cons_index(struct ark_rx_queue *queue, uint32_t cons_index) { queue->cons_index = cons_index; - if ((cons_index + queue->queue_size - queue->seed_index) >= 64U) { + if ((cons_index + queue->queue_size - queue->seed_index) >= ARK_RX_MPU_CHUNK) { eth_ark_rx_seed_mbufs(queue); ark_mpu_set_producer(queue->mpu, queue->seed_index); } @@ -179,12 +180,12 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, queue->reserve_q = rte_zmalloc_socket("Ark_rx_queue mbuf", nb_desc * sizeof(struct rte_mbuf *), - 64, + 512, socket_id); queue->paddress_q = rte_zmalloc_socket("Ark_rx_queue paddr", nb_desc * sizeof(rte_iova_t), - 64, + 512, socket_id); if (queue->reserve_q == 0 || queue->paddress_q == 0) { @@ -455,7 +456,8 @@ eth_ark_rx_stop_queue(struct rte_eth_dev *dev, uint16_t queue_id) static inline int eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue) { - uint32_t limit = queue->cons_index + queue->queue_size; + uint32_t limit = (queue->cons_index & ~(ARK_RX_MPU_CHUNK - 1)) + + queue->queue_size; uint32_t seed_index = queue->seed_index; uint32_t count = 0; @@ -618,14 +620,14 @@ eth_ark_udm_force_close(struct rte_eth_dev *dev) ark_mpu_start(queue->mpu); /* Add some buffers */ - index = 100000 + queue->seed_index; + index = ARK_RX_MPU_CHUNK + queue->seed_index; ark_mpu_set_producer(queue->mpu, index); } /* Wait to allow data to pass */ usleep(100); - ARK_PMD_LOG(DEBUG, "UDM forced flush attempt, stopped = %d\n", - ark_udm_is_flushed(ark->udm.v)); + ARK_PMD_LOG(NOTICE, "UDM forced flush attempt, stopped = %d\n", + ark_udm_is_flushed(ark->udm.v)); } ark_udm_reset(ark->udm.v); } diff --git a/drivers/net/ark/ark_mpu.c b/drivers/net/ark/ark_mpu.c index 8160c1de7b..b8e94b6ed3 100644 --- a/drivers/net/ark/ark_mpu.c +++ b/drivers/net/ark/ark_mpu.c @@ -68,6 +68,7 @@ ark_mpu_reset(struct ark_mpu_t *mpu) int cnt = 0; mpu->cfg.command = MPU_CMD_RESET; + rte_wmb(); while (mpu->cfg.command != MPU_CMD_IDLE) { if (cnt++ > 1000) diff --git a/drivers/net/ark/ark_pktchkr.c b/drivers/net/ark/ark_pktchkr.c index 84bb567a41..12a5abb2f7 100644 --- a/drivers/net/ark/ark_pktchkr.c +++ b/drivers/net/ark/ark_pktchkr.c @@ -113,7 +113,7 @@ ark_pktchkr_stopped(ark_pkt_chkr_t handle) struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle; uint32_t r = inst->sregs->pkt_start_stop; - return (((r >> 16) & 1) == 1); + return (((r >> 16) & 1) == 1) || (r == 0); } void diff --git a/drivers/net/ark/ark_pktgen.c b/drivers/net/ark/ark_pktgen.c index 515bfe461c..6195ef997f 100644 --- a/drivers/net/ark/ark_pktgen.c +++ b/drivers/net/ark/ark_pktgen.c @@ -107,7 +107,7 @@ ark_pktgen_paused(ark_pkt_gen_t handle) struct ark_pkt_gen_inst *inst = (struct ark_pkt_gen_inst *)handle; uint32_t r = inst->regs->pkt_start_stop; - return (((r >> 16) & 1) == 1); + return (((r >> 24) & 1) == 1) || (((r >> 16) & 1) == 1) || (r == 0); } void diff --git a/drivers/net/ark/ark_udm.c b/drivers/net/ark/ark_udm.c index 28c4500a2c..9ebed89627 100644 --- a/drivers/net/ark/ark_udm.c +++ b/drivers/net/ark/ark_udm.c @@ -33,7 +33,9 @@ ark_udm_stop(struct ark_udm_t *udm, const int wait) { int cnt = 0; + udm->setup.r0 = 0; udm->cfg.command = 2; + rte_wmb(); while (wait && (udm->cfg.stop_flushed & 0x01) == 0) { if (cnt++ > 1000) @@ -70,6 +72,7 @@ ark_udm_reset(struct ark_udm_t *udm) void ark_udm_start(struct ark_udm_t *udm) { + udm->setup.r0 = 0x100; udm->cfg.command = 1; } -- 2.25.1