Skip to content

bnxt_en: Add kTLS TX offload support

Michael Chan netdev 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest15 patches 4 repliesIn review
  2. v515 patches 4 repliesSuperseded
  3. v415 patches 4 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v315 patches2 repliesSuperseded
v215 patches10 repliesSuperseded
v115 patches2 repliesSuperseded

Changes in v6 from the cover letter

Fix more Sashiko reported issues:

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15bnxt_en: Add Midpath channel informationdrivers/net/ethernet/broadcom/Kconfig drivers/net/ethernet/broadcom/bnxt/Makefile drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 more+97 -00 replies
2/15bnxt_en: Account for the MPC TX and CP ringsdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +4 more+90 -260 replies
3/15bnxt_en: Set default MPC ring countdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.c +1 more+117 -10 replies
4/15bnxt_en: Rename xdp_tx_lock to tx_lockdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c+5 -50 replies
5/15bnxt_en: Allocate and free MPC software structuresdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.c +1 more+294 -70 replies
6/15bnxt_en: Allocate and free MPC channels from firmwaredrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.c +1 more+136 -92 replies
7/15bnxt_en: Allocate crypto structure and backing storedrivers/net/ethernet/broadcom/bnxt/Makefile drivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h +3 more+193 -10 replies
8/15bnxt_en: Reserve crypto RX and TX key contexts on a PFdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.c +1 more+70 -20 replies
9/15bnxt_en: Add infrastructure for crypto key context IDsdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.c drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.h+365 -00 replies
10/15bnxt_en: Add MPC transmit and completion functionsdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.c +1 more+230 -01 reply
11/15bnxt_en: Add crypto MPC transmit/completion infrastructuredrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.c +3 more+488 -51 reply
12/15bnxt_en: Support kTLS TX offload by implementing .tls_dev_add/del()drivers/net/ethernet/broadcom/bnxt/Makefile drivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h +4 more+566 -30 replies
13/15bnxt_en: Implement kTLS TX normal pathdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.c +4 more+258 -80 replies
14/15bnxt_en: Add support for inline transmit BDsdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h+19 -30 replies
15/15bnxt_en: Add kTLS retransmission supportdrivers/net/ethernet/broadcom/bnxt/bnxt.c drivers/net/ethernet/broadcom/bnxt/bnxt.h drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +2 more+167 -90 replies

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchAjit KhapardeKalesh APAndy GospodarekPavan Chebbi
1/15R-b R-b R-b R-b
2/15R-b R-b R-b R-b
3/15R-b R-b R-b
4/15R-b R-b R-b
5/15R-b R-b
6/15R-b R-b
7/15R-b R-b
8/15R-b R-b
9/15R-b R-b
10/15R-b R-b
11/15R-b R-b
12/15R-b R-b
13/15R-b R-b
14/15R-b
15/15R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v6 thread

Cover letter [PATCH net-next v6 00/15] bnxt_en: Add kTLS TX offload support

This patchset adds kTLS offload support for TX direction. A number of new files are added:

bnxt_mpc.[ch] handle midpath channels (MPCs) used to offload kTLS connections to the chip's crypto blocks without going through FW.

bnxt_crypto.[ch] handle the crypto interface and resources.

bnxt_ktls.[ch] handle kTLS offload.

A new CONFIG_BNXT_TLS is added to enable all of the above. The first 6 patches add the MPC logic including resource accounting and reservations. The next 5 patches add the crypto logic to handle the crypto resources and to send/receive control data using the MPCs. The last 4 patches add kTLS offload for the TX direction.

There will be a follow-on patchset to make the TX offload more complete and to add the RX direction offload.

v6:
Fix more Sashiko reported issues:

Patch #1:
Make sure mpc capability is only updated during reset or ifdown/up.

Patch #10:
Handle both long and short MPC completions. Leave one empty slot in the MPC ring just like TX ring. Use memory barrier when updating tx_cons for MPC ring.

Patch #11:
Disable NAPI during MPC ring restart.
Add bnxt_free_mpc_entries() called during shutdown like other rings. Simplify bnxt_xmit_crypto_cmd() error path.

Patch #13:
Goto kick_pending if kTLS transmit failed to flush the DB. Handle the case of BPF truncating the TX packet.

