STRUCT BNX2I_HBA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct bnx2i_hba(9) πŸ’–

okay so this is a page from the Kernel API Manual, bestie β€” literally the reference for struct bnx2i_hba, and we're gonna go through the whole thing together. no skimming, no skipping, we're doing all of it. grab a snack πŸ“


✨ NAME ✨

struct bnx2i_hba β€” the bnx2i adapter structure. that's the vibe. it's giving "one struct to hold your whole HBA's life together" πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole thing, character for character, no cap:

struct bnx2i_hba {
    struct list_head link;
    struct cnic_dev *cnic;
    struct pci_dev *pcidev;
    struct net_device *netdev;
    void __iomem *regview;
    resource_size_t reg_base;
    u32 age;
    unsigned long cnic_dev_type;
  #define BNX2I_NX2_DEV_5706              0x0;
  #define BNX2I_NX2_DEV_5708              0x1;
  #define BNX2I_NX2_DEV_5709              0x2;
  #define BNX2I_NX2_DEV_57710             0x3;
    u32 mail_queue_access;
  #define BNX2I_MQ_KERNEL_MODE            0x0;
  #define BNX2I_MQ_KERNEL_BYPASS_MODE     0x1;
  #define BNX2I_MQ_BIN_MODE               0x2;
    unsigned long  reg_with_cnic;
  #define BNX2I_CNIC_REGISTERED           1;
    unsigned long  adapter_state;
  #define ADAPTER_STATE_UP                0;
  #define ADAPTER_STATE_GOING_DOWN        1;
  #define ADAPTER_STATE_LINK_DOWN         2;
  #define ADAPTER_STATE_INIT_FAILED       31;
    unsigned int mtu_supported;
  #define BNX2I_MAX_MTU_SUPPORTED         9000;
    struct Scsi_Host *shost;
    u32 max_sqes;
    u32 max_rqes;
    u32 max_cqes;
    u32 num_ccell;
    int ofld_conns_active;
    wait_queue_head_t eh_wait;
    int max_active_conns;
    struct iscsi_cid_queue cid_que;
    rwlock_t ep_rdwr_lock;
    struct list_head ep_ofld_list;
    struct list_head ep_active_list;
    struct list_head ep_destroy_list;
    char *mp_bd_tbl;
    dma_addr_t mp_bd_dma;
    char *dummy_buffer;
    dma_addr_t dummy_buf_dma;
    spinlock_t lock;
    struct mutex net_dev_lock;
    int hba_shutdown_tmo;
    int conn_teardown_tmo;
    int conn_ctx_destroy_tmo;
    u16 pci_did;
    u16 pci_vid;
    u16 pci_sdid;
    u16 pci_svid;
    u16 pci_func;
    u16 pci_devno;
    u32 num_wqe_sent;
    u32 num_cqe_rcvd;
    u32 num_intr_claimed;
    u32 link_changed_count;
    u32 ipaddr_changed_count;
    u32 num_sess_opened;
    u32 num_conn_opened;
    unsigned int ctx_ccell_tasks;
  #ifdef CONFIG_32BIT;
    spinlock_t stat_lock;
  #endif;
    struct bnx2i_stats_info bnx2i_stats;
    struct iscsi_stats_info stats;
 };

🌸 Members 🌸

okay this is the long part but honestly it's my favorite part. every single field, explained πŸ’–

  • link β€” list head to link elements.
  • cnic β€” pointer to cnic device.
  • pcidev β€” pointer to pci dev.
  • netdev β€” pointer to netdev structure.
  • regview β€” mapped PCI register space.
  • age β€” age, incremented by every recovery.
  • cnic_dev_type β€” cnic device type, 5706/5708/5709/57710.
  • mail_queue_access β€” mailbox queue access mode, applicable to 5709 only.
  • reg_with_cnic β€” indicates whether the device is register with CNIC.
  • adapter_state β€” adapter state, UP, GOING_DOWN, LINK_DOWN.
  • mtu_supported β€” Ethernet MTU supported.
  • shost β€” scsi host pointer.
  • max_sqes β€” SQ size.
  • max_rqes β€” RQ size.
  • max_cqes β€” CQ size.
  • num_ccell β€” number of command cells per connection.
  • ofld_conns_active β€” active connection list.
  • eh_wait β€” wait queue for the endpoint to shutdown.
  • max_active_conns β€” max offload connections supported by this device.
  • cid_que β€” iscsi cid queue.
  • ep_rdwr_lock β€” read / write lock to synchronize various ep lists.
  • ep_ofld_list β€” connection list for pending offload completion.
  • ep_active_list β€” connection list for active offload endpoints.
  • ep_destroy_list β€” connection list for pending offload completion.
  • mp_bd_tbl β€” BD table to be used with middle path requests.
  • mp_bd_dma β€” DMA address of mp_bd_tbl memory buffer.
  • dummy_buffer β€” Dummy buffer to be used with zero length scsicmd reqs.
  • dummy_buf_dma β€” DMA address of dummy_buffer memory buffer.
  • lock β€” lock to synchronize access to hba structure.
  • hba_shutdown_tmo β€” Timeout value to shutdown each connection.
  • conn_teardown_tmo β€” Timeout value to tear down each connection.
  • conn_ctx_destroy_tmo β€” Timeout value to destroy context of each connection.
  • pci_did β€” PCI device ID.
  • pci_vid β€” PCI vendor ID.
  • pci_sdid β€” PCI subsystem device ID.
  • pci_svid β€” PCI subsystem vendor ID.
  • pci_func β€” PCI function number in system pci tree.
  • pci_devno β€” PCI device number in system pci tree.
  • num_wqe_sent β€” statistic counter, total wqe's sent.
  • num_cqe_rcvd β€” statistic counter, total cqe's received.
  • num_intr_claimed β€” statistic counter, total interrupts claimed.
  • link_changed_count β€” statistic counter, num of link change notifications received.
  • ipaddr_changed_count β€” statistic counter, num times IP address changed while at least one connection is offloaded.
  • num_sess_opened β€” statistic counter, total num sessions opened.
  • num_conn_opened β€” statistic counter, total num conns opened on this hba.
  • ctx_ccell_tasks β€” captures number of ccells and tasks supported by currently offloaded connection, used to decode context memory.
  • stat_lock β€” spin lock used by the statistic collector (32 bit).
  • stats β€” local iSCSI statistic collection place holder.
ngl, net_dev_lock is in the struct but the member list doesn't give it a blurb β€” so we're not making one up. we respect the source 😌

πŸ¦‹ Description πŸ¦‹

Adapter Data Structure. that's it, that's the description. short and iconic, honestly πŸ‘‘


🌈 SEE ALSO 🌈

go look at these, bestie β€” they're all in the Kernel file ./drivers/scsi/bnx2i/bnx2i.h:

  • struct generic_pdu_resc(9)
  • struct bd_resc_page(9)
  • struct io_bdt(9)
  • struct bnx2i_conn(9)
  • struct iscsi_cid_queue(9)
  • struct qp_info(9)
  • struct bnx2i_endpoint(9)

and that's the whole page, periodt πŸ’œ this one came from ./drivers/scsi/bnx2i and it's dated October 2026 β€” so yeah, shoutout to that source and that date, they ate and left no crumbs 🫢✨

πŸ“¦ where this page comes from