Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH v5 00/24] Migrate to hfi2 driver
@ 2026-09-03 17:54 Dennis Dalessandro
  2026-09-03 17:54 ` [PATCH v5 for-next 01/24] RDMA/hfi2: Start hfi2 driver by basing off of hfi1 Dennis Dalessandro
                   ` (24 more replies)
  0 siblings, 25 replies; 28+ messages in thread
From: Dennis Dalessandro @ 2026-09-03 17:54 UTC (permalink / raw)
  To: jgg, leon
  Cc: Dean Luick, Douglas Miller, Breandan Cunningham, Arnd Bergmann,
	linux-rdma

While sharing similar bones, the chip for the Cornelis Networks next
generation fabric technology has some fundamental differences that
resulted in a near complete re-write of the driver. It also does not
use the private cdev interface that the hfi1 driver exposes. After
discussing this with the RDMA maintainers we have decided to go with
the approach of moving to a new driver and declaring hfi1 obsolete.

It is desirable to keep hfi1 around temporarily to let user APIs
catch up to support access through the uverbs device rather than the
private hfi1 cdev.

This driver is designed to support future products as well.

Portions of this series were developed with the assistance of a large
language model (LLM), reviewed and verified by the author. Each
commit affected carries an "Assisted-by: LLM" trailer per
Documentation/process/coding-assistants.rst.

This series applies on top of the rdma/for-next branch.

Changes since v4:
- cport.c: rate-limit the "Op N SS failed" error log in cport_req_fn() and fix a
  use-after-free where msg->req->hdr fields were read after cwput(msg) had
  already freed msg, by moving the error log before the cwput() call.
- mad.c: treat undersized CH_OP_UMAD_9B/16B payloads in cport_umad_handler() as
  a normal, expected occurrence (e.g. periodic SM keep-alive/poll probes)
  rather than a protocol error; count them via n_vl15_dropped and silently
  drop instead of returning MSG_RSP_STATUS_INVALID_STATE, to avoid flooding
  the console.
- Updated the AI attribution trailer on all commits from
  "Assisted-by: AGENT:MODEL" to the simplified "Assisted-by: LLM" per updated
  upstream guidance.

Changes since v3:
- Folded in the "Sync with upstream hfi1 fixes and cleanups" series and
  the MAINTAINERS entry addition, applying each into the patch that
  first introduces the file(s) it touches rather than carrying them as
  separate trailing patches.

Changes since v2:
- Address Sashiko automated review findings (Critical and High severity):
  - pio.c: drop spinlock around sc_wait_for_packet_egress() in
    hfi2_sc_disable() to prevent 50ms mdelay under IRQ-disabled lock.
  - sdma.h: add bounds guard in _make_tx_sdma_desc() to prevent heap
    overflow when num_desc reaches MAX_DESC.
  - user_sdma.c: use wait_event (uninterruptible) in free_queues() to
    prevent UAF when a signal interrupts teardown.
  - uc.c: fix RDMA_WRITE_LAST tlen guard to use extra_bytes instead of
    pad+4, correctly handling 16B headers.
  - rdmavt/cq.c, rdmavt/srq.c: add synchronize_rcu() before vfree() in
    rvt_resize_cq() and rvt_modify_srq() to close free-while-mapped race.
  - ipoib_tx.c: add iowait_sdma_drain() before hfi2_ipoib_drain_tx_ring()
    in hfi2_ipoib_napi_tx_disable() to wait for in-flight SDMA completions.
  - cport.c: use spin_lock_irqsave for lost_mctxt_intr; timer_shutdown_sync
    for lost_int_timer; cancel_work_sync for mctxt_work; u32 for new_ctxts
    with overflow guard; bounds check in hfi2_cport_resp_set.
  - firmware.c: fix HM_TIMEOUT (10ms->100ms); add NULL guard in
    check_meta_version; add bounds checks in hfi2_parse_platform_config
    and hfi2_get_platform_config_field.
  - mad.c: add OPA_16B_L4_IB_GLOBAL and OPA_16B_L4_9B cases to
    get_mad_offset(); fix cport_mad_handler len check; add sts=0 for
    no-op attribute IDs in cport_subn_set_opa; add len bounds checks.
  - init.c: fix hfi2_mod_init error path; add rcu_read_lock in
    hfi2_lookup; fix hfi2_register_cport_trap error path; re-dispatch
    IB_EVENT_PORT_ACTIVE after HFI2_INITTED is set.
  - intr.c: hfi2_go_port_active() uses signal_ib_event() to add
    HFI2_INITTED guard, fixing IPoIB no-carrier on driver load.
  - verbs.c: fix double-free in hfi2_verbs_send_dma(); fix txreq leak
    on pkey check failure; timer_shutdown_sync for mem_timer.
  - qp.c: add INIT_WORK for opfn_work in hfi2_qp_priv_alloc().
  - uverbs.c: remove old mmap entry before overwriting in
    hfi2_mmap_entry_insert() to prevent leak on repeated USER_INFO calls.
  - netdev_rx.c: fix resource leaks in hfi2_alloc_rx() and hfi2_free_rx().
