Patch to add ethtool -g to Spidernet network driver
Subsystems (2)
This patch adds ethtool -g (show ring sizes) support to the Spidernet network driver.
--- drivers/net/spider_net.c | 12 +++++++----- drivers/net/spider_net.h | 3 +++ drivers/net/spider_net_ethtool.c | 13 +++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-)
Index: linux-2.6.18-rc2/drivers/net/spider_net.c
===================================================================
--- linux-2.6.18-rc2.orig/drivers/net/spider_net.c 2006-08-03
12:03:01.000000000 -0500
+++ linux-2.6.18-rc2/drivers/net/spider_net.c 2006-08-04
14:48:28.000000000 -0500
@@ -1612,13 +1612,12 @@ spider_net_open(struct net_device *netde
int result;
result = -ENOMEM;
- if (spider_net_init_chain(card, &card->tx_chain,
- card->descr,
- PCI_DMA_TODEVICE, tx_descriptors))
+ if (spider_net_init_chain(card, &card->tx_chain, card->descr,
+ PCI_DMA_TODEVICE, card->tx_desc))
goto alloc_tx_failed;
if (spider_net_init_chain(card, &card->rx_chain,
- card->descr + tx_descriptors,
- PCI_DMA_FROMDEVICE, rx_descriptors))
+ card->descr + card->rx_desc,
+ PCI_DMA_FROMDEVICE, card->rx_desc))
goto alloc_rx_failed;
/* allocate rx skbs */
@@ -2006,6 +2005,9 @@ spider_net_setup_netdev(struct spider_ne
card->options.rx_csum = SPIDER_NET_RX_CSUM_DEFAULT;
+ card->tx_desc = tx_descriptors;
+ card->rx_desc = rx_descriptors;
+
spider_net_setup_netdev_ops(netdev);
netdev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX;
Index: linux-2.6.18-rc2/drivers/net/spider_net.h
===================================================================
--- linux-2.6.18-rc2.orig/drivers/net/spider_net.h 2006-08-03
12:03:01.000000000 -0500
+++ linux-2.6.18-rc2/drivers/net/spider_net.h 2006-08-04
14:48:26.000000000 -0500
@@ -441,6 +441,9 @@ struct spider_net_card {
/* for ethtool */
int msg_enable;
+ int rx_desc;
+ int tx_desc;
+
struct spider_net_descr descr[0];
};
Index: linux-2.6.18-rc2/drivers/net/spider_net_ethtool.c
===================================================================
--- linux-2.6.18-rc2.orig/drivers/net/spider_net_ethtool.c 2006-08-03
12:03:01.000000000 -0500
+++ linux-2.6.18-rc2/drivers/net/spider_net_ethtool.c 2006-08-04
15:00:22.000000000 -0500
@@ -130,6 +130,18 @@ spider_net_ethtool_set_tx_csum(struct ne
return 0;
}
+static void +spider_net_ethtool_get_ringparam(struct net_device *netdev,
+ struct ethtool_ringparam *ering)
+{
+ struct spider_net_card *card = netdev->priv;
+
+ ering->tx_max_pending = SPIDER_NET_TX_DESCRIPTORS_MAX;
+ ering->tx_pending = card->tx_desc;
+ ering->rx_max_pending = SPIDER_NET_RX_DESCRIPTORS_MAX;
+ ering->rx_pending = card->rx_desc;
+}
+
struct ethtool_ops spider_net_ethtool_ops = {
.get_settings = spider_net_ethtool_get_settings,
.get_drvinfo = spider_net_ethtool_get_drvinfo,
@@ -141,5 +153,6 @@ struct ethtool_ops spider_net_ethtool_op
.set_rx_csum = spider_net_ethtool_set_rx_csum,
.get_tx_csum = spider_net_ethtool_get_tx_csum,
.set_tx_csum = spider_net_ethtool_set_tx_csum,
+ .get_ringparam = spider_net_ethtool_get_ringparam,
};
Signature · 1 line
Jim Lewis
Quoted 5 lines · Jim Lewis
This patch adds ethtool -g (show ring sizes) support to the Spidernet network driver.
Signed-off-by James K Lewis <[email protected]>
ACK, but does not apply:
Applying 'Patch to add ethtool -g to Spidernet network driver'
error: patch fragment without header at line 13: @@ -1612,13 +1612,12 @@ spider_net_open(struct net_device *netde
error: patch fragment without header at line 31: @@ -2006,6 +2005,9 @@ spider_net_setup_netdev(struct spider_ne
error: patch fragment without header at line 47: @@ -441,6 +441,9 @@ struct spider_net_card {
error: patch fragment without header at line 63: @@ -130,6 +130,18 @@ spider_net_ethtool_set_tx_csum(struct ne
error: patch fragment without header at line 82: @@ -141,5 +153,6 @@ struct ethtool_ops spider_net_ethtool_op
fatal: No changes
Quoted 8 lines · On Mon, 14 Aug 2006 14:02:26 -0400 Jeff Garzik <[email protected]> wrote:
Quoted 5 lines · Jim Lewis
This patch adds ethtool -g (show ring sizes) support to the Spidernet network driver.
Signed-off-by James K Lewis <[email protected]>ACK, but does not apply:
I added it to rc4-mm1. I probably fixed it up by hand - I forget - it happens so often :(
I have a really large pile of patches to send out to the subsystem maintainers, so this'll be coming back at you soon via that route.
Quoted 2 lines · Andrew Morton
I have a really large pile of patches to send out to the subsystem maintainers, so this'll be coming back at you soon via that route.
Great, I had hoped that might be the case.
Thanks,
Jeff