From patchwork Fri Feb 16 12:02:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Vojanec X-Patchwork-Id: 136851 X-Patchwork-Delegate: thomas@monjalon.net 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 7BDB643B39; Fri, 16 Feb 2024 13:02:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B2E7432C8; Fri, 16 Feb 2024 13:02:58 +0100 (CET) Received: from office2.cesnet.cz (office2.cesnet.cz [78.128.248.237]) by mails.dpdk.org (Postfix) with ESMTP id B487043001 for ; Fri, 16 Feb 2024 13:02:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1708084975; bh=WKS8aLkathJfvGpvIHeAuhWkZox/I1V0PVCWWs4lUvM=; h=From:To:Cc:Subject:Date; b=AduucdjgvYrLnTCSEctZXo1sKSNbPyzfHV5OCjYrtjTOOiZ85zUYokVv3pIXrFAcv Xf0DpIAmA8MeEvEyzqEKgZvd6lYfHEXIPRoAILN9oKYr8ffSBLcYDN6j7GAMJiHDZ4 IHGeCgNKzR/BdQ9dpakwRkpvH3TepjNB9iD7RN0+u0r6w9HXdeIytnkeiBJefScRvE v5C4VNT8L7LJmnRnouB+ecuTWz/lvWT6h3fOv5fizd2Sc/sYl33ouTMGIgXHJSwP1Z FoEtFMc++XxX1MLFKVoOZTQwSxSd45n86l14nKkAsPd8QNr1HdhXAqISw6KOT2ulTA fTqM/8H936KMQ== Received: from dpdk-test6.liberouter.org (rt-tmc-kou.liberouter.org [195.113.172.126]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id BAD621180080; Fri, 16 Feb 2024 13:02:53 +0100 (CET) From: Kamil Vojanec To: dev@dpdk.org Cc: Kamil Vojanec , Konstantin Ananyev , Trevor Tao Subject: [PATCH] examples/l3fwd: fix conf propagation to RX queues Date: Fri, 16 Feb 2024 13:02:07 +0100 Message-Id: <20240216120207.126025-1-vojanec@cesnet.cz> X-Mailer: git-send-email 2.39.3 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 When configuring RX queues, the default port configuration was used, even though it was modified before. This results in the 'relax-rx-offload' not being respected for RX queues. This commit uses 'rte_eth_dev_conf_get()' to obtain the device configuration structure instead. Fixes: 4b01cabfb0 ("examples/l3fwd: add option to relax Rx offload") Signed-off-by: Kamil Vojanec Acked-by: Konstantin Ananyev Acked-by: Kevin Traynor --- examples/l3fwd/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 3bf28aec0c..2b714a362a 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -1388,6 +1388,7 @@ l3fwd_poll_resource_setup(void) fflush(stdout); /* init RX queues */ for(queue = 0; queue < qconf->n_rx_queue; ++queue) { + struct rte_eth_conf local_conf; struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id; @@ -1408,8 +1409,14 @@ l3fwd_poll_resource_setup(void) "Error during getting device (port %u) info: %s\n", portid, strerror(-ret)); + ret = rte_eth_dev_conf_get(portid, &local_conf); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "Error during getting device (port %u) configuration: %s\n", + portid, strerror(-ret)); + rxq_conf = dev_info.default_rxconf; - rxq_conf.offloads = port_conf.rxmode.offloads; + rxq_conf.offloads = local_conf.rxmode.offloads; if (!per_port_pool) ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, socketid,