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 09F68A00C5; Tue, 15 Feb 2022 23:19:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 677694115D; Tue, 15 Feb 2022 23:19:43 +0100 (CET) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by mails.dpdk.org (Postfix) with ESMTP id 3741A41153 for ; Tue, 15 Feb 2022 23:19:41 +0100 (CET) Received: by mail-io1-f45.google.com with SMTP id w7so187521ioj.5 for ; Tue, 15 Feb 2022 14:19:41 -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=tV7aWTFWMWpteSMSfSZggj8tWppYCzCFjdcnF5bFdtk=; b=1nvcpjWELXoeWfXIEH5qoAImeVIYi38amrrj1kCkOXGMm3DITUaFld57jko+9NLPnn Y8jxPC1EMDtQC47PGaokj25iSQwWmxL8AmbQEiJSOISkeZDaV9o3QI8ph6iG4+bVfS05 WRhLPMGNU8PkJzOlqyHJFSL0td+kork+GmiALUtDy8Mvf7rSO5Tv4XHrBY7enQVEOWbK l2J4yyO6u+/o9D0XyI78FH8e019oWGlBqDAyXaHr0c0sqRKi5u/SsbWAfNgOonODM/gN jc/9Aquxwb0692oVGKl1gOAqgAbBNHT6d1jQNZxiM0pW9jPH9/EWqVZIQsnX6+5tMyoD n+1g== 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=tV7aWTFWMWpteSMSfSZggj8tWppYCzCFjdcnF5bFdtk=; b=ge6DEMNXQbclAT7TaVMRmqcVssJhUNBpfJ6aAdafAl71iwDf7aUnoLaUwFIlZbobN+ BieG1xA8HBfBftu05WJmQLVCSTFyWd06irQY0c5hMpuuitelzN/ZKT85zJxJwzWUhJls F94aMbonvNzdlZFYfezZXChN6zVtomwv+7ISFMUuWczlWSMHeWEstKYOGsdR0BAGA0Dv UgorMlzYA+Dnw3HnQQvmaIegFnVXiB16vPRcHw3sWvYHzsWM4Vnv0YpoY73IiGRZfeqG eJRE45cDLFMY2c93zrv4mt1Vo/Q4JJxUUfB0n8skS7cAB0ypYro5JYLgx9pbHSoDacZu XjlA== X-Gm-Message-State: AOAM531iAsP0ijwrRtAJIA5e0KIo2oIlqwt+n7CQ8SiIgjYTWLEB+phl yf1eFvdpMBgoTef4QfvGwD3MUP2gQ+sW0Q== X-Google-Smtp-Source: ABdhPJwEAScU+bWS7ewXU8NLghFdApgfR5VHdJ01q8jP7WHfctebwR2UFC/BWfUSUDORMgbOSgGrBw== X-Received: by 2002:a05:6638:3003:: with SMTP id r3mr644613jak.239.1644963580419; Tue, 15 Feb 2022 14:19:40 -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 a15sm10758823ilj.21.2022.02.15.14.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 14:19:40 -0800 (PST) From: John Miller To: dev@dpdk.org, ferruh.yigit@intel.com Cc: shepard.siegel@atomicrules.com, John Miller Subject: [PATCH v3 5/7] net/ark: support chunk DMA transfers Date: Tue, 15 Feb 2022 16:19:24 -0600 Message-Id: <20220215221926.409039-5-john.miller@atomicrules.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220215221926.409039-1-john.miller@atomicrules.com> References: <20220119191255.273988-ed.czeck@atomicrules.com> <20220215221926.409039-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. 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. Signed-off-by: John Miller --- drivers/net/ark/ark_ethdev_rx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index 0478702cbe..0fbb2603db 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) { @@ -446,7 +447,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; @@ -609,14 +611,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); } -- 2.25.1