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 42FB6A00BE; Thu, 10 Feb 2022 15:34:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BADD42725; Thu, 10 Feb 2022 15:34:42 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 40B644013F for ; Thu, 10 Feb 2022 15:34:39 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id c5-20020a17090a1d0500b001b904a7046dso7174527pjd.1 for ; Thu, 10 Feb 2022 06:34:39 -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=q75o+/9GxaJoOdlRFKRTH6ELjBKC9+PkD+8j/QAfZfs=; b=5Nzd7B775T0o2yPhiGh/I6bRy4PXvG/xvZnZYFONbWeac2FIyfbh7VZ0Mh5vP+KRvb 3vemiMFJ/MA8QvLMN96w3vlArE2hz/UqrKrYA1gFZwTV6s04gnCZRn+4PoKEuiBPJH23 CWDAtzb8Y8KtVDbRomnIIPYQQjYBo9bYZjYslF+EqFsxgexn1I1Ur15yVfvTqllzW1JX JK/JC/mBfm0aspNz/J87ItYgabBCFCfJAlovv3NJKdYnTK1QI0gtpnjDrGQZiJZvRXv7 TShCWVGxNv7V4KDjmPKsFR16d9urY6+g7joxK/+zUNnT4Jaj/IQ0UTQjFIqzC2yQM9f6 FeZA== 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=q75o+/9GxaJoOdlRFKRTH6ELjBKC9+PkD+8j/QAfZfs=; b=oM3j/74sBQ81p5MDXABVvL+669hUEk53v5FgPYp62pyU8ziGXS5MuW/4S7mv9gRn+U tuvydnnjyCN568YJ77FOkQ0+yqIqvxHQK4esTdqNxXXBQlA6QhgvdZfd2XSm9zzd8dFZ ZRd/1BhfET2bBy+dASKqobH9yRwzlH+nsTBTwVTbjHOlRsxjsDOYS14iZND/uVQV9KKE 8JOcjCeHH9oomrZOZdV51+exXxv+LTAa8p05QX7kjUUxdf42oyEUuTd/zuldPse2XQ9u YRfFRsGc4tB70pzTV0H9uM0UZVV44ciN5a99zRc3IYyAluX9aXPTnV+RFgg2q7fhjQA5 U5bA== X-Gm-Message-State: AOAM533fuolSPBrgG14nQTqfl9HLioYHiWUZaoPlM9zYZGUAi8rkV37u vwvqbrneLFYskW/1ir36K8AsKp3TTBYHSg== X-Google-Smtp-Source: ABdhPJxrLfL08lOWMuHqKnTfpMuYBTx/iRquNsilSJ+/oCDWqEiL1KWGYI7W6fDQVOv3bJTpVccJQw== X-Received: by 2002:a17:903:2cc:: with SMTP id s12mr7785374plk.130.1644503678210; Thu, 10 Feb 2022 06:34:38 -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 il18sm2875359pjb.27.2022.02.10.06.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 06:34:37 -0800 (PST) From: John Miller To: dev@dpdk.org, ferruh.yigit@intel.com Cc: shepard.siegel@atomicrules.com, John Miller Subject: [PATCH v2 3/3] net/ark: support chunk DMA transfers Date: Thu, 10 Feb 2022 08:34:23 -0600 Message-Id: <20220210143423.287613-3-john.miller@atomicrules.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210143423.287613-1-john.miller@atomicrules.com> References: <20220119191255.273988-ed.czeck@atomicrules.com> <20220210143423.287613-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 --- v2: Various performance optimizations and behavior fixes - Chunk mpu transfer use 64 objects (512 byte) to maintain memory read alignment - Align mpu memory allocation to be at 512 byte boundaries - Reduce force-close allocation from 10000 objects to 64 objects - Add memory write barriers for read and wait status functions in ddm, udm and mpu. - Configuration status updates for internal packet checker and generator. --- 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