#include <linux/module.h>
#include <linux/stringify.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/dma-mapping.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/page.h>
#include <linux/time.h>
#include <linux/mii.h>
#include <linux/mdio.h>
#include <linux/if.h>
#include <linux/if_vlan.h>
#include <linux/if_bridge.h>
#include <linux/rtc.h>
#include <linux/bpf.h>
#include <net/gro.h>
#include <net/ip.h>
#include <net/tcp.h>
#include <net/udp.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
#include <net/udp_tunnel.h>
#include <linux/workqueue.h>
#include <linux/prefetch.h>
#include <linux/cache.h>
#include <linux/log2.h>
#include <linux/bitmap.h>
#include <linux/cpu_rmap.h>
#include <linux/cpumask.h>
#include <net/pkt_cls.h>
#include <net/page_pool/helpers.h>
#include <linux/align.h>
#include <net/netdev_queues.h>
#include "bnxt_hsi.h"
#include "bnxt.h"
#include "bnxt_hwrm.h"
#include "bnxt_ulp.h"
#include "bnxt_sriov.h"
#include "bnxt_ethtool.h"
#include "bnxt_dcb.h"
#include "bnxt_xdp.h"
#include "bnxt_ptp.h"
#include "bnxt_vfr.h"
#include "bnxt_tc.h"
#include "bnxt_devlink.h"
#include "bnxt_debugfs.h"
#include "bnxt_coredump.h"
#include "bnxt_hwmon.h"
#define BNXT_TX_TIMEOUT …
#define BNXT_DEF_MSG_ENABLE …
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;
#define BNXT_RX_OFFSET …
#define BNXT_RX_DMA_OFFSET …
#define BNXT_RX_COPY_THRESH …
#define BNXT_TX_PUSH_THRESH …
static const struct { … } board_info[] = …;
static const struct pci_device_id bnxt_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, bnxt_pci_tbl);
static const u16 bnxt_vf_req_snif[] = …;
static const u16 bnxt_async_events_arr[] = …;
static struct workqueue_struct *bnxt_pf_wq;
#define BNXT_IPV6_MASK_ALL …
#define BNXT_IPV6_MASK_NONE …
const struct bnxt_flow_masks BNXT_FLOW_MASK_NONE = …;
const struct bnxt_flow_masks BNXT_FLOW_IPV6_MASK_ALL = …;
const struct bnxt_flow_masks BNXT_FLOW_IPV4_MASK_ALL = …;
static bool bnxt_vf_pciid(enum board_idx idx)
{ … }
#define DB_CP_REARM_FLAGS …
#define DB_CP_FLAGS …
#define BNXT_DB_CQ(db, idx) …
#define BNXT_DB_NQ_P5(db, idx) …
#define BNXT_DB_NQ_P7(db, idx) …
#define BNXT_DB_CQ_ARM(db, idx) …
#define BNXT_DB_NQ_ARM_P5(db, idx) …
static void bnxt_db_nq(struct bnxt *bp, struct bnxt_db_info *db, u32 idx)
{ … }
static void bnxt_db_nq_arm(struct bnxt *bp, struct bnxt_db_info *db, u32 idx)
{ … }
static void bnxt_db_cq(struct bnxt *bp, struct bnxt_db_info *db, u32 idx)
{ … }
static void bnxt_queue_fw_reset_work(struct bnxt *bp, unsigned long delay)
{ … }
static void __bnxt_queue_sp_work(struct bnxt *bp)
{ … }
static void bnxt_queue_sp_work(struct bnxt *bp, unsigned int event)
{ … }
static void bnxt_sched_reset_rxr(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
{ … }
void bnxt_sched_reset_txr(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
u16 curr)
{ … }
const u16 bnxt_lhint_arr[] = …;
static u16 bnxt_xmit_get_cfa_action(struct sk_buff *skb)
{ … }
static void bnxt_txr_db_kick(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
u16 prod)
{ … }
static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ … }
static bool __bnxt_tx_int(struct bnxt *bp, struct bnxt_tx_ring_info *txr,
int budget)
{ … }
static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
{ … }
static struct page *__bnxt_alloc_rx_page(struct bnxt *bp, dma_addr_t *mapping,
struct bnxt_rx_ring_info *rxr,
unsigned int *offset,
gfp_t gfp)
{ … }
static inline u8 *__bnxt_alloc_rx_frag(struct bnxt *bp, dma_addr_t *mapping,
gfp_t gfp)
{ … }
int bnxt_alloc_rx_data(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
u16 prod, gfp_t gfp)
{ … }
void bnxt_reuse_rx_data(struct bnxt_rx_ring_info *rxr, u16 cons, void *data)
{ … }
static inline u16 bnxt_find_next_agg_idx(struct bnxt_rx_ring_info *rxr, u16 idx)
{ … }
static inline int bnxt_alloc_rx_page(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
u16 prod, gfp_t gfp)
{ … }
static struct rx_agg_cmp *bnxt_get_agg(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr,
u16 cp_cons, u16 curr)
{ … }
static struct rx_agg_cmp *bnxt_get_tpa_agg_p5(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
u16 agg_id, u16 curr)
{ … }
static void bnxt_reuse_rx_agg_bufs(struct bnxt_cp_ring_info *cpr, u16 idx,
u16 start, u32 agg_bufs, bool tpa)
{ … }
static struct sk_buff *bnxt_rx_multi_page_skb(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
u16 cons, void *data, u8 *data_ptr,
dma_addr_t dma_addr,
unsigned int offset_and_len)
{ … }
static struct sk_buff *bnxt_rx_page_skb(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
u16 cons, void *data, u8 *data_ptr,
dma_addr_t dma_addr,
unsigned int offset_and_len)
{ … }
static struct sk_buff *bnxt_rx_skb(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr, u16 cons,
void *data, u8 *data_ptr,
dma_addr_t dma_addr,
unsigned int offset_and_len)
{ … }
static u32 __bnxt_rx_agg_pages(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr,
struct skb_shared_info *shinfo,
u16 idx, u32 agg_bufs, bool tpa,
struct xdp_buff *xdp)
{ … }
static struct sk_buff *bnxt_rx_agg_pages_skb(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr,
struct sk_buff *skb, u16 idx,
u32 agg_bufs, bool tpa)
{ … }
static u32 bnxt_rx_agg_pages_xdp(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr,
struct xdp_buff *xdp, u16 idx,
u32 agg_bufs, bool tpa)
{ … }
static int bnxt_agg_bufs_valid(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
u8 agg_bufs, u32 *raw_cons)
{ … }
static struct sk_buff *bnxt_copy_data(struct bnxt_napi *bnapi, u8 *data,
unsigned int len,
dma_addr_t mapping)
{ … }
static struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data,
unsigned int len,
dma_addr_t mapping)
{ … }
static struct sk_buff *bnxt_copy_xdp(struct bnxt_napi *bnapi,
struct xdp_buff *xdp,
unsigned int len,
dma_addr_t mapping)
{ … }
static int bnxt_discard_rx(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
u32 *raw_cons, void *cmp)
{ … }
static u16 bnxt_alloc_agg_idx(struct bnxt_rx_ring_info *rxr, u16 agg_id)
{ … }
static void bnxt_free_agg_idx(struct bnxt_rx_ring_info *rxr, u16 idx)
{ … }
static u16 bnxt_lookup_agg_idx(struct bnxt_rx_ring_info *rxr, u16 agg_id)
{ … }
static void bnxt_tpa_metadata(struct bnxt_tpa_info *tpa_info,
struct rx_tpa_start_cmp *tpa_start,
struct rx_tpa_start_cmp_ext *tpa_start1)
{ … }
static void bnxt_tpa_metadata_v2(struct bnxt_tpa_info *tpa_info,
struct rx_tpa_start_cmp *tpa_start,
struct rx_tpa_start_cmp_ext *tpa_start1)
{ … }
static void bnxt_tpa_start(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
u8 cmp_type, struct rx_tpa_start_cmp *tpa_start,
struct rx_tpa_start_cmp_ext *tpa_start1)
{ … }
static void bnxt_abort_tpa(struct bnxt_cp_ring_info *cpr, u16 idx, u32 agg_bufs)
{ … }
#ifdef CONFIG_INET
static void bnxt_gro_tunnel(struct sk_buff *skb, __be16 ip_proto)
{ … }
#endif
static struct sk_buff *bnxt_gro_func_5731x(struct bnxt_tpa_info *tpa_info,
int payload_off, int tcp_ts,
struct sk_buff *skb)
{ … }
static struct sk_buff *bnxt_gro_func_5750x(struct bnxt_tpa_info *tpa_info,
int payload_off, int tcp_ts,
struct sk_buff *skb)
{ … }
#define BNXT_IPV4_HDR_SIZE …
#define BNXT_IPV6_HDR_SIZE …
static struct sk_buff *bnxt_gro_func_5730x(struct bnxt_tpa_info *tpa_info,
int payload_off, int tcp_ts,
struct sk_buff *skb)
{ … }
static inline struct sk_buff *bnxt_gro_skb(struct bnxt *bp,
struct bnxt_tpa_info *tpa_info,
struct rx_tpa_end_cmp *tpa_end,
struct rx_tpa_end_cmp_ext *tpa_end1,
struct sk_buff *skb)
{ … }
static struct net_device *bnxt_get_pkt_dev(struct bnxt *bp, u16 cfa_code)
{ … }
static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr,
u32 *raw_cons,
struct rx_tpa_end_cmp *tpa_end,
struct rx_tpa_end_cmp_ext *tpa_end1,
u8 *event)
{ … }
static void bnxt_tpa_agg(struct bnxt *bp, struct bnxt_rx_ring_info *rxr,
struct rx_agg_cmp *rx_agg)
{ … }
static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi,
struct sk_buff *skb)
{ … }
static bool bnxt_rx_ts_valid(struct bnxt *bp, u32 flags,
struct rx_cmp_ext *rxcmp1, u32 *cmpl_ts)
{ … }
static struct sk_buff *bnxt_rx_vlan(struct sk_buff *skb, u8 cmp_type,
struct rx_cmp *rxcmp,
struct rx_cmp_ext *rxcmp1)
{ … }
static enum pkt_hash_types bnxt_rss_ext_op(struct bnxt *bp,
struct rx_cmp *rxcmp)
{ … }
static int bnxt_rx_pkt(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
u32 *raw_cons, u8 *event)
{ … }
static int bnxt_force_rx_discard(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr,
u32 *raw_cons, u8 *event)
{ … }
u32 bnxt_fw_health_readl(struct bnxt *bp, int reg_idx)
{ … }
static u16 bnxt_agg_ring_id_to_grp_idx(struct bnxt *bp, u16 ring_id)
{ … }
static u16 bnxt_get_force_speed(struct bnxt_link_info *link_info)
{ … }
static void bnxt_set_force_speed(struct bnxt_link_info *link_info)
{ … }
static void bnxt_set_auto_speed(struct bnxt_link_info *link_info)
{ … }
static bool bnxt_force_speed_updated(struct bnxt_link_info *link_info)
{ … }
static bool bnxt_auto_speed_updated(struct bnxt_link_info *link_info)
{ … }
#define BNXT_EVENT_THERMAL_CURRENT_TEMP(data2) …
#define BNXT_EVENT_THERMAL_THRESHOLD_TEMP(data2) …
#define EVENT_DATA1_THERMAL_THRESHOLD_TYPE(data1) …
#define EVENT_DATA1_THERMAL_THRESHOLD_DIR_INCREASING(data1) …
static bool bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2)
{ … }
#define BNXT_GET_EVENT_PORT(data) …
#define BNXT_EVENT_RING_TYPE(data2) …
#define BNXT_EVENT_RING_TYPE_RX(data2) …
#define BNXT_EVENT_PHC_EVENT_TYPE(data1) …
#define BNXT_EVENT_PHC_RTC_UPDATE(data1) …
#define BNXT_PHC_BITS …
static int bnxt_async_event_process(struct bnxt *bp,
struct hwrm_async_event_cmpl *cmpl)
{ … }
static int bnxt_hwrm_handler(struct bnxt *bp, struct tx_cmp *txcmp)
{ … }
static irqreturn_t bnxt_msix(int irq, void *dev_instance)
{ … }
static inline int bnxt_has_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
{ … }
static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
int budget)
{ … }
static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi,
int budget)
{ … }
static int bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
int budget)
{ … }
static int bnxt_poll_nitroa0(struct napi_struct *napi, int budget)
{ … }
static int bnxt_poll(struct napi_struct *napi, int budget)
{ … }
static int __bnxt_poll_cqs(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
{ … }
static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi,
u64 dbr_type, int budget)
{ … }
static int bnxt_poll_p5(struct napi_struct *napi, int budget)
{ … }
static void bnxt_free_tx_skbs(struct bnxt *bp)
{ … }
static void bnxt_free_one_rx_ring(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
{ … }
static void bnxt_free_one_rx_agg_ring(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
{ … }
static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr)
{ … }
static void bnxt_free_rx_skbs(struct bnxt *bp)
{ … }
static void bnxt_free_skbs(struct bnxt *bp)
{ … }
static void bnxt_init_ctx_mem(struct bnxt_ctx_mem_type *ctxm, void *p, int len)
{ … }
static void bnxt_free_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem)
{ … }
static int bnxt_alloc_ring(struct bnxt *bp, struct bnxt_ring_mem_info *rmem)
{ … }
static void bnxt_free_tpa_info(struct bnxt *bp)
{ … }
static int bnxt_alloc_tpa_info(struct bnxt *bp)
{ … }
static void bnxt_free_rx_rings(struct bnxt *bp)
{ … }
static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
int numa_node)
{ … }
static int bnxt_alloc_rx_rings(struct bnxt *bp)
{ … }
static void bnxt_free_tx_rings(struct bnxt *bp)
{ … }
#define BNXT_TC_TO_RING_BASE(bp, tc) …
#define BNXT_RING_TO_TC_OFF(bp, tx) …
#define BNXT_RING_TO_TC(bp, tx) …
static int bnxt_alloc_tx_rings(struct bnxt *bp)
{ … }
static void bnxt_free_cp_arrays(struct bnxt_cp_ring_info *cpr)
{ … }
static int bnxt_alloc_cp_arrays(struct bnxt_cp_ring_info *cpr, int n)
{ … }
static void bnxt_free_all_cp_arrays(struct bnxt *bp)
{ … }
static int bnxt_alloc_all_cp_arrays(struct bnxt *bp)
{ … }
static void bnxt_free_cp_rings(struct bnxt *bp)
{ … }
static int bnxt_alloc_cp_sub_ring(struct bnxt *bp,
struct bnxt_cp_ring_info *cpr)
{ … }
static int bnxt_alloc_cp_rings(struct bnxt *bp)
{ … }
static void bnxt_init_rx_ring_struct(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr)
{ … }
static void bnxt_reset_rx_ring_struct(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr)
{ … }
static void bnxt_init_ring_struct(struct bnxt *bp)
{ … }
static void bnxt_init_rxbd_pages(struct bnxt_ring_struct *ring, u32 type)
{ … }
static void bnxt_alloc_one_rx_ring_skb(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
int ring_nr)
{ … }
static void bnxt_alloc_one_rx_ring_page(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
int ring_nr)
{ … }
static int bnxt_alloc_one_rx_ring(struct bnxt *bp, int ring_nr)
{ … }
static void bnxt_init_one_rx_ring_rxbd(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr)
{ … }
static void bnxt_init_one_rx_agg_ring_rxbd(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr)
{ … }
static int bnxt_init_one_rx_ring(struct bnxt *bp, int ring_nr)
{ … }
static void bnxt_init_cp_rings(struct bnxt *bp)
{ … }
static int bnxt_init_rx_rings(struct bnxt *bp)
{ … }
static int bnxt_init_tx_rings(struct bnxt *bp)
{ … }
static void bnxt_free_ring_grps(struct bnxt *bp)
{ … }
static int bnxt_init_ring_grps(struct bnxt *bp, bool irq_re_init)
{ … }
static void bnxt_free_vnics(struct bnxt *bp)
{ … }
static int bnxt_alloc_vnics(struct bnxt *bp)
{ … }
static void bnxt_init_vnics(struct bnxt *bp)
{ … }
static int bnxt_calc_nr_ring_pages(u32 ring_size, int desc_per_pg)
{ … }
void bnxt_set_tpa_flags(struct bnxt *bp)
{ … }
void bnxt_set_ring_params(struct bnxt *bp)
{ … }
int bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode)
{ … }
static void bnxt_free_vnic_attributes(struct bnxt *bp)
{ … }
static int bnxt_alloc_vnic_attributes(struct bnxt *bp)
{ … }
static void bnxt_free_hwrm_resources(struct bnxt *bp)
{ … }
static int bnxt_alloc_hwrm_resources(struct bnxt *bp)
{ … }
static void bnxt_free_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats)
{ … }
static int bnxt_alloc_stats_mem(struct bnxt *bp, struct bnxt_stats_mem *stats,
bool alloc_masks)
{ … }
static void bnxt_fill_masks(u64 *mask_arr, u64 mask, int count)
{ … }
static void bnxt_copy_hw_masks(u64 *mask_arr, __le64 *hw_mask_arr, int count)
{ … }
static int bnxt_hwrm_func_qstat_ext(struct bnxt *bp,
struct bnxt_stats_mem *stats)
{ … }
static int bnxt_hwrm_port_qstats(struct bnxt *bp, u8 flags);
static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp, u8 flags);
static void bnxt_init_stats(struct bnxt *bp)
{ … }
static void bnxt_free_port_stats(struct bnxt *bp)
{ … }
static void bnxt_free_ring_stats(struct bnxt *bp)
{ … }
static int bnxt_alloc_stats(struct bnxt *bp)
{ … }
static void bnxt_clear_ring_indices(struct bnxt *bp)
{ … }
void bnxt_insert_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr)
{ … }
void bnxt_del_one_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr)
{ … }
static void bnxt_clear_usr_fltrs(struct bnxt *bp, bool all)
{ … }
static void bnxt_del_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr)
{ … }
static void bnxt_free_ntp_fltrs(struct bnxt *bp, bool all)
{ … }
static int bnxt_alloc_ntp_fltrs(struct bnxt *bp)
{ … }
static void bnxt_free_l2_filters(struct bnxt *bp, bool all)
{ … }
static void bnxt_init_l2_fltr_tbl(struct bnxt *bp)
{ … }
static void bnxt_free_mem(struct bnxt *bp, bool irq_re_init)
{ … }
static int bnxt_alloc_mem(struct bnxt *bp, bool irq_re_init)
{ … }
static void bnxt_disable_int(struct bnxt *bp)
{ … }
static int bnxt_cp_num_to_irq_num(struct bnxt *bp, int n)
{ … }
static void bnxt_disable_int_sync(struct bnxt *bp)
{ … }
static void bnxt_enable_int(struct bnxt *bp)
{ … }
int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp, unsigned long *bmap, int bmap_size,
bool async_only)
{ … }
int bnxt_hwrm_func_drv_unrgtr(struct bnxt *bp)
{ … }
static int bnxt_set_tpa(struct bnxt *bp, bool set_tpa);
static int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, u8 tunnel_type)
{ … }
static int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, __be16 port,
u8 tunnel_type)
{ … }
static int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, u16 vnic_id)
{ … }
void bnxt_del_l2_filter(struct bnxt *bp, struct bnxt_l2_filter *fltr)
{ … }
static struct bnxt_l2_filter *__bnxt_lookup_l2_filter(struct bnxt *bp,
struct bnxt_l2_key *key,
u32 idx)
{ … }
static struct bnxt_l2_filter *bnxt_lookup_l2_filter(struct bnxt *bp,
struct bnxt_l2_key *key,
u32 idx)
{ … }
#define BNXT_IPV4_4TUPLE(bp, fkeys) …
#define BNXT_IPV6_4TUPLE(bp, fkeys) …
static u32 bnxt_get_rss_flow_tuple_len(struct bnxt *bp, struct flow_keys *fkeys)
{ … }
static u32 bnxt_toeplitz(struct bnxt *bp, struct flow_keys *fkeys,
const unsigned char *key)
{ … }
#ifdef CONFIG_RFS_ACCEL
static struct bnxt_l2_filter *
bnxt_lookup_l2_filter_from_key(struct bnxt *bp, struct bnxt_l2_key *key)
{ … }
#endif
static int bnxt_init_l2_filter(struct bnxt *bp, struct bnxt_l2_filter *fltr,
struct bnxt_l2_key *key, u32 idx)
{ … }
static struct bnxt_l2_filter *bnxt_alloc_l2_filter(struct bnxt *bp,
struct bnxt_l2_key *key,
gfp_t gfp)
{ … }
struct bnxt_l2_filter *bnxt_alloc_new_l2_filter(struct bnxt *bp,
struct bnxt_l2_key *key,
u16 flags)
{ … }
static u16 bnxt_vf_target_id(struct bnxt_pf_info *pf, u16 vf_idx)
{ … }
int bnxt_hwrm_l2_filter_free(struct bnxt *bp, struct bnxt_l2_filter *fltr)
{ … }
int bnxt_hwrm_l2_filter_alloc(struct bnxt *bp, struct bnxt_l2_filter *fltr)
{ … }
int bnxt_hwrm_cfa_ntuple_filter_free(struct bnxt *bp,
struct bnxt_ntuple_filter *fltr)
{ … }
#define BNXT_NTP_FLTR_FLAGS …
#define BNXT_NTP_TUNNEL_FLTR_FLAG …
void bnxt_fill_ipv6_mask(__be32 mask[4])
{ … }
static void
bnxt_cfg_rfs_ring_tbl_idx(struct bnxt *bp,
struct hwrm_cfa_ntuple_filter_alloc_input *req,
struct bnxt_ntuple_filter *fltr)
{ … }
int bnxt_hwrm_cfa_ntuple_filter_alloc(struct bnxt *bp,
struct bnxt_ntuple_filter *fltr)
{ … }
static int bnxt_hwrm_set_vnic_filter(struct bnxt *bp, u16 vnic_id, u16 idx,
const u8 *mac_addr)
{ … }
static void bnxt_hwrm_clear_vnic_filter(struct bnxt *bp)
{ … }
#define BNXT_DFLT_TUNL_TPA_BMAP …
static void bnxt_hwrm_vnic_update_tunl_tpa(struct bnxt *bp,
struct hwrm_vnic_tpa_cfg_input *req)
{ … }
int bnxt_hwrm_vnic_set_tpa(struct bnxt *bp, struct bnxt_vnic_info *vnic,
u32 tpa_flags)
{ … }
static u16 bnxt_cp_ring_from_grp(struct bnxt *bp, struct bnxt_ring_struct *ring)
{ … }
static u16 bnxt_cp_ring_for_rx(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
{ … }
static u16 bnxt_cp_ring_for_tx(struct bnxt *bp, struct bnxt_tx_ring_info *txr)
{ … }
static int bnxt_alloc_rss_indir_tbl(struct bnxt *bp)
{ … }
void bnxt_set_dflt_rss_indir_tbl(struct bnxt *bp,
struct ethtool_rxfh_context *rss_ctx)
{ … }
static u16 bnxt_get_max_rss_ring(struct bnxt *bp)
{ … }
int bnxt_get_nr_rss_ctxs(struct bnxt *bp, int rx_rings)
{ … }
static void bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
static void bnxt_fill_hw_rss_tbl_p5(struct bnxt *bp,
struct bnxt_vnic_info *vnic)
{ … }
static void
__bnxt_hwrm_vnic_set_rss(struct bnxt *bp, struct hwrm_vnic_rss_cfg_input *req,
struct bnxt_vnic_info *vnic)
{ … }
static int bnxt_hwrm_vnic_set_rss(struct bnxt *bp, struct bnxt_vnic_info *vnic,
bool set_rss)
{ … }
static int bnxt_hwrm_vnic_set_rss_p5(struct bnxt *bp,
struct bnxt_vnic_info *vnic, bool set_rss)
{ … }
static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)
{ … }
static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
static void bnxt_hwrm_vnic_ctx_free_one(struct bnxt *bp,
struct bnxt_vnic_info *vnic,
u16 ctx_idx)
{ … }
static void bnxt_hwrm_vnic_ctx_free(struct bnxt *bp)
{ … }
static int bnxt_hwrm_vnic_ctx_alloc(struct bnxt *bp,
struct bnxt_vnic_info *vnic, u16 ctx_idx)
{ … }
static u32 bnxt_get_roce_vnic_mode(struct bnxt *bp)
{ … }
int bnxt_hwrm_vnic_cfg(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
static void bnxt_hwrm_vnic_free_one(struct bnxt *bp,
struct bnxt_vnic_info *vnic)
{ … }
static void bnxt_hwrm_vnic_free(struct bnxt *bp)
{ … }
int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic,
unsigned int start_rx_ring_idx,
unsigned int nr_rings)
{ … }
static int bnxt_hwrm_vnic_qcaps(struct bnxt *bp)
{ … }
static int bnxt_hwrm_ring_grp_alloc(struct bnxt *bp)
{ … }
static void bnxt_hwrm_ring_grp_free(struct bnxt *bp)
{ … }
static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
struct bnxt_ring_struct *ring,
u32 ring_type, u32 map_index)
{ … }
static int bnxt_hwrm_set_async_event_cr(struct bnxt *bp, int idx)
{ … }
static void bnxt_set_db_mask(struct bnxt *bp, struct bnxt_db_info *db,
u32 ring_type)
{ … }
static void bnxt_set_db(struct bnxt *bp, struct bnxt_db_info *db, u32 ring_type,
u32 map_idx, u32 xid)
{ … }
static int bnxt_hwrm_rx_ring_alloc(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr)
{ … }
static int bnxt_hwrm_rx_agg_ring_alloc(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr)
{ … }
static int bnxt_hwrm_ring_alloc(struct bnxt *bp)
{ … }
static int hwrm_ring_free_send_msg(struct bnxt *bp,
struct bnxt_ring_struct *ring,
u32 ring_type, int cmpl_ring_id)
{ … }
static void bnxt_hwrm_rx_ring_free(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
bool close_path)
{ … }
static void bnxt_hwrm_rx_agg_ring_free(struct bnxt *bp,
struct bnxt_rx_ring_info *rxr,
bool close_path)
{ … }
static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
{ … }
static int __bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max,
bool shared);
static int bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max,
bool shared);
static int bnxt_hwrm_get_rings(struct bnxt *bp)
{ … }
int __bnxt_hwrm_get_tx_rings(struct bnxt *bp, u16 fid, int *tx_rings)
{ … }
static bool bnxt_rfs_supported(struct bnxt *bp);
static struct hwrm_func_cfg_input *
__bnxt_hwrm_reserve_pf_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static struct hwrm_func_vf_cfg_input *
__bnxt_hwrm_reserve_vf_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static int
bnxt_hwrm_reserve_pf_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static int
bnxt_hwrm_reserve_vf_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static int bnxt_hwrm_reserve_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
int bnxt_nq_rings_in_use(struct bnxt *bp)
{ … }
static int bnxt_cp_rings_in_use(struct bnxt *bp)
{ … }
static int bnxt_get_func_stat_ctxs(struct bnxt *bp)
{ … }
static int bnxt_get_total_rss_ctxs(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static void bnxt_check_rss_tbl_no_rmgr(struct bnxt *bp)
{ … }
static int bnxt_get_total_vnics(struct bnxt *bp, int rx_rings)
{ … }
static bool bnxt_need_reserve_rings(struct bnxt *bp)
{ … }
static void bnxt_copy_reserved_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static bool bnxt_rings_ok(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static int bnxt_get_avail_msix(struct bnxt *bp, int num);
static int __bnxt_reserve_rings(struct bnxt *bp)
{ … }
static int bnxt_hwrm_check_vf_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static int bnxt_hwrm_check_pf_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static int bnxt_hwrm_check_rings(struct bnxt *bp, struct bnxt_hw_rings *hwr)
{ … }
static void bnxt_hwrm_coal_params_qcaps(struct bnxt *bp)
{ … }
static u16 bnxt_usec_to_coal_tmr(struct bnxt *bp, u16 usec)
{ … }
static void bnxt_hwrm_set_coal_params(struct bnxt *bp,
struct bnxt_coal *hw_coal,
struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req)
{ … }
static int __bnxt_hwrm_set_coal_nq(struct bnxt *bp, struct bnxt_napi *bnapi,
struct bnxt_coal *hw_coal)
{ … }
int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi)
{ … }
static int
bnxt_hwrm_set_rx_coal(struct bnxt *bp, struct bnxt_napi *bnapi,
struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req)
{ … }
static int
bnxt_hwrm_set_tx_coal(struct bnxt *bp, struct bnxt_napi *bnapi,
struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req)
{ … }
int bnxt_hwrm_set_coal(struct bnxt *bp)
{ … }
static void bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
{ … }
static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
{ … }
static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
{ … }
static void bnxt_init_ctx_initializer(struct bnxt_ctx_mem_type *ctxm,
u8 init_val, u8 init_offset,
bool init_mask_set)
{ … }
static int bnxt_alloc_all_ctx_pg_info(struct bnxt *bp, int ctx_max)
{ … }
#define BNXT_CTX_INIT_VALID(flags) …
static int bnxt_hwrm_func_backing_store_qcaps_v2(struct bnxt *bp)
{ … }
static int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp)
{ … }
static void bnxt_hwrm_set_pg_attr(struct bnxt_ring_mem_info *rmem, u8 *pg_attr,
__le64 *pg_dir)
{ … }
#define FUNC_BACKING_STORE_CFG_REQ_DFLT_ENABLES …
static int bnxt_hwrm_func_backing_store_cfg(struct bnxt *bp, u32 enables)
{ … }
static int bnxt_alloc_ctx_mem_blk(struct bnxt *bp,
struct bnxt_ctx_pg_info *ctx_pg)
{ … }
static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp,
struct bnxt_ctx_pg_info *ctx_pg, u32 mem_size,
u8 depth, struct bnxt_ctx_mem_type *ctxm)
{ … }
static void bnxt_free_ctx_pg_tbls(struct bnxt *bp,
struct bnxt_ctx_pg_info *ctx_pg)
{ … }
static int bnxt_setup_ctxm_pg_tbls(struct bnxt *bp,
struct bnxt_ctx_mem_type *ctxm, u32 entries,
u8 pg_lvl)
{ … }
static int bnxt_hwrm_func_backing_store_cfg_v2(struct bnxt *bp,
struct bnxt_ctx_mem_type *ctxm,
bool last)
{ … }
static int bnxt_backing_store_cfg_v2(struct bnxt *bp, u32 ena)
{ … }
void bnxt_free_ctx_mem(struct bnxt *bp)
{ … }
static int bnxt_alloc_ctx_mem(struct bnxt *bp)
{ … }
static int bnxt_hwrm_crash_dump_mem_cfg(struct bnxt *bp)
{ … }
static void bnxt_free_crash_dump_mem(struct bnxt *bp)
{ … }
static int bnxt_alloc_crash_dump_mem(struct bnxt *bp)
{ … }
int bnxt_hwrm_func_resc_qcaps(struct bnxt *bp, bool all)
{ … }
static int __bnxt_hwrm_ptp_qcfg(struct bnxt *bp)
{ … }
static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
{ … }
static void bnxt_hwrm_dbg_qcaps(struct bnxt *bp)
{ … }
static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp);
int bnxt_hwrm_func_qcaps(struct bnxt *bp)
{ … }
static int bnxt_hwrm_cfa_adv_flow_mgnt_qcaps(struct bnxt *bp)
{ … }
static int __bnxt_alloc_fw_health(struct bnxt *bp)
{ … }
static int bnxt_alloc_fw_health(struct bnxt *bp)
{ … }
static void __bnxt_map_fw_health_reg(struct bnxt *bp, u32 reg)
{ … }
static void bnxt_inv_fw_health_reg(struct bnxt *bp)
{ … }
static void bnxt_try_map_fw_health_reg(struct bnxt *bp)
{ … }
static int bnxt_map_fw_health_regs(struct bnxt *bp)
{ … }
static void bnxt_remap_fw_health_regs(struct bnxt *bp)
{ … }
static int bnxt_hwrm_error_recovery_qcfg(struct bnxt *bp)
{ … }
static int bnxt_hwrm_func_reset(struct bnxt *bp)
{ … }
static void bnxt_nvm_cfg_ver_get(struct bnxt *bp)
{ … }
static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
{ … }
static int bnxt_hwrm_poll(struct bnxt *bp)
{ … }
static int bnxt_hwrm_ver_get(struct bnxt *bp)
{ … }
int bnxt_hwrm_fw_set_time(struct bnxt *bp)
{ … }
static void bnxt_add_one_ctr(u64 hw, u64 *sw, u64 mask)
{ … }
static void __bnxt_accumulate_stats(__le64 *hw_stats, u64 *sw_stats, u64 *masks,
int count, bool ignore_zero)
{ … }
static void bnxt_accumulate_stats(struct bnxt_stats_mem *stats)
{ … }
static void bnxt_accumulate_all_stats(struct bnxt *bp)
{ … }
static int bnxt_hwrm_port_qstats(struct bnxt *bp, u8 flags)
{ … }
static int bnxt_hwrm_port_qstats_ext(struct bnxt *bp, u8 flags)
{ … }
static void bnxt_hwrm_free_tunnel_ports(struct bnxt *bp)
{ … }
static int bnxt_set_tpa(struct bnxt *bp, bool set_tpa)
{ … }
static void bnxt_hwrm_clear_vnic_rss(struct bnxt *bp)
{ … }
static void bnxt_clear_vnic(struct bnxt *bp)
{ … }
static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
bool irq_re_init)
{ … }
static int bnxt_hwrm_set_br_mode(struct bnxt *bp, u16 br_mode)
{ … }
static int bnxt_hwrm_set_cache_line_size(struct bnxt *bp, int size)
{ … }
static int __bnxt_setup_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
int bnxt_hwrm_vnic_update(struct bnxt *bp, struct bnxt_vnic_info *vnic,
u8 valid)
{ … }
int bnxt_hwrm_vnic_rss_cfg_p5(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
int __bnxt_setup_vnic_p5(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
static int bnxt_setup_vnic(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{ … }
static int bnxt_alloc_and_setup_vnic(struct bnxt *bp,
struct bnxt_vnic_info *vnic,
u16 start_rx_ring_idx, int rx_rings)
{ … }
static int bnxt_alloc_rfs_vnics(struct bnxt *bp)
{ … }
void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx,
bool all)
{ … }
static void bnxt_hwrm_realloc_rss_ctx_vnic(struct bnxt *bp)
{ … }
static void bnxt_clear_rss_ctxs(struct bnxt *bp)
{ … }
static bool bnxt_promisc_ok(struct bnxt *bp)
{ … }
static int bnxt_setup_nitroa0_vnic(struct bnxt *bp)
{ … }
static int bnxt_cfg_rx_mode(struct bnxt *);
static bool bnxt_mc_list_updated(struct bnxt *, u32 *);
static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init)
{ … }
static int bnxt_shutdown_nic(struct bnxt *bp, bool irq_re_init)
{ … }
static int bnxt_init_nic(struct bnxt *bp, bool irq_re_init)
{ … }
static int bnxt_set_real_num_queues(struct bnxt *bp)
{ … }
static int __bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max,
bool shared)
{ … }
static int __bnxt_num_tx_to_cp(struct bnxt *bp, int tx, int tx_sets, int tx_xdp)
{ … }
int bnxt_num_tx_to_cp(struct bnxt *bp, int tx)
{ … }
static int bnxt_num_cp_to_tx(struct bnxt *bp, int tx_cp)
{ … }
static int bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max,
bool sh)
{ … }
static void bnxt_setup_msix(struct bnxt *bp)
{ … }
static int bnxt_init_int_mode(struct bnxt *bp);
static int bnxt_change_msix(struct bnxt *bp, int total)
{ … }
static int bnxt_setup_int_mode(struct bnxt *bp)
{ … }
static unsigned int bnxt_get_max_func_rss_ctxs(struct bnxt *bp)
{ … }
static unsigned int bnxt_get_max_func_vnics(struct bnxt *bp)
{ … }
unsigned int bnxt_get_max_func_stat_ctxs(struct bnxt *bp)
{ … }
unsigned int bnxt_get_max_func_cp_rings(struct bnxt *bp)
{ … }
static unsigned int bnxt_get_max_func_cp_rings_for_en(struct bnxt *bp)
{ … }
static unsigned int bnxt_get_max_func_irqs(struct bnxt *bp)
{ … }
static void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)
{ … }
unsigned int bnxt_get_avail_cp_rings_for_en(struct bnxt *bp)
{ … }
unsigned int bnxt_get_avail_stat_ctxs_for_en(struct bnxt *bp)
{ … }
static int bnxt_get_avail_msix(struct bnxt *bp, int num)
{ … }
static int bnxt_get_num_msix(struct bnxt *bp)
{ … }
static int bnxt_init_int_mode(struct bnxt *bp)
{ … }
static void bnxt_clear_int_mode(struct bnxt *bp)
{ … }
int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
{ … }
static void bnxt_free_irq(struct bnxt *bp)
{ … }
static int bnxt_request_irq(struct bnxt *bp)
{ … }
static void bnxt_del_napi(struct bnxt *bp)
{ … }
static void bnxt_init_napi(struct bnxt *bp)
{ … }
static void bnxt_disable_napi(struct bnxt *bp)
{ … }
static void bnxt_enable_napi(struct bnxt *bp)
{ … }
void bnxt_tx_disable(struct bnxt *bp)
{ … }
void bnxt_tx_enable(struct bnxt *bp)
{ … }
static char *bnxt_report_fec(struct bnxt_link_info *link_info)
{ … }
void bnxt_report_link(struct bnxt *bp)
{ … }
static bool bnxt_phy_qcaps_no_speed(struct hwrm_port_phy_qcaps_output *resp)
{ … }
static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
{ … }
static bool bnxt_support_dropped(u16 advertising, u16 supported)
{ … }
static bool bnxt_support_speed_dropped(struct bnxt_link_info *link_info)
{ … }
int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
{ … }
static void bnxt_get_port_module_status(struct bnxt *bp)
{ … }
static void
bnxt_hwrm_set_pause_common(struct bnxt *bp, struct hwrm_port_phy_cfg_input *req)
{ … }
static void bnxt_hwrm_set_link_common(struct bnxt *bp, struct hwrm_port_phy_cfg_input *req)
{ … }
int bnxt_hwrm_set_pause(struct bnxt *bp)
{ … }
static void bnxt_hwrm_set_eee(struct bnxt *bp,
struct hwrm_port_phy_cfg_input *req)
{ … }
int bnxt_hwrm_set_link_setting(struct bnxt *bp, bool set_pause, bool set_eee)
{ … }
static int bnxt_hwrm_shutdown_link(struct bnxt *bp)
{ … }
static int bnxt_fw_reset_via_optee(struct bnxt *bp)
{ … }
static int bnxt_try_recover_fw(struct bnxt *bp)
{ … }
static void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset)
{ … }
int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset)
{ … }
static int bnxt_hwrm_if_change(struct bnxt *bp, bool up)
{ … }
static int bnxt_hwrm_port_led_qcaps(struct bnxt *bp)
{ … }
int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp)
{ … }
int bnxt_hwrm_free_wol_fltr(struct bnxt *bp)
{ … }
static u16 bnxt_hwrm_get_wol_fltrs(struct bnxt *bp, u16 handle)
{ … }
static void bnxt_get_wol_settings(struct bnxt *bp)
{ … }
static bool bnxt_eee_config_ok(struct bnxt *bp)
{ … }
static int bnxt_update_phy_setting(struct bnxt *bp)
{ … }
static int bnxt_init_dflt_ring_mode(struct bnxt *bp);
static int bnxt_reinit_after_abort(struct bnxt *bp)
{ … }
static void bnxt_cfg_one_usr_fltr(struct bnxt *bp, struct bnxt_filter_base *fltr)
{ … }
static void bnxt_cfg_usr_fltrs(struct bnxt *bp)
{ … }
static int bnxt_set_xps_mapping(struct bnxt *bp)
{ … }
static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
{ … }
int bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
{ … }
int bnxt_half_open_nic(struct bnxt *bp)
{ … }
void bnxt_half_close_nic(struct bnxt *bp)
{ … }
void bnxt_reenable_sriov(struct bnxt *bp)
{ … }
static int bnxt_open(struct net_device *dev)
{ … }
static bool bnxt_drv_busy(struct bnxt *bp)
{ … }
static void bnxt_get_ring_stats(struct bnxt *bp,
struct rtnl_link_stats64 *stats);
static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
bool link_re_init)
{ … }
void bnxt_close_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
{ … }
static int bnxt_close(struct net_device *dev)
{ … }
static int bnxt_hwrm_port_phy_read(struct bnxt *bp, u16 phy_addr, u16 reg,
u16 *val)
{ … }
static int bnxt_hwrm_port_phy_write(struct bnxt *bp, u16 phy_addr, u16 reg,
u16 val)
{ … }
static int bnxt_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ … }
static void bnxt_get_ring_stats(struct bnxt *bp,
struct rtnl_link_stats64 *stats)
{ … }
static void bnxt_add_prev_stats(struct bnxt *bp,
struct rtnl_link_stats64 *stats)
{ … }
static void
bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{ … }
static void bnxt_get_one_ring_err_stats(struct bnxt *bp,
struct bnxt_total_ring_err_stats *stats,
struct bnxt_cp_ring_info *cpr)
{ … }
void bnxt_get_ring_err_stats(struct bnxt *bp,
struct bnxt_total_ring_err_stats *stats)
{ … }
static bool bnxt_mc_list_updated(struct bnxt *bp, u32 *rx_mask)
{ … }
static bool bnxt_uc_list_updated(struct bnxt *bp)
{ … }
static void bnxt_set_rx_mode(struct net_device *dev)
{ … }
static int bnxt_cfg_rx_mode(struct bnxt *bp)
{ … }
static bool bnxt_can_reserve_rings(struct bnxt *bp)
{ … }
static bool bnxt_rfs_supported(struct bnxt *bp)
{ … }
bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx)
{ … }
static netdev_features_t bnxt_fix_features(struct net_device *dev,
netdev_features_t features)
{ … }
static int bnxt_reinit_features(struct bnxt *bp, bool irq_re_init,
bool link_re_init, u32 flags, bool update_tpa)
{ … }
static int bnxt_set_features(struct net_device *dev, netdev_features_t features)
{ … }
static bool bnxt_exthdr_check(struct bnxt *bp, struct sk_buff *skb, int nw_off,
u8 **nextp)
{ … }
static bool bnxt_udp_tunl_check(struct bnxt *bp, struct sk_buff *skb)
{ … }
static bool bnxt_tunl_check(struct bnxt *bp, struct sk_buff *skb, u8 l4_proto)
{ … }
static netdev_features_t bnxt_features_check(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features)
{ … }
int bnxt_dbg_hwrm_rd_reg(struct bnxt *bp, u32 reg_off, u16 num_words,
u32 *reg_buf)
{ … }
static int bnxt_dbg_hwrm_ring_info_get(struct bnxt *bp, u8 ring_type,
u32 ring_id, u32 *prod, u32 *cons)
{ … }
static void bnxt_dump_tx_sw_state(struct bnxt_napi *bnapi)
{ … }
static void bnxt_dump_rx_sw_state(struct bnxt_napi *bnapi)
{ … }
static void bnxt_dump_cp_sw_state(struct bnxt_napi *bnapi)
{ … }
static void bnxt_dbg_dump_states(struct bnxt *bp)
{ … }
static int bnxt_hwrm_rx_ring_reset(struct bnxt *bp, int ring_nr)
{ … }
static void bnxt_reset_task(struct bnxt *bp, bool silent)
{ … }
static void bnxt_tx_timeout(struct net_device *dev, unsigned int txqueue)
{ … }
static void bnxt_fw_health_check(struct bnxt *bp)
{ … }
static void bnxt_timer(struct timer_list *t)
{ … }
static void bnxt_rtnl_lock_sp(struct bnxt *bp)
{ … }
static void bnxt_rtnl_unlock_sp(struct bnxt *bp)
{ … }
static void bnxt_reset(struct bnxt *bp, bool silent)
{ … }
static void bnxt_rx_ring_reset(struct bnxt *bp)
{ … }
static void bnxt_fw_fatal_close(struct bnxt *bp)
{ … }
static void bnxt_fw_reset_close(struct bnxt *bp)
{ … }
static bool is_bnxt_fw_ok(struct bnxt *bp)
{ … }
static void bnxt_force_fw_reset(struct bnxt *bp)
{ … }
void bnxt_fw_exception(struct bnxt *bp)
{ … }
static int bnxt_get_registered_vfs(struct bnxt *bp)
{ … }
void bnxt_fw_reset(struct bnxt *bp)
{ … }
static void bnxt_chk_missed_irq(struct bnxt *bp)
{ … }
static void bnxt_cfg_ntp_filters(struct bnxt *);
static void bnxt_init_ethtool_link_settings(struct bnxt *bp)
{ … }
static void bnxt_fw_echo_reply(struct bnxt *bp)
{ … }
static void bnxt_ulp_restart(struct bnxt *bp)
{ … }
static void bnxt_sp_task(struct work_struct *work)
{ … }
static void _bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx,
int *max_cp);
int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
int tx_xdp)
{ … }
static void bnxt_unmap_bars(struct bnxt *bp, struct pci_dev *pdev)
{ … }
static void bnxt_cleanup_pci(struct bnxt *bp)
{ … }
static void bnxt_init_dflt_coal(struct bnxt *bp)
{ … }
static bool bnxt_fw_pre_resv_vnics(struct bnxt *bp)
{ … }
static int bnxt_fw_init_one_p1(struct bnxt *bp)
{ … }
static int bnxt_fw_init_one_p2(struct bnxt *bp)
{ … }
static void bnxt_set_dflt_rss_hash_type(struct bnxt *bp)
{ … }
static void bnxt_set_dflt_rfs(struct bnxt *bp)
{ … }
static void bnxt_fw_init_one_p3(struct bnxt *bp)
{ … }
static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt);
int bnxt_fw_init_one(struct bnxt *bp)
{ … }
static void bnxt_fw_reset_writel(struct bnxt *bp, int reg_idx)
{ … }
bool bnxt_hwrm_reset_permitted(struct bnxt *bp)
{ … }
static void bnxt_reset_all(struct bnxt *bp)
{ … }
static bool bnxt_fw_reset_timeout(struct bnxt *bp)
{ … }
static void bnxt_fw_reset_abort(struct bnxt *bp, int rc)
{ … }
static void bnxt_fw_reset_task(struct work_struct *work)
{ … }
static int bnxt_init_board(struct pci_dev *pdev, struct net_device *dev)
{ … }
static int bnxt_change_mac_addr(struct net_device *dev, void *p)
{ … }
static int bnxt_change_mtu(struct net_device *dev, int new_mtu)
{ … }
int bnxt_setup_mq_tc(struct net_device *dev, u8 tc)
{ … }
static int bnxt_setup_tc_block_cb(enum tc_setup_type type, void *type_data,
void *cb_priv)
{ … }
LIST_HEAD(…);
static int bnxt_setup_tc(struct net_device *dev, enum tc_setup_type type,
void *type_data)
{ … }
u32 bnxt_get_ntp_filter_idx(struct bnxt *bp, struct flow_keys *fkeys,
const struct sk_buff *skb)
{ … }
int bnxt_insert_ntp_filter(struct bnxt *bp, struct bnxt_ntuple_filter *fltr,
u32 idx)
{ … }
static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
struct bnxt_ntuple_filter *f2)
{ … }
struct bnxt_ntuple_filter *
bnxt_lookup_ntp_filter_from_idx(struct bnxt *bp,
struct bnxt_ntuple_filter *fltr, u32 idx)
{ … }
#ifdef CONFIG_RFS_ACCEL
static int bnxt_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb,
u16 rxq_index, u32 flow_id)
{ … }
#endif
void bnxt_del_ntp_filter(struct bnxt *bp, struct bnxt_ntuple_filter *fltr)
{ … }
static void bnxt_cfg_ntp_filters(struct bnxt *bp)
{ … }
static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int table,
unsigned int entry, struct udp_tunnel_info *ti)
{ … }
static int bnxt_udp_tunnel_unset_port(struct net_device *netdev, unsigned int table,
unsigned int entry, struct udp_tunnel_info *ti)
{ … }
static const struct udp_tunnel_nic_info bnxt_udp_tunnels = …, bnxt_udp_tunnels_p7 = …;
static int bnxt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev, u32 filter_mask,
int nlflags)
{ … }
static int bnxt_bridge_setlink(struct net_device *dev, struct nlmsghdr *nlh,
u16 flags, struct netlink_ext_ack *extack)
{ … }
int bnxt_get_port_parent_id(struct net_device *dev,
struct netdev_phys_item_id *ppid)
{ … }
static const struct net_device_ops bnxt_netdev_ops = …;
static void bnxt_get_queue_stats_rx(struct net_device *dev, int i,
struct netdev_queue_stats_rx *stats)
{ … }
static void bnxt_get_queue_stats_tx(struct net_device *dev, int i,
struct netdev_queue_stats_tx *stats)
{ … }
static void bnxt_get_base_stats(struct net_device *dev,
struct netdev_queue_stats_rx *rx,
struct netdev_queue_stats_tx *tx)
{ … }
static const struct netdev_stat_ops bnxt_stat_ops = …;
static int bnxt_alloc_rx_agg_bmap(struct bnxt *bp, struct bnxt_rx_ring_info *rxr)
{ … }
static int bnxt_queue_mem_alloc(struct net_device *dev, void *qmem, int idx)
{ … }
static void bnxt_queue_mem_free(struct net_device *dev, void *qmem)
{ … }
static void bnxt_copy_rx_ring(struct bnxt *bp,
struct bnxt_rx_ring_info *dst,
struct bnxt_rx_ring_info *src)
{ … }
static int bnxt_queue_start(struct net_device *dev, void *qmem, int idx)
{ … }
static int bnxt_queue_stop(struct net_device *dev, void *qmem, int idx)
{ … }
static const struct netdev_queue_mgmt_ops bnxt_queue_mgmt_ops = …;
static void bnxt_remove_one(struct pci_dev *pdev)
{ … }
static int bnxt_probe_phy(struct bnxt *bp, bool fw_dflt)
{ … }
static int bnxt_get_max_irq(struct pci_dev *pdev)
{ … }
static void _bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx,
int *max_cp)
{ … }
int bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx, bool shared)
{ … }
static int bnxt_get_dflt_rings(struct bnxt *bp, int *max_rx, int *max_tx,
bool shared)
{ … }
static void bnxt_trim_dflt_sh_rings(struct bnxt *bp)
{ … }
static int bnxt_set_dflt_rings(struct bnxt *bp, bool sh)
{ … }
static int bnxt_init_dflt_ring_mode(struct bnxt *bp)
{ … }
int bnxt_restore_pf_fw_resources(struct bnxt *bp)
{ … }
static int bnxt_init_mac_addr(struct bnxt *bp)
{ … }
static void bnxt_vpd_read_info(struct bnxt *bp)
{ … }
static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[])
{ … }
static int bnxt_map_db_bar(struct bnxt *bp)
{ … }
void bnxt_print_device_info(struct bnxt *bp)
{ … }
static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void bnxt_shutdown(struct pci_dev *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int bnxt_suspend(struct device *device)
{ … }
static int bnxt_resume(struct device *device)
{ … }
static SIMPLE_DEV_PM_OPS(bnxt_pm_ops, bnxt_suspend, bnxt_resume);
#define BNXT_PM_OPS …
#else
#define BNXT_PM_OPS …
#endif
static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev,
pci_channel_state_t state)
{ … }
static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev)
{ … }
static void bnxt_io_resume(struct pci_dev *pdev)
{ … }
static const struct pci_error_handlers bnxt_err_handler = …;
static struct pci_driver bnxt_pci_driver = …;
static int __init bnxt_init(void)
{ … }
static void __exit bnxt_exit(void)
{ … }
module_init(…) …;
module_exit(bnxt_exit);