Skip to contentSkip to conversation

net: ll_temac: RX/TX ring size and coalesce ethtool parameters

PATCH In review Esben Haabendal 2 participants 6 messages Feb 28, 2020 – Mar 1, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover net: ll_temac: RX/TX ring size and coalesce ethtool parameters

This series adds support for RX/TX ring size and irq coalesce ethtool parameters to ll_temac driver.

Esben Haabendal (4):
net: ll_temac: Remove unused tx_bd_next struct field
net: ll_temac: Remove unused start_p variable
net: ll_temac: Make RX/TX ring sizes configurable
net: ll_temac: Add ethtool support for coalesce parameters

 drivers/net/ethernet/xilinx/ll_temac.h      |   8 +-
 drivers/net/ethernet/xilinx/ll_temac_main.c | 198 +++++++++++++++-----
 2 files changed, 154 insertions(+), 52 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/4 net: ll_temac: Remove unused tx_bd_next struct field

The tx_bd_next field was included in the initial commit, commit 92744989533c ("net: add Xilinx ll_temac device driver"), but has never had any real use.

---
 drivers/net/ethernet/xilinx/ll_temac.h      | 1 -
 drivers/net/ethernet/xilinx/ll_temac_main.c | 1 -
 2 files changed, 2 deletions(-)
drivers/net/ethernet/xilinx/ll_temac.h +0 -1
index 53fb8141f1a6..463ef9eaf42d 100644
@@ -372,7 +372,6 @@ struct temac_local {
 	struct cdmac_bd *rx_bd_v;
 	dma_addr_t rx_bd_p;
 	int tx_bd_ci;
-	int tx_bd_next;
 	int tx_bd_tail;
 	int rx_bd_ci;
 	int rx_bd_tail;
drivers/net/ethernet/xilinx/ll_temac_main.c +0 -1
index 9461acec6f70..b0fab9a2056f 100644
@@ -387,7 +387,6 @@ static int temac_dma_bd_init(struct net_device *ndev)
 
 	/* Init descriptor indexes */
 	lp->tx_bd_ci = 0;
-	lp->tx_bd_next = 0;
 	lp->tx_bd_tail = 0;
 	lp->rx_bd_ci = 0;
 	lp->rx_bd_tail = RX_BD_NUM - 1;
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/4 net: ll_temac: Remove unused start_p variable

In reply to Esben Haabendal

The start_p variable was included in the initial commit, commit 92744989533c ("net: add Xilinx ll_temac device driver"), but has never had any real use.

---
 drivers/net/ethernet/xilinx/ll_temac_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -2
index b0fab9a2056f..d6853c44e672 100644
@@ -825,14 +825,13 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	struct temac_local *lp = netdev_priv(ndev);
 	struct cdmac_bd *cur_p;
-	dma_addr_t start_p, tail_p, skb_dma_addr;
+	dma_addr_t tail_p, skb_dma_addr;
 	int ii;
 	unsigned long num_frag;
 	skb_frag_t *frag;
 
 	num_frag = skb_shinfo(skb)->nr_frags;
 	frag = &skb_shinfo(skb)->frags[0];
-	start_p = lp->tx_bd_p + sizeof(*lp->tx_bd_v) * lp->tx_bd_tail;
 	cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
 
 	if (temac_check_tx_bd_space(lp, num_frag + 1)) {
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/4 net: ll_temac: Make RX/TX ring sizes configurable

In reply to Esben Haabendal

Add support for setting the RX and TX ring sizes for this driver using ethtool. Also increase the default RX ring size as the previous default was far too low for good performance in some configurations.

---
 drivers/net/ethernet/xilinx/ll_temac.h      |  2 +
 drivers/net/ethernet/xilinx/ll_temac_main.c | 96 +++++++++++++++------
 2 files changed, 72 insertions(+), 26 deletions(-)
drivers/net/ethernet/xilinx/ll_temac.h +2 -0
index 463ef9eaf42d..8777ec6e21c8 100644
@@ -369,8 +369,10 @@ struct temac_local {
 	/* Buffer descriptors */
 	struct cdmac_bd *tx_bd_v;
 	dma_addr_t tx_bd_p;
+	u32 tx_bd_num;
 	struct cdmac_bd *rx_bd_v;
 	dma_addr_t rx_bd_p;
+	u32 rx_bd_num;
 	int tx_bd_ci;
 	int tx_bd_tail;
 	int rx_bd_ci;
drivers/net/ethernet/xilinx/ll_temac_main.c +70 -26

219 lines not on this page · raw message

Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/4 net: ll_temac: Add ethtool support for coalesce parameters

In reply to Esben Haabendal

Please note that the delays are calculated based on typical parameters. But as TEMAC is an HDL IP, designs may vary, and future work might be needed to make this calculation configurable.

---
 drivers/net/ethernet/xilinx/ll_temac.h      |  5 +-
 drivers/net/ethernet/xilinx/ll_temac_main.c | 98 ++++++++++++++++-----
 2 files changed, 81 insertions(+), 22 deletions(-)
drivers/net/ethernet/xilinx/ll_temac.h +3 -2
index 8777ec6e21c8..4a73127e10a6 100644
@@ -379,9 +379,10 @@ struct temac_local {
 	int rx_bd_tail;
 
 	/* DMA channel control setup */
-	u32 tx_chnl_ctrl;
-	u32 rx_chnl_ctrl;
+	u8 coalesce_count_tx;
+	u8 coalesce_delay_tx;
 	u8 coalesce_count_rx;
+	u8 coalesce_delay_rx;
 
 	struct delayed_work restart_work;
 };
drivers/net/ethernet/xilinx/ll_temac_main.c +78 -20

139 lines not on this page · raw message

Signature · 1 line
2.25.1
maintainer
#5 lore raw
In reply to Esben Haabendal

From: Esben Haabendal <[email protected]>
Date: Fri, 28 Feb 2020 08:56:42 +0100

Quoted 8 lines

This series adds support for RX/TX ring size and irq coalesce ethtool parameters to ll_temac driver.

Esben Haabendal (4):
net: ll_temac: Remove unused tx_bd_next struct field
net: ll_temac: Remove unused start_p variable
net: ll_temac: Make RX/TX ring sizes configurable
net: ll_temac: Add ethtool support for coalesce parameters

Series applied, thanks.

I supposed not allowing the ring param change when the device is up is one way to avoid the complexity of handling failures.

However, users may find this very limiting since most networking devices allow this operation when the device is up and running.