Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=200eef20db6de7535438c9af9becc8169c6cb6c0
Commit:     200eef20db6de7535438c9af9becc8169c6cb6c0
Parent:     1d3bb996481e116f5f2b127cbd29b83365d2cf62
Author:     Dhananjay Phadke <[EMAIL PROTECTED]>
AuthorDate: Mon Sep 3 10:33:35 2007 +0530
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:51:52 2007 -0700

    netxen: ethtool fixes
    
    Resubmitting the patch.
    
    This patch improves ethtool support for printing correct ring statistics,
    segmentation offload status, etc.
    
    Signed-off by: Dhananjay Phadke <[EMAIL PROTECTED]>
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/netxen/netxen_nic.h         |    2 +-
 drivers/net/netxen/netxen_nic_ethtool.c |   27 +++++++++++++++++++++------
 drivers/net/netxen/netxen_nic_init.c    |    7 +++++--
 drivers/net/netxen/netxen_nic_main.c    |    1 +
 4 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 7bbd5d1..fbc2553 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -919,7 +919,7 @@ struct netxen_adapter {
        u16 link_duplex;
        u16 state;
        u16 link_autoneg;
-       int rcsum;
+       int rx_csum;
        int status;
        spinlock_t stats_lock;
 
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c 
b/drivers/net/netxen/netxen_nic_ethtool.c
index 78e4231..cfb847b 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -516,17 +516,17 @@ netxen_nic_get_ringparam(struct net_device *dev, struct 
ethtool_ringparam *ring)
        ring->rx_jumbo_pending = 0;
        for (i = 0; i < MAX_RCV_CTX; ++i) {
                ring->rx_pending += adapter->recv_ctx[i].
-                   rcv_desc[RCV_DESC_NORMAL_CTXID].rcv_pending;
+                   rcv_desc[RCV_DESC_NORMAL_CTXID].max_rx_desc_count;
                ring->rx_jumbo_pending += adapter->recv_ctx[i].
-                   rcv_desc[RCV_DESC_JUMBO_CTXID].rcv_pending;
+                   rcv_desc[RCV_DESC_JUMBO_CTXID].max_rx_desc_count;
        }
+       ring->tx_pending = adapter->max_tx_desc_count;
 
-       ring->rx_max_pending = adapter->max_rx_desc_count;
-       ring->tx_max_pending = adapter->max_tx_desc_count;
-       ring->rx_jumbo_max_pending = adapter->max_jumbo_rx_desc_count;
+       ring->rx_max_pending = MAX_RCV_DESCRIPTORS;
+       ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST;
+       ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS;
        ring->rx_mini_max_pending = 0;
        ring->rx_mini_pending = 0;
-       ring->rx_jumbo_pending = 0;
 }
 
 static void
@@ -731,6 +731,19 @@ netxen_nic_get_ethtool_stats(struct net_device *dev,
        }
 }
 
+static u32 netxen_nic_get_rx_csum(struct net_device *dev)
+{
+       struct netxen_adapter *adapter = netdev_priv(dev);
+       return adapter->rx_csum;
+}
+
+static int netxen_nic_set_rx_csum(struct net_device *dev, u32 data)
+{
+       struct netxen_adapter *adapter = netdev_priv(dev);
+       adapter->rx_csum = !!data;
+       return 0;
+}
+
 struct ethtool_ops netxen_nic_ethtool_ops = {
        .get_settings = netxen_nic_get_settings,
        .set_settings = netxen_nic_set_settings,
@@ -751,4 +764,6 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
        .get_strings = netxen_nic_get_strings,
        .get_ethtool_stats = netxen_nic_get_ethtool_stats,
        .get_sset_count = netxen_get_sset_count,
+       .get_rx_csum = netxen_nic_get_rx_csum,
+       .set_rx_csum = netxen_nic_set_rx_csum,
 };
diff --git a/drivers/net/netxen/netxen_nic_init.c 
b/drivers/net/netxen/netxen_nic_init.c
index 1811bcb..3758926 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1118,10 +1118,13 @@ netxen_process_rcv(struct netxen_adapter *adapter, int 
ctxid,
 
        skb = (struct sk_buff *)buffer->skb;
 
-       if (likely(netxen_get_sts_status(desc) == STATUS_CKSUM_OK)) {
+       if (likely(adapter->rx_csum &&
+                               netxen_get_sts_status(desc) == 
STATUS_CKSUM_OK)) {
                adapter->stats.csummed++;
                skb->ip_summed = CHECKSUM_UNNECESSARY;
-       }
+       } else
+               skb->ip_summed = CHECKSUM_NONE;
+
        skb->dev = netdev;
        if (desc_ctx == RCV_DESC_LRO_CTXID) {
                /* True length was only available on the last pkt */
diff --git a/drivers/net/netxen/netxen_nic_main.c 
b/drivers/net/netxen/netxen_nic_main.c
index b9cde65..2a1d6d7 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -409,6 +409,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
        /* This will be reset for mezz cards  */
        adapter->portnum = pci_func_id;
        adapter->status   &= ~NETXEN_NETDEV_STATUS;
+       adapter->rx_csum = 1;
 
        netdev->open               = netxen_nic_open;
        netdev->stop               = netxen_nic_close;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to