net: ll_temac: RX/TX ring size and coalesce ethtool parameters
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
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
@@ -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
@@ -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
PATCH 2/4 net: ll_temac: Remove unused start_p variable
In reply to Esben HaabendalThe 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
@@ -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
PATCH 3/4 net: ll_temac: Make RX/TX ring sizes configurable
In reply to Esben HaabendalAdd 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
@@ -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
PATCH 4/4 net: ll_temac: Add ethtool support for coalesce parameters
In reply to Esben HaabendalPlease 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
@@ -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
David Miller
maintainerFrom: 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_temacdriver.Esben Haabendal (4):
net:ll_temac: Remove unusedtx_bd_nextstruct field
net:ll_temac: Remove unusedstart_pvariable
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.