- Add hfi2 to kernel build system (drivers/infiniband/Kconfig and
  drivers/infiniband/hw/Makefile) so make produces hfi2.ko.
- trace_tx.h: fix UAF in hfi2_ipoib_txq_template trace event by capturing
  sde->this_idx and sde->cpu into entry fields at trace time instead of
  dereferencing the sde pointer in the deferred TP_printk context.
- sdma.c: fix trace-after-free in sdma_flush_descq; add bounds check in
  hfi2_sdma_set_cpu_to_sde_map to prevent heap overflow; add synchronize_rcu()
  before freeing rhashtable node; add cancel_work_sync() for three workers in
  hfi2_sdma_exit to prevent UAF on engine teardown.
- user_exp_rcv.c: fix TID/page leak on error path in hfi2_user_exp_rcv_setup
  by replacing broken tinfo->tidlist=kernel_ptr + hfi2_user_exp_rcv_clear()
  (which fails SMAP) with a direct unprogram_rcvarray() loop.
- verbs.c: use spin_lock_irqsave in verbs_sdma_complete() since it is called
  from interrupt context; fix AHG branch in build_verbs_tx_desc() to include
  extra_bytes in the tlen passed to sdma_txinit_ahg().
- tid_rdma.c: add missing 'return false' after rvt_error_qp() in the !tidlen
  error path of hfi2_build_tid_rdma_packet() to prevent use-after-free.
- fault.c: guard 'data[size-1] = newline' with 'if (size > 0)' to prevent
  OOB write when the opcode bitmap is empty.
- ipoib_main.c: remove manual free_percpu(dev->tstats) from ndo_uninit;
  the netdev core owns tstats lifecycle when NETDEV_PCPU_STAT_TSTATS is set.

Changes since v1:
- Broke up the large MAD and verbs patches that exceeded 3K LOC.
  Machine-generated counter accessor functions are now separated
  from real logic into their own patches (Leon Romanovsky).
- Removed all TODO stubs (e.g., jkr_handle_link_bounce()) that only
  printed a warning. Cleaned up unnecessary casts, unused parameters,
  and other minor style issues (Jason Gunthorpe).
- Removed dead declarations from system core headers, including
  hfi2_cdev_cleanup() and similar functions that were declared but
  never defined (Jason Gunthorpe).
- Modernized hfi2_rdma_mmap() to use the rdma_user_mmap_io /
  rdma_user_mmap_entry infrastructure as required for new drivers
  (Jason Gunthorpe).
- The opa_vnic removal is being submitted as a separate independent
  series per reviewer request (Leon Romanovsky).
- Replaced the writev-on-uverbs-fd approach with an anonymous
  'hfi2-sdma' file descriptor returned via ioctl. The data path
  write_iter is registered on the anonymous fd, avoiding any changes
  to the uverbs core.
- Audited all commit messages to ensure they accurately describe patch
  contents; moved changelog notes to the --- block where they had been
  incorrectly placed in the commit body; fixed minor typos.

---

