bnxt_en: Update for net-next
Subsystems (5)
Michael Chan
maintainercover bnxt_en: Update for net-next
This patchset contains 3 featuress:
- The page pool implementation for the normal RX path (non-XDP) for paged buffers in the aggregation ring.
- Saving of the ring error counters across reset.
- Hwmon enhancements and migration to newer kernel APIs.
Kalesh AP (5):
bnxt_en: Enhance hwmon temperature reporting
bnxt_en: Move hwmon functions into a dedicated file
bnxt_en: Modify the driver to use hwmon_device_register_with_info
bnxt_en: Expose threshold temperatures through hwmon
bnxt_en: Event handler for Thermal event
Michael Chan (5):
bnxt_en: Increment rx_resets counter in bnxt_disable_napi()
bnxt_en: Save ring error counters across reset
bnxt_en: Display the ring error counters under ethtool -S
bnxt_en: Add tx_resets ring counter
bnxt_en: Update firmware interface to 1.10.2.171
Somnath Kotur (2):
bnxt_en: Use the unified RX page pool buffers for XDP and non-XDP
bnxt_en: Let the page pool manage the DMA mapping
drivers/net/ethernet/broadcom/bnxt/Makefile | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 268 ++++----- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 31 +- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 49 +- drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 545 ++++++++++++------ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 191 ++++++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.h | 30 + 7 files changed, 751 insertions(+), 364 deletions(-) create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.h
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 1/12 bnxt_en: Use the unified RX page pool buffers for XDP and non-XDP
From: Somnath Kotur <[email protected]>
Convert to use the page pool buffers for the aggregation ring when running in non-XDP mode. This simplifies the driver and we benefit from the recycling of pages. Adjust the page pool size to account for the aggregation ring size.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 71 +++++------------------ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 - 2 files changed, 14 insertions(+), 60 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +14 -57
@@ -877,48 +877,15 @@ static inline int bnxt_alloc_rx_page(struct bnxt *bp,struct rx_bd *rxbd = &rxr->rx_agg_desc_ring[RX_RING (prod)][RX_IDX (prod)];struct bnxt_sw_rx_agg_bd *rx_agg_buf; -struct pci_dev *pdev = bp->pdev;struct page *page;dma_addr_t mapping;u16 sw_prod = rxr->rx_sw_agg_prod;unsigned int offset =0 ; -if (BNXT_RX_PAGE_MODE (bp)) { - page =__bnxt_alloc_rx_page (bp, &mapping, rxr, &offset, gfp); - -if (!page) -return -ENOMEM ; - - }else { -if (PAGE_SIZE >BNXT_RX_PAGE_SIZE ) { - page = rxr->rx_page; -if (!page) { - page =alloc_page (gfp); -if (!page) -return -ENOMEM ; - rxr->rx_page = page; - rxr->rx_page_offset =0 ; - } - offset = rxr->rx_page_offset; - rxr->rx_page_offset +=BNXT_RX_PAGE_SIZE ; -if (rxr->rx_page_offset ==PAGE_SIZE ) - rxr->rx_page =NULL ; -else -get_page (page); - }else { - page =alloc_page (gfp); -if (!page) -return -ENOMEM ; - } + page =__bnxt_alloc_rx_page (bp, &mapping, rxr, &offset, gfp); - mapping =dma_map_page_attrs (&pdev->dev, page, offset, -BNXT_RX_PAGE_SIZE ,DMA_FROM_DEVICE , -DMA_ATTR_WEAK_ORDERING ); -if (dma_mapping_error (&pdev->dev, mapping)) { -__free_page (page); -return -EIO ; - } - } +if (!page) +return -ENOMEM ;if (unlikely (test_bit (sw_prod, rxr->rx_agg_bmap))) sw_prod =bnxt_find_next_agg_idx (rxr, sw_prod);
@@ -1204,6 +1171,7 @@ static struct sk_buff *bnxt_rx_agg_pages_skb(struct bnxt *bp, total_frag_len =__bnxt_rx_agg_pages (bp, cpr, shinfo, idx, agg_bufs, tpa,NULL );if (!total_frag_len) { +skb_mark_for_recycle (skb);dev_kfree_skb (skb);return NULL ; }
@@ -1794,6 +1762,7 @@ static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi,return ; }skb_record_rx_queue (skb, bnapi->index); +skb_mark_for_recycle (skb);napi_gro_receive (&bnapi->napi, skb); }
@@ -3002,30 +2971,16 @@ static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr)if (!page)continue ; -if (BNXT_RX_PAGE_MODE (bp)) { -dma_unmap_page_attrs (&pdev->dev, rx_agg_buf->mapping, -BNXT_RX_PAGE_SIZE , bp->rx_dir, -DMA_ATTR_WEAK_ORDERING ); - rx_agg_buf->page =NULL ; -__clear_bit (i, rxr->rx_agg_bmap); - -page_pool_recycle_direct (rxr->page_pool, page); - }else { -dma_unmap_page_attrs (&pdev->dev, rx_agg_buf->mapping, -BNXT_RX_PAGE_SIZE ,DMA_FROM_DEVICE , -DMA_ATTR_WEAK_ORDERING ); - rx_agg_buf->page =NULL ; -__clear_bit (i, rxr->rx_agg_bmap); +dma_unmap_page_attrs (&pdev->dev, rx_agg_buf->mapping, +BNXT_RX_PAGE_SIZE , bp->rx_dir, +DMA_ATTR_WEAK_ORDERING ); + rx_agg_buf->page =NULL ; +__clear_bit (i, rxr->rx_agg_bmap); -__free_page (page); - } +page_pool_recycle_direct (rxr->page_pool, page); } skip_rx_agg_free: -if (rxr->rx_page) { -__free_page (rxr->rx_page); - rxr->rx_page =NULL ; - } map = rxr->rx_tpa_idx_map;if (map)memset (map->agg_idx_bmap,0 ,sizeof (map->agg_idx_bmap));
@@ -3244,7 +3199,9 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp, {struct page_pool_params pp = {0 }; - pp.pool_size = bp->rx_ring_size; + pp.pool_size = bp->rx_agg_ring_size; +if (BNXT_RX_PAGE_MODE (bp)) + pp.pool_size += bp->rx_ring_size; pp.nid =dev_to_node (&bp->pdev->dev); pp.napi = &rxr->bnapi->napi; pp.dev = &bp->pdev->dev;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +0 -3
@@ -919,9 +919,6 @@ struct bnxt_rx_ring_info {unsigned long *rx_agg_bmap;u16 rx_agg_bmap_size; -struct page *rx_page; -unsigned int rx_page_offset; -dma_addr_t rx_desc_mapping[MAX_RX_PAGES ];dma_addr_t rx_agg_desc_mapping[MAX_RX_AGG_PAGES ];
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 2/12 bnxt_en: Let the page pool manage the DMA mapping
In reply to Michael ChanFrom: Somnath Kotur <[email protected]>
Use the page pool's ability to maintain DMA mappings for us. This avoids re-mapping of the recycled pages.
---
v2: Use PAGE_SIZE for pp.max_len.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 32 +++++++---------------- 1 file changed, 10 insertions(+), 22 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +10 -22
@@ -761,7 +761,6 @@ static struct page *__bnxt_alloc_rx_page(struct bnxt *bp, dma_addr_t *mapping, unsigned int *offset, gfp_t gfp) { -struct device *dev = &bp->pdev->dev;struct page *page;if (PAGE_SIZE >BNXT_RX_PAGE_SIZE ) {
@@ -774,12 +773,7 @@ static struct page *__bnxt_alloc_rx_page(struct bnxt *bp, dma_addr_t *mapping,if (!page)return NULL ; - *mapping =dma_map_page_attrs (dev, page, *offset,BNXT_RX_PAGE_SIZE , - bp->rx_dir,DMA_ATTR_WEAK_ORDERING ); -if (dma_mapping_error (dev, *mapping)) { -page_pool_recycle_direct (rxr->page_pool, page); -return NULL ; - } + *mapping =page_pool_get_dma_addr (page) + *offset;return page; }
@@ -998,8 +992,8 @@ static struct sk_buff *bnxt_rx_multi_page_skb(struct bnxt *bp,return NULL ; } dma_addr -= bp->rx_dma_offset; -dma_unmap_page_attrs (&bp->pdev->dev, dma_addr,BNXT_RX_PAGE_SIZE , - bp->rx_dir,DMA_ATTR_WEAK_ORDERING ); +dma_sync_single_for_cpu (&bp->pdev->dev, dma_addr,BNXT_RX_PAGE_SIZE , + bp->rx_dir); skb =build_skb (data_ptr - bp->rx_offset,BNXT_RX_PAGE_SIZE );if (!skb) {page_pool_recycle_direct (rxr->page_pool, page);
@@ -1032,8 +1026,8 @@ static struct sk_buff *bnxt_rx_page_skb(struct bnxt *bp,return NULL ; } dma_addr -= bp->rx_dma_offset; -dma_unmap_page_attrs (&bp->pdev->dev, dma_addr,BNXT_RX_PAGE_SIZE , - bp->rx_dir,DMA_ATTR_WEAK_ORDERING ); +dma_sync_single_for_cpu (&bp->pdev->dev, dma_addr,BNXT_RX_PAGE_SIZE , + bp->rx_dir);if (unlikely (!payload)) payload =eth_get_headlen (bp->dev, data_ptr, len);
@@ -1149,9 +1143,8 @@ static u32 __bnxt_rx_agg_pages(struct bnxt *bp,return 0 ; } -dma_unmap_page_attrs (&pdev->dev, mapping,BNXT_RX_PAGE_SIZE , - bp->rx_dir, -DMA_ATTR_WEAK_ORDERING ); +dma_sync_single_for_cpu (&pdev->dev, mapping,BNXT_RX_PAGE_SIZE , + bp->rx_dir); total_frag_len += frag_len; prod =NEXT_RX_AGG (prod);
@@ -2947,10 +2940,6 @@ static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr) rx_buf->data =NULL ;if (BNXT_RX_PAGE_MODE (bp)) { - mapping -= bp->rx_dma_offset; -dma_unmap_page_attrs (&pdev->dev, mapping, -BNXT_RX_PAGE_SIZE , bp->rx_dir, -DMA_ATTR_WEAK_ORDERING );page_pool_recycle_direct (rxr->page_pool, data); }else { dma_unmap_single_attrs(&pdev->dev, mapping,
@@ -2971,9 +2960,6 @@ static void bnxt_free_one_rx_ring_skbs(struct bnxt *bp, int ring_nr)if (!page)continue ; -dma_unmap_page_attrs (&pdev->dev, rx_agg_buf->mapping, -BNXT_RX_PAGE_SIZE , bp->rx_dir, -DMA_ATTR_WEAK_ORDERING ); rx_agg_buf->page =NULL ;__clear_bit (i, rxr->rx_agg_bmap);
@@ -3205,7 +3191,9 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp, pp.nid =dev_to_node (&bp->pdev->dev); pp.napi = &rxr->bnapi->napi; pp.dev = &bp->pdev->dev; - pp.dma_dir =DMA_BIDIRECTIONAL ; + pp.dma_dir = bp->rx_dir; + pp.max_len =PAGE_SIZE ; + pp.flags =PP_FLAG_DMA_MAP |PP_FLAG_DMA_SYNC_DEV ;if (PAGE_SIZE >BNXT_RX_PAGE_SIZE ) pp.flags |=PP_FLAG_PAGE_FRAG ;
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 3/12 bnxt_en: Increment rx_resets counter in bnxt_disable_napi()
In reply to Michael ChanIf we are doing a complete reset with irq_re_init set to true in bnxt_close_nic(), all the ring structures will be freed. New structures will be allocated in bnxt_open_nic(). The current code increments rx_resets counter in bnxt_enable_napi() if bnapi->in_reset is true. In a complete reset, bnapi->in_reset will never be true since the structure is just allocated.
Increment the rx_resets counter in bnxt_disable_napi() instead. This will allow us to save all the ring error counters including the rx_resets counters in the next patch.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +7 -5
@@ -9393,10 +9393,14 @@ static void bnxt_disable_napi(struct bnxt *bp)return ;for (i =0 ; i < bp->cp_nr_rings; i++) { -struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; +struct bnxt_napi *bnapi = bp->bnapi[i]; +struct bnxt_cp_ring_info *cpr; -napi_disable (&bp->bnapi[i]->napi); -if (bp->bnapi[i]->rx_ring) + cpr = &bnapi->cp_ring; +if (bnapi->in_reset) + cpr->sw_stats.rx.rx_resets++; +napi_disable (&bnapi->napi); +if (bnapi->rx_ring)cancel_work_sync (&cpr->dim.work); } }
@@ -9413,8 +9417,6 @@ static void bnxt_enable_napi(struct bnxt *bp) bnapi->tx_fault =0 ; cpr = &bnapi->cp_ring; -if (bnapi->in_reset) - cpr->sw_stats.rx.rx_resets++; bnapi->in_reset = false; bnapi->tx_pkts =0 ;
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 4/12 bnxt_en: Save ring error counters across reset
In reply to Michael ChanCurrently, the ring counters are stored in the per ring datastructure. During reset, all the rings are freed together with the associated datastructures. As a result, all the ring error counters will be reset to zero.
Add logic to keep track of the total error counts of all the rings and save them before reset (including ifdown). The next patch will display these total ring error counters under ethtool -S.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 32 ++++++++++++++++++++++- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 15 +++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +31 -1
@@ -10685,8 +10685,10 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,bnxt_free_skbs (bp);/* Save ring stats before shutdown */ -if (bp->bnapi && irq_re_init) +if (bp->bnapi && irq_re_init) {bnxt_get_ring_stats (bp, &bp->net_stats_prev); +bnxt_get_ring_err_stats (bp, &bp->ring_err_stats_prev); + }if (irq_re_init) {bnxt_free_irq (bp);bnxt_del_napi (bp);
@@ -10935,6 +10937,34 @@ bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)clear_bit (BNXT_STATE_READ_STATS , &bp->state); } +static void bnxt_get_one_ring_err_stats (struct bnxt *bp, +struct bnxt_total_ring_err_stats *stats, +struct bnxt_cp_ring_info *cpr) +{ +struct bnxt_sw_stats *sw_stats = &cpr->sw_stats; +u64 *hw_stats = cpr->stats.sw_stats; + + stats->rx_total_l4_csum_errors += sw_stats->rx.rx_l4_csum_errors; + stats->rx_total_resets += sw_stats->rx.rx_resets; + stats->rx_total_buf_errors += sw_stats->rx.rx_buf_errors; + stats->rx_total_oom_discards += sw_stats->rx.rx_oom_discards; + stats->rx_total_netpoll_discards += sw_stats->rx.rx_netpoll_discards; + stats->rx_total_ring_discards += +BNXT_GET_RING_STATS64 (hw_stats, rx_discard_pkts); + stats->tx_total_ring_discards += +BNXT_GET_RING_STATS64 (hw_stats, tx_discard_pkts); + stats->total_missed_irqs += sw_stats->cmn.missed_irqs; +} + +void bnxt_get_ring_err_stats (struct bnxt *bp, +struct bnxt_total_ring_err_stats *stats) +{ +int i; + +for (i =0 ; i < bp->cp_nr_rings; i++) +bnxt_get_one_ring_err_stats (bp, stats, &bp->bnapi[i]->cp_ring); +} +static bool bnxt_mc_list_updated (struct bnxt *bp,u32 *rx_mask) {struct net_device *dev = bp->dev;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +15 -0
@@ -948,6 +948,17 @@ struct bnxt_sw_stats {struct bnxt_cmn_sw_stats cmn; }; +struct bnxt_total_ring_err_stats { +u64 rx_total_l4_csum_errors; +u64 rx_total_resets; +u64 rx_total_buf_errors; +u64 rx_total_oom_discards; +u64 rx_total_netpoll_discards; +u64 rx_total_ring_discards; +u64 tx_total_ring_discards; +u64 total_missed_irqs; +}; +struct bnxt_stats_mem {u64 *sw_stats;u64 *hw_masks;
@@ -2018,6 +2029,8 @@ struct bnxt {u8 pri2cos_idx[8 ];u8 pri2cos_valid; +struct bnxt_total_ring_err_stats ring_err_stats_prev; +u16 hwrm_max_req_len;u16 hwrm_max_ext_req_len;unsigned int hwrm_cmd_timeout;
@@ -2344,6 +2357,8 @@ int bnxt_half_open_nic(struct bnxt *bp);void bnxt_half_close_nic (struct bnxt *bp);void bnxt_reenable_sriov (struct bnxt *bp);int bnxt_close_nic (struct bnxt *,bool ,bool ); +void bnxt_get_ring_err_stats (struct bnxt *bp, +struct bnxt_total_ring_err_stats *stats);int bnxt_dbg_hwrm_rd_reg (struct bnxt *bp,u32 reg_off,u16 num_words,u32 *reg_buf);void bnxt_fw_exception (struct bnxt *bp);
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 5/12 bnxt_en: Display the ring error counters under ethtool -S
In reply to Michael ChanThe existing driver displays the sum of 4 ring counters under ethtool -S. These counters are in the array bnxt_sw_func_stats. These counters are summed at the time of ethtool -S and will be lost when the device is reset.
Replace these counters with the new total ring error counters added in the last patch. These new counters are saved before reset. ethtool -S will now display the sum of the saved counters plus the current counters.
--- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +23 -25
@@ -339,13 +339,15 @@ enum { RX_NETPOLL_DISCARDS, }; -static struct { -u64 counter; -char string[ETH_GSTRING_LEN ]; -} bnxt_sw_func_stats[] = { - {0 ,"rx_total_discard_pkts" }, - {0 ,"tx_total_discard_pkts" }, - {0 ,"rx_total_netpoll_discards" }, +static const char *const bnxt_ring_err_stats_arr[] = { +"rx_total_l4_csum_errors" , +"rx_total_resets" , +"rx_total_buf_errors" , +"rx_total_oom_discards" , +"rx_total_netpoll_discards" , +"rx_total_ring_discards" , +"tx_total_ring_discards" , +"total_missed_irqs" , };#define NUM_RING_RX_SW_STATS ARRAY_SIZE(bnxt_rx_sw_stats_str)
@@ -495,7 +497,7 @@ static const struct { BNXT_TX_STATS_PRI_ENTRIES(tx_packets), }; -#define BNXT_NUM_SW_FUNC_STATS ARRAY_SIZE(bnxt_sw_func_stats) +#define BNXT_NUM_RING_ERR_STATS ARRAY_SIZE(bnxt_ring_err_stats_arr)#define BNXT_NUM_PORT_STATS ARRAY_SIZE(bnxt_port_stats_arr)#define BNXT_NUM_STATS_PRI \ (ARRAY_SIZE(bnxt_rx_bytes_pri_arr) + \
@@ -532,7 +534,7 @@ static int bnxt_get_num_stats(struct bnxt *bp) {int num_stats =bnxt_get_num_ring_stats (bp); - num_stats +=BNXT_NUM_SW_FUNC_STATS ; + num_stats +=BNXT_NUM_RING_ERR_STATS ;if (bp->flags &BNXT_FLAG_PORT_STATS ) num_stats +=BNXT_NUM_PORT_STATS ;
@@ -583,18 +585,17 @@ static bool is_tx_ring(struct bnxt *bp, int ring_num)static void bnxt_get_ethtool_stats (struct net_device *dev,struct ethtool_stats *stats,u64 *buf) { -u32 i, j =0 ; +struct bnxt_total_ring_err_stats ring_err_stats = {0 };struct bnxt *bp =netdev_priv (dev); +u64 *curr, *prev;u32 tpa_stats; +u32 i, j =0 ;if (!bp->bnapi) { - j +=bnxt_get_num_ring_stats (bp) +BNXT_NUM_SW_FUNC_STATS ; + j +=bnxt_get_num_ring_stats (bp); goto skip_ring_stats; } -for (i =0 ; i <BNXT_NUM_SW_FUNC_STATS ; i++) - bnxt_sw_func_stats[i].counter =0 ; - tpa_stats =bnxt_get_num_tpa_ring_stats (bp);for (i =0 ; i < bp->cp_nr_rings; i++) {struct bnxt_napi *bnapi = bp->bnapi[i];
@@ -631,19 +632,16 @@ static void bnxt_get_ethtool_stats(struct net_device *dev, sw = (u64 *)&cpr->sw_stats.cmn;for (k =0 ; k <NUM_RING_CMN_SW_STATS ; j++, k++) buf[j] = sw[k]; - - bnxt_sw_func_stats[RX_TOTAL_DISCARDS ].counter += -BNXT_GET_RING_STATS64 (sw_stats, rx_discard_pkts); - bnxt_sw_func_stats[TX_TOTAL_DISCARDS ].counter += -BNXT_GET_RING_STATS64 (sw_stats, tx_discard_pkts); - bnxt_sw_func_stats[RX_NETPOLL_DISCARDS ].counter += - cpr->sw_stats.rx.rx_netpoll_discards; } -for (i =0 ; i <BNXT_NUM_SW_FUNC_STATS ; i++, j++) - buf[j] = bnxt_sw_func_stats[i].counter; +bnxt_get_ring_err_stats (bp, &ring_err_stats); skip_ring_stats: + curr = &ring_err_stats.rx_total_l4_csum_errors; + prev = &bp->ring_err_stats_prev.rx_total_l4_csum_errors; +for (i =0 ; i <BNXT_NUM_RING_ERR_STATS ; i++, j++, curr++, prev++) + buf[j] = *curr + *prev; +if (bp->flags &BNXT_FLAG_PORT_STATS ) {u64 *port_stats = bp->port_stats.sw_stats;
@@ -745,8 +743,8 @@ static void bnxt_get_strings(struct net_device *dev, u32 stringset, u8 *buf) buf +=ETH_GSTRING_LEN ; } } -for (i =0 ; i <BNXT_NUM_SW_FUNC_STATS ; i++) { -strcpy (buf, bnxt_sw_func_stats[i].string); +for (i =0 ; i <BNXT_NUM_RING_ERR_STATS ; i++) { +strscpy (buf, bnxt_ring_err_stats_arr[i],ETH_GSTRING_LEN ); buf +=ETH_GSTRING_LEN ; }
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 6/12 bnxt_en: Add tx_resets ring counter
In reply to Michael ChanAdd a new tx_resets ring counter. This counter will be saved as tx_total_resets across any reset. Since we currently do a full reset in bnxt_sched_reset_txr(), the per ring counter will always be cleared during reset. Only the tx_total_resets count will be meaningful and we only dispaly this under ethtool -S.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 + 3 files changed, 10 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +3 -0
@@ -9397,6 +9397,8 @@ static void bnxt_disable_napi(struct bnxt *bp)struct bnxt_cp_ring_info *cpr; cpr = &bnapi->cp_ring; +if (bnapi->tx_fault) + cpr->sw_stats.tx.tx_resets++;if (bnapi->in_reset) cpr->sw_stats.rx.rx_resets++;napi_disable (&bnapi->napi);
@@ -10951,6 +10953,7 @@ static void bnxt_get_one_ring_err_stats(struct bnxt *bp, stats->rx_total_netpoll_discards += sw_stats->rx.rx_netpoll_discards; stats->rx_total_ring_discards +=BNXT_GET_RING_STATS64 (hw_stats, rx_discard_pkts); + stats->tx_total_resets += sw_stats->tx.tx_resets; stats->tx_total_ring_discards +=BNXT_GET_RING_STATS64 (hw_stats, tx_discard_pkts); stats->total_missed_irqs += sw_stats->cmn.missed_irqs;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +6 -0
@@ -939,12 +939,17 @@ struct bnxt_rx_sw_stats {u64 rx_netpoll_discards; }; +struct bnxt_tx_sw_stats { +u64 tx_resets; +}; +struct bnxt_cmn_sw_stats {u64 missed_irqs; };struct bnxt_sw_stats {struct bnxt_rx_sw_stats rx; +struct bnxt_tx_sw_stats tx;struct bnxt_cmn_sw_stats cmn; };
@@ -955,6 +960,7 @@ struct bnxt_total_ring_err_stats {u64 rx_total_oom_discards;u64 rx_total_netpoll_discards;u64 rx_total_ring_discards; +u64 tx_total_resets;u64 tx_total_ring_discards;u64 total_missed_irqs; };
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +1 -0
@@ -346,6 +346,7 @@ static const char *const bnxt_ring_err_stats_arr[] = {"rx_total_oom_discards" ,"rx_total_netpoll_discards" ,"rx_total_ring_discards" , +"tx_total_resets" ,"tx_total_ring_discards" , "total_missed_irqs", };
Signature · 1 line
2.30.1
Simon Horman
reviewerRe: [PATCH net-next 06/12] bnxt_en: Add tx_resets ring counter
Quoted 5 lines · Michael Chan
Add a new
tx_resetsring counter. This counter will be saved astx_total_resetsacross any reset. Since we currently do a full reset inbnxt_sched_reset_txr(), the per ring counter will always be cleared during reset. Only thetx_total_resetscount will be meaningful and we only dispaly this under ethtool -S.
nit: dispaly -> display
Quoted 3 lines
...
Michael Chan
maintainerPATCH 7/12 bnxt_en: Update firmware interface to 1.10.2.171
In reply to Michael ChanThe main changes are the additional thermal thresholds in hwrm_temp_monitor_query_output and the new async event to report thermal errors.
the new async event
--- drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h | 545 ++++++++++++------ 1 file changed, 367 insertions(+), 178 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h +367 -178
@@ -2,7 +2,7 @@* * Copyright (c) 2014-2016 Broadcom Corporation * Copyright (c) 2014-2018 Broadcom Limited -* Copyright (c) 2018-2022 Broadcom Inc. +* Copyright (c) 2018-2023 Broadcom Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
@@ -191,6 +191,11 @@ struct cmd_nums {#define HWRM_QUEUE_VLANPRI2PRI_CFG 0x85UL#define HWRM_QUEUE_GLOBAL_CFG 0x86UL#define HWRM_QUEUE_GLOBAL_QCFG 0x87UL +#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_QCFG 0x88UL +#define HWRM_QUEUE_ADPTV_QOS_RX_FEATURE_CFG 0x89UL +#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_QCFG 0x8aUL +#define HWRM_QUEUE_ADPTV_QOS_TX_FEATURE_CFG 0x8bUL +#define HWRM_QUEUE_QCAPS 0x8cUL#define HWRM_CFA_L2_FILTER_ALLOC 0x90UL#define HWRM_CFA_L2_FILTER_FREE 0x91UL#define HWRM_CFA_L2_FILTER_CFG 0x92UL
@@ -315,6 +320,7 @@ struct cmd_nums {#define HWRM_CFA_LAG_GROUP_MEMBER_UNRGTR 0x127UL#define HWRM_CFA_TLS_FILTER_ALLOC 0x128UL#define HWRM_CFA_TLS_FILTER_FREE 0x129UL +#define HWRM_CFA_RELEASE_AFM_FUNC 0x12aUL#define HWRM_ENGINE_CKV_STATUS 0x12eUL#define HWRM_ENGINE_CKV_CKEK_ADD 0x12fUL#define HWRM_ENGINE_CKV_CKEK_DELETE 0x130UL
@@ -383,6 +389,9 @@ struct cmd_nums {#define HWRM_FUNC_DBR_RECOVERY_COMPLETED 0x1aaUL#define HWRM_FUNC_SYNCE_CFG 0x1abUL#define HWRM_FUNC_SYNCE_QCFG 0x1acUL +#define HWRM_FUNC_KEY_CTX_FREE 0x1adUL +#define HWRM_FUNC_LAG_MODE_CFG 0x1aeUL +#define HWRM_FUNC_LAG_MODE_QCFG 0x1afUL#define HWRM_SELFTEST_QLIST 0x200UL#define HWRM_SELFTEST_EXEC 0x201UL#define HWRM_SELFTEST_IRQ 0x202UL
@@ -408,10 +417,10 @@ struct cmd_nums {#define HWRM_MFG_SELFTEST_QLIST 0x216UL#define HWRM_MFG_SELFTEST_EXEC 0x217UL#define HWRM_STAT_GENERIC_QSTATS 0x218UL +#define HWRM_MFG_PRVSN_EXPORT_CERT 0x219UL#define HWRM_TF 0x2bcUL#define HWRM_TF_VERSION_GET 0x2bdUL#define HWRM_TF_SESSION_OPEN 0x2c6UL -#define HWRM_TF_SESSION_ATTACH 0x2c7UL#define HWRM_TF_SESSION_REGISTER 0x2c8UL#define HWRM_TF_SESSION_UNREGISTER 0x2c9UL#define HWRM_TF_SESSION_CLOSE 0x2caUL
@@ -426,14 +435,6 @@ struct cmd_nums {#define HWRM_TF_TBL_TYPE_GET 0x2daUL#define HWRM_TF_TBL_TYPE_SET 0x2dbUL#define HWRM_TF_TBL_TYPE_BULK_GET 0x2dcUL -#define HWRM_TF_CTXT_MEM_ALLOC 0x2e2UL -#define HWRM_TF_CTXT_MEM_FREE 0x2e3UL -#define HWRM_TF_CTXT_MEM_RGTR 0x2e4UL -#define HWRM_TF_CTXT_MEM_UNRGTR 0x2e5UL -#define HWRM_TF_EXT_EM_QCAPS 0x2e6UL -#define HWRM_TF_EXT_EM_OP 0x2e7UL -#define HWRM_TF_EXT_EM_CFG 0x2e8UL -#define HWRM_TF_EXT_EM_QCFG 0x2e9UL#define HWRM_TF_EM_INSERT 0x2eaUL#define HWRM_TF_EM_DELETE 0x2ebUL#define HWRM_TF_EM_HASH_INSERT 0x2ecUL
@@ -465,6 +466,14 @@ struct cmd_nums {#define HWRM_TFC_IDX_TBL_GET 0x390UL#define HWRM_TFC_IDX_TBL_FREE 0x391UL#define HWRM_TFC_GLOBAL_ID_ALLOC 0x392UL +#define HWRM_TFC_TCAM_SET 0x393UL +#define HWRM_TFC_TCAM_GET 0x394UL +#define HWRM_TFC_TCAM_ALLOC 0x395UL +#define HWRM_TFC_TCAM_ALLOC_SET 0x396UL +#define HWRM_TFC_TCAM_FREE 0x397UL +#define HWRM_TFC_IF_TBL_SET 0x398UL +#define HWRM_TFC_IF_TBL_GET 0x399UL +#define HWRM_TFC_TBL_SCOPE_CONFIG_GET 0x39aUL#define HWRM_SV 0x400UL#define HWRM_DBG_READ_DIRECT 0xff10UL#define HWRM_DBG_READ_INDIRECT 0xff11UL
@@ -494,6 +503,8 @@ struct cmd_nums {#define HWRM_DBG_USEQ_RUN 0xff29UL#define HWRM_DBG_USEQ_DELIVERY_REQ 0xff2aUL#define HWRM_DBG_USEQ_RESP_HDR 0xff2bUL +#define HWRM_NVM_GET_VPD_FIELD_INFO 0xffeaUL +#define HWRM_NVM_SET_VPD_FIELD_INFO 0xffebUL#define HWRM_NVM_DEFRAG 0xffecUL#define HWRM_NVM_REQ_ARBITRATION 0xffedUL#define HWRM_NVM_FACTORY_DEFAULTS 0xffeeUL
@@ -540,6 +551,7 @@ struct ret_codes {#define HWRM_ERR_CODE_BUSY 0x10UL#define HWRM_ERR_CODE_RESOURCE_LOCKED 0x11UL#define HWRM_ERR_CODE_PF_UNAVAILABLE 0x12UL +#define HWRM_ERR_CODE_ENTITY_NOT_PRESENT 0x13UL#define HWRM_ERR_CODE_TLV_ENCAPSULATED_RESPONSE 0x8000UL#define HWRM_ERR_CODE_UNKNOWN_ERR 0xfffeUL#define HWRM_ERR_CODE_CMD_NOT_SUPPORTED 0xffffUL
@@ -571,8 +583,8 @@ struct hwrm_err_output {#define HWRM_VERSION_MAJOR 1#define HWRM_VERSION_MINOR 10#define HWRM_VERSION_UPDATE 2 -#define HWRM_VERSION_RSVD 118 -#define HWRM_VERSION_STR "1.10.2.118" +#define HWRM_VERSION_RSVD 171 +#define HWRM_VERSION_STR "1.10.2.171"/* hwrm_ver_get_input (size:192b/24B) */ struct hwrm_ver_get_input {
@@ -761,51 +773,53 @@ struct hwrm_async_event_cmpl {#define ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT 0x2eUL#define ASYNC_EVENT_CMPL_TYPE_LAST ASYNC_EVENT_CMPL_TYPE_HWRM_ASYNC_EVENT__le16 event_id; -#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE 0x0UL -#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE 0x1UL -#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE 0x2UL -#define ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE 0x3UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED 0x4UL -#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED 0x5UL -#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE 0x6UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE 0x7UL -#define ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY 0x8UL -#define ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY 0x9UL -#define ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG 0xaUL -#define ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD 0x10UL -#define ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD 0x11UL -#define ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT 0x12UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD 0x20UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD 0x21UL -#define ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR 0x30UL -#define ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE 0x31UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE 0x32UL -#define ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE 0x33UL -#define ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE 0x34UL -#define ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE 0x35UL -#define ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED 0x36UL -#define ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION 0x37UL -#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ 0x38UL -#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE 0x39UL -#define ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE 0x3aUL -#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE 0x3bUL -#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE 0x3cUL -#define ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE 0x3dUL -#define ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE 0x3eUL -#define ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE 0x3fUL -#define ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE 0x40UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE 0x41UL -#define ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST 0x42UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE 0x43UL -#define ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP 0x44UL -#define ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT 0x45UL -#define ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_THRESHOLD 0x46UL -#define ASYNC_EVENT_CMPL_EVENT_ID_RSS_CHANGE 0x47UL -#define ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_NQ_UPDATE 0x48UL -#define ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID 0x49UL -#define ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG 0xfeUL -#define ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR 0xffUL -#define ASYNC_EVENT_CMPL_EVENT_ID_LAST ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR +#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE 0x0UL +#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_MTU_CHANGE 0x1UL +#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CHANGE 0x2UL +#define ASYNC_EVENT_CMPL_EVENT_ID_DCB_CONFIG_CHANGE 0x3UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED 0x4UL +#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_NOT_ALLOWED 0x5UL +#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE 0x6UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PORT_PHY_CFG_CHANGE 0x7UL +#define ASYNC_EVENT_CMPL_EVENT_ID_RESET_NOTIFY 0x8UL +#define ASYNC_EVENT_CMPL_EVENT_ID_ERROR_RECOVERY 0x9UL +#define ASYNC_EVENT_CMPL_EVENT_ID_RING_MONITOR_MSG 0xaUL +#define ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_UNLOAD 0x10UL +#define ASYNC_EVENT_CMPL_EVENT_ID_FUNC_DRVR_LOAD 0x11UL +#define ASYNC_EVENT_CMPL_EVENT_ID_FUNC_FLR_PROC_CMPLT 0x12UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD 0x20UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_LOAD 0x21UL +#define ASYNC_EVENT_CMPL_EVENT_ID_VF_FLR 0x30UL +#define ASYNC_EVENT_CMPL_EVENT_ID_VF_MAC_ADDR_CHANGE 0x31UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PF_VF_COMM_STATUS_CHANGE 0x32UL +#define ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE 0x33UL +#define ASYNC_EVENT_CMPL_EVENT_ID_LLFC_PFC_CHANGE 0x34UL +#define ASYNC_EVENT_CMPL_EVENT_ID_DEFAULT_VNIC_CHANGE 0x35UL +#define ASYNC_EVENT_CMPL_EVENT_ID_HW_FLOW_AGED 0x36UL +#define ASYNC_EVENT_CMPL_EVENT_ID_DEBUG_NOTIFICATION 0x37UL +#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_REQ 0x38UL +#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_CACHE_FLUSH_DONE 0x39UL +#define ASYNC_EVENT_CMPL_EVENT_ID_TCP_FLAG_ACTION_CHANGE 0x3aUL +#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_FLOW_ACTIVE 0x3bUL +#define ASYNC_EVENT_CMPL_EVENT_ID_EEM_CFG_CHANGE 0x3cUL +#define ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_DEFAULT_VNIC_CHANGE 0x3dUL +#define ASYNC_EVENT_CMPL_EVENT_ID_TFLIB_LINK_STATUS_CHANGE 0x3eUL +#define ASYNC_EVENT_CMPL_EVENT_ID_QUIESCE_DONE 0x3fUL +#define ASYNC_EVENT_CMPL_EVENT_ID_DEFERRED_RESPONSE 0x40UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PFC_WATCHDOG_CFG_CHANGE 0x41UL +#define ASYNC_EVENT_CMPL_EVENT_ID_ECHO_REQUEST 0x42UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PHC_UPDATE 0x43UL +#define ASYNC_EVENT_CMPL_EVENT_ID_PPS_TIMESTAMP 0x44UL +#define ASYNC_EVENT_CMPL_EVENT_ID_ERROR_REPORT 0x45UL +#define ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_THRESHOLD 0x46UL +#define ASYNC_EVENT_CMPL_EVENT_ID_RSS_CHANGE 0x47UL +#define ASYNC_EVENT_CMPL_EVENT_ID_DOORBELL_PACING_NQ_UPDATE 0x48UL +#define ASYNC_EVENT_CMPL_EVENT_ID_HW_DOORBELL_RECOVERY_READ_ERROR 0x49UL +#define ASYNC_EVENT_CMPL_EVENT_ID_CTX_ERROR 0x4aUL +#define ASYNC_EVENT_CMPL_EVENT_ID_MAX_RGTR_EVENT_ID 0x4bUL +#define ASYNC_EVENT_CMPL_EVENT_ID_FW_TRACE_MSG 0xfeUL +#define ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR 0xffUL +#define ASYNC_EVENT_CMPL_EVENT_ID_LAST ASYNC_EVENT_CMPL_EVENT_ID_HWRM_ERROR__le32 event_data2;u8 opaque_v;#define ASYNC_EVENT_CMPL_V 0x1UL
@@ -1011,6 +1025,7 @@ struct hwrm_async_event_cmpl_vf_cfg_change {#define ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_MAC_ADDR_CHANGE 0x4UL#define ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_DFLT_VLAN_CHANGE 0x8UL#define ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TRUSTED_VF_CFG_CHANGE 0x10UL +#define ASYNC_EVENT_CMPL_VF_CFG_CHANGE_EVENT_DATA1_TF_OWNERSHIP_RELEASE 0x20UL };/* hwrm_async_event_cmpl_default_vnic_change (size:128b/16B) */
@@ -1402,6 +1417,45 @@ struct hwrm_async_event_cmpl_error_report_doorbell_drop_threshold {#define ASYNC_EVENT_CMPL_ERROR_REPORT_DOORBELL_DROP_THRESHOLD_EVENT_DATA1_EPOCH_SFT 8 }; +/* hwrm_async_event_cmpl_error_report_thermal (size:128b/16B) */ +struct hwrm_async_event_cmpl_error_report_thermal { +__le16 type; +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_MASK 0x3fUL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_SFT 0 +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT 0x2eUL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_TYPE_HWRM_ASYNC_EVENT +__le16 event_id; +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT 0x45UL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_ID_ERROR_REPORT +__le32 event_data2; +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK 0xffUL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_SFT 0 +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK 0xff00UL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT 8 +u8 opaque_v; +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_V 0x1UL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_MASK 0xfeUL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_OPAQUE_SFT 1 +u8 timestamp_lo; +__le16 timestamp_hi; +__le32 event_data1; +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_MASK 0xffUL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_SFT 0 +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT 0x5UL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_ERROR_TYPE_THERMAL_EVENT +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK 0x700UL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SFT 8 +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_WARN (0x0UL << 8) +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_CRITICAL (0x1UL << 8) +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_FATAL (0x2UL << 8) +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN (0x3UL << 8) +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR 0x800UL +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_DECREASING (0x0UL << 11) +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING (0x1UL << 11) +#define ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_LAST ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_TRANSITION_DIR_INCREASING +}; +/* hwrm_func_reset_input (size:192b/24B) */ struct hwrm_func_reset_input {__le16 req_type;
@@ -1502,7 +1556,7 @@ struct hwrm_func_vf_free_output {u8 valid; }; -/* hwrm_func_vf_cfg_input (size:448b/56B) */ +/* hwrm_func_vf_cfg_input (size:576b/72B) */ struct hwrm_func_vf_cfg_input {__le16 req_type;__le16 cmpl_ring;
@@ -1510,20 +1564,22 @@ struct hwrm_func_vf_cfg_input {__le16 target_id;__le64 resp_addr;__le32 enables; -#define FUNC_VF_CFG_REQ_ENABLES_MTU 0x1UL -#define FUNC_VF_CFG_REQ_ENABLES_GUEST_VLAN 0x2UL -#define FUNC_VF_CFG_REQ_ENABLES_ASYNC_EVENT_CR 0x4UL -#define FUNC_VF_CFG_REQ_ENABLES_DFLT_MAC_ADDR 0x8UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS 0x10UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS 0x20UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_TX_RINGS 0x40UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_RX_RINGS 0x80UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_L2_CTXS 0x100UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_VNICS 0x200UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS 0x400UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_HW_RING_GRPS 0x800UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_TX_KEY_CTXS 0x1000UL -#define FUNC_VF_CFG_REQ_ENABLES_NUM_RX_KEY_CTXS 0x2000UL +#define FUNC_VF_CFG_REQ_ENABLES_MTU 0x1UL +#define FUNC_VF_CFG_REQ_ENABLES_GUEST_VLAN 0x2UL +#define FUNC_VF_CFG_REQ_ENABLES_ASYNC_EVENT_CR 0x4UL +#define FUNC_VF_CFG_REQ_ENABLES_DFLT_MAC_ADDR 0x8UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_RSSCOS_CTXS 0x10UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_CMPL_RINGS 0x20UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_TX_RINGS 0x40UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_RX_RINGS 0x80UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_L2_CTXS 0x100UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_VNICS 0x200UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_STAT_CTXS 0x400UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_HW_RING_GRPS 0x800UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_KTLS_TX_KEY_CTXS 0x1000UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_KTLS_RX_KEY_CTXS 0x2000UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_QUIC_TX_KEY_CTXS 0x4000UL +#define FUNC_VF_CFG_REQ_ENABLES_NUM_QUIC_RX_KEY_CTXS 0x8000UL__le16 mtu;__le16 guest_vlan;__le16 async_event_cr;
@@ -1547,8 +1603,12 @@ struct hwrm_func_vf_cfg_input {__le16 num_vnics;__le16 num_stat_ctxs;__le16 num_hw_ring_grps; -__le16 num_tx_key_ctxs; -__le16 num_rx_key_ctxs; +__le32 num_ktls_tx_key_ctxs; +__le32 num_ktls_rx_key_ctxs; +__le16 num_msix; +u8 unused[2 ]; +__le32 num_quic_tx_key_ctxs; +__le32 num_quic_rx_key_ctxs; };/* hwrm_func_vf_cfg_output (size:128b/16B) */
@@ -1572,7 +1632,7 @@ struct hwrm_func_qcaps_input {u8 unused_0[6 ]; }; -/* hwrm_func_qcaps_output (size:768b/96B) */ +/* hwrm_func_qcaps_output (size:896b/112B) */ struct hwrm_func_qcaps_output {__le16 error_code;__le16 req_type;
@@ -1686,6 +1746,11 @@ struct hwrm_func_qcaps_output {#define FUNC_QCAPS_RESP_FLAGS_EXT2_SYNCE_SUPPORTED 0x80UL#define FUNC_QCAPS_RESP_FLAGS_EXT2_DBR_PACING_V0_SUPPORTED 0x100UL#define FUNC_QCAPS_RESP_FLAGS_EXT2_TX_PKT_TS_CMPL_SUPPORTED 0x200UL +#define FUNC_QCAPS_RESP_FLAGS_EXT2_HW_LAG_SUPPORTED 0x400UL +#define FUNC_QCAPS_RESP_FLAGS_EXT2_ON_CHIP_CTX_SUPPORTED 0x800UL +#define FUNC_QCAPS_RESP_FLAGS_EXT2_STEERING_TAG_SUPPORTED 0x1000UL +#define FUNC_QCAPS_RESP_FLAGS_EXT2_ENHANCED_VF_SCALE_SUPPORTED 0x2000UL +#define FUNC_QCAPS_RESP_FLAGS_EXT2_KEY_XID_PARTITION_SUPPORTED 0x4000UL__le16 tunnel_disable_flag;#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN 0x1UL#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_NGE 0x2UL
@@ -1695,7 +1760,15 @@ struct hwrm_func_qcaps_output {#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_IPINIP 0x20UL#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_MPLS 0x40UL#define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_PPPOE 0x80UL +u8 key_xid_partition_cap; +#define FUNC_QCAPS_RESP_KEY_XID_PARTITION_CAP_TKC 0x1UL +#define FUNC_QCAPS_RESP_KEY_XID_PARTITION_CAP_RKC 0x2UL +#define FUNC_QCAPS_RESP_KEY_XID_PARTITION_CAP_QUIC_TKC 0x4UL +#define FUNC_QCAPS_RESP_KEY_XID_PARTITION_CAP_QUIC_RKC 0x8ULu8 unused_1; +u8 device_serial_number[8 ]; +__le16 ctxs_per_partition; +u8 unused_2[5 ];u8 valid; };
@@ -1710,7 +1783,7 @@ struct hwrm_func_qcfg_input {u8 unused_0[6 ]; }; -/* hwrm_func_qcfg_output (size:896b/112B) */ +/* hwrm_func_qcfg_output (size:1024b/128B) */ struct hwrm_func_qcfg_output {__le16 error_code;__le16 req_type;
@@ -1870,19 +1943,24 @@ struct hwrm_func_qcfg_output {#define FUNC_QCFG_RESP_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100 (0x1UL << 29)#define FUNC_QCFG_RESP_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST FUNC_QCFG_RESP_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100__le16 host_mtu; -__le16 alloc_tx_key_ctxs; -__le16 alloc_rx_key_ctxs; +u8 unused_3[2 ]; +u8 unused_4[2 ];u8 port_kdnet_mode;#define FUNC_QCFG_RESP_PORT_KDNET_MODE_DISABLED 0x0UL#define FUNC_QCFG_RESP_PORT_KDNET_MODE_ENABLED 0x1UL#define FUNC_QCFG_RESP_PORT_KDNET_MODE_LAST FUNC_QCFG_RESP_PORT_KDNET_MODE_ENABLEDu8 kdnet_pcie_function;__le16 port_kdnet_fid; -u8 unused_3; +u8 unused_5[2 ]; +__le32 alloc_tx_key_ctxs; +__le32 alloc_rx_key_ctxs; +u8 lag_id; +u8 parif; +u8 unused_6[5 ];u8 valid; }; -/* hwrm_func_cfg_input (size:960b/120B) */ +/* hwrm_func_cfg_input (size:1088b/136B) */ struct hwrm_func_cfg_input {__le16 req_type;__le16 cmpl_ring;
@@ -2061,8 +2139,7 @@ struct hwrm_func_cfg_input {#define FUNC_CFG_REQ_PARTITION_MAX_BW_BW_VALUE_UNIT_LAST FUNC_CFG_REQ_PARTITION_MAX_BW_BW_VALUE_UNIT_PERCENT1_100__be16 tpid;__le16 host_mtu; -__le16 num_tx_key_ctxs; -__le16 num_rx_key_ctxs; +u8 unused_0[4 ];__le32 enables2;#define FUNC_CFG_REQ_ENABLES2_KDNET 0x1UL#define FUNC_CFG_REQ_ENABLES2_DB_PAGE_SIZE 0x2UL
@@ -2083,7 +2160,12 @@ struct hwrm_func_cfg_input {#define FUNC_CFG_REQ_DB_PAGE_SIZE_2MB 0x9UL#define FUNC_CFG_REQ_DB_PAGE_SIZE_4MB 0xaUL#define FUNC_CFG_REQ_DB_PAGE_SIZE_LAST FUNC_CFG_REQ_DB_PAGE_SIZE_4MB -u8 unused_0[6 ]; +u8 unused_1[2 ]; +__le32 num_ktls_tx_key_ctxs; +__le32 num_ktls_rx_key_ctxs; +__le32 num_quic_tx_key_ctxs; +__le32 num_quic_rx_key_ctxs; +__le32 unused_2; };/* hwrm_func_cfg_output (size:128b/16B) */
@@ -2390,7 +2472,11 @@ struct hwrm_func_drv_qver_input {__le64 resp_addr;__le32 reserved;__le16 fid; -u8 unused_0[2 ]; +u8 driver_type; +#define FUNC_DRV_QVER_REQ_DRIVER_TYPE_L2 0x0UL +#define FUNC_DRV_QVER_REQ_DRIVER_TYPE_ROCE 0x1UL +#define FUNC_DRV_QVER_REQ_DRIVER_TYPE_LAST FUNC_DRV_QVER_REQ_DRIVER_TYPE_ROCE +u8 unused_0; };/* hwrm_func_drv_qver_output (size:256b/32B) */
@@ -2435,7 +2521,7 @@ struct hwrm_func_resource_qcaps_input {u8 unused_0[6 ]; }; -/* hwrm_func_resource_qcaps_output (size:512b/64B) */ +/* hwrm_func_resource_qcaps_output (size:704b/88B) */ struct hwrm_func_resource_qcaps_output {__le16 error_code;__le16 req_type;
@@ -2467,15 +2553,20 @@ struct hwrm_func_resource_qcaps_output {__le16 max_tx_scheduler_inputs;__le16 flags;#define FUNC_RESOURCE_QCAPS_RESP_FLAGS_MIN_GUARANTEED 0x1UL -__le16 min_tx_key_ctxs; -__le16 max_tx_key_ctxs; -__le16 min_rx_key_ctxs; -__le16 max_rx_key_ctxs; -u8 unused_0[5 ]; +__le16 min_msix; +__le32 min_ktls_tx_key_ctxs; +__le32 max_ktls_tx_key_ctxs; +__le32 min_ktls_rx_key_ctxs; +__le32 max_ktls_rx_key_ctxs; +__le32 min_quic_tx_key_ctxs; +__le32 max_quic_tx_key_ctxs; +__le32 min_quic_rx_key_ctxs; +__le32 max_quic_rx_key_ctxs; +u8 unused_0[3 ];u8 valid; }; -/* hwrm_func_vf_resource_cfg_input (size:512b/64B) */ +/* hwrm_func_vf_resource_cfg_input (size:704b/88B) */ struct hwrm_func_vf_resource_cfg_input {__le16 req_type;__le16 cmpl_ring;
@@ -2502,14 +2593,18 @@ struct hwrm_func_vf_resource_cfg_input {__le16 max_hw_ring_grps;__le16 flags;#define FUNC_VF_RESOURCE_CFG_REQ_FLAGS_MIN_GUARANTEED 0x1UL -__le16 min_tx_key_ctxs; -__le16 max_tx_key_ctxs; -__le16 min_rx_key_ctxs; -__le16 max_rx_key_ctxs; -u8 unused_0[2 ]; -}; - -/* hwrm_func_vf_resource_cfg_output (size:256b/32B) */ +__le16 min_msix; +__le32 min_ktls_tx_key_ctxs; +__le32 max_ktls_tx_key_ctxs; +__le32 min_ktls_rx_key_ctxs; +__le32 max_ktls_rx_key_ctxs; +__le32 min_quic_tx_key_ctxs; +__le32 max_quic_tx_key_ctxs; +__le32 min_quic_rx_key_ctxs; +__le32 max_quic_rx_key_ctxs; +}; + +/* hwrm_func_vf_resource_cfg_output (size:320b/40B) */ struct hwrm_func_vf_resource_cfg_output {__le16 error_code;__le16 req_type;
@@ -2523,9 +2618,9 @@ struct hwrm_func_vf_resource_cfg_output {__le16 reserved_vnics;__le16 reserved_stat_ctx;__le16 reserved_hw_ring_grps; -__le16 reserved_tx_key_ctxs; -__le16 reserved_rx_key_ctxs; -u8 unused_0[3 ]; +__le32 reserved_tx_key_ctxs; +__le32 reserved_rx_key_ctxs; +u8 unused_0[7 ];u8 valid; };
@@ -2592,7 +2687,8 @@ struct hwrm_func_backing_store_qcaps_output {__le16 rkc_entry_size;__le32 tkc_max_entries;__le32 rkc_max_entries; -u8 rsvd1[7 ]; +__le16 fast_qpmd_qp_num_entries; +u8 rsvd1[5 ];u8 valid; };
@@ -2630,27 +2726,28 @@ struct hwrm_func_backing_store_cfg_input {#define FUNC_BACKING_STORE_CFG_REQ_FLAGS_PREBOOT_MODE 0x1UL#define FUNC_BACKING_STORE_CFG_REQ_FLAGS_MRAV_RESERVATION_SPLIT 0x2UL__le32 enables; -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_QP 0x1UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_SRQ 0x2UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_CQ 0x4UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_VNIC 0x8UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_STAT 0x10UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_SP 0x20UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING0 0x40UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING1 0x80UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING2 0x100UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING3 0x200UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING4 0x400UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING5 0x800UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING6 0x1000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING7 0x2000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_MRAV 0x4000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TIM 0x8000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING8 0x10000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING9 0x20000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING10 0x40000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TKC 0x80000UL -#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_RKC 0x100000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_QP 0x1UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_SRQ 0x2UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_CQ 0x4UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_VNIC 0x8UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_STAT 0x10UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_SP 0x20UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING0 0x40UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING1 0x80UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING2 0x100UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING3 0x200UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING4 0x400UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING5 0x800UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING6 0x1000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING7 0x2000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_MRAV 0x4000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TIM 0x8000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING8 0x10000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING9 0x20000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TQM_RING10 0x40000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_TKC 0x80000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_RKC 0x100000UL +#define FUNC_BACKING_STORE_CFG_REQ_ENABLES_QP_FAST_QPMD 0x200000ULu8 qpc_pg_size_qpc_lvl;#define FUNC_BACKING_STORE_CFG_REQ_QPC_LVL_MASK 0xfUL#define FUNC_BACKING_STORE_CFG_REQ_QPC_LVL_SFT 0
@@ -3047,7 +3144,7 @@ struct hwrm_func_backing_store_cfg_input {#define FUNC_BACKING_STORE_CFG_REQ_RKC_PG_SIZE_PG_8M (0x4UL << 4)#define FUNC_BACKING_STORE_CFG_REQ_RKC_PG_SIZE_PG_1G (0x5UL << 4)#define FUNC_BACKING_STORE_CFG_REQ_RKC_PG_SIZE_LAST FUNC_BACKING_STORE_CFG_REQ_RKC_PG_SIZE_PG_1G -u8 rsvd[2 ]; +__le16 qp_num_fast_qpmd_entries; };/* hwrm_func_backing_store_cfg_output (size:128b/16B) */
@@ -3477,6 +3574,8 @@ struct hwrm_func_backing_store_cfg_v2_input {#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_QUIC_TKC 0x1aUL#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_QUIC_RKC 0x1bUL +#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_TBL_SCOPE 0x1cUL +#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_XID_PARTITION 0x1dUL#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID 0xffffUL#define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID__le16 instance;
@@ -3546,6 +3645,8 @@ struct hwrm_func_backing_store_qcfg_v2_input {#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_QUIC_TKC 0x1aUL#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_QUIC_RKC 0x1bUL +#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_TBL_SCOPE 0x1cUL +#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_XID_PARTITION 0x1dUL#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_INVALID 0xffffUL#define FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_QCFG_V2_REQ_TYPE_INVALID__le16 instance;
@@ -3559,22 +3660,24 @@ struct hwrm_func_backing_store_qcfg_v2_output {__le16 seq_id;__le16 resp_len;__le16 type; -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QP 0x0UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRQ 0x1UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CQ 0x2UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_VNIC 0x3UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_STAT 0x4UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SP_TQM_RING 0x5UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_FP_TQM_RING 0x6UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MRAV 0xeUL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TIM 0xfUL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TKC 0x13UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_RKC 0x14UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MP_TQM_RING 0x15UL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QUIC_TKC 0x1aUL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QUIC_RKC 0x1bUL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID 0xffffUL -#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QP 0x0UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SRQ 0x1UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_CQ 0x2UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_VNIC 0x3UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_STAT 0x4UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_SP_TQM_RING 0x5UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_FP_TQM_RING 0x6UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MRAV 0xeUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TIM 0xfUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TKC 0x13UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_RKC 0x14UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_MP_TQM_RING 0x15UL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QUIC_TKC 0x1aUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_QUIC_RKC 0x1bUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_TBL_SCOPE 0x1cUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_XID_PARTITION 0x1dUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID 0xffffUL +#define FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCFG_V2_RESP_TYPE_INVALID__le16 instance;__le32 flags;__le64 page_dir;
@@ -3609,7 +3712,8 @@ struct hwrm_func_backing_store_qcfg_v2_output {struct qpc_split_entries {__le32 qp_num_l2_entries;__le32 qp_num_qp1_entries; -__le32 rsvd[2 ]; +__le32 qp_num_fast_qpmd_entries; +__le32 rsvd; };/* srq_split_entries (size:128b/16B) */
@@ -3666,6 +3770,8 @@ struct hwrm_func_backing_store_qcaps_v2_input {#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_CQ_DB_SHADOW 0x19UL#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QUIC_TKC 0x1aUL#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_QUIC_RKC 0x1bUL +#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_TBL_SCOPE 0x1cUL +#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_XID_PARTITION 0x1dUL#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_INVALID 0xffffUL#define FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_QCAPS_V2_REQ_TYPE_INVALIDu8 rsvd[6 ];
@@ -3696,13 +3802,16 @@ struct hwrm_func_backing_store_qcaps_v2_output {#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_CQ_DB_SHADOW 0x19UL#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_QUIC_TKC 0x1aUL#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_QUIC_RKC 0x1bUL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_TBL_SCOPE 0x1cUL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_XID_PARTITION 0x1dUL#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_INVALID 0xffffUL#define FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_LAST FUNC_BACKING_STORE_QCAPS_V2_RESP_TYPE_INVALID__le16 entry_size;__le32 flags; -#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_ENABLE_CTX_KIND_INIT 0x1UL -#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_TYPE_VALID 0x2UL -#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_DRIVER_MANAGED_MEMORY 0x4UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_ENABLE_CTX_KIND_INIT 0x1UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_TYPE_VALID 0x2UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_DRIVER_MANAGED_MEMORY 0x4UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_FLAGS_ROCE_QP_PSEUDO_STATIC_ALLOC 0x8UL__le32 instance_bit_map;u8 ctx_init_value;u8 ctx_init_offset;
@@ -3712,7 +3821,13 @@ struct hwrm_func_backing_store_qcaps_v2_output {__le32 min_num_entries;__le16 next_valid_type;u8 subtype_valid_cnt; -u8 rsvd2; +u8 exact_cnt_bit_map; +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_0_EXACT 0x1UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_1_EXACT 0x2UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_2_EXACT 0x4UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_EXACT_CNT_BIT_MAP_SPLIT_ENTRY_3_EXACT 0x8UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_EXACT_CNT_BIT_MAP_UNUSED_MASK 0xf0UL +#define FUNC_BACKING_STORE_QCAPS_V2_RESP_EXACT_CNT_BIT_MAP_UNUSED_SFT 4__le32 split_entry_0;__le32 split_entry_1;__le32 split_entry_2;
@@ -4545,7 +4660,7 @@ struct tx_port_stats_ext {__le64 pfc_pri7_tx_transitions; }; -/* rx_port_stats_ext (size:3776b/472B) */ +/* rx_port_stats_ext (size:3904b/488B) */ struct rx_port_stats_ext {__le64 link_down_events;__le64 continuous_pause_events;
@@ -4606,6 +4721,8 @@ struct rx_port_stats_ext {__le64 rx_discard_packets_cos7;__le64 rx_fec_corrected_blocks;__le64 rx_fec_uncorrectable_blocks; +__le64 rx_filter_miss; +__le64 rx_fec_symbol_err; };/* hwrm_port_qstats_ext_input (size:320b/40B) */
@@ -6038,6 +6155,7 @@ struct hwrm_vnic_cfg_input {#define VNIC_CFG_REQ_FLAGS_ROCE_ONLY_VNIC_MODE 0x10UL#define VNIC_CFG_REQ_FLAGS_RSS_DFLT_CR_MODE 0x20UL#define VNIC_CFG_REQ_FLAGS_ROCE_MIRRORING_CAPABLE_VNIC_MODE 0x40UL +#define VNIC_CFG_REQ_FLAGS_PORTCOS_MAPPING_MODE 0x80UL__le32 enables;#define VNIC_CFG_REQ_ENABLES_DFLT_RING_GRP 0x1UL#define VNIC_CFG_REQ_ENABLES_RSS_RULE 0x2UL
@@ -6127,12 +6245,16 @@ struct hwrm_vnic_qcaps_output {#define VNIC_QCAPS_RESP_FLAGS_RSS_IPSEC_AH_SPI_IPV6_CAP 0x800000UL#define VNIC_QCAPS_RESP_FLAGS_RSS_IPSEC_ESP_SPI_IPV6_CAP 0x1000000UL#define VNIC_QCAPS_RESP_FLAGS_OUTERMOST_RSS_TRUSTED_VF_CAP 0x2000000UL +#define VNIC_QCAPS_RESP_FLAGS_PORTCOS_MAPPING_MODE 0x4000000UL +#define VNIC_QCAPS_RESP_FLAGS_RSS_PROF_TCAM_MODE_ENABLED 0x8000000UL +#define VNIC_QCAPS_RESP_FLAGS_VNIC_RSS_HASH_MODE_CAP 0x10000000UL +#define VNIC_QCAPS_RESP_FLAGS_HW_TUNNEL_TPA_CAP 0x20000000UL__le16 max_aggs_supported;u8 unused_1[5 ];u8 valid; }; -/* hwrm_vnic_tpa_cfg_input (size:320b/40B) */ +/* hwrm_vnic_tpa_cfg_input (size:384b/48B) */ struct hwrm_vnic_tpa_cfg_input {__le16 req_type;__le16 cmpl_ring;
@@ -6154,6 +6276,7 @@ struct hwrm_vnic_tpa_cfg_input {#define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGGS 0x2UL#define VNIC_TPA_CFG_REQ_ENABLES_MAX_AGG_TIMER 0x4UL#define VNIC_TPA_CFG_REQ_ENABLES_MIN_AGG_LEN 0x8UL +#define VNIC_TPA_CFG_REQ_ENABLES_TNL_TPA_EN 0x10UL__le16 vnic_id;__le16 max_agg_segs;#define VNIC_TPA_CFG_REQ_MAX_AGG_SEGS_1 0x0UL
@@ -6173,6 +6296,25 @@ struct hwrm_vnic_tpa_cfg_input {u8 unused_0[2 ];__le32 max_agg_timer;__le32 min_agg_len; +__le32 tnl_tpa_en_bitmap; +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_VXLAN 0x1UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_GENEVE 0x2UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_NVGRE 0x4UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_GRE 0x8UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_IPV4 0x10UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_IPV6 0x20UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_VXLAN_GPE 0x40UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_VXLAN_CUST1 0x80UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_GRE_CUST1 0x100UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR1 0x200UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR2 0x400UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR3 0x800UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR4 0x1000UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR5 0x2000UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR6 0x4000UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR7 0x8000UL +#define VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_UPAR8 0x10000UL +u8 unused_1[4 ]; };/* hwrm_vnic_tpa_cfg_output (size:128b/16B) */
@@ -6228,7 +6370,25 @@ struct hwrm_vnic_tpa_qcfg_output {#define VNIC_TPA_QCFG_RESP_MAX_AGGS_LAST VNIC_TPA_QCFG_RESP_MAX_AGGS_MAX__le32 max_agg_timer;__le32 min_agg_len; -u8 unused_0[7 ]; +__le32 tnl_tpa_en_bitmap; +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_VXLAN 0x1UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_GENEVE 0x2UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_NVGRE 0x4UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_GRE 0x8UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_IPV4 0x10UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_IPV6 0x20UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_VXLAN_GPE 0x40UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_VXLAN_CUST1 0x80UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_GRE_CUST1 0x100UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR1 0x200UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR2 0x400UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR3 0x800UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR4 0x1000UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR5 0x2000UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR6 0x4000UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR7 0x8000UL +#define VNIC_TPA_QCFG_RESP_TNL_TPA_EN_BITMAP_UPAR8 0x10000UL +u8 unused_0[3 ];u8 valid; };
@@ -6263,8 +6423,9 @@ struct hwrm_vnic_rss_cfg_input {__le64 hash_key_tbl_addr;__le16 rss_ctx_idx;u8 flags; -#define VNIC_RSS_CFG_REQ_FLAGS_HASH_TYPE_INCLUDE 0x1UL -#define VNIC_RSS_CFG_REQ_FLAGS_HASH_TYPE_EXCLUDE 0x2UL +#define VNIC_RSS_CFG_REQ_FLAGS_HASH_TYPE_INCLUDE 0x1UL +#define VNIC_RSS_CFG_REQ_FLAGS_HASH_TYPE_EXCLUDE 0x2UL +#define VNIC_RSS_CFG_REQ_FLAGS_IPSEC_HASH_TYPE_CFG_SUPPORT 0x4ULu8 ring_select_mode;#define VNIC_RSS_CFG_REQ_RING_SELECT_MODE_TOEPLITZ 0x0UL#define VNIC_RSS_CFG_REQ_RING_SELECT_MODE_XOR 0x1UL
@@ -6426,14 +6587,15 @@ struct hwrm_ring_alloc_input {__le16 target_id;__le64 resp_addr;__le32 enables; -#define RING_ALLOC_REQ_ENABLES_RING_ARB_CFG 0x2UL -#define RING_ALLOC_REQ_ENABLES_STAT_CTX_ID_VALID 0x8UL -#define RING_ALLOC_REQ_ENABLES_MAX_BW_VALID 0x20UL -#define RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID 0x40UL -#define RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID 0x80UL -#define RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID 0x100UL -#define RING_ALLOC_REQ_ENABLES_SCHQ_ID 0x200UL -#define RING_ALLOC_REQ_ENABLES_MPC_CHNLS_TYPE 0x400UL +#define RING_ALLOC_REQ_ENABLES_RING_ARB_CFG 0x2UL +#define RING_ALLOC_REQ_ENABLES_STAT_CTX_ID_VALID 0x8UL +#define RING_ALLOC_REQ_ENABLES_MAX_BW_VALID 0x20UL +#define RING_ALLOC_REQ_ENABLES_RX_RING_ID_VALID 0x40UL +#define RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID 0x80UL +#define RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID 0x100UL +#define RING_ALLOC_REQ_ENABLES_SCHQ_ID 0x200UL +#define RING_ALLOC_REQ_ENABLES_MPC_CHNLS_TYPE 0x400UL +#define RING_ALLOC_REQ_ENABLES_STEERING_TAG_VALID 0x800ULu8 ring_type;#define RING_ALLOC_REQ_RING_TYPE_L2_CMPL 0x0UL#define RING_ALLOC_REQ_RING_TYPE_TX 0x1UL
@@ -6487,7 +6649,7 @@ struct hwrm_ring_alloc_input {#define RING_ALLOC_REQ_RING_ARB_CFG_RSVD_SFT 4#define RING_ALLOC_REQ_RING_ARB_CFG_ARB_POLICY_PARAM_MASK 0xff00UL#define RING_ALLOC_REQ_RING_ARB_CFG_ARB_POLICY_PARAM_SFT 8 -__le16 unused_3; +__le16 steering_tag;__le32 reserved3;__le32 stat_ctx_id;__le32 reserved4;
@@ -6863,6 +7025,7 @@ struct hwrm_cfa_l2_filter_alloc_input {#define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL#define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL#define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL +#define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL#define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL 0xffUL#define CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_LAST CFA_L2_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNELu8 unused_4;
@@ -7045,6 +7208,7 @@ struct hwrm_cfa_tunnel_filter_alloc_input {#define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL#define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL#define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL +#define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL#define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL 0xffUL#define CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_LAST CFA_TUNNEL_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNELu8 tunnel_flags;
@@ -7179,7 +7343,8 @@ struct hwrm_cfa_encap_record_alloc_input {#define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_IPGRE_V1 0xaUL#define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_L2_ETYPE 0xbUL#define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VXLAN_GPE_V6 0xcUL -#define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_LAST CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VXLAN_GPE_V6 +#define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VXLAN_GPE 0x10UL +#define CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_LAST CFA_ENCAP_RECORD_ALLOC_REQ_ENCAP_TYPE_VXLAN_GPEu8 unused_0[3 ];__le32 encap_data[20 ]; };
@@ -7284,6 +7449,7 @@ struct hwrm_cfa_ntuple_filter_alloc_input {#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL +#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL 0xffUL#define CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_LAST CFA_NTUPLE_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNELu8 pri_hint;
@@ -7431,6 +7597,7 @@ struct hwrm_cfa_decap_filter_alloc_input {#define CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL#define CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL#define CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL +#define CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL#define CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL 0xffUL#define CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_LAST CFA_DECAP_FILTER_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNELu8 unused_0;
@@ -7574,6 +7741,7 @@ struct hwrm_cfa_flow_alloc_input {#define CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL#define CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL#define CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL +#define CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL#define CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL 0xffUL#define CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_LAST CFA_FLOW_ALLOC_REQ_TUNNEL_TYPE_ANYTUNNEL };
@@ -7999,8 +8167,11 @@ struct hwrm_tunnel_dst_port_query_input {#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ECPRI 0xeUL -#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ECPRI -u8 unused_0[7 ]; +#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_SRV6 0xfUL +#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL +#define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE +u8 tunnel_next_proto; +u8 unused_0[6 ]; };/* hwrm_tunnel_dst_port_query_output (size:128b/16B) */
@@ -8040,10 +8211,12 @@ struct hwrm_tunnel_dst_port_alloc_input {#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ECPRI 0xeUL -#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ECPRI -u8 unused_0; +#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_SRV6 0xfUL +#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL +#define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE +u8 tunnel_next_proto;__be16 tunnel_dst_port_val; -u8 unused_1[4 ]; +u8 unused_0[4 ]; };/* hwrm_tunnel_dst_port_alloc_output (size:128b/16B) */
@@ -8087,10 +8260,12 @@ struct hwrm_tunnel_dst_port_free_input {#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ECPRI 0xeUL -#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ECPRI -u8 unused_0; +#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_SRV6 0xfUL +#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE 0x10UL +#define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE +u8 tunnel_next_proto;__le16 tunnel_dst_port_id; -u8 unused_1[4 ]; +u8 unused_0[4 ]; };/* hwrm_tunnel_dst_port_free_output (size:128b/16B) */
@@ -8158,7 +8333,7 @@ struct ctx_hw_stats_ext {__le64 rx_tpa_events; }; -/* hwrm_stat_ctx_alloc_input (size:256b/32B) */ +/* hwrm_stat_ctx_alloc_input (size:320b/40B) */ struct hwrm_stat_ctx_alloc_input {__le16 req_type;__le16 cmpl_ring;
@@ -8171,6 +8346,10 @@ struct hwrm_stat_ctx_alloc_input {#define STAT_CTX_ALLOC_REQ_STAT_CTX_FLAGS_ROCE 0x1ULu8 unused_0;__le16 stats_dma_length; +__le16 flags; +#define STAT_CTX_ALLOC_REQ_FLAGS_STEERING_TAG_VALID 0x1UL +__le16 steering_tag; +__le32 unused_1; };/* hwrm_stat_ctx_alloc_output (size:128b/16B) */
@@ -8378,7 +8557,7 @@ struct hwrm_stat_generic_qstats_output {u8 valid; }; -/* generic_sw_hw_stats (size:1216b/152B) */ +/* generic_sw_hw_stats (size:1408b/176B) */ struct generic_sw_hw_stats {__le64 pcie_statistics_tx_tlp;__le64 pcie_statistics_rx_tlp;
@@ -8399,6 +8578,9 @@ struct generic_sw_hw_stats {__le64 cache_miss_count_cfcs;__le64 cache_miss_count_cfcc;__le64 cache_miss_count_cfcm; +__le64 hw_db_recov_dbs_dropped; +__le64 hw_db_recov_drops_serviced; +__le64 hw_db_recov_dbs_recovered; };/* hwrm_fw_reset_input (size:192b/24B) */
@@ -8822,7 +9004,7 @@ struct hwrm_temp_monitor_query_input {__le64 resp_addr; }; -/* hwrm_temp_monitor_query_output (size:128b/16B) */ +/* hwrm_temp_monitor_query_output (size:192b/24B) */ struct hwrm_temp_monitor_query_output {__le16 error_code;__le16 req_type;
@@ -8832,14 +9014,20 @@ struct hwrm_temp_monitor_query_output {u8 phy_temp;u8 om_temp;u8 flags; -#define TEMP_MONITOR_QUERY_RESP_FLAGS_TEMP_NOT_AVAILABLE 0x1UL -#define TEMP_MONITOR_QUERY_RESP_FLAGS_PHY_TEMP_NOT_AVAILABLE 0x2UL -#define TEMP_MONITOR_QUERY_RESP_FLAGS_OM_NOT_PRESENT 0x4UL -#define TEMP_MONITOR_QUERY_RESP_FLAGS_OM_TEMP_NOT_AVAILABLE 0x8UL -#define TEMP_MONITOR_QUERY_RESP_FLAGS_EXT_TEMP_FIELDS_AVAILABLE 0x10UL +#define TEMP_MONITOR_QUERY_RESP_FLAGS_TEMP_NOT_AVAILABLE 0x1UL +#define TEMP_MONITOR_QUERY_RESP_FLAGS_PHY_TEMP_NOT_AVAILABLE 0x2UL +#define TEMP_MONITOR_QUERY_RESP_FLAGS_OM_NOT_PRESENT 0x4UL +#define TEMP_MONITOR_QUERY_RESP_FLAGS_OM_TEMP_NOT_AVAILABLE 0x8UL +#define TEMP_MONITOR_QUERY_RESP_FLAGS_EXT_TEMP_FIELDS_AVAILABLE 0x10UL +#define TEMP_MONITOR_QUERY_RESP_FLAGS_THRESHOLD_VALUES_AVAILABLE 0x20ULu8 temp2;u8 phy_temp2;u8 om_temp2; +u8 warn_threshold; +u8 critical_threshold; +u8 fatal_threshold; +u8 shutdown_threshold; +u8 unused_0[4 ];u8 valid; };
@@ -9263,7 +9451,8 @@ struct hwrm_dbg_ring_info_get_output {__le32 producer_index;__le32 consumer_index;__le32 cag_vector_ctrl; -u8 unused_0[3 ]; +__le16 st_tag; +u8 unused_0;u8 valid; };
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 8/12 bnxt_en: Enhance hwmon temperature reporting
In reply to Michael ChanFrom: Kalesh AP <[email protected]>
Driver currently does hwmon device register and unregister in open and close() respectively. As a result, user will not be able to query hwmon temperature when interface is in ifdown state.
Enhance it by moving the hwmon register/unregister to the probe/remove functions.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +8 -7
@@ -10275,7 +10275,7 @@ static struct attribute *bnxt_attrs[] = { };ATTRIBUTE_GROUPS (bnxt); -static void bnxt_hwmon_close (struct bnxt *bp) +static void bnxt_hwmon_uninit (struct bnxt *bp) {if (bp->hwmon_dev) {hwmon_device_unregister (bp->hwmon_dev);
@@ -10283,7 +10283,7 @@ static void bnxt_hwmon_close(struct bnxt *bp) } } -static void bnxt_hwmon_open (struct bnxt *bp) +static void bnxt_hwmon_init (struct bnxt *bp) {struct hwrm_temp_monitor_query_input *req;struct pci_dev *pdev = bp->pdev;
@@ -10293,7 +10293,7 @@ static void bnxt_hwmon_open(struct bnxt *bp)if (!rc) rc =hwrm_req_send_silent (bp, req);if (rc == -EACCES || rc == -EOPNOTSUPP ) { -bnxt_hwmon_close (bp); +bnxt_hwmon_uninit (bp);return ; }
@@ -10309,11 +10309,11 @@ static void bnxt_hwmon_open(struct bnxt *bp) } }#else -static void bnxt_hwmon_close (struct bnxt *bp) +static void bnxt_hwmon_uninit (struct bnxt *bp) { } -static void bnxt_hwmon_open (struct bnxt *bp) +static void bnxt_hwmon_init (struct bnxt *bp) { }#endif
@@ -10646,7 +10646,6 @@ static int bnxt_open(struct net_device *dev)bnxt_reenable_sriov (bp); } } -bnxt_hwmon_open (bp); }return rc;
@@ -10731,7 +10730,6 @@ static int bnxt_close(struct net_device *dev) {struct bnxt *bp =netdev_priv (dev); -bnxt_hwmon_close (bp);bnxt_close_nic (bp, true, true);bnxt_hwrm_shutdown_link (bp);bnxt_hwrm_if_change (bp, false);
@@ -12295,6 +12293,7 @@ static int bnxt_fw_init_one_p2(struct bnxt *bp)if (bp->fw_cap &BNXT_FW_CAP_PTP )__bnxt_hwrm_ptp_qcfg (bp);bnxt_dcb_init (bp); +bnxt_hwmon_init (bp);return 0 ; }
@@ -13200,6 +13199,7 @@ static void bnxt_remove_one(struct pci_dev *pdev)bnxt_clear_int_mode (bp);bnxt_hwrm_func_drv_unrgtr (bp);bnxt_free_hwrm_resources (bp); +bnxt_hwmon_uninit (bp);bnxt_ethtool_free (bp);bnxt_dcb_free (bp);kfree (bp->ptp_cfg);
@@ -13796,6 +13796,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) init_err_pci_clean:bnxt_hwrm_func_drv_unrgtr (bp);bnxt_free_hwrm_resources (bp); +bnxt_hwmon_uninit (bp);bnxt_ethtool_free (bp);bnxt_ptp_clear (bp);kfree (bp->ptp_cfg);
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 9/12 bnxt_en: Move hwmon functions into a dedicated file
In reply to Michael ChanFrom: Kalesh AP <[email protected]>
This is in preparation for upcoming patches in the series. Driver has to expose more threshold temperatures through the hwmon sysfs interface. More code will be added and do not want to overload bnxt.c.
--- drivers/net/ethernet/broadcom/bnxt/Makefile | 1 + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 75 +---------------- .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 82 +++++++++++++++++++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.h | 25 ++++++ 4 files changed, 109 insertions(+), 74 deletions(-) create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c create mode 100644 drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.h
drivers/net/ethernet/broadcom/bnxt/Makefile +1 -0
@@ -4,3 +4,4 @@ obj-$(CONFIG_BNXT) += bnxt_en.o bnxt_en-y := bnxt.o bnxt_hwrm.o bnxt_sriov.o bnxt_ethtool.o bnxt_dcb.o bnxt_ulp.o bnxt_xdp.o bnxt_ptp.o bnxt_vfr.o bnxt_devlink.o bnxt_dim.o bnxt_coredump.o bnxt_en-$(CONFIG_BNXT_FLOWER_OFFLOAD) += bnxt_tc.o bnxt_en-$(CONFIG_DEBUG_FS) += bnxt_debugfs.o +bnxt_en-$(CONFIG_BNXT_HWMON) += bnxt_hwmon.o
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -74
93 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c new file +82 -0
82 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.h new file +25 -0
@@ -0,0 +1,25 @@ +/* Broadcom NetXtreme-C/E network driver. +* +* Copyright (c) 2023 Broadcom Limited +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation. +*/ + +#ifndef BNXT_HWMON_H +#define BNXT_HWMON_H + +#ifdef CONFIG_BNXT_HWMON +void bnxt_hwmon_uninit (struct bnxt *bp); +void bnxt_hwmon_init (struct bnxt *bp); +#else +static inline void bnxt_hwmon_uninit (struct bnxt *bp) +{ +} + +static inline void bnxt_hwmon_init (struct bnxt *bp) +{ +} +#endif +#endif
Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 10/12 bnxt_en: Modify the driver to use hwmon_device_register_with_info
In reply to Michael ChanFrom: Kalesh AP <[email protected]>
The use of hwmon_device_register_with_groups() is deprecated. Modified the driver to use hwmon_device_register_with_info().
Driver currently exports only temp1_input through hwmon sysfs interface. But FW has been modified to report more threshold temperatures and driver want to report them through the hwmon interface.
--- .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 72 ++++++++++++++----- 1 file changed, 56 insertions(+), 16 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +56 -16
@@ -18,34 +18,74 @@#include "bnxt_hwrm.h" #include "bnxt_hwmon.h" -static ssize_t bnxt_show_temp (struct device *dev, -struct device_attribute *devattr,char *buf) +static int bnxt_hwrm_temp_query (struct bnxt *bp,u8 *temp) {struct hwrm_temp_monitor_query_output *resp;struct hwrm_temp_monitor_query_input *req; -struct bnxt *bp =dev_get_drvdata (dev); -u32 len =0 ;int rc; rc =hwrm_req_init (bp, req,HWRM_TEMP_MONITOR_QUERY );if (rc)return rc; resp =hwrm_req_hold (bp, req); - rc =hwrm_req_send (bp, req); -if (!rc) - len =sprintf (buf,"%u\n" , resp->temp *1000 );/* display millidegree */ -hwrm_req_drop (bp, req); + rc =hwrm_req_send_silent (bp, req);if (rc) + goto err; + +if (temp) + *temp = resp->temp; +err: +hwrm_req_drop (bp, req); +return rc; +} + +static umode_t bnxt_hwmon_is_visible (const void *_data,enum hwmon_sensor_types type, +u32 attr,int channel) +{ +if (type != hwmon_temp) +return 0 ; + +switch (attr) { +case hwmon_temp_input: +return 0444 ; +default : +return 0 ; + } +} + +static int bnxt_hwmon_read (struct device *dev,enum hwmon_sensor_types type,u32 attr, +int channel,long *val) +{ +struct bnxt *bp =dev_get_drvdata (dev); +u8 temp =0 ; +int rc; + +switch (attr) { +case hwmon_temp_input: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp *1000 ;return rc; -return len; +default : +return -EOPNOTSUPP ; + } } -static SENSOR_DEVICE_ATTR(temp1_input, 0444, bnxt_show_temp, NULL, 0); -static struct attribute *bnxt_attrs[] = { - &sensor_dev_attr_temp1_input.dev_attr.attr, +static const struct hwmon_channel_info *bnxt_hwmon_info[] = { +HWMON_CHANNEL_INFO (temp, +HWMON_T_INPUT ),NULL }; -ATTRIBUTE_GROUPS (bnxt); + +static const struct hwmon_ops bnxt_hwmon_ops = { + .is_visible = bnxt_hwmon_is_visible, + .read = bnxt_hwmon_read, +}; + +static const struct hwmon_chip_info bnxt_hwmon_chip_info = { + .ops = &bnxt_hwmon_ops, + .info = bnxt_hwmon_info, +};void bnxt_hwmon_uninit (struct bnxt *bp) {
@@ -72,9 +112,9 @@ void bnxt_hwmon_init(struct bnxt *bp)if (bp->hwmon_dev)return ; - bp->hwmon_dev =hwmon_device_register_with_groups (&pdev->dev, -DRV_MODULE_NAME , bp, - bnxt_groups); + bp->hwmon_dev =hwmon_device_register_with_info (&pdev->dev, +DRV_MODULE_NAME , bp, + &bnxt_hwmon_chip_info,NULL );if (IS_ERR (bp->hwmon_dev)) { bp->hwmon_dev =NULL ;dev_warn (&pdev->dev,"Cannot register hwmon device\n" );
Signature · 1 line
2.30.1
Guenter Roeck
maintainerRe: [PATCH net-next 10/12] bnxt_en: Modify the driver to use hwmon_device_register_with_info
Quoted 41 lines · Michael Chan
From: Kalesh AP <[email protected]>
The use of
hwmon_device_register_with_groups()is deprecated. Modified the driver to usehwmon_device_register_with_info().Driver currently exports only
temp1_inputthrough hwmon sysfs interface. But FW has been modified to report more threshold temperatures and driver want to report them through the hwmon interface.Cc Jean Delvare <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Kalesh AP <[email protected]>Signed-off-by Michael Chan <[email protected]>--- .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 72 ++++++++++++++----- 1 file changed, 56 insertions(+), 16 deletions(-)drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-4@@ -18,34 +18,74 @@#include "bnxt_hwrm.h" #include "bnxt_hwmon.h" -static ssize_t bnxt_show_temp (struct device *dev, -struct device_attribute *devattr,char *buf) +static int bnxt_hwrm_temp_query (struct bnxt *bp,u8 *temp) {struct hwrm_temp_monitor_query_output *resp;struct hwrm_temp_monitor_query_input *req; -struct bnxt *bp =dev_get_drvdata (dev); -u32 len =0 ;int rc; rc =hwrm_req_init (bp, req,HWRM_TEMP_MONITOR_QUERY );if (rc)return rc; resp =hwrm_req_hold (bp, req);
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c line 36
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +5
-4- rc =hwrm_req_send (bp, req); -if (!rc) - len =sprintf (buf,"%u\n" , resp->temp *1000 );/* display millidegree */ -hwrm_req_drop (bp, req); + rc =hwrm_req_send_silent (bp, req);if (rc) + goto err; + +if (temp) + *temp = resp->temp;
Why this NULL pointer check ? This is a static function, and it is never called with a NULL pointer.
Quoted 34 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +32
-1+err: +hwrm_req_drop (bp, req); +return rc; +} + +static umode_t bnxt_hwmon_is_visible (const void *_data,enum hwmon_sensor_types type, +u32 attr,int channel) +{ +if (type != hwmon_temp) +return 0 ; + +switch (attr) { +case hwmon_temp_input: +return 0444 ; +default : +return 0 ; + } +} + +static int bnxt_hwmon_read (struct device *dev,enum hwmon_sensor_types type,u32 attr, +int channel,long *val) +{ +struct bnxt *bp =dev_get_drvdata (dev); +u8 temp =0 ; +int rc; + +switch (attr) { +case hwmon_temp_input: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp *1000 ;return rc; -return len; +default :
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c line 76
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +5
-3+return -EOPNOTSUPP ; + } } -static SENSOR_DEVICE_ATTR(temp1_input, 0444, bnxt_show_temp, NULL, 0); -static struct attribute *bnxt_attrs[] = { - &sensor_dev_attr_temp1_input.dev_attr.attr, +static const struct hwmon_channel_info *bnxt_hwmon_info[] = { +HWMON_CHANNEL_INFO (temp, +HWMON_T_INPUT ),
Nit: Unnecessary continuation line
Quoted 32 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +13
-4NULL }; -ATTRIBUTE_GROUPS (bnxt); + +static const struct hwmon_ops bnxt_hwmon_ops = { + .is_visible = bnxt_hwmon_is_visible, + .read = bnxt_hwmon_read, +}; + +static const struct hwmon_chip_info bnxt_hwmon_chip_info = { + .ops = &bnxt_hwmon_ops, + .info = bnxt_hwmon_info, +};void bnxt_hwmon_uninit (struct bnxt *bp) {@@ -72,9 +112,9 @@ void bnxt_hwmon_init(struct bnxt *bp)if (bp->hwmon_dev)return ; - bp->hwmon_dev =hwmon_device_register_with_groups (&pdev->dev, -DRV_MODULE_NAME , bp, - bnxt_groups); + bp->hwmon_dev =hwmon_device_register_with_info (&pdev->dev, +DRV_MODULE_NAME , bp, + &bnxt_hwmon_chip_info,NULL );if (IS_ERR (bp->hwmon_dev)) { bp->hwmon_dev =NULL ;dev_warn (&pdev->dev,"Cannot register hwmon device\n" );Signature · 1 line
2.30.1
Michael Chan
maintainerPATCH 11/12 bnxt_en: Expose threshold temperatures through hwmon
In reply to Michael ChanFrom: Kalesh AP <[email protected]>
HWRM_TEMP_MONITOR_QUERY response now indicates various threshold temperatures. Expose these threshold temperatures through the hwmon sysfs.
Also, provide temp1_max_alarm through which the user can check whether the threshold temperature has been reached or not.
Example:
cat /sys/class/hwmon/hwmon3/temp1_input
75000
cat /sys/class/hwmon/hwmon3/temp1_max
105000
cat /sys/class/hwmon/hwmon3/temp1_max_alarm
0
--- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 7 ++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 71 +++++++++++++++++-- 2 files changed, 73 insertions(+), 5 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.h +7 -0
@@ -2013,6 +2013,7 @@ struct bnxt {#define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30)#define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(31)#define BNXT_FW_CAP_PTP BIT_ULL(32) +#define BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED BIT_ULL(33)u32 fw_dbg_cap;
@@ -2185,7 +2186,13 @@ struct bnxt {struct bnxt_tc_info *tc_info;struct list_head tc_indr_block_list;struct dentry *debugfs_pdev; +#ifdef CONFIG_BNXT_HWMON struct device *hwmon_dev; +u8 warn_thresh_temp; +u8 crit_thresh_temp; +u8 fatal_thresh_temp; +u8 shutdown_thresh_temp; +#endif enum board_idx board_idx; };
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +66 -5
110 lines not on this page · raw message
Signature · 1 line
2.30.1
Guenter Roeck
maintainerRe: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Quoted 57 lines · Michael Chan
From: Kalesh AP <[email protected]>
HWRM_TEMP_MONITOR_QUERYresponse now indicates various threshold temperatures. Expose these threshold temperatures through the hwmon sysfs.
Also, providetemp1_max_alarmthrough which the user can check whether the threshold temperature has been reached or not.Example:
cat/sys/class/hwmon/hwmon3/temp1_input
75000
cat/sys/class/hwmon/hwmon3/temp1_max
105000
cat/sys/class/hwmon/hwmon3/temp1_max_alarm
0Cc Jean Delvare <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Kalesh AP <[email protected]>Signed-off-by Michael Chan <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 7 ++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 71 +++++++++++++++++-- 2 files changed, 73 insertions(+), 5 deletions(-)drivers/net/ethernet/broadcom/bnxt/bnxt.h +7
-0@@ -2013,6 +2013,7 @@ struct bnxt {#define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30)#define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(31)#define BNXT_FW_CAP_PTP BIT_ULL(32) +#define BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED BIT_ULL(33)u32 fw_dbg_cap;@@ -2185,7 +2186,13 @@ struct bnxt {struct bnxt_tc_info *tc_info;struct list_head tc_indr_block_list;struct dentry *debugfs_pdev; +#ifdef CONFIG_BNXT_HWMON struct device *hwmon_dev; +u8 warn_thresh_temp; +u8 crit_thresh_temp; +u8 fatal_thresh_temp; +u8 shutdown_thresh_temp; +#endif enum board_idx board_idx; };drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +0
-0
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 40
Quoted 7 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +4
-0@@ -34,6 +34,15 @@ static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp)if (temp) *temp = resp->temp; + +if (resp->flags &TEMP_MONITOR_QUERY_RESP_FLAGS_THRESHOLD_VALUES_AVAILABLE ) { +if (!temp) + bp->fw_cap |=BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED ;
The if statement seems unnecessary. If the flag was not set during initialization, the limit attributes won't be visible anyway, so it doesn't make a difference if it is set now or not.
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 44
Quoted 4 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +4
-0+ bp->warn_thresh_temp = resp->warn_threshold; + bp->crit_thresh_temp = resp->critical_threshold; + bp->fatal_thresh_temp = resp->fatal_threshold; + bp->shutdown_thresh_temp = resp->shutdown_threshold;
Are those temperatures expected to change during runtime ? If not it might make sense to only execute the entire if condition if temp == NULL to avoid unnecessary reassignments whenever the temperature is read.
Quoted 13 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +3
-0+ } err:hwrm_req_drop (bp, req);return rc;@@ -42,12 +51,30 @@ static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp)static umode_t bnxt_hwmon_is_visible (const void *_data,enum hwmon_sensor_types type,u32 attr,int channel) { +const struct bnxt *bp = _data; +if (type != hwmon_temp)return 0 ;
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 68
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +7
-0switch (attr) {case hwmon_temp_input:return 0444 ; +case hwmon_temp_lcrit: +case hwmon_temp_crit: +case hwmon_temp_emergency: +case hwmon_temp_lcrit_alarm: +case hwmon_temp_crit_alarm: +case hwmon_temp_emergency_alarm: +if (~bp->fw_cap &BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED )
Seems to me that
if (!(bp->fw_cap & BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED))
would be much easier to understand.
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 76
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +8
-0+return 0 ; +return 0444 ; +/* Max temperature setting in NVM is optional */ +case hwmon_temp_max: +case hwmon_temp_max_alarm: +if (~bp->fw_cap &BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED || + !bp->shutdown_thresh_temp) +return 0 ;
Wrong use of the 'max' attribute. More on that below.
Quoted 14 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +7
-0+return 0444 ;default :return 0 ; }@@ -66,6 +93,38 @@ static int bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32if (!rc) *val = temp *1000 ;return rc; +case hwmon_temp_lcrit: + *val = bp->warn_thresh_temp *1000 ; +return 0 ; +case hwmon_temp_crit: + *val = bp->crit_thresh_temp *1000 ; +return 0 ;
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 · line 111
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +10
-0+case hwmon_temp_emergency: + *val = bp->fatal_thresh_temp *1000 ; +return 0 ; +case hwmon_temp_max: + *val = bp->shutdown_thresh_temp *1000 ; +return 0 ; +case hwmon_temp_lcrit_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->warn_thresh_temp;
That is wrong. lcrit is the _lower_ critical temperature, ie the temperature is critically low. This is not a "high temperature" alarm.
Quoted 5 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +5
-0+return rc; +case hwmon_temp_crit_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->crit_thresh_temp;
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 · line 126
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +10
-0+return rc; +case hwmon_temp_emergency_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->fatal_thresh_temp; +return rc; +case hwmon_temp_max_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->shutdown_thresh_temp;
Hmm, that isn't really the purpose of alarm attributes. The expectation would be that the chip sets alarm flags and the driver reports it. I guess there is some value in having it, so I won't object.
Anyway, the ordering is wrong. max_alarm should be the lowest alarm level, followed by crit and emergency. So
max_alarm -> temp >= bp->warn_thresh_temp crit_alarm -> temp >= bp->crit_thresh_temp emergency_alarm -> temp >= bp->fatal_thresh_temp or temp >= bp->shutdown_thresh_temp
There are only three levels of upper temperature alarms. Abusing lcrit as 4th upper alarm is most definitely wrong.
Quoted 20 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +6
-1+return rc;default :return -EOPNOTSUPP ; }@@ -73,7 +132,11 @@ static int bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32static const struct hwmon_channel_info *bnxt_hwmon_info[] = {HWMON_CHANNEL_INFO (temp, -HWMON_T_INPUT ), +HWMON_T_INPUT | +HWMON_T_MAX |HWMON_T_LCRIT | +HWMON_T_CRIT |HWMON_T_EMERGENCY | +HWMON_T_CRIT_ALARM |HWMON_T_LCRIT_ALARM | +HWMON_T_MAX_ALARM |HWMON_T_EMERGENCY_ALARM ),NULL };@@ -97,13 +160,11 @@ void bnxt_hwmon_uninit(struct bnxt *bp)void bnxt_hwmon_init (struct bnxt *bp)
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c void bnxt_hwmon_uninit(struct bnxt *bp) · line 167
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +2
-4{ -struct hwrm_temp_monitor_query_input *req;struct pci_dev *pdev = bp->pdev;int rc; - rc =hwrm_req_init (bp, req,HWRM_TEMP_MONITOR_QUERY ); -if (!rc) - rc =hwrm_req_send_silent (bp, req); +/* temp1_xxx is only sensor, ensure not registered if it will fail */ + rc =bnxt_hwrm_temp_query (bp,NULL );
Ah, that is the reason for the check in bnxt_hwrm_temp_query(). The check in that function should really be added here, not in the previous patch.
Quoted 6 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +0
-0if (rc == -EACCES || rc == -EOPNOTSUPP ) {bnxt_hwmon_uninit (bp);return ;Signature · 1 line
2.30.1
Re: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Thank you Guenter for the review and the suggestions.
Please see my response inline.
Quoted 176 lines · Guenter Roeck
Quoted 21 lines · Michael Chan
From: Kalesh AP <[email protected]>
HWRM_TEMP_MONITOR_QUERYresponse now indicates various threshold temperatures. Expose these threshold temperatures through the hwmon sysfs.
Also, providetemp1_max_alarmthrough which the user can check whether the threshold temperature has been reached or not.Example:
cat/sys/class/hwmon/hwmon3/temp1_input
75000
cat/sys/class/hwmon/hwmon3/temp1_max
105000
cat/sys/class/hwmon/hwmon3/temp1_max_alarm
0Cc Jean Delvare <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Kalesh AP <[email protected]>Signed-off-by Michael Chan <[email protected]>Review
Quoted 6 lines
--- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 7 ++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 71 +++++++++++++++++-- 2 files changed, 73 insertions(+), 5 deletions(-)(quoted diff) +0
-0
b/drivers/net/ethernet/broadcom/bnxt/bnxt.hReview
Quoted 26 lines
index
84cbcfa61bc1..43a07d84f815100644drivers/net/ethernet/broadcom/bnxt/bnxt.h +7
-0@@ -2013,6 +2013,7 @@ struct bnxt {#define BNXT_FW_CAP_RING_MONITOR BIT_ULL(30)#define BNXT_FW_CAP_DBG_QCAPS BIT_ULL(31)#define BNXT_FW_CAP_PTP BIT_ULL(32) +#define BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED BIT_ULL(33)u32 fw_dbg_cap;@@ -2185,7 +2186,13 @@ struct bnxt {struct bnxt_tc_info *tc_info;struct list_head tc_indr_block_list;struct dentry *debugfs_pdev; +#ifdef CONFIG_BNXT_HWMON struct device *hwmon_dev; +u8 warn_thresh_temp; +u8 crit_thresh_temp; +u8 fatal_thresh_temp; +u8 shutdown_thresh_temp; +#endif enum board_idx board_idx; };(quoted diff) +0
-0
b/drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.cdrivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8
Quoted 4 lines
index
20381b7b1d78..f5affac1169a100644drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +0
-0@@ -34,6 +34,15 @@ static int bnxt_hwrm_temp_query(struct bnxt *bp, u8*temp)
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp)
Quoted 5 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +2
-0if (temp) *temp = resp->temp; + + if (resp->flags &
TEMP_MONITOR_QUERY_RESP_FLAGS_THRESHOLD_VALUES_AVAILABLE) {drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 40
Quoted 2 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +2
-0+if (!temp) + bp->fw_cap |=BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED ;The if statement seems unnecessary. If the flag was not set during initialization, the limit attributes won't be visible anyway, so it doesn't make a difference if it is set now or not.
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 44
Quoted 4 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +4
-0+ bp->warn_thresh_temp = resp->warn_threshold; + bp->crit_thresh_temp = resp->critical_threshold; + bp->fatal_thresh_temp = resp->fatal_threshold; + bp->shutdown_thresh_temp = resp->shutdown_threshold;Are those temperatures expected to change during runtime ? If not it might make sense to only execute the entire if condition if temp == NULL to avoid unnecessary reassignments whenever the temperature is read.
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8
Quoted 5 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-0+ } err:hwrm_req_drop (bp, req);return rc;@@ -42,12 +51,30 @@ static int bnxt_hwrm_temp_query(struct bnxt *bp, u8*temp)
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 · line 51
Quoted 1 line
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +0
-0static umode_t bnxt_hwmon_is_visible(const void *_data, enum
hwmon_sensor_typestype,Quoted 7 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +2
-0u32 attr, int channel) { +const struct bnxt *bp = _data; +if (type != hwmon_temp)return 0 ;drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 68
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +7
-0switch (attr) {case hwmon_temp_input:return 0444 ; +case hwmon_temp_lcrit: +case hwmon_temp_crit: +case hwmon_temp_emergency: +case hwmon_temp_lcrit_alarm: +case hwmon_temp_crit_alarm: +case hwmon_temp_emergency_alarm: +if (~bp->fw_cap &BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED )Seems to me that
if (!(bp->fw_cap & BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED))would be much easier to understand.
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwrm_temp_query(struct bnxt *bp, u8 *temp) · line 76
Quoted 8 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +8
-0+return 0 ; +return 0444 ; +/* Max temperature setting in NVM is optional */ +case hwmon_temp_max: +case hwmon_temp_max_alarm: +if (~bp->fw_cap &BNXT_FW_CAP_THRESHOLD_TEMP_SUPPORTED || + !bp->shutdown_thresh_temp) +return 0 ;Wrong use of the 'max' attribute. More on that below.
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwmon_read(struct device *dev, enum
Quoted 5 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-0+return 0444 ;default :return 0 ; }@@ -66,6 +93,38 @@ static int bnxt_hwmon_read(struct device *dev, enum
hwmon_sensor_typestype, u32Quoted 9 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +6
-0if (!rc) *val = temp *1000 ;return rc; +case hwmon_temp_lcrit: + *val = bp->warn_thresh_temp *1000 ; +return 0 ; +case hwmon_temp_crit: + *val = bp->crit_thresh_temp *1000 ; +return 0 ;drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 · line 111
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +10
-0+case hwmon_temp_emergency: + *val = bp->fatal_thresh_temp *1000 ; +return 0 ; +case hwmon_temp_max: + *val = bp->shutdown_thresh_temp *1000 ; +return 0 ; +case hwmon_temp_lcrit_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->warn_thresh_temp;That is wrong. lcrit is the _lower_ critical temperature, ie the temperature is critically low. This is not a "high temperature" alarm.
Quoted 5 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +5
-0+return rc; +case hwmon_temp_crit_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->crit_thresh_temp;drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 · line 126
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +10
-0+return rc; +case hwmon_temp_emergency_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->fatal_thresh_temp; +return rc; +case hwmon_temp_max_alarm: + rc =bnxt_hwrm_temp_query (bp, &temp); +if (!rc) + *val = temp >= bp->shutdown_thresh_temp;Hmm, that isn't really the purpose of alarm attributes. The expectation would be that the chip sets alarm flags and the driver reports it. I guess there is some value in having it, so I won't object.
Anyway, the ordering is wrong.
max_alarmshould be the lowest alarm level, followed by crit and emergency. So
Quoted 8 lines
max_alarm -> temp >= bp->warn_thresh_temp crit_alarm -> temp >= bp->crit_thresh_temp emergency_alarm -> temp >= bp->fatal_thresh_temp or temp >= bp->shutdown_thresh_tempThere are only three levels of upper temperature alarms. Abusing lcrit as 4th upper alarm is most definitely wrong.
[Kalesh]: Thank you for the clarification.bnxt_en driver wants to expose 4 threshold temperatures to the user through hwmon sysfs.
1. warning threshold temperature
2. critical threshold temperature
3. fatal threshold temperature
4. shutdown threshold temperature
I will use the following mapping:
hwmon_temp_max : warning threshold temperature hwmon_temp_crit : critical threshold temperature hwmon_temp_emergency : fatal threshold temperature
hwmon_temp_max_alarm : temp >= bp->warn_thresh_temp hwmon_temp_crit_alarm : temp >= bp->crit_thresh_temp hwmon_temp_emergency_alarm : temp >= bp->fatal_thresh_temp
Is it OK to map the shutdown threshold temperature to "hwmon_temp_fault"? If not, can you please suggest an alternative?
Regards,
Kalesh
Quoted 47 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c static int bnxt_hwmon_read(struct device *dev, enum
Quoted 6 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-0+return rc;default :return -EOPNOTSUPP ; }@@ -73,7 +132,11 @@ static int bnxt_hwmon_read(struct device *dev, enum
hwmon_sensor_typestype, u32Quoted 14 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +5
-1static const struct hwmon_channel_info *bnxt_hwmon_info[] = {HWMON_CHANNEL_INFO (temp, -HWMON_T_INPUT ), +HWMON_T_INPUT | +HWMON_T_MAX |HWMON_T_LCRIT | +HWMON_T_CRIT |HWMON_T_EMERGENCY | +HWMON_T_CRIT_ALARM |HWMON_T_LCRIT_ALARM | +HWMON_T_MAX_ALARM |HWMON_T_EMERGENCY_ALARM ),NULL };@@ -97,13 +160,11 @@ void bnxt_hwmon_uninit(struct bnxt *bp)drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c void bnxt_hwmon_uninit(struct bnxt *bp) · line 166
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-4void bnxt_hwmon_init (struct bnxt *bp) { -struct hwrm_temp_monitor_query_input *req;struct pci_dev *pdev = bp->pdev;int rc; - rc =hwrm_req_init (bp, req,HWRM_TEMP_MONITOR_QUERY ); -if (!rc) - rc =hwrm_req_send_silent (bp, req); +/* temp1_xxx is only sensor, ensure not registered if it will fail */
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c void bnxt_hwmon_uninit(struct bnxt *bp) · line 167
Quoted 1 line
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +1
-0+ rc =bnxt_hwrm_temp_query (bp,NULL );Ah, that is the reason for the check in
bnxt_hwrm_temp_query(). The check in that function should really be added here, not in the previous patch.Quoted 6 lines
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +0
-1if (rc == -EACCES || rc == -EOPNOTSUPP ) {bnxt_hwmon_uninit (bp);return ; --2.30.1
Signature · 2 lines
Regards, Kalesh A P
Guenter Roeck
maintainerRe: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Quoted 6 lines · Kalesh Anakkur Purayil
Thank you Guenter for the review and the suggestions.
Please see my response inline.
On Tue, Aug 15, 2023 at 8:35 PM Guenter Roeck <[email protected]> wrote:
[ ... ]
Quoted 29 lines
Quoted 7 lines
Hmm, that isn't really the purpose of alarm attributes. The expectation would be that the chip sets alarm flags and the driver reports it. I guess there is some value in having it, so I won't object.
Anyway, the ordering is wrong.
max_alarmshould be the lowest alarm level, followed by crit and emergency. SoQuoted 8 lines
max_alarm -> temp >= bp->warn_thresh_temp crit_alarm -> temp >= bp->crit_thresh_temp emergency_alarm -> temp >= bp->fatal_thresh_temp or temp >= bp->shutdown_thresh_tempThere are only three levels of upper temperature alarms. Abusing lcrit as 4th upper alarm is most definitely wrong.
[Kalesh]: Thank you for the clarification.
bnxt_endriver wants to expose 4 threshold temperatures to the user through hwmon sysfs.
1. warning threshold temperature
2. critical threshold temperature
3. fatal threshold temperature
4. shutdown threshold temperatureI will use the following mapping:
hwmon_temp_max: warning threshold temperaturehwmon_temp_crit: critical threshold temperaturehwmon_temp_emergency: fatal threshold temperature
Quoted 5 lines
hwmon_temp_max_alarm: temp >=bp->warn_thresh_temphwmon_temp_crit_alarm: temp >=bp->crit_thresh_temphwmon_temp_emergency_alarm: temp >=bp->fatal_thresh_tempIs it OK to map the shutdown threshold temperature to "
hwmon_temp_fault"?
That is a flag, not a temperature, and it is intended to signal a problem ith the sensor.
Quoted 2 lines
If not, can you please suggest an alternative?
The only one I can think of is to add non-standard attributes such as temp1_shutdown and temp1_shutdown_alarm.
Guenter
Re: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Quoted 46 lines · Guenter Roeck
Quoted 5 lines · Kalesh Anakkur Purayil
Thank you Guenter for the review and the suggestions.
Please see my response inline.
On Tue, Aug 15, 2023 at 8:35 PM Guenter Roeck <[email protected]>
Quoted 1 line · wrote:
[ ... ]
Quoted 12 lines
Quoted 12 lines
Hmm, that isn't really the purpose of alarm attributes. The expectation would be that the chip sets alarm flags and the driver reports it. I guess there is some value in having it, so I won't object.
Anyway, the ordering is wrong.
max_alarmshould be the lowest alarm level, followed by crit and emergency. Somax_alarm -> temp >= bp->warn_thresh_temp crit_alarm -> temp >= bp->crit_thresh_temp emergency_alarm -> temp >= bp->fatal_thresh_temp or temp >= bp->shutdown_thresh_tempQuoted 5 lines
Quoted 3 lines
There are only three levels of upper temperature alarms. Abusing lcrit as 4th upper alarm is most definitely wrong.
[Kalesh]: Thank you for the clarification.
bnxt_endriver wants to expose 4 threshold temperatures to the userthrough
Quoted 12 lines
hwmon sysfs.
1. warning threshold temperature
2. critical threshold temperature
3. fatal threshold temperature
4. shutdown threshold temperatureI will use the following mapping:
hwmon_temp_max: warning threshold temperaturehwmon_temp_crit: critical threshold temperaturehwmon_temp_emergency: fatal threshold temperatureQuoted 5 lines
hwmon_temp_max_alarm: temp >=bp->warn_thresh_temphwmon_temp_crit_alarm: temp >=bp->crit_thresh_temphwmon_temp_emergency_alarm: temp >=bp->fatal_thresh_tempIs it OK to map the shutdown threshold temperature to "
hwmon_temp_fault"?
Quoted 9 lines
That is a flag, not a temperature, and it is intended to signal a problem ith the sensor.
Quoted 2 lines
If not, can you please suggest an alternative?
The only one I can think of is to add non-standard attributes such as
temp1_shutdownandtemp1_shutdown_alarm.
[Kalesh]: Sorry, I don't quite get this part. I was looking at the kernel hwmon code, but could not find any reference.
Can we add new attributes "shutdown" and "shutdown_alarm" for tempX? For example:
#define HWMON_T_SHUTDOWN BIT(hwmon_temp_shutdown)
Quoted 3 lines
Guenter
Signature · 2 lines
Regards, Kalesh A P
Guenter Roeck
maintainerRe: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Quoted 51 lines · Kalesh Anakkur Purayil
Quoted 49 lines · Guenter Roeck
Quoted 5 lines · Kalesh Anakkur Purayil
Thank you Guenter for the review and the suggestions.
Please see my response inline.
On Tue, Aug 15, 2023 at 8:35 PM Guenter Roeck <[email protected]>
Quoted 1 line · wrote:
[ ... ]
Quoted 12 lines
Quoted 12 lines
Hmm, that isn't really the purpose of alarm attributes. The expectation would be that the chip sets alarm flags and the driver reports it. I guess there is some value in having it, so I won't object.
Anyway, the ordering is wrong.
max_alarmshould be the lowest alarm level, followed by crit and emergency. Somax_alarm -> temp >= bp->warn_thresh_temp crit_alarm -> temp >= bp->crit_thresh_temp emergency_alarm -> temp >= bp->fatal_thresh_temp or temp >= bp->shutdown_thresh_tempQuoted 5 lines
Quoted 3 lines
There are only three levels of upper temperature alarms. Abusing lcrit as 4th upper alarm is most definitely wrong.
[Kalesh]: Thank you for the clarification.
bnxt_endriver wants to expose 4 threshold temperatures to the userthrough
Quoted 12 lines
hwmon sysfs.
1. warning threshold temperature
2. critical threshold temperature
3. fatal threshold temperature
4. shutdown threshold temperatureI will use the following mapping:
hwmon_temp_max: warning threshold temperaturehwmon_temp_crit: critical threshold temperaturehwmon_temp_emergency: fatal threshold temperatureQuoted 5 lines
hwmon_temp_max_alarm: temp >=bp->warn_thresh_temphwmon_temp_crit_alarm: temp >=bp->crit_thresh_temphwmon_temp_emergency_alarm: temp >=bp->fatal_thresh_tempIs it OK to map the shutdown threshold temperature to "
hwmon_temp_fault"?That is a flag, not a temperature, and it is intended to signal a problem ith the sensor.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
If not, can you please suggest an alternative?
The only one I can think of is to add non-standard attributes such as
temp1_shutdownandtemp1_shutdown_alarm.[Kalesh]: Sorry, I don't quite get this part. I was looking at the kernel hwmon code, but could not find any reference.
It would be non-standard attributes, so, correct, there is no reference.
Quoted 5 lines
Can we add new attributes "shutdown" and "
shutdown_alarm" for tempX? For example:#define
HWMON_T_SHUTDOWNBIT(hwmon_temp_shutdown)
Not for a single driver. You can implement the sysfs attributes directly in the driver and pass an extra attribute group to the hwmon core when registering the hwmon device.
Guenter
Michael Chan
maintainerRe: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Quoted 11 lines · Guenter Roeck
Quoted 3 lines · Kalesh Anakkur Purayil
[Kalesh]: Sorry, I don't quite get this part. I was looking at the kernel hwmon code, but could not find any reference.
It would be non-standard attributes, so, correct, there is no reference.
Quoted 3 lines
Can we add new attributes "shutdown" and "
shutdown_alarm" for tempX? For example:
Quoted 6 lines
Quoted 2 lines
#define
HWMON_T_SHUTDOWNBIT(hwmon_temp_shutdown)Not for a single driver. You can implement the sysfs attributes directly in the driver and pass an extra attribute group to the hwmon core when registering the hwmon device.
Thanks for the review. I will drop these hwmon patches for now and respin the others for v2. Kalesh will rework these hwmon patches.
Guenter Roeck
maintainerRe: [PATCH net-next 11/12] bnxt_en: Expose threshold temperatures through hwmon
Quoted 15 lines · Michael Chan
Quoted 14 lines · Guenter Roeck
Quoted 3 lines · Kalesh Anakkur Purayil
[Kalesh]: Sorry, I don't quite get this part. I was looking at the kernel hwmon code, but could not find any reference.
It would be non-standard attributes, so, correct, there is no reference.
Quoted 5 lines
Can we add new attributes "shutdown" and "
shutdown_alarm" for tempX? For example:#define
HWMON_T_SHUTDOWNBIT(hwmon_temp_shutdown)
Quoted 6 lines
Quoted 3 lines
Not for a single driver. You can implement the sysfs attributes directly in the driver and pass an extra attribute group to the hwmon core when registering the hwmon device.
Thanks for the review. I will drop these hwmon patches for now and respin the others for v2. Kalesh will rework these hwmon patches.
Alternatively you could keep the standard attributes and add the shutdown attributes later.
Guenter
Michael Chan
maintainerPATCH 12/12 bnxt_en: Event handler for Thermal event
In reply to Michael ChanFrom: Kalesh AP <[email protected]>
Newer FW will send a new async event when it detects that the chip's temperature has crossed the configured threshold value. The driver will now notify hwmon and will log a warning message.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 44 +++++++++++++++++++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 8 ++++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.h | 5 +++ 3 files changed, 57 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +44 -0
@@ -2130,6 +2130,17 @@ static u16 bnxt_agg_ring_id_to_grp_idx(struct bnxt *bp, u16 ring_id)return INVALID_HW_RING_ID ; } +#define BNXT_EVENT_THERMAL_CURRENT_TEMP (data2) \ + ((data2) & ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK) + +#define BNXT_EVENT_THERMAL_THRESHOLD_TEMP (data2) \ + (((data2) & \ + ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK) >> \ + ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT) + +#define EVENT_DATA1_THERMAL_THRESHOLD_TYPE (data1) \ + ((data1) & ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK) +static void bnxt_event_error_report (struct bnxt *bp,u32 data1,u32 data2) {u32 err_type =BNXT_EVENT_ERROR_REPORT_TYPE (data1);
@@ -2145,6 +2156,39 @@ static void bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2)case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD :netdev_warn (bp->dev,"One or more MMIO doorbells dropped by the device!\n" );break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD : { +char *threshold_type; +u32 attr; + +switch (EVENT_DATA1_THERMAL_THRESHOLD_TYPE (data1)) { +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_WARN : + attr = hwmon_temp_lcrit_alarm; + threshold_type ="warning" ; +break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_CRITICAL : + attr = hwmon_temp_crit_alarm; + threshold_type ="critical" ; +break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_FATAL : + attr = hwmon_temp_emergency_alarm; + threshold_type ="fatal" ; +break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN : + attr = hwmon_temp_max_alarm; + threshold_type ="shutdown" ; +break ; +default : +netdev_err (bp->dev,"Unknown Thermal threshold type event\n" ); +return ; + } +netdev_warn (bp->dev,"Chip temperature has crossed the %s thermal threshold!\n" , + threshold_type); +netdev_warn (bp->dev,"Temperature (In Celsius), Current: %lu, threshold: %lu\n" , +BNXT_EVENT_THERMAL_CURRENT_TEMP (data2), +BNXT_EVENT_THERMAL_THRESHOLD_TEMP (data2)); +bnxt_hwmon_notify_event (bp, attr); +break ; + }default :netdev_err (bp->dev,"FW reported unknown error type %u\n" , err_type);
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +8 -0
@@ -18,6 +18,14 @@#include "bnxt_hwrm.h" #include "bnxt_hwmon.h" +void bnxt_hwmon_notify_event (struct bnxt *bp,u32 attr) +{ +if (!bp->hwmon_dev) +return ; + +hwmon_notify_event (&bp->pdev->dev, hwmon_temp, attr,0 ); +} +static int bnxt_hwrm_temp_query (struct bnxt *bp,u8 *temp) {struct hwrm_temp_monitor_query_output *resp;
drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.h +5 -0
@@ -11,9 +11,14 @@#define BNXT_HWMON_H #ifdef CONFIG_BNXT_HWMON +void bnxt_hwmon_notify_event (struct bnxt *bp,u32 attr);void bnxt_hwmon_uninit (struct bnxt *bp);void bnxt_hwmon_init (struct bnxt *bp);#else +static inline void bnxt_hwmon_notify_event (struct bnxt *bp,u32 attr) +{ +} +static inline void bnxt_hwmon_uninit (struct bnxt *bp) { }
Signature · 1 line
2.30.1
Guenter Roeck
maintainerRe: [PATCH net-next 12/12] bnxt_en: Event handler for Thermal event
Quoted 40 lines · Michael Chan
From: Kalesh AP <[email protected]>
Newer FW will send a new async event when it detects that the chip's temperature has crossed the configured threshold value. The driver will now notify hwmon and will log a warning message.
Cc Jean Delvare <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Kalesh AP <[email protected]>Signed-off-by Michael Chan <[email protected]>--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 44 +++++++++++++++++++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.c | 8 ++++ .../net/ethernet/broadcom/bnxt/bnxt_hwmon.h | 5 +++ 3 files changed, 57 insertions(+)drivers/net/ethernet/broadcom/bnxt/bnxt.c +11
-0@@ -2130,6 +2130,17 @@ static u16 bnxt_agg_ring_id_to_grp_idx(struct bnxt *bp, u16 ring_id)return INVALID_HW_RING_ID ; } +#define BNXT_EVENT_THERMAL_CURRENT_TEMP (data2) \ + ((data2) & ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_CURRENT_TEMP_MASK) + +#define BNXT_EVENT_THERMAL_THRESHOLD_TEMP (data2) \ + (((data2) & \ + ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_MASK) >> \ + ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA2_THRESHOLD_TEMP_SFT) + +#define EVENT_DATA1_THERMAL_THRESHOLD_TYPE (data1) \ + ((data1) & ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_MASK) +static void bnxt_event_error_report (struct bnxt *bp,u32 data1,u32 data2) {u32 err_type =BNXT_EVENT_ERROR_REPORT_TYPE (data1);
drivers/net/ethernet/broadcom/bnxt/bnxt.c static void bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2) · line 2165
Quoted 10 lines
drivers/net/ethernet/broadcom/bnxt/bnxt.c +7
-0@@ -2145,6 +2156,39 @@ static void bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2)case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_DOORBELL_DROP_THRESHOLD :netdev_warn (bp->dev,"One or more MMIO doorbells dropped by the device!\n" );break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_BASE_EVENT_DATA1_ERROR_TYPE_THERMAL_THRESHOLD : { +char *threshold_type; +u32 attr; + +switch (EVENT_DATA1_THERMAL_THRESHOLD_TYPE (data1)) { +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_WARN : + attr = hwmon_temp_lcrit_alarm;
As with previous patch, wrong attribute
drivers/net/ethernet/broadcom/bnxt/bnxt.c static void bnxt_event_error_report(struct bnxt *bp, u32 data1, u32 data2) · line 2177
Quoted 12 lines
drivers/net/ethernet/broadcom/bnxt/bnxt.c +12
-0+ threshold_type ="warning" ; +break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_CRITICAL : + attr = hwmon_temp_crit_alarm; + threshold_type ="critical" ; +break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_FATAL : + attr = hwmon_temp_emergency_alarm; + threshold_type ="fatal" ; +break ; +case ASYNC_EVENT_CMPL_ERROR_REPORT_THERMAL_EVENT_DATA1_THRESHOLD_TYPE_SHUTDOWN : + attr = hwmon_temp_max_alarm;
Same here.
Overall it seems to me it would be better to keep hwmon internals out of this file and just pass the threshold type to the hwmon code.
Quoted 58 lines
drivers/net/ethernet/broadcom/bnxt/bnxt.c +14
-0+ threshold_type ="shutdown" ; +break ; +default : +netdev_err (bp->dev,"Unknown Thermal threshold type event\n" ); +return ; + } +netdev_warn (bp->dev,"Chip temperature has crossed the %s thermal threshold!\n" , + threshold_type); +netdev_warn (bp->dev,"Temperature (In Celsius), Current: %lu, threshold: %lu\n" , +BNXT_EVENT_THERMAL_CURRENT_TEMP (data2), +BNXT_EVENT_THERMAL_THRESHOLD_TEMP (data2)); +bnxt_hwmon_notify_event (bp, attr); +break ; + }default :netdev_err (bp->dev,"FW reported unknown error type %u\n" , err_type);drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.c +8
-0@@ -18,6 +18,14 @@#include "bnxt_hwrm.h" #include "bnxt_hwmon.h" +void bnxt_hwmon_notify_event (struct bnxt *bp,u32 attr) +{ +if (!bp->hwmon_dev) +return ; + +hwmon_notify_event (&bp->pdev->dev, hwmon_temp, attr,0 ); +} +static int bnxt_hwrm_temp_query (struct bnxt *bp,u8 *temp) {struct hwrm_temp_monitor_query_output *resp;drivers/net/ethernet/broadcom/bnxt/bnxt_hwmon.h +5
-0@@ -11,9 +11,14 @@#define BNXT_HWMON_H #ifdef CONFIG_BNXT_HWMON +void bnxt_hwmon_notify_event (struct bnxt *bp,u32 attr);void bnxt_hwmon_uninit (struct bnxt *bp);void bnxt_hwmon_init (struct bnxt *bp);#else +static inline void bnxt_hwmon_notify_event (struct bnxt *bp,u32 attr) +{ +} +static inline void bnxt_hwmon_uninit (struct bnxt *bp) { }Signature · 1 line
2.30.1