Thread (18 messages) 18 messages, 2 authors, 2026-06-15

Re: [PATCH net-next v3 09/15] bnxt_en: Add infrastructure for crypto key context IDs

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-06-15 20:57:34

On Sun, 14 Jun 2026 00:24:01 -0700 Michael Chan wrote:
Each kTLS connection requires a crypto key context ID (KID).  These KIDs
are allocated from the firmware in batches.  Add data structure to store
these IDs.  The bnxt_kid_info structure stores a batch of IDs and it can be
linked as we allocate more batches.  There is a bitmap in the structure
to keep track of which ones are in use.  Add APIs to allocate and free
these KIDs.
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:283:7: warning: variable 'kctx_tx' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
  283 |                 if (retry_cnt++ > KTLS_RETRY_MAX) {
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:319:8: note: uninitialized use occurs here
  319 |         kfree(kctx_tx);
      |               ^~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:283:3: note: remove the 'if' if its condition is always false
  283 |                 if (retry_cnt++ > KTLS_RETRY_MAX) {
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  284 |                         atomic64_inc(&ktls->counters[BNXT_KTLS_ERR_RETRY_EXCEEDED]);
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  285 |                         netdev_warn(dev, "%s timed out waiting for device, state %lx\n",
      |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  286 |                                     __func__, bp->state);
      |                                     ~~~~~~~~~~~~~~~~~~~~~
  287 |                         goto free;
      |                         ~~~~~~~~~~
  288 |                 }
      |                 ~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:277:7: warning: variable 'kctx_tx' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
  277 |                 if (!netif_running(dev) ||
      |                     ^~~~~~~~~~~~~~~~~~~~~~
  278 |                     test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:319:8: note: uninitialized use occurs here
  319 |         kfree(kctx_tx);
      |               ^~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:277:3: note: remove the 'if' if its condition is always false
  277 |                 if (!netif_running(dev) ||
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
  278 |                     test_bit(BNXT_STATE_IN_FW_RESET, &bp->state))
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279 |                         goto free;
      |                         ~~~~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:277:7: warning: variable 'kctx_tx' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
  277 |                 if (!netif_running(dev) ||
      |                     ^~~~~~~~~~~~~~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:319:8: note: uninitialized use occurs here
  319 |         kfree(kctx_tx);
      |               ^~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:277:7: note: remove the '||' if its condition is always false
  277 |                 if (!netif_running(dev) ||
      |                     ^~~~~~~~~~~~~~~~~~~~~~
../drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c:260:42: note: initialize the variable 'kctx_tx' to silence this warning
  260 |         struct bnxt_ktls_offload_ctx_tx *kctx_tx;
      |                                                 ^
      |                                                  = NULL
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help