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 6B32445BD5; Fri, 25 Oct 2024 13:52:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C2E5402DF; Fri, 25 Oct 2024 13:52:33 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 8B5A8400D5 for ; Fri, 25 Oct 2024 13:52:32 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 5DB58206AE; Fri, 25 Oct 2024 13:52:32 +0200 (CEST) Received: from dkrd4.smartsharesys.local ([192.168.4.26]) by smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 25 Oct 2024 13:52:32 +0200 From: =?UTF-8?q?Morten=20Br=C3=B8rup?= To: dev@dpdk.org, Tyler Retzlaff , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Ajit Khaparde , Somnath Kotur , Bruce Richardson , Gaetan Rivet , Jie Hai , Long Li , Wei Hu Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH 0/2] ethdev: support single queue per port Date: Fri, 25 Oct 2024 11:52:21 +0000 Message-ID: <20241025115223.1230680-1-mb@smartsharesystems.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 25 Oct 2024 11:52:32.0095 (UTC) FILETIME=[5FDF3EF0:01DB26D4] 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 DPDK for one queue per port (#define RTE_MAX_QUEUES_PER_PORT 1), compilation of some network drivers fails with e.g.: ../drivers/net/bnxt/bnxt_rxq.c: In function 'bnxt_rx_queue_stop': ../drivers/net/bnxt/bnxt_rxq.c:587:34: error: array subscript 1 is above array bounds of 'uint8_t[1]' {aka 'unsigned char[1]'} [-Werror=array-bounds=] 587 | dev->data->rx_queue_state[q_id] = RTE_ETH_QUEUE_STATE_STOPPED; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ In file included from ../drivers/net/bnxt/bnxt.h:16, from ../drivers/net/bnxt/bnxt_rxq.c:10: ../lib/ethdev/ethdev_driver.h:168:17: note: while referencing 'rx_queue_state' 168 | uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT]; | ^~~~~~~~~~~~~~ This series fixes those compiler emitted errros as follows: 1. A precondition hint macro is introduced, which can be used to prevent the compiler/optimizer from considering scenarios that cannot occur. 2. The hint is added to the network drivers where a compiler in the CI has been seen to emit the above error when DPDK is configured for one queue per port, but we know that the error cannot occur. Morten Brørup (2): eal: add unreachable and precondition hints drivers/net: support single queue per port drivers/net/bnxt/bnxt_ethdev.c | 2 ++ drivers/net/bnxt/bnxt_rxq.c | 1 + drivers/net/e1000/igb_rxtx.c | 2 ++ drivers/net/failsafe/failsafe_ops.c | 10 ++++++++-- drivers/net/hns3/hns3_rxtx.c | 2 ++ drivers/net/mana/tx.c | 1 + lib/eal/include/rte_common.h | 27 +++++++++++++++++++++++++++ 7 files changed, 43 insertions(+), 2 deletions(-) -- 2.43.0