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 28D6A48B0C for ; Fri, 14 Nov 2025 19:52:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2244D40E09; Fri, 14 Nov 2025 19:52:48 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 7827F40E09 for ; Fri, 14 Nov 2025 19:52:46 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-7b9c17dd591so1681044b3a.3 for ; Fri, 14 Nov 2025 10:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1763146365; x=1763751165; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Zaz5hrgCnNp873lhNmZ9Pm/5apsXNL+UG/H1WiUC1hA=; b=ABZn755X18F35NFDS9U3NrI1YqBzaPYRHUvB/4LtgKhjRotoX71vM971CPRfXQsjl3 BW8ElsNu6nCYh78fe4iQDeN6d/QPjG5MmARtVp0I0JIDIpFkVwS2/VaDHuroX6seGkc3 zl2e2+s2zozferS3Z+3C9sXkN5b0aA/DRe+RptJKb2oH9ocTJTKru4fujhUbjRhjDA1G pG0vWtgzZrJYWMGmjuIEvYWTpLIICRFN9dd4DGqUwR4ysnmpQBz5tqlb+/84mz7cJUUo wvtB5Jb3zM4Jnasfz9GUH9EwF3qQAt/IAyZAikoU0Y/k7Hix8fVESUmd7S9fWKq5rFrL F9/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763146365; x=1763751165; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Zaz5hrgCnNp873lhNmZ9Pm/5apsXNL+UG/H1WiUC1hA=; b=vLfbN+OKU87EEjO+s/+eJ9UY9FqexpJf/XjR1aKOlDUMWPfy/i46A4TTQtZqqP+wEH duzqPaVpFmEzV4Azkp7ysB/5m5+fttEV8Sslc78yit6yoTRCOoHPjWaPvJTmJSBQrn2c W5CYHQcgCy0HUKvWwnz+9UfW7KYBw5SxCbCuUbdlD9fJYUfQdHL8AxFKwEQxNnhmCL8n NfkH4P8dH42y6fCO6RxLNEiV/tC2a761Z7SIVaGrNgJjT9OCjYtkQqEtNn2A2onIQVM4 saai81b10844WycfjQCFrMyGFSgHU0xIiBy8JDtrYOi8mrEiTrCoppSj/ZzVonJVdGiM BKmA== X-Forwarded-Encrypted: i=1; AJvYcCW2avl2tWydASZf1QWC8RB8RC/9exWf+Mipvn8BH2Jnf8daef572t1/gsF1ipk/uJauQK8iEMo=@dpdk.org X-Gm-Message-State: AOJu0YzB/DKuf+GI1TcRVU6YYUNOfIafP9zR9nia1kKUWSVide3F6/rK N1zq7cLBIcXMnIEWdIKxJoG+lAkw2wSSIcm2TDJAscS+XKPYRHzAXkdQ6k5QuxUtdFg= X-Gm-Gg: ASbGncu4juCHZnXyx+EbbpYqSWCWHqRBeZhB6/+ZkYeoi9Dve1EjFB3XlXfe8E+3XPN sEri1lUUtg1O1EuP3PKuzH3TYr/fpmU1P2ADBuUrfvryvxHeqYfRB4O+0k9f4vVZmBIzKVu7OX7 Bcr49llhUwcZVCxYss3bRxQqfxUaRKhLYx9vX+eLpH4CbJzpW2gW8kWxsGTN0jNWy7IfOG6Qx6e II12VxIN5yOIyO5ChqlT9V99z4M9swMmRvDYnK4vrffr/0Hu3+1nu7gnoX+4rISWv4Jzv2fZAdU 2neZpq3aew/Mec32JExCM7uPrFvm6K5/871vX/2C0gxHfJEp4s/baV92wGypRZAT3t0OjwhjrZN VjM+O1lDUZ528IMjiU6qyHYbkKpp4bxaS9gwEP4CxG9vqw1J20quNV3vqY87viy1Cdc/JuDITQ2 88HfYvz8fB/tFgDd9kDtLTTJENgiuU0Oq+Az9wJaa9II1cFa7ekw== X-Google-Smtp-Source: AGHT+IGQWMsc4nc/fgzaWcTnawhY3cvj0blV2G5axkRvYwFHHAfaIyaQTJMPuRI0caw3lJF0bMXvyQ== X-Received: by 2002:a05:7022:2398:b0:11b:1e43:1c75 with SMTP id a92af1059eb24-11b41211172mr1662068c88.29.1763146365269; Fri, 14 Nov 2025 10:52:45 -0800 (PST) Received: from phoenix.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11b06088604sm13188482c88.7.2025.11.14.10.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 10:52:44 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Ajit Khaparde , Somnath Kotur , Kishore Padmanabha , Venkat Duvvuru , Mike Baucom Subject: [PATCH] net/bnxt: fix unintialized warning Date: Fri, 14 Nov 2025 10:52:40 -0800 Message-ID: <20251114185240.1363648-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org With gcc-16 it inlines a lot more code and creates a warnings where it thinks it might be manipulating bits that are not set. It looks like this is because the bits in control word (cword) in theory could be larger than the variable. Should not be possible because wc_ctl_size_bits is only set to 3, 16, or 32 but that happens outside of the scope of these functions. Resolve by adding bounds check which compiler sees and knows the loop will only see those bits. In function ‘ulp_bs_push_msb’, inlined from ‘ulp_blob_push’ at ../drivers/net/bnxt/tf_ulp/ulp_utils.h:407:8, inlined from ‘ulp_blob_push_32’ at ../drivers/net/bnxt/tf_ulp/ulp_utils.h:551:7, inlined from ‘ulp_mapper_wc_tcam_tbl_dyn_post_process’ at ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2487:9: ../drivers/net/bnxt/tf_ulp/ulp_utils.h:336:17: warning: ‘cword’ may be used uninitialized [-Wmaybe-uninitialized] 336 | ulp_bs_put_msb(bs, pos, 8, val[i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/net/bnxt/tf_ulp/ulp_mapper.c: In function ‘ulp_mapper_wc_tcam_tbl_dyn_post_process’: ../drivers/net/bnxt/tf_ulp/ulp_mapper.c:2443:18: note: ‘cword’ declared here 2443 | uint32_t cword, i, rc; | ^~~~~ Bugzilla ID: 1821 Fixes: 3fe124d2536c ("net/bnxt: support Thor platform") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 5 +++++ drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper.c b/drivers/net/bnxt/tf_ulp/ulp_mapper.c index 0ff952950b..960cdda311 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper.c @@ -2446,6 +2446,11 @@ ulp_mapper_wc_tcam_tbl_dyn_post_process(struct bnxt_ulp_device_params *dparms, slice_width = dparms->wc_slice_width; clen = dparms->wc_ctl_size_bits; + if (clen > 32) { + BNXT_DRV_DBG(ERR, "Key size bits %d too large\n", clen); + return -EINVAL; + } + max_slices = dparms->wc_max_slices; blen = ulp_blob_data_len_get(key); diff --git a/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c b/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c index f99698a1d8..2d89f10d5e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c +++ b/drivers/net/bnxt/tf_ulp/ulp_mapper_tfc.c @@ -90,6 +90,10 @@ ulp_mapper_tfc_wc_tcam_post_process(struct bnxt_ulp_device_params *dparms, slice_width = dparms->wc_slice_width; clen = dparms->wc_ctl_size_bits; + if (clen > 32) { + BNXT_DRV_DBG(ERR, "Key size bits %d too large\n", clen); + return -EINVAL; + } max_slices = dparms->wc_max_slices; blen = ulp_blob_data_len_get(key); -- 2.51.0