Patch #14:
Clear is_push and inline_data_bds during TX ring free.

v5:
https://lore.kernel.org/netdev/[email protected]/

Fix most valid Sashiko reported issues or add comments to clarify:

Patch #2:
Clarify in the commit log that kTLS, MPC rings are only supported on P5_PLUS chips in response to some Sashiko comments.

Patch #3:
Improve the ethtool -L MPC calculation to use the actual MPC rings during ring check.

Add a comment in the code to explain the bnxt_trim_mpc_ring() call.

Patch #5:
Check for P5_PLUS before allocating mpc_info to more clearly document that MPC rings are only supported on P5_PLUS chips.

Patch #8:
Pre-existing Sashiko issue not addressed.

Patch #9:
More clearly document and explain that bnxt_clear_crypto() has no concurrent readers/writers.

Add comment to explain that the bnxt_free_one_ctx() caller is reponsible to check the epoch value when needed.

Patch #10:
Add description in commit log that crypto engines use short completions only.

Already explained that only P5_PLUS supports MPC.

Patch #11:
Defer the MPC ring reset to bnxt_sp_task() just like other resets to avoid any possibility od deadlock.

Add more comments to explain the MPC ring disable, stop, start.

Patch #12:
The bnxt_drv_busy() is the existing driver scheme to wait for activities to stop during shutdown.

Patch #13:
The kTLS software counters match the other driver software counters using plain u64. We can add u64_stats_sync for 32-bit systems but it makes more sense to add it to all the existing counters as well.

Use BNXT_NO_FW_ACCESS() to fix possible massive AER timeout.

Patch #15:
Use bool instead of bit fields to keep track of kTLS states (requested by Paolo).

v4:
https://lore.kernel.org/netdev/[email protected]/

Fix kerneldoc prototype warning and uninitialized variable warnings reported by Jakub.

Fix most valid Sashiko reported issues.

v3:
https://lore.kernel.org/netdev/[email protected]/

Fix most AI reported issues from Jakub.

v2:
https://lore.kernel.org/netdev/[email protected]/

Fix unused variable compile warnings in patch 10 and 12 by reorganizing the patches (reported by Jakub)

Fix some error recovery issues in patch 12

v1:
https://lore.kernel.org/netdev/[email protected]/

Michael Chan (15):
bnxt_en: Add Midpath channel information
bnxt_en: Account for the MPC TX and CP rings
bnxt_en: Set default MPC ring count
bnxt_en: Rename xdp_tx_lock to tx_lock
bnxt_en: Allocate and free MPC software structures
bnxt_en: Allocate and free MPC channels from firmware
bnxt_en: Allocate crypto structure and backing store
bnxt_en: Reserve crypto RX and TX key contexts on a PF
bnxt_en: Add infrastructure for crypto key context IDs
bnxt_en: Add MPC transmit and completion functions
bnxt_en: Add crypto MPC transmit/completion infrastructure
bnxt_en: Support kTLS TX offload by implementing .tls_dev_add/del()
bnxt_en: Implement kTLS TX normal path
bnxt_en: Add support for inline transmit BDs
bnxt_en: Add kTLS retransmission support

 drivers/net/ethernet/broadcom/Kconfig         |   9 +
 drivers/net/ethernet/broadcom/bnxt/Makefile   |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 303 +++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  96 ++-
 .../net/ethernet/broadcom/bnxt/bnxt_crypto.c  | 618 ++++++++++++++
 .../net/ethernet/broadcom/bnxt/bnxt_crypto.h  | 230 +++++
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  61 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_gso.c |   2 +-
 .../net/ethernet/broadcom/bnxt/bnxt_ktls.c    | 578 +++++++++++++
 .../net/ethernet/broadcom/bnxt/bnxt_ktls.h    | 174 ++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.c | 795 ++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.h | 232 +++++
 .../net/ethernet/broadcom/bnxt/bnxt_sriov.c   |   6 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |   8 +-
 include/linux/bnxt/hsi.h                      |  37 +
 15 files changed, 3083 insertions(+), 67 deletions(-)
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.c
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_crypto.h
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.c
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_ktls.h
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.c
 create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_mpc.h
Signature · 1 line
2.51.0