[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230111143427.1127174-4-jgh@redhat.com>
Date: Wed, 11 Jan 2023 14:34:23 +0000
From: jgh@...hat.com
To: netdev@...r.kernel.org
Cc: Jeremy Harris <jgh@...hat.com>
Subject: [RFC PATCH 3/7] drivers: net: xgene: NIC driver Rx ring ECN
From: Jeremy Harris <jgh@...hat.com>
Sample NIC driver support.
This is the preferred model, usable where the driver has explicit
knowlege of the receive ring size and fill count.
Signed-off-by: Jeremy Harris <jgh@...hat.com>
---
drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 390671640388..4f48f5a8ea8b 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -667,7 +667,8 @@ static bool xgene_enet_errata_10GE_8(struct sk_buff *skb, u32 len, u8 status)
static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring,
struct xgene_enet_raw_desc *raw_desc,
- struct xgene_enet_raw_desc *exp_desc)
+ struct xgene_enet_raw_desc *exp_desc,
+ bool congestion)
{
struct xgene_enet_desc_ring *buf_pool, *page_pool;
u32 datalen, frag_size, skb_index;
@@ -757,6 +758,7 @@ static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring,
rx_ring->rx_packets++;
rx_ring->rx_bytes += datalen;
+ skb->congestion_experienced = congestion;
napi_gro_receive(&rx_ring->napi, skb);
out:
@@ -814,7 +816,9 @@ static int xgene_enet_process_ring(struct xgene_enet_desc_ring *ring,
desc_count++;
}
if (is_rx_desc(raw_desc)) {
- ret = xgene_enet_rx_frame(ring, raw_desc, exp_desc);
+ /* We are congested when the ring is 7/8'ths full
+ */
+ ret = xgene_enet_rx_frame(ring, raw_desc, exp_desc, count > slots * 7 / 8);
} else {
ret = xgene_enet_tx_completion(ring, raw_desc);
is_completion = true;
--
2.39.0
Powered by blists - more mailing lists