netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/13] bnxt_en: Update for net-next
@ 2023-12-12  0:51 Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 01/13] bnxt_en: Fix trimming of P5 RX and TX rings Michael Chan
                   ` (13 more replies)
  0 siblings, 14 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]

The first 4 patches in the series fix issues in the net-next tree
introduced in the last 4 weeks.  The first 3 patches fix ring accounting
and indexing logic.  The 4th patch fix TX timeout when the TX ring is
very small.

The next 7 patches add new features on the P7 chips, including TX
coalesced completions, VXLAN GPE and UDP GSO stateless offload, a
new rx_filter_miss counters, and more QP backing store memory for
RoCE.

The last 2 patches are PTP improvements.

Damodharam Ammepalli (1):
  bnxt_en: add rx_filter_miss extended stats

Michael Chan (8):
  bnxt_en: Fix trimming of P5 RX and TX rings
  bnxt_en: Fix TX ring indexing logic
  bnxt_en: Prevent TX timeout with a very small TX ring
  bnxt_en: Support TX coalesced completion on 5760X chips
  bnxt_en: Use proper TUNNEL_DST_PORT_ALLOC* commands
  bnxt_en: Add support for VXLAN GPE
  bnxt_en: Configure UDP tunnel TPA
  bnxt_en: Add support for UDP GSO on 5760X chips

Pavan Chebbi (2):
  bnxt_en: Skip nic close/open when configuring tstamp filters
  bnxt_en: Make PTP TX timestamp HWRM query silent

Selvin Xavier (1):
  bnxt_en: Allocate extra QP backing store memory when RoCE FW reports
    it

Somnath Kotur (1):
  bnxt_en: Fix AGG ring check logic in bnxt_check_rings()

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 155 +++++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |   5 +
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c |  35 ++--
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h |   2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |   2 +-
 6 files changed, 153 insertions(+), 47 deletions(-)

-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 01/13] bnxt_en: Fix trimming of P5 RX and TX rings
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 02/13] bnxt_en: Fix AGG ring check logic in bnxt_check_rings() Michael Chan
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Pavan Chebbi

[-- Attachment #1: Type: text/plain, Size: 2175 bytes --]

The recent commit to trim the RX and TX rings on P5 chips by assigning
each with max CP rings divided by 2 is not correct.  Max CP rings
divided by 2 may be bigger than the original RX or TX and would
lead to failure.  In other words, we may be checking for increased
RX/TX rings than required and it may fail.

Fix it by calling __bnxt_trim_rings() instead that would properly
trim RX and TX without the possibility of increasing their values.

Fixes: f5b29c6afe36 ("bnxt_en: Add helper to get the number of CP rings required for TX rings")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 92a54113f872..7afbbc71f92f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -6489,6 +6489,8 @@ static void bnxt_hwrm_ring_free(struct bnxt *bp, bool close_path)
 	}
 }
 
+static int __bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max,
+			     bool shared);
 static int bnxt_trim_rings(struct bnxt *bp, int *rx, int *tx, int max,
 			   bool shared);
 
@@ -6532,8 +6534,9 @@ static int bnxt_hwrm_get_rings(struct bnxt *bp)
 			if (bp->flags & BNXT_FLAG_AGG_RINGS)
 				rx >>= 1;
 			if (cp < (rx + tx)) {
-				rx = cp / 2;
-				tx = rx;
+				rc = __bnxt_trim_rings(bp, &rx, &tx, cp, false);
+				if (rc)
+					return rc;
 				if (bp->flags & BNXT_FLAG_AGG_RINGS)
 					rx <<= 1;
 				hw_resc->resv_rx_rings = rx;
@@ -13885,9 +13888,12 @@ static void _bnxt_get_max_rings(struct bnxt *bp, int *max_rx, int *max_tx,
 	if (bp->flags & BNXT_FLAG_AGG_RINGS)
 		*max_rx >>= 1;
 	if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) {
-		if (*max_cp < (*max_rx + *max_tx)) {
-			*max_rx = *max_cp / 2;
-			*max_tx = *max_rx;
+		int rc;
+
+		rc = __bnxt_trim_rings(bp, max_rx, max_tx, *max_cp, false);
+		if (rc) {
+			*max_rx = 0;
+			*max_tx = 0;
 		}
 		/* On P5 chips, max_cp output param should be available NQs */
 		*max_cp = max_irq;
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 02/13] bnxt_en: Fix AGG ring check logic in bnxt_check_rings()
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 01/13] bnxt_en: Fix trimming of P5 RX and TX rings Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 03/13] bnxt_en: Fix TX ring indexing logic Michael Chan
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]

From: Somnath Kotur <somnath.kotur@broadcom.com>

_bnxt_get_max_rings() that is invoked in bnxt_check_rings() already
accounts for the AGG ring(s) and gives a max value based on that.
Increasing for AGG rings before calling _bnxt_get_max_rings() will
result in checking for twice the number of rings than required and
it can fail.  Fix it by adjusting for AGG rings after calling
_bnxt_get_max_rings().

Fixes: f5b29c6afe36 ("bnxt_en: Add helper to get the number of CP rings required for TX rings")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 7afbbc71f92f..114beaa95e78 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -12724,14 +12724,14 @@ int bnxt_check_rings(struct bnxt *bp, int tx, int rx, bool sh, int tcs,
 	if (tcs)
 		tx_sets = tcs;
 
-	if (bp->flags & BNXT_FLAG_AGG_RINGS)
-		rx_rings <<= 1;
-
 	_bnxt_get_max_rings(bp, &max_rx, &max_tx, &max_cp);
 
 	if (max_rx < rx_rings)
 		return -ENOMEM;
 
+	if (bp->flags & BNXT_FLAG_AGG_RINGS)
+		rx_rings <<= 1;
+
 	tx_rings_needed = tx * tx_sets + tx_xdp;
 	if (max_tx < tx_rings_needed)
 		return -ENOMEM;
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 03/13] bnxt_en: Fix TX ring indexing logic
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 01/13] bnxt_en: Fix trimming of P5 RX and TX rings Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 02/13] bnxt_en: Fix AGG ring check logic in bnxt_check_rings() Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 04/13] bnxt_en: Prevent TX timeout with a very small TX ring Michael Chan
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 1693 bytes --]

Two spots were missed when modifying the TX ring indexing logic.
The use of unmasked TX index in bnxt_tx_int() will cause unnecessary
__bnxt_tx_int() calls.  The same issue in bnxt_tx_int_xdp() can
result in illegal array index.

Fixes: 6d1add95536b ("bnxt_en: Modify TX ring indexing logic.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 114beaa95e78..83a47feaf869 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -781,7 +781,7 @@ static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
 	int i;
 
 	bnxt_for_each_napi_tx(i, bnapi, txr) {
-		if (txr->tx_hw_cons != txr->tx_cons)
+		if (txr->tx_hw_cons != RING_TX(bp, txr->tx_cons))
 			__bnxt_tx_int(bp, txr, budget);
 	}
 	bnapi->events &= ~BNXT_TX_CMP_EVENT;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index 4791f6a14e55..037624f17aea 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -173,7 +173,7 @@ void bnxt_tx_int_xdp(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
 	bnapi->events &= ~BNXT_TX_CMP_EVENT;
 	WRITE_ONCE(txr->tx_cons, tx_cons);
 	if (rx_doorbell_needed) {
-		tx_buf = &txr->tx_buf_ring[last_tx_cons];
+		tx_buf = &txr->tx_buf_ring[RING_TX(bp, last_tx_cons)];
 		bnxt_db_write(bp, &rxr->rx_db, tx_buf->rx_prod);
 
 	}
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 04/13] bnxt_en: Prevent TX timeout with a very small TX ring
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (2 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 03/13] bnxt_en: Fix TX ring indexing logic Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 05/13] bnxt_en: Support TX coalesced completion on 5760X chips Michael Chan
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, gospo, Somnath Kotur,
	Andy Gospodarek, Hongguang Gao

[-- Attachment #1: Type: text/plain, Size: 1445 bytes --]

If xmit_more condition is true, the driver may set the
TX_BD_FLAGS_NO_CMPL flag.  If after this packet, the TX ring can no
longer hold a packet with maximum fragments, we will stop the TX
queue.  When this happens, we must clear the TX_BD_FLAGS_NO_CMPL flag
on the last packet or there will be no completion and cause TX
timeout.

Fixes: c1056a59aee1 ("bnxt_en: Optimize xmit_more TX path")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 83a47feaf869..cc6cab340423 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -666,8 +666,11 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 tx_done:
 
 	if (unlikely(bnxt_tx_avail(bp, txr) <= MAX_SKB_FRAGS + 1)) {
-		if (netdev_xmit_more() && !tx_buf->is_push)
+		if (netdev_xmit_more() && !tx_buf->is_push) {
+			txbd0->tx_bd_len_flags_type &=
+				cpu_to_le32(~TX_BD_FLAGS_NO_CMPL);
 			bnxt_txr_db_kick(bp, txr, prod);
+		}
 
 		netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr),
 				   bp->tx_wake_thresh);
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 05/13] bnxt_en: Support TX coalesced completion on 5760X chips
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (3 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 04/13] bnxt_en: Prevent TX timeout with a very small TX ring Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 06/13] bnxt_en: Allocate extra QP backing store memory when RoCE FW reports it Michael Chan
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 3028 bytes --]

TX coalesced completions are supported on newer chips to provide
one TX completion record for multiple TX packets up to the
sq_cons_idx in the completion record.  This method saves PCIe
bandwidth by reducing the number of TX completions.

Only very minor changes are now required to support this mode
with the new framework that handles TX completions based on
the consumer indices.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 +++++++++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  1 +
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index cc6cab340423..72e2bd4611de 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -2785,14 +2785,18 @@ static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
 		 */
 		dma_rmb();
 		cmp_type = TX_CMP_TYPE(txcmp);
-		if (cmp_type == CMP_TYPE_TX_L2_CMP) {
+		if (cmp_type == CMP_TYPE_TX_L2_CMP ||
+		    cmp_type == CMP_TYPE_TX_L2_COAL_CMP) {
 			u32 opaque = txcmp->tx_cmp_opaque;
 			struct bnxt_tx_ring_info *txr;
 			u16 tx_freed;
 
 			txr = bnapi->tx_ring[TX_OPAQUE_RING(opaque)];
 			event |= BNXT_TX_CMP_EVENT;
-			txr->tx_hw_cons = TX_OPAQUE_PROD(bp, opaque);
+			if (cmp_type == CMP_TYPE_TX_L2_COAL_CMP)
+				txr->tx_hw_cons = TX_CMP_SQ_CONS_IDX(txcmp);
+			else
+				txr->tx_hw_cons = TX_OPAQUE_PROD(bp, opaque);
 			tx_freed = (txr->tx_hw_cons - txr->tx_cons) &
 				   bp->tx_ring_mask;
 			/* return full budget so NAPI will complete. */
@@ -6068,6 +6072,9 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
 		req->length = cpu_to_le32(bp->tx_ring_mask + 1);
 		req->stat_ctx_id = cpu_to_le32(grp_info->fw_stats_ctx);
 		req->queue_id = cpu_to_le16(ring->queue_id);
+		if (bp->flags & BNXT_FLAG_TX_COAL_CMPL)
+			req->cmpl_coal_cnt =
+				RING_ALLOC_REQ_CMPL_COAL_CNT_COAL_64;
 		break;
 	}
 	case HWRM_RING_ALLOC_RX:
@@ -8279,6 +8286,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 		bp->fw_cap |= BNXT_FW_CAP_LIVEPATCH;
 	if (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_BS_V2_SUPPORTED)
 		bp->fw_cap |= BNXT_FW_CAP_BACKING_STORE_V2;
+	if (flags_ext & FUNC_QCAPS_RESP_FLAGS_EXT_TX_COAL_CMPL_CAP)
+		bp->flags |= BNXT_FLAG_TX_COAL_CMPL;
 
 	flags_ext2 = le32_to_cpu(resp->flags_ext2);
 	if (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index afa784305fea..67915ab13f50 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2047,6 +2047,7 @@ struct bnxt {
 	#define BNXT_FLAG_CHIP_NITRO_A0	0x1000000
 	#define BNXT_FLAG_DIM		0x2000000
 	#define BNXT_FLAG_ROCE_MIRROR_CAP	0x4000000
+	#define BNXT_FLAG_TX_COAL_CMPL	0x8000000
 	#define BNXT_FLAG_PORT_STATS_EXT	0x10000000
 
 	#define BNXT_FLAG_ALL_CONFIG_FEATS (BNXT_FLAG_TPA |		\
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 06/13] bnxt_en: Allocate extra QP backing store memory when RoCE FW reports it
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (4 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 05/13] bnxt_en: Support TX coalesced completion on 5760X chips Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 07/13] bnxt_en: Use proper TUNNEL_DST_PORT_ALLOC* commands Michael Chan
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Selvin Xavier

[-- Attachment #1: Type: text/plain, Size: 3292 bytes --]

From: Selvin Xavier <selvin.xavier@broadcom.com>

The Fast QP modify destroy RoCE feature requires additional QP entries
in QP context backing store. FW reports the extra count to be
allocated during backing store query. Use this value and allocate extra
memory.  Note that this works for both the V1 and V1 backing store
FW APIs.

Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 72e2bd4611de..42a52ee8c1bc 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7535,6 +7535,7 @@ static int bnxt_hwrm_func_backing_store_qcaps(struct bnxt *bp)
 		ctxm->max_entries = le32_to_cpu(resp->qp_max_entries);
 		ctxm->qp_qp1_entries = le16_to_cpu(resp->qp_min_qp1_entries);
 		ctxm->qp_l2_entries = le16_to_cpu(resp->qp_max_l2_entries);
+		ctxm->qp_fast_qpmd_entries = le16_to_cpu(resp->fast_qpmd_qp_num_entries);
 		ctxm->entry_size = le16_to_cpu(resp->qp_entry_size);
 		bnxt_init_ctx_initializer(ctxm, init_val, resp->qp_init_offset,
 					  (init_mask & (1 << init_idx++)) != 0);
@@ -7672,6 +7673,9 @@ static int bnxt_hwrm_func_backing_store_cfg(struct bnxt *bp, u32 enables)
 		bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem,
 				      &req->qpc_pg_size_qpc_lvl,
 				      &req->qpc_page_dir);
+
+		if (enables & FUNC_BACKING_STORE_CFG_REQ_ENABLES_QP_FAST_QPMD)
+			req->qp_num_fast_qpmd_entries = cpu_to_le16(ctxm->qp_fast_qpmd_entries);
 	}
 	if (enables & FUNC_BACKING_STORE_CFG_REQ_ENABLES_SRQ) {
 		ctxm = &ctx->ctx_arr[BNXT_CTX_SRQ];
@@ -8004,6 +8008,7 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	u32 num_mr, num_ah;
 	u32 extra_srqs = 0;
 	u32 extra_qps = 0;
+	u32 fast_qpmd_qps;
 	u8 pg_lvl = 1;
 	int i, rc;
 
@@ -8020,14 +8025,20 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	ctxm = &ctx->ctx_arr[BNXT_CTX_QP];
 	l2_qps = ctxm->qp_l2_entries;
 	qp1_qps = ctxm->qp_qp1_entries;
+	fast_qpmd_qps = ctxm->qp_fast_qpmd_entries;
 	max_qps = ctxm->max_entries;
 	ctxm = &ctx->ctx_arr[BNXT_CTX_SRQ];
 	srqs = ctxm->srq_l2_entries;
 	max_srqs = ctxm->max_entries;
+	ena = 0;
 	if ((bp->flags & BNXT_FLAG_ROCE_CAP) && !is_kdump_kernel()) {
 		pg_lvl = 2;
 		extra_qps = min_t(u32, 65536, max_qps - l2_qps - qp1_qps);
+		/* allocate extra qps if fw supports RoCE fast qp destroy feature */
+		extra_qps += fast_qpmd_qps;
 		extra_srqs = min_t(u32, 8192, max_srqs - srqs);
+		if (fast_qpmd_qps)
+			ena |= FUNC_BACKING_STORE_CFG_REQ_ENABLES_QP_FAST_QPMD;
 	}
 
 	ctxm = &ctx->ctx_arr[BNXT_CTX_QP];
@@ -8057,7 +8068,6 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	if (rc)
 		return rc;
 
-	ena = 0;
 	if (!(bp->flags & BNXT_FLAG_ROCE_CAP))
 		goto skip_rdma;
 
@@ -8074,7 +8084,7 @@ static int bnxt_alloc_ctx_mem(struct bnxt *bp)
 	rc = bnxt_setup_ctxm_pg_tbls(bp, ctxm, num_mr + num_ah, 2);
 	if (rc)
 		return rc;
-	ena = FUNC_BACKING_STORE_CFG_REQ_ENABLES_MRAV;
+	ena |= FUNC_BACKING_STORE_CFG_REQ_ENABLES_MRAV;
 
 	ctxm = &ctx->ctx_arr[BNXT_CTX_TIM];
 	rc = bnxt_setup_ctxm_pg_tbls(bp, ctxm, l2_qps + qp1_qps + extra_qps, 1);
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 07/13] bnxt_en: Use proper TUNNEL_DST_PORT_ALLOC* commands
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (5 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 06/13] bnxt_en: Allocate extra QP backing store memory when RoCE FW reports it Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 08/13] bnxt_en: Add support for VXLAN GPE Michael Chan
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]

In bnxt_udp_tunnel_set_port(), use the proper ALLOC commands instead
of the FREE commands for correctness.  The ALLOC and FREE commands
happen to be identical so this is just a cosmetic fix for correctness.

Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 42a52ee8c1bc..f2e8904de97f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -13673,9 +13673,9 @@ static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int tabl
 	unsigned int cmd;
 
 	if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
-		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
+		cmd = TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN;
 	else
-		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
+		cmd = TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE;
 
 	return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti->port, cmd);
 }
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 08/13] bnxt_en: Add support for VXLAN GPE
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (6 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 07/13] bnxt_en: Use proper TUNNEL_DST_PORT_ALLOC* commands Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 09/13] bnxt_en: Configure UDP tunnel TPA Michael Chan
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, gospo, Damodharam Ammepalli,
	Ajit Khaparde, Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 5315 bytes --]

Add a new bnxt_udp_tunnels_p7 struct to support the new P7 chips that
can parse VXLAN GPE packets.  Add VXLAN GPE tunnel type handling to
the .set_port() and .unset_port() functions.  .ndo_features_check()
is also enhanced to support VXLAN GPE which may encapsulate inner
IP packets instead of ethernet packets.

Reviewed-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 43 ++++++++++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  2 ++
 2 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index f2e8904de97f..b9eb3e0c5995 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -5179,6 +5179,11 @@ static int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, u8 tunnel_type)
 		bp->nge_port = 0;
 		bp->nge_fw_dst_port_id = INVALID_HW_RING_ID;
 		break;
+	case TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE:
+		req->tunnel_dst_port_id = cpu_to_le16(bp->vxlan_gpe_fw_dst_port_id);
+		bp->vxlan_gpe_port = 0;
+		bp->vxlan_gpe_fw_dst_port_id = INVALID_HW_RING_ID;
+		break;
 	default:
 		break;
 	}
@@ -5222,6 +5227,11 @@ static int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, __be16 port,
 		bp->nge_port = port;
 		bp->nge_fw_dst_port_id = le16_to_cpu(resp->tunnel_dst_port_id);
 		break;
+	case TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE:
+		bp->vxlan_gpe_port = port;
+		bp->vxlan_gpe_fw_dst_port_id =
+			le16_to_cpu(resp->tunnel_dst_port_id);
+		break;
 	default:
 		break;
 	}
@@ -12002,9 +12012,10 @@ static bool bnxt_udp_tunl_check(struct bnxt *bp, struct sk_buff *skb)
 	struct udphdr *uh = udp_hdr(skb);
 	__be16 udp_port = uh->dest;
 
-	if (udp_port != bp->vxlan_port && udp_port != bp->nge_port)
+	if (udp_port != bp->vxlan_port && udp_port != bp->nge_port &&
+	    udp_port != bp->vxlan_gpe_port)
 		return false;
-	if (skb->inner_protocol_type == ENCAP_TYPE_ETHER) {
+	if (skb->inner_protocol == htons(ETH_P_TEB)) {
 		struct ethhdr *eh = inner_eth_hdr(skb);
 
 		switch (eh->h_proto) {
@@ -12015,6 +12026,11 @@ static bool bnxt_udp_tunl_check(struct bnxt *bp, struct sk_buff *skb)
 						 skb_inner_network_offset(skb),
 						 NULL);
 		}
+	} else if (skb->inner_protocol == htons(ETH_P_IP)) {
+		return true;
+	} else if (skb->inner_protocol == htons(ETH_P_IPV6)) {
+		return bnxt_exthdr_check(bp, skb, skb_inner_network_offset(skb),
+					 NULL);
 	}
 	return false;
 }
@@ -13674,8 +13690,10 @@ static int bnxt_udp_tunnel_set_port(struct net_device *netdev, unsigned int tabl
 
 	if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
 		cmd = TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN;
-	else
+	else if (ti->type == UDP_TUNNEL_TYPE_GENEVE)
 		cmd = TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_GENEVE;
+	else
+		cmd = TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE;
 
 	return bnxt_hwrm_tunnel_dst_port_alloc(bp, ti->port, cmd);
 }
@@ -13688,8 +13706,10 @@ static int bnxt_udp_tunnel_unset_port(struct net_device *netdev, unsigned int ta
 
 	if (ti->type == UDP_TUNNEL_TYPE_VXLAN)
 		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN;
-	else
+	else if (ti->type == UDP_TUNNEL_TYPE_GENEVE)
 		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE;
+	else
+		cmd = TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE;
 
 	return bnxt_hwrm_tunnel_dst_port_free(bp, cmd);
 }
@@ -13703,6 +13723,16 @@ static const struct udp_tunnel_nic_info bnxt_udp_tunnels = {
 		{ .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_VXLAN,  },
 		{ .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_GENEVE, },
 	},
+}, bnxt_udp_tunnels_p7 = {
+	.set_port	= bnxt_udp_tunnel_set_port,
+	.unset_port	= bnxt_udp_tunnel_unset_port,
+	.flags		= UDP_TUNNEL_NIC_INFO_MAY_SLEEP |
+			  UDP_TUNNEL_NIC_INFO_OPEN_ONLY,
+	.tables		= {
+		{ .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_VXLAN,  },
+		{ .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_GENEVE, },
+		{ .n_entries = 1, .tunnel_types = UDP_TUNNEL_TYPE_VXLAN_GPE, },
+	},
 };
 
 static int bnxt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
@@ -14298,7 +14328,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 			NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_GRE |
 			NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM |
 			NETIF_F_GSO_IPXIP4 | NETIF_F_GSO_PARTIAL;
-	dev->udp_tunnel_nic_info = &bnxt_udp_tunnels;
+	if (bp->flags & BNXT_FLAG_CHIP_P7)
+		dev->udp_tunnel_nic_info = &bnxt_udp_tunnels_p7;
+	else
+		dev->udp_tunnel_nic_info = &bnxt_udp_tunnels;
 
 	dev->gso_partial_features = NETIF_F_GSO_UDP_TUNNEL_CSUM |
 				    NETIF_F_GSO_GRE_CSUM;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 67915ab13f50..609f4073f5ff 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2284,8 +2284,10 @@ struct bnxt {
 
 	u16			vxlan_fw_dst_port_id;
 	u16			nge_fw_dst_port_id;
+	u16			vxlan_gpe_fw_dst_port_id;
 	__be16			vxlan_port;
 	__be16			nge_port;
+	__be16			vxlan_gpe_port;
 	u8			port_partition_type;
 	u8			port_count;
 	u16			br_mode;
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 09/13] bnxt_en: Configure UDP tunnel TPA
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (7 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 08/13] bnxt_en: Add support for VXLAN GPE Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 10/13] bnxt_en: add rx_filter_miss extended stats Michael Chan
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Ajit Khaparde

[-- Attachment #1: Type: text/plain, Size: 3838 bytes --]

On the new P7 chips, TPA for tunnel packets can be independently
enabled for each VNIC.  The default TPA configuration should not
include UDP tunnels because the UDP ports for these tunnels are not
known yet.  The chip should not aggregate these UDP tunneled packets
using default UDP ports until the ports are known.

Add a new function bnxt_hwrm_vnic_update_tunl_tpa() to enable VXLAN
and Geneve TPA if the corresponding UDP ports are known.

Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 33 +++++++++++++++++++++++
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  1 +
 2 files changed, 34 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index b9eb3e0c5995..3594290e187a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -5150,6 +5150,8 @@ int bnxt_hwrm_func_drv_unrgtr(struct bnxt *bp)
 	return hwrm_req_send(bp, req);
 }
 
+static int bnxt_set_tpa(struct bnxt *bp, bool set_tpa);
+
 static int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, u8 tunnel_type)
 {
 	struct hwrm_tunnel_dst_port_free_input *req;
@@ -5192,6 +5194,8 @@ static int bnxt_hwrm_tunnel_dst_port_free(struct bnxt *bp, u8 tunnel_type)
 	if (rc)
 		netdev_err(bp->dev, "hwrm_tunnel_dst_port_free failed. rc:%d\n",
 			   rc);
+	if (bp->flags & BNXT_FLAG_TPA)
+		bnxt_set_tpa(bp, true);
 	return rc;
 }
 
@@ -5235,6 +5239,8 @@ static int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, __be16 port,
 	default:
 		break;
 	}
+	if (bp->flags & BNXT_FLAG_TPA)
+		bnxt_set_tpa(bp, true);
 
 err_out:
 	hwrm_req_drop(bp, req);
@@ -5427,6 +5433,30 @@ static int bnxt_hwrm_clear_vnic_filter(struct bnxt *bp)
 	return rc;
 }
 
+#define BNXT_DFLT_TUNL_TPA_BMAP				\
+	(VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_GRE |	\
+	 VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_IPV4 |	\
+	 VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_IPV6)
+
+static void bnxt_hwrm_vnic_update_tunl_tpa(struct bnxt *bp,
+					   struct hwrm_vnic_tpa_cfg_input *req)
+{
+	u32 tunl_tpa_bmap = BNXT_DFLT_TUNL_TPA_BMAP;
+
+	if (!(bp->fw_cap & BNXT_FW_CAP_VNIC_TUNNEL_TPA))
+		return;
+
+	if (bp->vxlan_port)
+		tunl_tpa_bmap |= VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_VXLAN;
+	if (bp->vxlan_gpe_port)
+		tunl_tpa_bmap |= VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_VXLAN_GPE;
+	if (bp->nge_port)
+		tunl_tpa_bmap |= VNIC_TPA_CFG_REQ_TNL_TPA_EN_BITMAP_GENEVE;
+
+	req->enables |= cpu_to_le32(VNIC_TPA_CFG_REQ_ENABLES_TNL_TPA_EN);
+	req->tnl_tpa_en_bitmap = cpu_to_le32(tunl_tpa_bmap);
+}
+
 static int bnxt_hwrm_vnic_set_tpa(struct bnxt *bp, u16 vnic_id, u32 tpa_flags)
 {
 	struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id];
@@ -5483,6 +5513,7 @@ static int bnxt_hwrm_vnic_set_tpa(struct bnxt *bp, u16 vnic_id, u32 tpa_flags)
 		req->max_aggs = cpu_to_le16(max_aggs);
 
 		req->min_agg_len = cpu_to_le32(512);
+		bnxt_hwrm_vnic_update_tunl_tpa(bp, req);
 	}
 	req->vnic_id = cpu_to_le16(vnic->fw_vnic_id);
 
@@ -5977,6 +6008,8 @@ static int bnxt_hwrm_vnic_qcaps(struct bnxt *bp)
 			else
 				bp->hw_ring_stats_size = BNXT_RING_STATS_SIZE_P7;
 		}
+		if (flags & VNIC_QCAPS_RESP_FLAGS_HW_TUNNEL_TPA_CAP)
+			bp->fw_cap |= BNXT_FW_CAP_VNIC_TUNNEL_TPA;
 	}
 	hwrm_req_drop(bp, req);
 	return rc;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 609f4073f5ff..15d33f4a61c2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2240,6 +2240,7 @@ struct bnxt {
 	#define BNXT_FW_CAP_DFLT_VLAN_TPID_PCP		BIT_ULL(34)
 	#define BNXT_FW_CAP_PRE_RESV_VNICS		BIT_ULL(35)
 	#define BNXT_FW_CAP_BACKING_STORE_V2		BIT_ULL(36)
+	#define BNXT_FW_CAP_VNIC_TUNNEL_TPA		BIT_ULL(37)
 
 	u32			fw_dbg_cap;
 
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 10/13] bnxt_en: add rx_filter_miss extended stats
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (8 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 09/13] bnxt_en: Configure UDP tunnel TPA Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 11/13] bnxt_en: Add support for UDP GSO on 5760X chips Michael Chan
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Damodharam Ammepalli

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

From: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>

rx_filter_miss counter is newly added to the rx_port_stats_ext
stats structure for newer chips.  Newer firmware will return the
structure size that includes this counter.  Add this entry to
the bnxt_port_stats_ext_arr array and the ethtool -S code will
pick up this counter if it is supported.

Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index bb9cab821587..45ce7e2e3662 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -461,6 +461,7 @@ static const struct {
 	BNXT_RX_STATS_EXT_DISCARD_COS_ENTRIES,
 	BNXT_RX_STATS_EXT_ENTRY(rx_fec_corrected_blocks),
 	BNXT_RX_STATS_EXT_ENTRY(rx_fec_uncorrectable_blocks),
+	BNXT_RX_STATS_EXT_ENTRY(rx_filter_miss),
 };
 
 static const struct {
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 11/13] bnxt_en: Add support for UDP GSO on 5760X chips
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (9 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 10/13] bnxt_en: add rx_filter_miss extended stats Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 12/13] bnxt_en: Skip nic close/open when configuring tstamp filters Michael Chan
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Andy Gospodarek,
	Somnath Kotur

[-- Attachment #1: Type: text/plain, Size: 3253 bytes --]

The new 5760X chips supports UDP GSO.  Tested using udpgso_bench_tx.

Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 21 ++++++++++++++++++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h |  1 +
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 3594290e187a..be3fa0545fdc 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -587,12 +587,21 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	txbd1->tx_bd_hsize_lflags = lflags;
 	if (skb_is_gso(skb)) {
+		bool udp_gso = !!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4);
 		u32 hdr_len;
 
-		if (skb->encapsulation)
-			hdr_len = skb_inner_tcp_all_headers(skb);
-		else
+		if (skb->encapsulation) {
+			if (udp_gso)
+				hdr_len = skb_inner_transport_offset(skb) +
+					  sizeof(struct udphdr);
+			else
+				hdr_len = skb_inner_tcp_all_headers(skb);
+		} else if (udp_gso) {
+			hdr_len = skb_transport_offset(skb) +
+				  sizeof(struct udphdr);
+		} else {
 			hdr_len = skb_tcp_all_headers(skb);
+		}
 
 		txbd1->tx_bd_hsize_lflags |= cpu_to_le32(TX_BD_FLAGS_LSO |
 					TX_BD_FLAGS_T_IPID |
@@ -8345,6 +8354,8 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
 	flags_ext2 = le32_to_cpu(resp->flags_ext2);
 	if (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_RX_ALL_PKTS_TIMESTAMPS_SUPPORTED)
 		bp->fw_cap |= BNXT_FW_CAP_RX_ALL_PKT_TS;
+	if (flags_ext2 & FUNC_QCAPS_RESP_FLAGS_EXT2_UDP_GSO_SUPPORTED)
+		bp->flags |= BNXT_FLAG_UDP_GSO_CAP;
 
 	bp->tx_push_thresh = 0;
 	if ((flags & FUNC_QCAPS_RESP_FLAGS_PUSH_MODE_SUPPORTED) &&
@@ -14351,6 +14362,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 			   NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM |
 			   NETIF_F_GSO_PARTIAL | NETIF_F_RXHASH |
 			   NETIF_F_RXCSUM | NETIF_F_GRO;
+	if (bp->flags & BNXT_FLAG_UDP_GSO_CAP)
+		dev->hw_features |= NETIF_F_GSO_UDP_L4;
 
 	if (BNXT_SUPPORTS_TPA(bp))
 		dev->hw_features |= NETIF_F_LRO;
@@ -14361,6 +14374,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 			NETIF_F_GSO_UDP_TUNNEL | NETIF_F_GSO_GRE |
 			NETIF_F_GSO_UDP_TUNNEL_CSUM | NETIF_F_GSO_GRE_CSUM |
 			NETIF_F_GSO_IPXIP4 | NETIF_F_GSO_PARTIAL;
+	if (bp->flags & BNXT_FLAG_UDP_GSO_CAP)
+		dev->hw_enc_features |= NETIF_F_GSO_UDP_L4;
 	if (bp->flags & BNXT_FLAG_CHIP_P7)
 		dev->udp_tunnel_nic_info = &bnxt_udp_tunnels_p7;
 	else
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index 15d33f4a61c2..1269463b9b04 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2044,6 +2044,7 @@ struct bnxt {
 	#define BNXT_FLAG_MULTI_HOST	0x100000
 	#define BNXT_FLAG_DSN_VALID	0x200000
 	#define BNXT_FLAG_DOUBLE_DB	0x400000
+	#define BNXT_FLAG_UDP_GSO_CAP	0x800000
 	#define BNXT_FLAG_CHIP_NITRO_A0	0x1000000
 	#define BNXT_FLAG_DIM		0x2000000
 	#define BNXT_FLAG_ROCE_MIRROR_CAP	0x4000000
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 12/13] bnxt_en: Skip nic close/open when configuring tstamp filters
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (10 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 11/13] bnxt_en: Add support for UDP GSO on 5760X chips Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2023-12-12  0:51 ` [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent Michael Chan
  2023-12-13  0:10 ` [PATCH net-next 00/13] bnxt_en: Update for net-next patchwork-bot+netdevbpf
  13 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Pavan Chebbi,
	Andy Gospodarek

[-- Attachment #1: Type: text/plain, Size: 3681 bytes --]

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

We don't have to close and open the nic to make sure we have
valid rx timestamps. Once we have the timestamp filter applied to
the HW and the timestamp_fld_format bit is cleared in the rx
completion and the timestamp is non-zero, we can be sure that rx
timestamp is valid data.

Skip close/open when we set any timestamp filter.

Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 29 +++++++------------
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h |  2 +-
 2 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index a1ec39b46518..3d1c36d384c2 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -319,15 +319,17 @@ static int bnxt_ptp_cfg_event(struct bnxt *bp, u8 event)
 	return hwrm_req_send(bp, req);
 }
 
-void bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp)
+int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp)
 {
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 	struct hwrm_port_mac_cfg_input *req;
+	int rc;
 
 	if (!ptp || !ptp->tstamp_filters)
-		return;
+		return -EIO;
 
-	if (hwrm_req_init(bp, req, HWRM_PORT_MAC_CFG))
+	rc = hwrm_req_init(bp, req, HWRM_PORT_MAC_CFG);
+	if (rc)
 		goto out;
 
 	if (!(bp->fw_cap & BNXT_FW_CAP_RX_ALL_PKT_TS) && (ptp->tstamp_filters &
@@ -342,15 +344,17 @@ void bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp)
 	req->enables = cpu_to_le32(PORT_MAC_CFG_REQ_ENABLES_RX_TS_CAPTURE_PTP_MSG_TYPE);
 	req->rx_ts_capture_ptp_msg_type = cpu_to_le16(ptp->rxctl);
 
-	if (!hwrm_req_send(bp, req)) {
+	rc = hwrm_req_send(bp, req);
+	if (!rc) {
 		bp->ptp_all_rx_tstamp = !!(ptp->tstamp_filters &
 					   PORT_MAC_CFG_REQ_FLAGS_ALL_RX_TS_CAPTURE_ENABLE);
-		return;
+		return 0;
 	}
 	ptp->tstamp_filters = 0;
 out:
 	bp->ptp_all_rx_tstamp = 0;
 	netdev_warn(bp->dev, "Failed to configure HW packet timestamp filters\n");
+	return rc;
 }
 
 void bnxt_ptp_reapply_pps(struct bnxt *bp)
@@ -494,7 +498,6 @@ static int bnxt_hwrm_ptp_cfg(struct bnxt *bp)
 {
 	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;
 	u32 flags = 0;
-	int rc = 0;
 
 	switch (ptp->rx_filter) {
 	case HWTSTAMP_FILTER_ALL:
@@ -519,19 +522,7 @@ static int bnxt_hwrm_ptp_cfg(struct bnxt *bp)
 
 	ptp->tstamp_filters = flags;
 
-	if (netif_running(bp->dev)) {
-		if (ptp->rx_filter == HWTSTAMP_FILTER_ALL) {
-			rc = bnxt_close_nic(bp, false, false);
-			if (!rc)
-				rc = bnxt_open_nic(bp, false, false);
-		} else {
-			bnxt_ptp_cfg_tstamp_filters(bp);
-		}
-		if (!rc && !ptp->tstamp_filters)
-			rc = -EIO;
-	}
-
-	return rc;
+	return bnxt_ptp_cfg_tstamp_filters(bp);
 }
 
 int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
index 34162e07a119..fce8dc39a7d0 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
@@ -137,7 +137,7 @@ do {						\
 int bnxt_ptp_parse(struct sk_buff *skb, u16 *seq_id, u16 *hdr_off);
 void bnxt_ptp_update_current_time(struct bnxt *bp);
 void bnxt_ptp_pps_event(struct bnxt *bp, u32 data1, u32 data2);
-void bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp);
+int bnxt_ptp_cfg_tstamp_filters(struct bnxt *bp);
 void bnxt_ptp_reapply_pps(struct bnxt *bp);
 int bnxt_hwtstamp_set(struct net_device *dev, struct ifreq *ifr);
 int bnxt_hwtstamp_get(struct net_device *dev, struct ifreq *ifr);
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (11 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 12/13] bnxt_en: Skip nic close/open when configuring tstamp filters Michael Chan
@ 2023-12-12  0:51 ` Michael Chan
  2024-01-24 10:18   ` Breno Leitao
  2023-12-13  0:10 ` [PATCH net-next 00/13] bnxt_en: Update for net-next patchwork-bot+netdevbpf
  13 siblings, 1 reply; 20+ messages in thread
From: Michael Chan @ 2023-12-12  0:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, kuba, pabeni, gospo, Pavan Chebbi

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

In a busy network, especially with flow control enabled, we may
experience timestamp query failures fairly regularly. After a while,
dmesg may be flooded with timestamp query failure error messages.

Silence the error message from the low level hwrm function that
sends the firmware message.  Change netdev_err() to netdev_WARN_ONCE()
if this FW call ever fails.

Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index 3d1c36d384c2..adad188e38b8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -129,7 +129,7 @@ static int bnxt_hwrm_port_ts_query(struct bnxt *bp, u32 flags, u64 *ts)
 	}
 	resp = hwrm_req_hold(bp, req);
 
-	rc = hwrm_req_send(bp, req);
+	rc = hwrm_req_send_silent(bp, req);
 	if (!rc)
 		*ts = le64_to_cpu(resp->ptp_msg_ts);
 	hwrm_req_drop(bp, req);
@@ -684,8 +684,8 @@ static void bnxt_stamp_tx_skb(struct bnxt *bp, struct sk_buff *skb)
 		timestamp.hwtstamp = ns_to_ktime(ns);
 		skb_tstamp_tx(ptp->tx_skb, &timestamp);
 	} else {
-		netdev_err(bp->dev, "TS query for TX timer failed rc = %x\n",
-			   rc);
+		netdev_WARN_ONCE(bp->dev,
+				 "TS query for TX timer failed rc = %x\n", rc);
 	}
 
 	dev_kfree_skb_any(ptp->tx_skb);
-- 
2.30.1


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* Re: [PATCH net-next 00/13] bnxt_en: Update for net-next
  2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
                   ` (12 preceding siblings ...)
  2023-12-12  0:51 ` [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent Michael Chan
@ 2023-12-13  0:10 ` patchwork-bot+netdevbpf
  13 siblings, 0 replies; 20+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-13  0:10 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, edumazet, kuba, pabeni, gospo

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 11 Dec 2023 16:51:09 -0800 you wrote:
> The first 4 patches in the series fix issues in the net-next tree
> introduced in the last 4 weeks.  The first 3 patches fix ring accounting
> and indexing logic.  The 4th patch fix TX timeout when the TX ring is
> very small.
> 
> The next 7 patches add new features on the P7 chips, including TX
> coalesced completions, VXLAN GPE and UDP GSO stateless offload, a
> new rx_filter_miss counters, and more QP backing store memory for
> RoCE.
> 
> [...]

Here is the summary with links:
  - [net-next,01/13] bnxt_en: Fix trimming of P5 RX and TX rings
    https://git.kernel.org/netdev/net-next/c/f1e50b276d37
  - [net-next,02/13] bnxt_en: Fix AGG ring check logic in bnxt_check_rings()
    https://git.kernel.org/netdev/net-next/c/7fb17a0c18b6
  - [net-next,03/13] bnxt_en: Fix TX ring indexing logic
    https://git.kernel.org/netdev/net-next/c/18fe0a383cca
  - [net-next,04/13] bnxt_en: Prevent TX timeout with a very small TX ring
    https://git.kernel.org/netdev/net-next/c/f12f551b5b96
  - [net-next,05/13] bnxt_en: Support TX coalesced completion on 5760X chips
    https://git.kernel.org/netdev/net-next/c/6dea3ebe0d22
  - [net-next,06/13] bnxt_en: Allocate extra QP backing store memory when RoCE FW reports it
    https://git.kernel.org/netdev/net-next/c/297e625bf89e
  - [net-next,07/13] bnxt_en: Use proper TUNNEL_DST_PORT_ALLOC* commands
    https://git.kernel.org/netdev/net-next/c/e6f8a5a8ecc9
  - [net-next,08/13] bnxt_en: Add support for VXLAN GPE
    https://git.kernel.org/netdev/net-next/c/77b0fff55dcd
  - [net-next,09/13] bnxt_en: Configure UDP tunnel TPA
    https://git.kernel.org/netdev/net-next/c/960096334417
  - [net-next,10/13] bnxt_en: add rx_filter_miss extended stats
    https://git.kernel.org/netdev/net-next/c/6ce30622547d
  - [net-next,11/13] bnxt_en: Add support for UDP GSO on 5760X chips
    https://git.kernel.org/netdev/net-next/c/feeef68f6f3d
  - [net-next,12/13] bnxt_en: Skip nic close/open when configuring tstamp filters
    https://git.kernel.org/netdev/net-next/c/84793a499578
  - [net-next,13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
    https://git.kernel.org/netdev/net-next/c/056bce63c469

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
  2023-12-12  0:51 ` [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent Michael Chan
@ 2024-01-24 10:18   ` Breno Leitao
  2024-01-25  3:35     ` Pavan Chebbi
  0 siblings, 1 reply; 20+ messages in thread
From: Breno Leitao @ 2024-01-24 10:18 UTC (permalink / raw)
  To: Michael Chan; +Cc: davem, netdev, edumazet, kuba, pabeni, gospo, Pavan Chebbi

Hello Michael, Pavan,

On Mon, Dec 11, 2023 at 04:51:22PM -0800, Michael Chan wrote:
> From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> 
> In a busy network, especially with flow control enabled, we may
> experience timestamp query failures fairly regularly. After a while,
> dmesg may be flooded with timestamp query failure error messages.
> 
> Silence the error message from the low level hwrm function that
> sends the firmware message.  Change netdev_err() to netdev_WARN_ONCE()
> if this FW call ever fails.

This is starting to cause a warning now, which is not ideal, because
this error-now-warning happens quite frequently in Meta's fleet.

At the same time, we want to have our kernels running warninglessly.
Moreover, the call stack displayed by the warning doesn't seem to be
quite useful and doees not help to investigate "the problem", I _think_.

Is it OK to move it back to error, something as:

-	netdev_WARN_ONCE(bp->dev,
+	netdev_err_once(bp->dev,
			 "TS query for TX timer failed rc = %x\n", rc);

Thank you

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

* Re: [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
  2024-01-24 10:18   ` Breno Leitao
@ 2024-01-25  3:35     ` Pavan Chebbi
  2024-01-25  4:47       ` Michael Chan
  2024-01-25  9:51       ` Breno Leitao
  0 siblings, 2 replies; 20+ messages in thread
From: Pavan Chebbi @ 2024-01-25  3:35 UTC (permalink / raw)
  To: Breno Leitao; +Cc: Michael Chan, davem, netdev, edumazet, kuba, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

On Wed, Jan 24, 2024 at 3:48 PM Breno Leitao <leitao@debian.org> wrote:
>
> Hello Michael, Pavan,
>
> On Mon, Dec 11, 2023 at 04:51:22PM -0800, Michael Chan wrote:
> > From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> >
> > In a busy network, especially with flow control enabled, we may
> > experience timestamp query failures fairly regularly. After a while,
> > dmesg may be flooded with timestamp query failure error messages.
> >
> > Silence the error message from the low level hwrm function that
> > sends the firmware message.  Change netdev_err() to netdev_WARN_ONCE()
> > if this FW call ever fails.
>
> This is starting to cause a warning now, which is not ideal, because
> this error-now-warning happens quite frequently in Meta's fleet.
>
> At the same time, we want to have our kernels running warninglessly.
> Moreover, the call stack displayed by the warning doesn't seem to be
> quite useful and doees not help to investigate "the problem", I _think_.
>
> Is it OK to move it back to error, something as:
>
> -       netdev_WARN_ONCE(bp->dev,
> +       netdev_err_once(bp->dev,
>                          "TS query for TX timer failed rc = %x\n", rc);

Hi Breno, I think it is OK to change.
Would you be submitting a patch for this?

>
> Thank you

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* Re: [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
  2024-01-25  3:35     ` Pavan Chebbi
@ 2024-01-25  4:47       ` Michael Chan
  2024-01-25  9:52         ` Breno Leitao
  2024-01-25  9:51       ` Breno Leitao
  1 sibling, 1 reply; 20+ messages in thread
From: Michael Chan @ 2024-01-25  4:47 UTC (permalink / raw)
  To: Pavan Chebbi; +Cc: Breno Leitao, davem, netdev, edumazet, kuba, pabeni, gospo

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

On Wed, Jan 24, 2024 at 7:35 PM Pavan Chebbi <pavan.chebbi@broadcom.com> wrote:
>
> On Wed, Jan 24, 2024 at 3:48 PM Breno Leitao <leitao@debian.org> wrote:
> >
> > Hello Michael, Pavan,
> >
> > On Mon, Dec 11, 2023 at 04:51:22PM -0800, Michael Chan wrote:
> > > From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> > >
> > > In a busy network, especially with flow control enabled, we may
> > > experience timestamp query failures fairly regularly. After a while,
> > > dmesg may be flooded with timestamp query failure error messages.
> > >
> > > Silence the error message from the low level hwrm function that
> > > sends the firmware message.  Change netdev_err() to netdev_WARN_ONCE()
> > > if this FW call ever fails.
> >
> > This is starting to cause a warning now, which is not ideal, because
> > this error-now-warning happens quite frequently in Meta's fleet.
> >
> > At the same time, we want to have our kernels running warninglessly.
> > Moreover, the call stack displayed by the warning doesn't seem to be
> > quite useful and doees not help to investigate "the problem", I _think_.
> >
> > Is it OK to move it back to error, something as:
> >
> > -       netdev_WARN_ONCE(bp->dev,
> > +       netdev_err_once(bp->dev,
> >                          "TS query for TX timer failed rc = %x\n", rc);
>
> Hi Breno, I think it is OK to change.
> Would you be submitting a patch for this?
>

Why not netdev_warn_once()?  It will just print a message at the
warning level without the stack trace.  I think we consider this
condition to be just a warning and not an error.  Thanks.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]

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

* Re: [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
  2024-01-25  3:35     ` Pavan Chebbi
  2024-01-25  4:47       ` Michael Chan
@ 2024-01-25  9:51       ` Breno Leitao
  1 sibling, 0 replies; 20+ messages in thread
From: Breno Leitao @ 2024-01-25  9:51 UTC (permalink / raw)
  To: Pavan Chebbi; +Cc: Michael Chan, davem, netdev, edumazet, kuba, pabeni, gospo

On Thu, Jan 25, 2024 at 09:05:39AM +0530, Pavan Chebbi wrote:
> On Wed, Jan 24, 2024 at 3:48 PM Breno Leitao <leitao@debian.org> wrote:
> >
> > Hello Michael, Pavan,
> >
> > On Mon, Dec 11, 2023 at 04:51:22PM -0800, Michael Chan wrote:
> > > From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> > >
> > > In a busy network, especially with flow control enabled, we may
> > > experience timestamp query failures fairly regularly. After a while,
> > > dmesg may be flooded with timestamp query failure error messages.
> > >
> > > Silence the error message from the low level hwrm function that
> > > sends the firmware message.  Change netdev_err() to netdev_WARN_ONCE()
> > > if this FW call ever fails.
> >
> > This is starting to cause a warning now, which is not ideal, because
> > this error-now-warning happens quite frequently in Meta's fleet.
> >
> > At the same time, we want to have our kernels running warninglessly.
> > Moreover, the call stack displayed by the warning doesn't seem to be
> > quite useful and doees not help to investigate "the problem", I _think_.
> >
> > Is it OK to move it back to error, something as:
> >
> > -       netdev_WARN_ONCE(bp->dev,
> > +       netdev_err_once(bp->dev,
> >                          "TS query for TX timer failed rc = %x\n", rc);
> 
> Hi Breno, I think it is OK to change.

> Would you be submitting a patch for this?

Yes, let me send a patch. I will follow Michael's suggestion and use
netdev_warn_once()

Thanks!

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

* Re: [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent
  2024-01-25  4:47       ` Michael Chan
@ 2024-01-25  9:52         ` Breno Leitao
  0 siblings, 0 replies; 20+ messages in thread
From: Breno Leitao @ 2024-01-25  9:52 UTC (permalink / raw)
  To: Michael Chan; +Cc: Pavan Chebbi, davem, netdev, edumazet, kuba, pabeni, gospo

On Wed, Jan 24, 2024 at 08:47:03PM -0800, Michael Chan wrote:
> On Wed, Jan 24, 2024 at 7:35 PM Pavan Chebbi <pavan.chebbi@broadcom.com> wrote:
> >
> > On Wed, Jan 24, 2024 at 3:48 PM Breno Leitao <leitao@debian.org> wrote:
> > >
> > > Hello Michael, Pavan,
> > >
> > > On Mon, Dec 11, 2023 at 04:51:22PM -0800, Michael Chan wrote:
> > > > From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> > > >
> > > > In a busy network, especially with flow control enabled, we may
> > > > experience timestamp query failures fairly regularly. After a while,
> > > > dmesg may be flooded with timestamp query failure error messages.
> > > >
> > > > Silence the error message from the low level hwrm function that
> > > > sends the firmware message.  Change netdev_err() to netdev_WARN_ONCE()
> > > > if this FW call ever fails.
> > >
> > > This is starting to cause a warning now, which is not ideal, because
> > > this error-now-warning happens quite frequently in Meta's fleet.
> > >
> > > At the same time, we want to have our kernels running warninglessly.
> > > Moreover, the call stack displayed by the warning doesn't seem to be
> > > quite useful and doees not help to investigate "the problem", I _think_.
> > >
> > > Is it OK to move it back to error, something as:
> > >
> > > -       netdev_WARN_ONCE(bp->dev,
> > > +       netdev_err_once(bp->dev,
> > >                          "TS query for TX timer failed rc = %x\n", rc);
> >
> > Hi Breno, I think it is OK to change.
> > Would you be submitting a patch for this?
> >
> 
> Why not netdev_warn_once()?  It will just print a message at the
> warning level without the stack trace.  I think we consider this
> condition to be just a warning and not an error.  Thanks.

This is even better. I will send a patch shortly.

Thanks


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

end of thread, other threads:[~2024-01-25  9:52 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12  0:51 [PATCH net-next 00/13] bnxt_en: Update for net-next Michael Chan
2023-12-12  0:51 ` [PATCH net-next 01/13] bnxt_en: Fix trimming of P5 RX and TX rings Michael Chan
2023-12-12  0:51 ` [PATCH net-next 02/13] bnxt_en: Fix AGG ring check logic in bnxt_check_rings() Michael Chan
2023-12-12  0:51 ` [PATCH net-next 03/13] bnxt_en: Fix TX ring indexing logic Michael Chan
2023-12-12  0:51 ` [PATCH net-next 04/13] bnxt_en: Prevent TX timeout with a very small TX ring Michael Chan
2023-12-12  0:51 ` [PATCH net-next 05/13] bnxt_en: Support TX coalesced completion on 5760X chips Michael Chan
2023-12-12  0:51 ` [PATCH net-next 06/13] bnxt_en: Allocate extra QP backing store memory when RoCE FW reports it Michael Chan
2023-12-12  0:51 ` [PATCH net-next 07/13] bnxt_en: Use proper TUNNEL_DST_PORT_ALLOC* commands Michael Chan
2023-12-12  0:51 ` [PATCH net-next 08/13] bnxt_en: Add support for VXLAN GPE Michael Chan
2023-12-12  0:51 ` [PATCH net-next 09/13] bnxt_en: Configure UDP tunnel TPA Michael Chan
2023-12-12  0:51 ` [PATCH net-next 10/13] bnxt_en: add rx_filter_miss extended stats Michael Chan
2023-12-12  0:51 ` [PATCH net-next 11/13] bnxt_en: Add support for UDP GSO on 5760X chips Michael Chan
2023-12-12  0:51 ` [PATCH net-next 12/13] bnxt_en: Skip nic close/open when configuring tstamp filters Michael Chan
2023-12-12  0:51 ` [PATCH net-next 13/13] bnxt_en: Make PTP TX timestamp HWRM query silent Michael Chan
2024-01-24 10:18   ` Breno Leitao
2024-01-25  3:35     ` Pavan Chebbi
2024-01-25  4:47       ` Michael Chan
2024-01-25  9:52         ` Breno Leitao
2024-01-25  9:51       ` Breno Leitao
2023-12-13  0:10 ` [PATCH net-next 00/13] bnxt_en: Update for net-next patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).