Dennis Dalessandro (24):
      RDMA/hfi2: Start hfi2 driver by basing off of hfi1
      RDMA/hfi2: Add in HW register definition files
      RDMA/hfi2: Add counter accessor functions
      RDMA/hfi2: Add in HW register access support
      RDMA/hfi2: Add in trace header files
      RDMA/hfi2: Add in trace support
      RDMA/hfi2: Add system core header files
      RDMA/hfi2: Add driver and interrupt infrastructure
      RDMA/hfi2: Add initialization and firmware support
      RDMA/hfi2: Add in MAD handling related headers
      RDMA/hfi2: Add cport management
      RDMA/hfi2: Implement MAD handling
      RDMA/hfi2: Add IO related headers
      RDMA/hfi2: Add PIO send infrastructure
      RDMA/hfi2: Add SDMA infrastructure
      RDMA/hfi2: Implement data moving infrastructure
      RDMA/hfi2: Add verbs core
      RDMA/hfi2: Add RC protocol support
      RDMA/hfi2: Add in support for verbs
      RDMA/hfi2: Add misc header files
      RDMA/hfi2: Add the rest of the driver
      RDMA/hfi2: Make it build and add TODO list
      RDMA/hfi2: Modernize mmap to use rdma_user_mmap_entry infrastructure
      RDMA/hfi2: Support ipoib


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2026-09-04  0:03 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 17:54 [PATCH v5 00/24] Migrate to hfi2 driver Dennis Dalessandro
2026-09-03 17:54 ` [PATCH v5 for-next 01/24] RDMA/hfi2: Start hfi2 driver by basing off of hfi1 Dennis Dalessandro
2026-09-03 17:54 ` [PATCH v5 for-next 02/24] RDMA/hfi2: Add in HW register definition files Dennis Dalessandro
2026-09-03 17:54 ` [PATCH v5 for-next 03/24] RDMA/hfi2: Add counter accessor functions Dennis Dalessandro
2026-09-03 17:54 ` [PATCH v5 for-next 04/24] RDMA/hfi2: Add in MAD handling related headers Dennis Dalessandro
2026-09-03 17:54 ` [PATCH v5 for-next 05/24] RDMA/hfi2: Add in HW register access support Dennis Dalessandro
2026-09-03 17:54 ` [PATCH v5 for-next 06/24] RDMA/hfi2: Add in trace header files Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 07/24] RDMA/hfi2: Add in trace support Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 08/24] RDMA/hfi2: Add system core header files Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 09/24] RDMA/hfi2: Add driver and interrupt infrastructure Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 10/24] RDMA/hfi2: Add initialization and firmware support Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 11/24] RDMA/hfi2: Add cport management Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 12/24] RDMA/hfi2: Implement MAD handling Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 13/24] RDMA/hfi2: Add IO related headers Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 14/24] RDMA/hfi2: Add PIO send infrastructure Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 15/24] RDMA/hfi2: Add SDMA infrastructure Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 16/24] RDMA/hfi2: Implement data moving infrastructure Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 17/24] RDMA/hfi2: Add verbs core Dennis Dalessandro
2026-09-03 17:55 ` [PATCH v5 for-next 18/24] RDMA/hfi2: Add RC protocol support Dennis Dalessandro
2026-09-03 17:56 ` [PATCH v5 for-next 19/24] RDMA/hfi2: Add in support for verbs Dennis Dalessandro
2026-09-03 17:56 ` [PATCH v5 for-next 20/24] RDMA/hfi2: Add misc header files Dennis Dalessandro
2026-09-03 17:56 ` [PATCH v5 for-next 21/24] RDMA/hfi2: Add the rest of the driver Dennis Dalessandro
2026-09-03 17:56 ` [PATCH v5 for-next 22/24] RDMA/hfi2: Make it build and add TODO list Dennis Dalessandro
2026-09-03 17:56 ` [PATCH v5 for-next 23/24] RDMA/hfi2: Modernize mmap to use rdma_user_mmap_entry infrastructure Dennis Dalessandro
2026-09-03 17:56 ` [PATCH v5 for-next 24/24] RDMA/hfi2: Support ipoib Dennis Dalessandro
2026-09-03 17:59 ` [PATCH v5 00/24] Migrate to hfi2 driver Jason Gunthorpe
2026-09-03 18:22   ` Dennis Dalessandro
2026-09-04  0:03     ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox