sfc changes for 2.6.36
Subsystems (2)
cover sfc changes for 2.6.36
This series changes logging to use the new netif_* macros (except in the MTD driver) and adds RX hash offload.
Ben.
Ben Hutchings (5):
sfc: Log MTD errors using partition name, not just net device name
sfc: Implement message level control
sfc: Replace EFX_DRIVER_NAME with KBUILD_MODNAME
sfc: Disable setting feature flags that are not implemented
sfc: Record hardware RX hash on each skb where possible
drivers/net/sfc/efx.c | 226 +++++++++++++++++++++++--------------- drivers/net/sfc/efx.h | 5 +- drivers/net/sfc/ethtool.c | 61 ++++++++--- drivers/net/sfc/falcon.c | 180 +++++++++++++++++++------------ drivers/net/sfc/falcon_boards.c | 30 +++--- drivers/net/sfc/falcon_xmac.c | 5 +- drivers/net/sfc/io.h | 30 +++-- drivers/net/sfc/mcdi.c | 98 ++++++++++------- drivers/net/sfc/mcdi_mac.c | 8 +- drivers/net/sfc/mcdi_phy.c | 20 ++-- drivers/net/sfc/mdio_10g.c | 39 ++++--- drivers/net/sfc/mdio_10g.h | 3 +- drivers/net/sfc/mtd.c | 23 +++-- drivers/net/sfc/net_driver.h | 43 ++------ drivers/net/sfc/nic.c | 219 +++++++++++++++++++++---------------- drivers/net/sfc/qt202x_phy.c | 42 ++++--- drivers/net/sfc/rx.c | 79 ++++++++++---- drivers/net/sfc/selftest.c | 129 +++++++++++++--------- drivers/net/sfc/siena.c | 47 +++++--- drivers/net/sfc/tenxpress.c | 12 ++- drivers/net/sfc/tx.c | 41 ++++--- 21 files changed, 793 insertions(+), 547 deletions(-)
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 1/5 sfc: Log MTD errors using partition name, not just net device name
--- drivers/net/sfc/mtd.c | 23 ++++++++++++++--------- 1 files changed, 14 insertions(+), 9 deletions(-)
drivers/net/sfc/mtd.c +14 -9
@@ -15,7 +15,6 @@#include <linux/slab.h> #include <linux/rtnetlink.h> -#define EFX_DRIVER_NAME "sfc_mtd"#include "net_driver.h" #include "spi.h" #include "efx.h"
@@ -71,8 +70,10 @@ static int siena_mtd_probe(struct efx_nic *efx);/* SPI utilities */ -static int efx_spi_slow_wait (struct efx_mtd *efx_mtd,bool uninterruptible) +static int +efx_spi_slow_wait (struct efx_mtd_partition *part,bool uninterruptible) { +struct efx_mtd *efx_mtd = part->mtd.priv;const struct efx_spi_device *spi = efx_mtd->spi;struct efx_nic *efx = efx_mtd->efx;u8 status;
@@ -92,7 +93,7 @@ static int efx_spi_slow_wait(struct efx_mtd *efx_mtd, bool uninterruptible)if (signal_pending (current))return -EINTR ; } -EFX_ERR (efx,"timed out waiting for %s\n" , efx_mtd->name); +pr_err ("%s: timed out waiting for %s\n" , part->name, efx_mtd->name);return -ETIMEDOUT ; }
@@ -131,8 +132,10 @@ efx_spi_unlock(struct efx_nic *efx, const struct efx_spi_device *spi)return 0 ; } -static int efx_spi_erase (struct efx_mtd *efx_mtd,loff_t start,size_t len) +static int +efx_spi_erase (struct efx_mtd_partition *part,loff_t start,size_t len) { +struct efx_mtd *efx_mtd = part->mtd.priv;const struct efx_spi_device *spi = efx_mtd->spi;struct efx_nic *efx = efx_mtd->efx;unsigned pos, block_len;
@@ -156,7 +159,7 @@ static int efx_spi_erase(struct efx_mtd *efx_mtd, loff_t start, size_t len) NULL, 0);if (rc)return rc; - rc =efx_spi_slow_wait (efx_mtd, false); + rc =efx_spi_slow_wait (part, false);/* Verify the entire region has been wiped */ memset (empty,0xff ,sizeof (empty));
@@ -198,13 +201,14 @@ static int efx_mtd_erase(struct mtd_info *mtd, struct erase_info *erase)static void efx_mtd_sync (struct mtd_info *mtd) { +struct efx_mtd_partition *part =to_efx_mtd_partition (mtd);struct efx_mtd *efx_mtd = mtd->priv; -struct efx_nic *efx = efx_mtd->efx;int rc; rc = efx_mtd->ops->sync (mtd);if (rc) -EFX_ERR (efx,"%s sync failed (%d)\n" , efx_mtd->name, rc); +pr_err ("%s: %s sync failed (%d)\n" , + part->name, efx_mtd->name, rc); }static void efx_mtd_remove_partition (struct efx_mtd_partition *part)
@@ -338,7 +342,7 @@ static int falcon_mtd_erase(struct mtd_info *mtd, loff_t start, size_t len) rc =mutex_lock_interruptible (&efx->spi_lock);if (rc)return rc; - rc =efx_spi_erase (efx_mtd, part->offset + start, len); + rc =efx_spi_erase (part, part->offset + start, len);mutex_unlock (&efx->spi_lock);return rc; }
@@ -363,12 +367,13 @@ static int falcon_mtd_write(struct mtd_info *mtd, loff_t start,static int falcon_mtd_sync (struct mtd_info *mtd) { +struct efx_mtd_partition *part =to_efx_mtd_partition (mtd);struct efx_mtd *efx_mtd = mtd->priv;struct efx_nic *efx = efx_mtd->efx;int rc;mutex_lock (&efx->spi_lock); - rc =efx_spi_slow_wait (efx_mtd, true); + rc =efx_spi_slow_wait (part, true);mutex_unlock (&efx->spi_lock);return rc; }
Signature · 7 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 2/5 sfc: Implement message level control
In reply to Ben HutchingsReplace EFX_ERR() with netif_err(), EFX_INFO() with netif_info(), EFX_LOG() with netif_dbg() and EFX_TRACE() and EFX_REGDUMP() with netif_vdbg().
Replace EFX_ERR_RL(), EFX_INFO_RL() and EFX_LOG_RL() using explicit calls to net_ratelimit().
Implement the ethtool operations to get and set message level flags, and add a 'debug' module parameter for the initial value.
--- drivers/net/sfc/efx.c | 223 +++++++++++++++++++++++--------------- drivers/net/sfc/efx.h | 5 +- drivers/net/sfc/ethtool.c | 46 ++++++--- drivers/net/sfc/falcon.c | 176 +++++++++++++++++++------------ drivers/net/sfc/falcon_boards.c | 30 +++--- drivers/net/sfc/falcon_xmac.c | 5 +- drivers/net/sfc/io.h | 30 +++-- drivers/net/sfc/mcdi.c | 98 ++++++++++-------- drivers/net/sfc/mcdi_mac.c | 8 +- drivers/net/sfc/mcdi_phy.c | 20 ++-- drivers/net/sfc/mdio_10g.c | 39 ++++--- drivers/net/sfc/mdio_10g.h | 3 +- drivers/net/sfc/net_driver.h | 35 +----- drivers/net/sfc/nic.c | 219 ++++++++++++++++++++++----------------- drivers/net/sfc/qt202x_phy.c | 42 ++++--- drivers/net/sfc/rx.c | 56 ++++++---- drivers/net/sfc/selftest.c | 126 +++++++++++++--------- drivers/net/sfc/siena.c | 42 +++++--- drivers/net/sfc/tenxpress.c | 12 ++- drivers/net/sfc/tx.c | 41 ++++--- 20 files changed, 727 insertions(+), 529 deletions(-)
drivers/net/sfc/efx.c +135 -88
@@ -189,6 +189,13 @@ module_param(irq_adapt_high_thresh, uint, 0644);MODULE_PARM_DESC (irq_adapt_high_thresh,"Threshold score for increasing IRQ moderation" ); +static unsigned debug = (NETIF_MSG_DRV |NETIF_MSG_PROBE | +NETIF_MSG_LINK |NETIF_MSG_IFDOWN | +NETIF_MSG_IFUP |NETIF_MSG_RX_ERR | +NETIF_MSG_TX_ERR |NETIF_MSG_HW ); +module_param (debug, uint,0 ); +MODULE_PARM_DESC (debug,"Bitmapped debugging message enable value" ); +/************************************************************************** * * Utility functions and prototypes
@@ -272,16 +279,16 @@ static int efx_poll(struct napi_struct *napi, int budget) {struct efx_channel *channel = container_of(napi, struct efx_channel, napi_str); +struct efx_nic *efx = channel->efx;int spent; -EFX_TRACE (channel->efx,"channel %d NAPI poll executing on CPU %d\n" , - channel->channel,raw_smp_processor_id ()); +netif_vdbg (efx, intr, efx->net_dev, +"channel %d NAPI poll executing on CPU %d\n" , + channel->channel,raw_smp_processor_id ()); spent =efx_process_channel (channel, budget);if (spent < budget) { -struct efx_nic *efx = channel->efx; -if (channel->channel < efx->n_rx_channels && efx->irq_rx_adaptive &&unlikely (++channel->irq_count ==1000 )) {
@@ -357,7 +364,8 @@ void efx_process_channel_now(struct efx_channel *channel)*/ static int efx_probe_eventq (struct efx_channel *channel) { -EFX_LOG (channel->efx,"chan %d create event queue\n" , channel->channel); +netif_dbg (channel->efx, probe, channel->efx->net_dev, +"chan %d create event queue\n" , channel->channel);return efx_nic_probe_eventq (channel); }
@@ -365,7 +373,8 @@ static int efx_probe_eventq(struct efx_channel *channel)/* Prepare channel's event queue */ static void efx_init_eventq (struct efx_channel *channel) { -EFX_LOG (channel->efx,"chan %d init event queue\n" , channel->channel); +netif_dbg (channel->efx, drv, channel->efx->net_dev, +"chan %d init event queue\n" , channel->channel); channel->eventq_read_ptr =0 ;
@@ -374,14 +383,16 @@ static void efx_init_eventq(struct efx_channel *channel)static void efx_fini_eventq (struct efx_channel *channel) { -EFX_LOG (channel->efx,"chan %d fini event queue\n" , channel->channel); +netif_dbg (channel->efx, drv, channel->efx->net_dev, +"chan %d fini event queue\n" , channel->channel);efx_nic_fini_eventq (channel); }static void efx_remove_eventq (struct efx_channel *channel) { -EFX_LOG (channel->efx,"chan %d remove event queue\n" , channel->channel); +netif_dbg (channel->efx, drv, channel->efx->net_dev, +"chan %d remove event queue\n" , channel->channel);efx_nic_remove_eventq (channel); }
@@ -398,7 +409,8 @@ static int efx_probe_channel(struct efx_channel *channel)struct efx_rx_queue *rx_queue;int rc; -EFX_LOG (channel->efx,"creating channel %d\n" , channel->channel); +netif_dbg (channel->efx, probe, channel->efx->net_dev, +"creating channel %d\n" , channel->channel); rc =efx_probe_eventq (channel);if (rc)
@@ -474,7 +486,8 @@ static void efx_init_channels(struct efx_nic *efx)/* Initialise the channels */ efx_for_each_channel (channel, efx) { -EFX_LOG (channel->efx,"init chan %d\n" , channel->channel); +netif_dbg (channel->efx, drv, channel->efx->net_dev, +"init chan %d\n" , channel->channel);efx_init_eventq (channel);
@@ -501,7 +514,8 @@ static void efx_start_channel(struct efx_channel *channel) {struct efx_rx_queue *rx_queue; -EFX_LOG (channel->efx,"starting chan %d\n" , channel->channel); +netif_dbg (channel->efx, ifup, channel->efx->net_dev, +"starting chan %d\n" , channel->channel);/* The interrupt handler for this channel may set work_pending * as soon as we enable it. Make sure it's cleared before
@@ -526,7 +540,8 @@ static void efx_stop_channel(struct efx_channel *channel)if (!channel->enabled)return ; -EFX_LOG (channel->efx,"stop chan %d\n" , channel->channel); +netif_dbg (channel->efx, ifdown, channel->efx->net_dev, +"stop chan %d\n" , channel->channel); channel->enabled = false;napi_disable (&channel->napi_str);
@@ -548,16 +563,19 @@ static void efx_fini_channels(struct efx_nic *efx)* descriptor caches reference memory we're about to free, * but falcon_reconfigure_mac_wrapper() won't reconnect * the MACs because of the pending reset. */ -EFX_ERR (efx,"Resetting to recover from flush failure\n" ); +netif_err (efx, drv, efx->net_dev, +"Resetting to recover from flush failure\n" );efx_schedule_reset (efx,RESET_TYPE_ALL ); }else if (rc) { -EFX_ERR (efx,"failed to flush queues\n" ); +netif_err (efx, drv, efx->net_dev,"failed to flush queues\n" ); }else { -EFX_LOG (efx,"successfully flushed all queues\n" ); +netif_dbg (efx, drv, efx->net_dev, +"successfully flushed all queues\n" ); }efx_for_each_channel (channel, efx) { -EFX_LOG (channel->efx,"shut down chan %d\n" , channel->channel); +netif_dbg (channel->efx, drv, channel->efx->net_dev, +"shut down chan %d\n" , channel->channel);efx_for_each_channel_rx_queue (rx_queue, channel)efx_fini_rx_queue (rx_queue);
@@ -572,7 +590,8 @@ static void efx_remove_channel(struct efx_channel *channel)struct efx_tx_queue *tx_queue;struct efx_rx_queue *rx_queue; -EFX_LOG (channel->efx,"destroy chan %d\n" , channel->channel); +netif_dbg (channel->efx, drv, channel->efx->net_dev, +"destroy chan %d\n" , channel->channel);efx_for_each_channel_rx_queue (rx_queue, channel)efx_remove_rx_queue (rx_queue);
@@ -623,12 +642,13 @@ void efx_link_status_changed(struct efx_nic *efx)/* Status message for kernel log */ if (link_state->up) { -EFX_INFO (efx,"link up at %uMbps %s-duplex (MTU %d)%s\n" , - link_state->speed, link_state->fd ?"full" :"half" , - efx->net_dev->mtu, - (efx->promiscuous ?" [PROMISC]" :"" )); +netif_info (efx, link, efx->net_dev, +"link up at %uMbps %s-duplex (MTU %d)%s\n" , + link_state->speed, link_state->fd ?"full" :"half" , + efx->net_dev->mtu, + (efx->promiscuous ?" [PROMISC]" :"" )); }else { -EFX_INFO (efx,"link down\n" ); +netif_info (efx, link, efx->net_dev,"link down\n" ); } }
@@ -732,7 +752,7 @@ static int efx_probe_port(struct efx_nic *efx) {int rc; -EFX_LOG (efx,"create port\n" ); +netif_dbg (efx, probe, efx->net_dev,"create port\n" );if (phy_flash_cfg) efx->phy_mode =PHY_MODE_SPECIAL ;
@@ -746,15 +766,16 @@ static int efx_probe_port(struct efx_nic *efx)if (is_valid_ether_addr (efx->mac_address)) {memcpy (efx->net_dev->dev_addr, efx->mac_address,ETH_ALEN ); }else { -EFX_ERR (efx,"invalid MAC address %pM\n" , - efx->mac_address); +netif_err (efx, probe, efx->net_dev,"invalid MAC address %pM\n" , + efx->mac_address);if (!allow_bad_hwaddr) { rc = -EINVAL ; goto err; }random_ether_addr (efx->net_dev->dev_addr); -EFX_INFO (efx,"using locally-generated MAC %pM\n" , - efx->net_dev->dev_addr); +netif_info (efx, probe, efx->net_dev, +"using locally-generated MAC %pM\n" , + efx->net_dev->dev_addr); }return 0 ;
@@ -768,7 +789,7 @@ static int efx_init_port(struct efx_nic *efx) {int rc; -EFX_LOG (efx,"init port\n" ); +netif_dbg (efx, drv, efx->net_dev,"init port\n" );mutex_lock (&efx->mac_lock);
@@ -799,7 +820,7 @@ fail1:static void efx_start_port (struct efx_nic *efx) { -EFX_LOG (efx,"start port\n" ); +netif_dbg (efx, ifup, efx->net_dev,"start port\n" );BUG_ON (efx->port_enabled);mutex_lock (&efx->mac_lock);
@@ -816,7 +837,7 @@ static void efx_start_port(struct efx_nic *efx)/* Prevent efx_mac_work() and efx_monitor() from working */ static void efx_stop_port (struct efx_nic *efx) { -EFX_LOG (efx,"stop port\n" ); +netif_dbg (efx, ifdown, efx->net_dev,"stop port\n" );mutex_lock (&efx->mac_lock); efx->port_enabled = false;
@@ -831,7 +852,7 @@ static void efx_stop_port(struct efx_nic *efx)static void efx_fini_port (struct efx_nic *efx) { -EFX_LOG (efx,"shut down port\n" ); +netif_dbg (efx, drv, efx->net_dev,"shut down port\n" );if (!efx->port_initialized)return ;
@@ -845,7 +866,7 @@ static void efx_fini_port(struct efx_nic *efx)static void efx_remove_port (struct efx_nic *efx) { -EFX_LOG (efx,"destroying port\n" ); +netif_dbg (efx, drv, efx->net_dev,"destroying port\n" ); efx->type->remove_port (efx); }
@@ -863,11 +884,12 @@ static int efx_init_io(struct efx_nic *efx)dma_addr_t dma_mask = efx->type->max_dma_mask;int rc; -EFX_LOG (efx,"initialising I/O\n" ); +netif_dbg (efx, probe, efx->net_dev,"initialising I/O\n" ); rc =pci_enable_device (pci_dev);if (rc) { -EFX_ERR (efx,"failed to enable PCI device\n" ); +netif_err (efx, probe, efx->net_dev, +"failed to enable PCI device\n" ); goto fail1; }
@@ -885,39 +907,45 @@ static int efx_init_io(struct efx_nic *efx) dma_mask >>=1 ; }if (rc) { -EFX_ERR (efx,"could not find a suitable DMA mask\n" ); +netif_err (efx, probe, efx->net_dev, +"could not find a suitable DMA mask\n" ); goto fail2; } -EFX_LOG (efx,"using DMA mask %llx\n" , (unsigned long long ) dma_mask); +netif_dbg (efx, probe, efx->net_dev, +"using DMA mask %llx\n" , (unsigned long long ) dma_mask); rc =pci_set_consistent_dma_mask (pci_dev, dma_mask);if (rc) {/* pci_set_consistent_dma_mask() is not *allowed* to * fail with a mask that pci_set_dma_mask() accepted, * but just in case... */ -EFX_ERR (efx,"failed to set consistent DMA mask\n" ); +netif_err (efx, probe, efx->net_dev, +"failed to set consistent DMA mask\n" ); goto fail2; } efx->membase_phys =pci_resource_start (efx->pci_dev,EFX_MEM_BAR ); rc =pci_request_region (pci_dev,EFX_MEM_BAR ,"sfc" );if (rc) { -EFX_ERR (efx,"request for memory BAR failed\n" ); +netif_err (efx, probe, efx->net_dev, +"request for memory BAR failed\n" ); rc = -EIO ; goto fail3; } efx->membase =ioremap_nocache (efx->membase_phys, efx->type->mem_map_size);if (!efx->membase) { -EFX_ERR (efx,"could not map memory BAR at %llx+%x\n" , - (unsigned long long )efx->membase_phys, - efx->type->mem_map_size); +netif_err (efx, probe, efx->net_dev, +"could not map memory BAR at %llx+%x\n" , + (unsigned long long )efx->membase_phys, + efx->type->mem_map_size); rc = -ENOMEM ; goto fail4; } -EFX_LOG (efx,"memory BAR at %llx+%x (virtual %p)\n" , - (unsigned long long )efx->membase_phys, - efx->type->mem_map_size, efx->membase); +netif_dbg (efx, probe, efx->net_dev, +"memory BAR at %llx+%x (virtual %p)\n" , + (unsigned long long )efx->membase_phys, + efx->type->mem_map_size, efx->membase);return 0 ;
@@ -933,7 +961,7 @@ static int efx_init_io(struct efx_nic *efx)static void efx_fini_io (struct efx_nic *efx) { -EFX_LOG (efx,"shutting down I/O\n" ); +netif_dbg (efx, drv, efx->net_dev,"shutting down I/O\n" );if (efx->membase) {iounmap (efx->membase);
@@ -997,9 +1025,11 @@ static void efx_probe_interrupts(struct efx_nic *efx) xentries[i].entry = i; rc =pci_enable_msix (efx->pci_dev, xentries, n_channels);if (rc >0 ) { -EFX_ERR (efx,"WARNING: Insufficient MSI-X vectors" -" available (%d < %d).\n" , rc, n_channels); -EFX_ERR (efx,"WARNING: Performance may be reduced.\n" ); +netif_err (efx, drv, efx->net_dev, +"WARNING: Insufficient MSI-X vectors" +" available (%d < %d).\n" , rc, n_channels); +netif_err (efx, drv, efx->net_dev, +"WARNING: Performance may be reduced.\n" );EFX_BUG_ON_PARANOID (rc >= n_channels); n_channels = rc; rc = pci_enable_msix(efx->pci_dev, xentries,
@@ -1023,7 +1053,8 @@ static void efx_probe_interrupts(struct efx_nic *efx) }else {/* Fall back to single channel MSI */ efx->interrupt_mode =EFX_INT_MODE_MSI ; -EFX_ERR (efx,"could not enable MSI-X\n" ); +netif_err (efx, drv, efx->net_dev, +"could not enable MSI-X\n" ); } }
@@ -1036,7 +1067,8 @@ static void efx_probe_interrupts(struct efx_nic *efx)if (rc ==0 ) { efx->channel[0 ].irq = efx->pci_dev->irq; }else { -EFX_ERR (efx,"could not enable MSI\n" ); +netif_err (efx, drv, efx->net_dev, +"could not enable MSI\n" ); efx->interrupt_mode =EFX_INT_MODE_LEGACY ; } }
@@ -1090,7 +1122,7 @@ static int efx_probe_nic(struct efx_nic *efx) {int rc; -EFX_LOG (efx,"creating NIC\n" ); +netif_dbg (efx, probe, efx->net_dev,"creating NIC\n" );/* Carry out hardware-type specific initialisation */ rc = efx->type->probe (efx);
@@ -1112,7 +1144,7 @@ static int efx_probe_nic(struct efx_nic *efx)static void efx_remove_nic (struct efx_nic *efx) { -EFX_LOG (efx,"destroying NIC\n" ); +netif_dbg (efx, drv, efx->net_dev,"destroying NIC\n" );efx_remove_interrupts (efx); efx->type->remove (efx);
@@ -1132,14 +1164,14 @@ static int efx_probe_all(struct efx_nic *efx)/* Create NIC */ rc =efx_probe_nic (efx);if (rc) { -EFX_ERR (efx,"failed to create NIC\n" ); +netif_err (efx, probe, efx->net_dev,"failed to create NIC\n" ); goto fail1; }/* Create port */ rc =efx_probe_port (efx);if (rc) { -EFX_ERR (efx,"failed to create port\n" ); +netif_err (efx, probe, efx->net_dev,"failed to create port\n" ); goto fail2; }
@@ -1147,8 +1179,9 @@ static int efx_probe_all(struct efx_nic *efx)efx_for_each_channel (channel, efx) { rc =efx_probe_channel (channel);if (rc) { -EFX_ERR (efx,"failed to create channel %d\n" , - channel->channel); +netif_err (efx, probe, efx->net_dev, +"failed to create channel %d\n" , + channel->channel); goto fail3; } }
@@ -1344,8 +1377,9 @@ static void efx_monitor(struct work_struct *data) struct efx_nic *efx = container_of(data, struct efx_nic, monitor_work.work); -EFX_TRACE (efx,"hardware monitor executing on CPU %d\n" , -raw_smp_processor_id ()); +netif_vdbg (efx, timer, efx->net_dev, +"hardware monitor executing on CPU %d\n" , +raw_smp_processor_id ());BUG_ON (efx->type->monitor ==NULL );/* If the mac_lock is already held then it is likely a port
@@ -1452,8 +1486,8 @@ static int efx_net_open(struct net_device *net_dev)struct efx_nic *efx =netdev_priv (net_dev);EFX_ASSERT_RESET_SERIALISED (efx); -EFX_LOG (efx,"opening device %s on CPU %d\n" , net_dev->name, -raw_smp_processor_id ()); +netif_dbg (efx, ifup, efx->net_dev,"opening device on CPU %d\n" , +raw_smp_processor_id ());if (efx->state ==STATE_DISABLED )return -EIO ;
@@ -1478,8 +1512,8 @@ static int efx_net_stop(struct net_device *net_dev) {struct efx_nic *efx =netdev_priv (net_dev); -EFX_LOG (efx,"closing %s on CPU %d\n" , net_dev->name, -raw_smp_processor_id ()); +netif_dbg (efx, ifdown, efx->net_dev,"closing on CPU %d\n" , +raw_smp_processor_id ());if (efx->state !=STATE_DISABLED ) {/* Stop the device and flush all the channels */
@@ -1532,8 +1566,9 @@ static void efx_watchdog(struct net_device *net_dev) {struct efx_nic *efx =netdev_priv (net_dev); -EFX_ERR (efx,"TX stuck with port_enabled=%d: resetting channels\n" , - efx->port_enabled); +netif_err (efx, tx_err, efx->net_dev, +"TX stuck with port_enabled=%d: resetting channels\n" , + efx->port_enabled);efx_schedule_reset (efx,RESET_TYPE_TX_WATCHDOG ); }
@@ -1552,7 +1587,7 @@ static int efx_change_mtu(struct net_device *net_dev, int new_mtu)efx_stop_all (efx); -EFX_LOG (efx,"changing MTU to %d\n" , new_mtu); +netif_dbg (efx, drv, efx->net_dev,"changing MTU to %d\n" , new_mtu);efx_fini_channels (efx);
@@ -1578,8 +1613,9 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)EFX_ASSERT_RESET_SERIALISED (efx);if (!is_valid_ether_addr (new_addr)) { -EFX_ERR (efx,"invalid ethernet MAC address requested: %pM\n" , - new_addr); +netif_err (efx, drv, efx->net_dev, +"invalid ethernet MAC address requested: %pM\n" , + new_addr);return -EINVAL ; }
@@ -1682,7 +1718,6 @@ static int efx_register_netdev(struct efx_nic *efx) net_dev->watchdog_timeo =5 *HZ ; net_dev->irq = efx->pci_dev->irq; net_dev->netdev_ops = &efx_netdev_ops; -SET_NETDEV_DEV (net_dev, &efx->pci_dev->dev);SET_ETHTOOL_OPS (net_dev, &efx_ethtool_ops);/* Clear MAC statistics */
@@ -1707,7 +1742,8 @@ static int efx_register_netdev(struct efx_nic *efx) rc =device_create_file (&efx->pci_dev->dev, &dev_attr_phy_type);if (rc) { -EFX_ERR (efx,"failed to init net dev attributes\n" ); +netif_err (efx, drv, efx->net_dev, +"failed to init net dev attributes\n" ); goto fail_registered; }
@@ -1715,7 +1751,7 @@ static int efx_register_netdev(struct efx_nic *efx) fail_locked:rtnl_unlock (); -EFX_ERR (efx,"could not register net dev\n" ); +netif_err (efx, drv, efx->net_dev,"could not register net dev\n" );return rc; fail_registered:
@@ -1780,7 +1816,7 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) rc = efx->type->init (efx);if (rc) { -EFX_ERR (efx,"failed to initialise NIC\n" ); +netif_err (efx, drv, efx->net_dev,"failed to initialise NIC\n" ); goto fail; }
@@ -1792,7 +1828,8 @@ int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok)if (rc) goto fail;if (efx->phy_op->reconfigure (efx)) -EFX_ERR (efx,"could not restore PHY settings\n" ); +netif_err (efx, drv, efx->net_dev, +"could not restore PHY settings\n" ); } efx->mac_op->reconfigure (efx);
@@ -1825,13 +1862,14 @@ int efx_reset(struct efx_nic *efx, enum reset_type method)int rc, rc2;bool disabled; -EFX_INFO (efx,"resetting (%s)\n" ,RESET_TYPE (method)); +netif_info (efx, drv, efx->net_dev,"resetting (%s)\n" , +RESET_TYPE (method));efx_reset_down (efx, method); rc = efx->type->reset (efx, method);if (rc) { -EFX_ERR (efx,"failed to reset hardware\n" ); +netif_err (efx, drv, efx->net_dev,"failed to reset hardware\n" ); goto out; }
@@ -1856,10 +1894,10 @@ out:if (disabled) {dev_close (efx->net_dev); -EFX_ERR (efx,"has been disabled\n" ); +netif_err (efx, drv, efx->net_dev,"has been disabled\n" ); efx->state =STATE_DISABLED ; }else { -EFX_LOG (efx,"reset complete\n" ); +netif_dbg (efx, drv, efx->net_dev,"reset complete\n" ); }return rc; }
@@ -1877,7 +1915,8 @@ static void efx_reset_work(struct work_struct *data)/* If we're not RUNNING then don't reset. Leave the reset_pending * flag set so that efx_pci_probe_main will be retried */ if (efx->state !=STATE_RUNNING ) { -EFX_INFO (efx,"scheduled reset quenched. NIC not RUNNING\n" ); +netif_info (efx, drv, efx->net_dev, +"scheduled reset quenched. NIC not RUNNING\n" );return ; }
@@ -1891,7 +1930,8 @@ void efx_schedule_reset(struct efx_nic *efx, enum reset_type type)enum reset_type method;if (efx->reset_pending !=RESET_TYPE_NONE ) { -EFX_INFO (efx,"quenching already scheduled reset\n" ); +netif_info (efx, drv, efx->net_dev, +"quenching already scheduled reset\n" );return ; }
@@ -1915,10 +1955,12 @@ void efx_schedule_reset(struct efx_nic *efx, enum reset_type type) }if (method != type) -EFX_LOG (efx,"scheduling %s reset for %s\n" , -RESET_TYPE (method),RESET_TYPE (type)); +netif_dbg (efx, drv, efx->net_dev, +"scheduling %s reset for %s\n" , +RESET_TYPE (method),RESET_TYPE (type));else -EFX_LOG (efx,"scheduling %s reset\n" ,RESET_TYPE (method)); +netif_dbg (efx, drv, efx->net_dev,"scheduling %s reset\n" , +RESET_TYPE (method)); efx->reset_pending = method;
@@ -2005,6 +2047,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,INIT_WORK (&efx->reset_work, efx_reset_work);INIT_DELAYED_WORK (&efx->monitor_work, efx_monitor); efx->pci_dev = pci_dev; + efx->msg_enable = debug; efx->state =STATE_INIT ; efx->reset_pending =RESET_TYPE_NONE ;strlcpy (efx->name,pci_name (pci_dev),sizeof (efx->name));
@@ -2124,7 +2167,7 @@ static void efx_pci_remove(struct pci_dev *pci_dev)efx_pci_remove_main (efx);efx_fini_io (efx); -EFX_LOG (efx,"shutdown successful\n" ); +netif_dbg (efx, drv, efx->net_dev,"shutdown successful\n" );pci_set_drvdata (pci_dev,NULL );efx_fini_struct (efx);
@@ -2149,13 +2192,15 @@ static int efx_pci_probe_main(struct efx_nic *efx) rc = efx->type->init (efx);if (rc) { -EFX_ERR (efx,"failed to initialise NIC\n" ); +netif_err (efx, probe, efx->net_dev, +"failed to initialise NIC\n" ); goto fail3; } rc =efx_init_port (efx);if (rc) { -EFX_ERR (efx,"failed to initialise port\n" ); +netif_err (efx, probe, efx->net_dev, +"failed to initialise port\n" ); goto fail4; }
@@ -2211,11 +2256,13 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, NETIF_F_HIGHDMA | NETIF_F_TSO); efx =netdev_priv (net_dev);pci_set_drvdata (pci_dev, efx); +SET_NETDEV_DEV (net_dev, &pci_dev->dev); rc =efx_init_struct (efx, type, pci_dev, net_dev);if (rc) goto fail1; -EFX_INFO (efx,"Solarflare Communications NIC detected\n" ); +netif_info (efx, probe, efx->net_dev, +"Solarflare Communications NIC detected\n" );/* Set up basic I/O (BAR mappings etc) */ rc =efx_init_io (efx);
@@ -2253,7 +2300,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev, }if (rc) { -EFX_ERR (efx,"Could not reset NIC\n" ); +netif_err (efx, probe, efx->net_dev,"Could not reset NIC\n" ); goto fail4; }
@@ -2265,7 +2312,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,if (rc) goto fail5; -EFX_LOG (efx,"initialisation successful\n" ); +netif_dbg (efx, probe, efx->net_dev,"initialisation successful\n" );rtnl_lock ();efx_mtd_probe (efx);/* allowed to fail */
@@ -2281,7 +2328,7 @@ static int __devinit efx_pci_probe(struct pci_dev *pci_dev,efx_fini_struct (efx); fail1:WARN_ON (rc >0 ); -EFX_LOG (efx,"initialisation failed. rc=%d\n" , rc); +netif_dbg (efx, drv, efx->net_dev,"initialisation failed. rc=%d\n" , rc);free_netdev (net_dev);return rc; }
drivers/net/sfc/efx.h +3 -2
@@ -106,8 +106,9 @@ extern unsigned int efx_monitor_interval;static inline void efx_schedule_channel (struct efx_channel *channel) { -EFX_TRACE (channel->efx,"channel %d scheduling NAPI poll on CPU%d\n" , - channel->channel,raw_smp_processor_id ()); +netif_vdbg (channel->efx, intr, channel->efx->net_dev, +"channel %d scheduling NAPI poll on CPU%d\n" , + channel->channel,raw_smp_processor_id ()); channel->work_pending = true;napi_schedule (&channel->napi_str);
drivers/net/sfc/ethtool.c +32 -14
105 lines not on this page · raw message
drivers/net/sfc/falcon.c +107 -69
418 lines not on this page · raw message
drivers/net/sfc/falcon_boards.c +16 -14
@@ -106,12 +106,12 @@ static int efx_check_lm87(struct efx_nic *efx, unsigned mask) alarms1 &= mask; alarms2 &= mask >>8 ;if (alarms1 || alarms2) { -EFX_ERR (efx, -"LM87 detected a hardware failure (status %02x:%02x)" -"%s%s\n" , - alarms1, alarms2, - (alarms1 &LM87_ALARM_TEMP_INT ) ?" INTERNAL" :"" , - (alarms1 &LM87_ALARM_TEMP_EXT1 ) ?" EXTERNAL" :"" ); +netif_err (efx, hw, efx->net_dev, +"LM87 detected a hardware failure (status %02x:%02x)" +"%s%s\n" , + alarms1, alarms2, + (alarms1 &LM87_ALARM_TEMP_INT ) ?" INTERNAL" :"" , + (alarms1 &LM87_ALARM_TEMP_EXT1 ) ?" EXTERNAL" :"" );return -ERANGE ; }
@@ -243,7 +243,7 @@ static int sfe4001_poweron(struct efx_nic *efx) (0 <<P0_EN_3V3X_LBN ) | (0 <<P0_EN_5V_LBN ) | (0 << P0_EN_1V0X_LBN));if (rc != out) { -EFX_INFO (efx,"power-cycling PHY\n" ); +netif_info (efx, hw, efx->net_dev,"power-cycling PHY\n" ); rc =i2c_smbus_write_byte_data (ioexp_client,P0_OUT , out);if (rc) goto fail_on;
@@ -269,7 +269,8 @@ static int sfe4001_poweron(struct efx_nic *efx)if (rc) goto fail_on; -EFX_INFO (efx,"waiting for DSP boot (attempt %d)...\n" , i); +netif_info (efx, hw, efx->net_dev, +"waiting for DSP boot (attempt %d)...\n" , i);/* In flash config mode, DSP does not turn on AFE, so * just wait 1 second.
@@ -291,7 +292,7 @@ static int sfe4001_poweron(struct efx_nic *efx) } } -EFX_INFO (efx,"timed out waiting for DSP boot\n" ); +netif_info (efx, hw, efx->net_dev,"timed out waiting for DSP boot\n" ); rc = -ETIMEDOUT ; fail_on:sfe4001_poweroff (efx);
@@ -377,7 +378,7 @@ static void sfe4001_fini(struct efx_nic *efx) {struct falcon_board *board =falcon_board (efx); -EFX_INFO (efx,"%s\n" , __func__); +netif_info (efx, drv, efx->net_dev,"%s\n" , __func__);device_remove_file (&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);sfe4001_poweroff (efx);
@@ -461,7 +462,7 @@ static int sfe4001_init(struct efx_nic *efx)if (rc) goto fail_on; -EFX_INFO (efx,"PHY is powered on\n" ); +netif_info (efx, hw, efx->net_dev,"PHY is powered on\n" );return 0 ; fail_on:
@@ -493,7 +494,7 @@ static int sfn4111t_check_hw(struct efx_nic *efx)static void sfn4111t_fini (struct efx_nic *efx) { -EFX_INFO (efx,"%s\n" , __func__); +netif_info (efx, drv, efx->net_dev,"%s\n" , __func__);device_remove_file (&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);i2c_unregister_device (falcon_board (efx)->hwmon_client);
@@ -742,13 +743,14 @@ int falcon_probe_board(struct efx_nic *efx, u16 revision_info) board->type = &board_types[i];if (board->type) { -EFX_INFO (efx,"board is %s rev %c%d\n" , +netif_info (efx, probe, efx->net_dev,"board is %s rev %c%d\n" , (efx->pci_dev->subsystem_vendor ==EFX_VENDID_SFC ) ? board->type->ref_model : board->type->gen_type,'A' + board->major, board->minor);return 0 ; }else { -EFX_ERR (efx,"unknown board type %d\n" , type_id); +netif_err (efx, probe, efx->net_dev,"unknown board type %d\n" , + type_id);return -ENODEV ; } }
drivers/net/sfc/falcon_xmac.c +3 -2
@@ -81,7 +81,8 @@ int falcon_reset_xaui(struct efx_nic *efx) }udelay (10 ); } -EFX_ERR (efx,"timed out waiting for XAUI/XGXS reset\n" ); +netif_err (efx, hw, efx->net_dev, +"timed out waiting for XAUI/XGXS reset\n" );return -ETIMEDOUT ; }
@@ -256,7 +257,7 @@ static bool falcon_xmac_link_ok_retry(struct efx_nic *efx, int tries)falcon_stop_nic_stats (efx);while (!mac_up && tries) { -EFX_LOG (efx,"bashing xaui\n" ); +netif_dbg (efx, hw, efx->net_dev,"bashing xaui\n" );falcon_reset_xaui (efx);udelay (200 );
drivers/net/sfc/io.h +18 -12
@@ -78,8 +78,9 @@ static inline void efx_writeo(struct efx_nic *efx, efx_oword_t *value, { unsigned long flags __attribute__ ((unused)); -EFX_REGDUMP (efx,"writing register %x with " EFX_OWORD_FMT "\n" , reg, -EFX_OWORD_VAL (*value)); +netif_vdbg (efx, hw, efx->net_dev, +"writing register %x with " EFX_OWORD_FMT "\n" , reg, +EFX_OWORD_VAL (*value));spin_lock_irqsave (&efx->biu_lock, flags);#ifdef EFX_USE_QWORD_IO
@@ -105,8 +106,9 @@ static inline void efx_sram_writeq(struct efx_nic *efx, void __iomem *membase,unsigned int addr = index *sizeof (*value); unsigned long flags __attribute__ ((unused)); -EFX_REGDUMP (efx,"writing SRAM address %x with " EFX_QWORD_FMT "\n" , - addr,EFX_QWORD_VAL (*value)); +netif_vdbg (efx, hw, efx->net_dev, +"writing SRAM address %x with " EFX_QWORD_FMT "\n" , + addr,EFX_QWORD_VAL (*value));spin_lock_irqsave (&efx->biu_lock, flags);#ifdef EFX_USE_QWORD_IO
@@ -129,8 +131,9 @@ static inline void efx_sram_writeq(struct efx_nic *efx, void __iomem *membase,static inline void efx_writed (struct efx_nic *efx,efx_dword_t *value,unsigned int reg) { -EFX_REGDUMP (efx,"writing partial register %x with " EFX_DWORD_FMT "\n" , - reg,EFX_DWORD_VAL (*value)); +netif_vdbg (efx, hw, efx->net_dev, +"writing partial register %x with " EFX_DWORD_FMT "\n" , + reg,EFX_DWORD_VAL (*value));/* No lock required */ _efx_writed (efx, value->u32[0 ], reg);
@@ -155,8 +158,9 @@ static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value, value->u32[3 ] =_efx_readd (efx, reg +12 );spin_unlock_irqrestore (&efx->biu_lock, flags); -EFX_REGDUMP (efx,"read from register %x, got " EFX_OWORD_FMT "\n" , reg, -EFX_OWORD_VAL (*value)); +netif_vdbg (efx, hw, efx->net_dev, +"read from register %x, got " EFX_OWORD_FMT "\n" , reg, +EFX_OWORD_VAL (*value)); }/* Read an 8-byte SRAM entry through supplied mapping,
@@ -177,8 +181,9 @@ static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase,#endif spin_unlock_irqrestore (&efx->biu_lock, flags); -EFX_REGDUMP (efx,"read from SRAM address %x, got " EFX_QWORD_FMT "\n" , - addr,EFX_QWORD_VAL (*value)); +netif_vdbg (efx, hw, efx->net_dev, +"read from SRAM address %x, got " EFX_QWORD_FMT "\n" , + addr,EFX_QWORD_VAL (*value)); }/* Read dword from register that allows partial writes (sic) */
@@ -186,8 +191,9 @@ static inline void efx_readd(struct efx_nic *efx, efx_dword_t *value, unsigned int reg) { value->u32[0 ] =_efx_readd (efx, reg); -EFX_REGDUMP (efx,"read from register %x, got " EFX_DWORD_FMT "\n" , - reg,EFX_DWORD_VAL (*value)); +netif_vdbg (efx, hw, efx->net_dev, +"read from register %x, got " EFX_DWORD_FMT "\n" , + reg,EFX_DWORD_VAL (*value)); }/* Write to a register forming part of a table */
drivers/net/sfc/mcdi.c +56 -42
281 lines not on this page · raw message
drivers/net/sfc/mcdi_mac.c +4 -4
@@ -69,8 +69,8 @@ static int efx_mcdi_get_mac_faults(struct efx_nic *efx, u32 *faults)return 0 ; fail: -EFX_ERR (efx,"%s: failed rc=%d\n" , - __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , + __func__, rc);return rc; }
@@ -110,8 +110,8 @@ int efx_mcdi_mac_stats(struct efx_nic *efx, dma_addr_t dma_addr,return 0 ; fail: -EFX_ERR (efx,"%s: %s failed rc=%d\n" , - __func__, enable ?"enable" :"disable" , rc); +netif_err (efx, hw, efx->net_dev,"%s: %s failed rc=%d\n" , + __func__, enable ?"enable" :"disable" , rc);return rc; }
drivers/net/sfc/mcdi_phy.c +11 -9
@@ -71,7 +71,7 @@ efx_mcdi_get_phy_cfg(struct efx_nic *efx, struct efx_mcdi_phy_data *cfg)return 0 ; fail: -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , __func__, rc);return rc; }
@@ -97,7 +97,7 @@ static int efx_mcdi_set_link(struct efx_nic *efx, u32 capabilities,return 0 ; fail: -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , __func__, rc);return rc; }
@@ -122,7 +122,7 @@ static int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes)return 0 ; fail: -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , __func__, rc);return rc; }
@@ -150,7 +150,7 @@ int efx_mcdi_mdio_read(struct efx_nic *efx, unsigned int bus,return 0 ; fail: -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , __func__, rc);return rc; }
@@ -178,7 +178,7 @@ int efx_mcdi_mdio_write(struct efx_nic *efx, unsigned int bus,return 0 ; fail: -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , __func__, rc);return rc; }
@@ -466,8 +466,8 @@ void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa) rmtadv |= ADVERTISED_Asym_Pause;if ((efx->wanted_fc &EFX_FC_TX ) && rmtadv == ADVERTISED_Asym_Pause) -EFX_ERR (efx,"warning: link partner doesn't support " -"pause frames" ); +netif_err (efx, link, efx->net_dev, +"warning: link partner doesn't support pause frames" ); }static bool efx_mcdi_phy_poll (struct efx_nic *efx)
@@ -483,7 +483,8 @@ static bool efx_mcdi_phy_poll(struct efx_nic *efx) rc =efx_mcdi_rpc (efx,MC_CMD_GET_LINK ,NULL ,0 , outbuf,sizeof (outbuf),NULL );if (rc) { -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , + __func__, rc); efx->link_state.up = false; }else { efx_mcdi_phy_decode_link(
@@ -526,7 +527,8 @@ static void efx_mcdi_phy_get_settings(struct efx_nic *efx, struct ethtool_cmd *e rc =efx_mcdi_rpc (efx,MC_CMD_GET_LINK ,NULL ,0 , outbuf,sizeof (outbuf),NULL );if (rc) { -EFX_ERR (efx,"%s: failed rc=%d\n" , __func__, rc); +netif_err (efx, hw, efx->net_dev,"%s: failed rc=%d\n" , + __func__, rc);return ; } ecmd->lp_advertising =
drivers/net/sfc/mdio_10g.c +23 -16
@@ -63,7 +63,8 @@ static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd, int fault_fatal)/* Read MMD STATUS2 to check it is responding. */ status =efx_mdio_read (efx, mmd,MDIO_STAT2 );if ((status &MDIO_STAT2_DEVPRST ) !=MDIO_STAT2_DEVPRST_VAL ) { -EFX_ERR (efx,"PHY MMD %d not responding.\n" , mmd); +netif_err (efx, hw, efx->net_dev, +"PHY MMD %d not responding.\n" , mmd);return -EIO ; } }
@@ -72,12 +73,14 @@ static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd, int fault_fatal) status =efx_mdio_read (efx, mmd,MDIO_STAT1 );if (status &MDIO_STAT1_FAULT ) {if (fault_fatal) { -EFX_ERR (efx,"PHY MMD %d reporting fatal" -" fault: status %x\n" , mmd, status); +netif_err (efx, hw, efx->net_dev, +"PHY MMD %d reporting fatal" +" fault: status %x\n" , mmd, status);return -EIO ; }else { -EFX_LOG (efx,"PHY MMD %d reporting status" -" %x (expected)\n" , mmd, status); +netif_dbg (efx, hw, efx->net_dev, +"PHY MMD %d reporting status" +" %x (expected)\n" , mmd, status); } }return 0 ;
@@ -103,8 +106,9 @@ int efx_mdio_wait_reset_mmds(struct efx_nic *efx, unsigned int mmd_mask)if (mask &1 ) { stat =efx_mdio_read (efx, mmd,MDIO_CTRL1 );if (stat <0 ) { -EFX_ERR (efx,"failed to read status of" -" MMD %d\n" , mmd); +netif_err (efx, hw, efx->net_dev, +"failed to read status of" +" MMD %d\n" , mmd);return -EIO ; }if (stat &MDIO_CTRL1_RESET )
@@ -119,8 +123,9 @@ int efx_mdio_wait_reset_mmds(struct efx_nic *efx, unsigned int mmd_mask)msleep (spintime); }if (in_reset !=0 ) { -EFX_ERR (efx,"not all MMDs came out of reset in time." -" MMDs still in reset: %x\n" , in_reset); +netif_err (efx, hw, efx->net_dev, +"not all MMDs came out of reset in time." +" MMDs still in reset: %x\n" , in_reset); rc = -ETIMEDOUT ; }return rc;
@@ -142,16 +147,18 @@ int efx_mdio_check_mmds(struct efx_nic *efx, devs1 =efx_mdio_read (efx, probe_mmd,MDIO_DEVS1 ); devs2 =efx_mdio_read (efx, probe_mmd,MDIO_DEVS2 );if (devs1 <0 || devs2 <0 ) { -EFX_ERR (efx,"failed to read devices present\n" ); +netif_err (efx, hw, efx->net_dev, +"failed to read devices present\n" );return -EIO ; } devices = devs1 | (devs2 <<16 );if ((devices & mmd_mask) != mmd_mask) { -EFX_ERR (efx,"required MMDs not present: got %x, " -"wanted %x\n" , devices, mmd_mask); +netif_err (efx, hw, efx->net_dev, +"required MMDs not present: got %x, wanted %x\n" , + devices, mmd_mask);return -ENODEV ; } -EFX_TRACE (efx,"Devices present: %x\n" , devices); +netif_vdbg (efx, hw, efx->net_dev,"Devices present: %x\n" , devices);/* Check all required MMDs are responding and happy. */ while (mmd_mask) {
@@ -219,7 +226,7 @@ static void efx_mdio_set_mmd_lpower(struct efx_nic *efx, {int stat =efx_mdio_read (efx, mmd,MDIO_STAT1 ); -EFX_TRACE (efx,"Setting low power mode for MMD %d to %d\n" , +netif_vdbg (efx, drv, efx->net_dev,"Setting low power mode for MMD %d to %d\n" , mmd, lpower);if (stat &MDIO_STAT1_LPOWERABLE ) {
@@ -349,8 +356,8 @@ int efx_mdio_test_alive(struct efx_nic *efx)if ((physid1 ==0x0000 ) || (physid1 ==0xffff ) || (physid2 ==0x0000 ) || (physid2 ==0xffff )) { -EFX_ERR (efx,"no MDIO PHY present with ID %d\n" , - efx->mdio.prtad); +netif_err (efx, hw, efx->net_dev, +"no MDIO PHY present with ID %d\n" , efx->mdio.prtad); rc = -EINVAL ; }else { rc =efx_mdio_check_mmds (efx, efx->mdio.mmds,0 );
drivers/net/sfc/mdio_10g.h +2 -1
@@ -51,7 +51,8 @@ static inline bool efx_mdio_phyxgxs_lane_sync(struct efx_nic *efx) sync = !!(lane_status &MDIO_PHYXS_LNSTAT_ALIGN );if (!sync) -EFX_LOG (efx,"XGXS lane status: %x\n" , lane_status); +netif_dbg (efx, hw, efx->net_dev,"XGXS lane status: %x\n" , + lane_status);return sync; }
drivers/net/sfc/net_driver.h +6 -29
@@ -13,6 +13,10 @@#ifndef EFX_NET_DRIVER_H #define EFX_NET_DRIVER_H +#if defined(EFX_ENABLE_DEBUG ) && !defined(DEBUG ) +#define DEBUG +#endif +#include <linux/version.h> #include <linux/netdevice.h> #include <linux/etherdevice.h>
@@ -48,35 +52,6 @@#define EFX_WARN_ON_PARANOID (x) do {} while (0)#endif -/* Un-rate-limited logging */ -#define EFX_ERR(efx, fmt, args...) \ -dev_err(&((efx)->pci_dev->dev), "ERR: %s " fmt, efx_dev_name(efx), ##args) - -#define EFX_INFO(efx, fmt, args...) \ -dev_info(&((efx)->pci_dev->dev), "INFO: %s " fmt, efx_dev_name(efx), ##args) - -#ifdef EFX_ENABLE_DEBUG -#define EFX_LOG(efx, fmt, args...) \ -dev_info(&((efx)->pci_dev->dev), "DBG: %s " fmt, efx_dev_name(efx), ##args) -#else -#define EFX_LOG(efx, fmt, args...) \ -dev_dbg(&((efx)->pci_dev->dev), "DBG: %s " fmt, efx_dev_name(efx), ##args) -#endif - -#define EFX_TRACE(efx, fmt, args...) do {} while (0) - -#define EFX_REGDUMP(efx, fmt, args...) do {} while (0) - -/* Rate-limited logging */ -#define EFX_ERR_RL(efx, fmt, args...) \ -do {if (net_ratelimit()) EFX_ERR(efx, fmt, ##args); } while (0) - -#define EFX_INFO_RL(efx, fmt, args...) \ -do {if (net_ratelimit()) EFX_INFO(efx, fmt, ##args); } while (0) - -#define EFX_LOG_RL(efx, fmt, args...) \ -do {if (net_ratelimit()) EFX_LOG(efx, fmt, ##args); } while (0) -/************************************************************************** * * Efx data structures
@@ -662,6 +637,7 @@ union efx_multicast_hash {* @interrupt_mode: Interrupt mode * @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues * @irq_rx_moderation: IRQ moderation time for RX event queues +* @msg_enable: Log message enable flags * @state: Device state flag. Serialised by the rtnl_lock. * @reset_pending: Pending reset method (normally RESET_TYPE_NONE) * @tx_queue: TX DMA queues
@@ -744,6 +720,7 @@ struct efx_nic {enum efx_int_mode interrupt_mode;bool irq_rx_adaptive;unsigned int irq_rx_moderation; +u32 msg_enable;enum nic_state state;enum reset_type reset_pending;
drivers/net/sfc/nic.c +124 -95
393 lines not on this page · raw message
drivers/net/sfc/qt202x_phy.c +24 -18
94 lines not on this page · raw message
drivers/net/sfc/rx.c +34 -22
110 lines not on this page · raw message
drivers/net/sfc/selftest.c +73 -53
261 lines not on this page · raw message
drivers/net/sfc/siena.c +25 -17
96 lines not on this page · raw message
drivers/net/sfc/tenxpress.c +7 -5
@@ -228,7 +228,8 @@ int sft9001_wait_boot(struct efx_nic *efx) boot_stat =efx_mdio_read (efx,MDIO_MMD_PCS ,PCS_BOOT_STATUS_REG );if (boot_stat >=0 ) { -EFX_LOG (efx,"PHY boot status = %#x\n" , boot_stat); +netif_dbg (efx, hw, efx->net_dev, +"PHY boot status = %#x\n" , boot_stat); switch (boot_stat & ((1 << PCS_BOOT_FATAL_ERROR_LBN) | (3 << PCS_BOOT_PROGRESS_LBN) |
@@ -463,10 +464,11 @@ static void sfx7101_check_bad_lp(struct efx_nic *efx, bool link_ok) reg |=PMA_PMD_LED_OFF <<PMA_PMD_LED_RX_LBN ; }else { reg |=PMA_PMD_LED_FLASH <<PMA_PMD_LED_RX_LBN ; -EFX_ERR (efx,"appears to be plugged into a port" -" that is not 10GBASE-T capable. The PHY" -" supports 10GBASE-T ONLY, so no link can" -" be established\n" ); +netif_err (efx, link, efx->net_dev, +"appears to be plugged into a port" +" that is not 10GBASE-T capable. The PHY" +" supports 10GBASE-T ONLY, so no link can" +" be established\n" ); }efx_mdio_write (efx,MDIO_MMD_PMAPMD ,PMA_PMD_LED_OVERR_REG , reg);
drivers/net/sfc/tx.c +24 -17
107 lines not on this page · raw message
Signature · 7 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerRe: [PATCH net-next-2.6 2/5] sfc: Implement message level control
From: Ben Hutchings <[email protected]>
Date: Wed, 23 Jun 2010 22:30:07 +0100
drivers/net/sfc/ethtool.c const struct ethtool_ops efx_ethtool_ops = { · line 873
Quoted 9 lines
drivers/net/sfc/ethtool.c +2
-0@@ -850,6 +866,8 @@ const struct ethtool_ops efx_ethtool_ops = { .get_drvinfo = efx_ethtool_get_drvinfo, .get_regs_len = efx_ethtool_get_regs_len, .get_regs = efx_ethtool_get_regs, + .get_msglevel = efx_ethtool_get_msglevel, + .set_msglevel = efx_ethtool_set_msglevel, .nway_reset = efx_ethtool_nway_reset, .get_link = efx_ethtool_get_link, .get_eeprom_len = efx_ethtool_get_eeprom_len,
davem@sunset:~/src/GIT/net-next-2.6$ egrep get_regs_len drivers/net/sfc/ethtool.c davem@sunset:~/src/GIT/net-next-2.6$
I don't know what tree you're patching this against, but neither net-2.6 nor net-next-2.6 have the context you have here in your patch so these patches do not apply at all.
Re: [PATCH net-next-2.6 2/5] sfc: Implement message level control
Quoted 16 lines · David Miller
From: Ben Hutchings <[email protected]>
Date: Wed, 23 Jun 2010 22:30:07 +0100drivers/net/sfc/ethtool.c const struct ethtool_ops efx_ethtool_ops = { · line 873
Quoted 9 lines
drivers/net/sfc/ethtool.c +2
-0@@ -850,6 +866,8 @@ const struct ethtool_ops efx_ethtool_ops = { .get_drvinfo = efx_ethtool_get_drvinfo, .get_regs_len = efx_ethtool_get_regs_len, .get_regs = efx_ethtool_get_regs, + .get_msglevel = efx_ethtool_get_msglevel, + .set_msglevel = efx_ethtool_set_msglevel, .nway_reset = efx_ethtool_nway_reset, .get_link = efx_ethtool_get_link, .get_eeprom_len = efx_ethtool_get_eeprom_len,davem@sunset:~/src/GIT/net-next-2.6$ egrep get_regs_len drivers/net/sfc/ethtool.c davem@sunset:~/src/GIT/net-next-2.6$
Quoted 3 lines
I don't know what tree you're patching this against, but neither net-2.6 nor net-next-2.6 have the context you have here in your patch so these patches do not apply at all.
I'm hoping you're going to apply
<http://patchwork.ozlabs.org/patch/56308> first.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerRe: [PATCH net-next-2.6 2/5] sfc: Implement message level control
From: Ben Hutchings <[email protected]>
Date: Thu, 24 Jun 2010 04:12:18 +0100
Quoted 2 lines
I'm hoping you're going to apply
<http://patchwork.ozlabs.org/patch/56308> first.
I'm hoping that you will always tell me about such dependencies in the future.
I always work my queue out of order. If I'm heavily backlogged like I am now, I'll sometimes apply much "simpler" to review patch sets before more difficult ones, even if the "difficult" ones are older.
Never assume anything, always state explicitly what tree something is for and whether dependencies exist for things as-yet not applied.
Your style of assuming things makes life real difficult for me.
PATCH 3/5 sfc: Replace EFX_DRIVER_NAME with KBUILD_MODNAME
In reply to Ben Hutchings--- drivers/net/sfc/efx.c | 2 +- drivers/net/sfc/ethtool.c | 2 +- drivers/net/sfc/net_driver.h | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-)
drivers/net/sfc/efx.c +1 -1
@@ -2432,7 +2432,7 @@ static struct dev_pm_ops efx_pm_ops = { };static struct pci_driver efx_pci_driver = { - .name =EFX_DRIVER_NAME , + .name =KBUILD_MODNAME , .id_table = efx_pci_table, .probe = efx_pci_probe, .remove = efx_pci_remove,
drivers/net/sfc/ethtool.c +1 -1
@@ -234,7 +234,7 @@ static void efx_ethtool_get_drvinfo(struct net_device *net_dev, {struct efx_nic *efx =netdev_priv (net_dev); -strlcpy (info->driver,EFX_DRIVER_NAME ,sizeof (info->driver)); +strlcpy (info->driver,KBUILD_MODNAME ,sizeof (info->driver));strlcpy (info->version,EFX_DRIVER_VERSION ,sizeof (info->version));if (efx_nic_rev (efx) >=EFX_REV_SIENA_A0 ) siena_print_fwver(efx, info->fw_version,
drivers/net/sfc/net_driver.h +1 -3
@@ -39,9 +39,7 @@* Build definitions * **************************************************************************/ -#ifndef EFX_DRIVER_NAME -#define EFX_DRIVER_NAME "sfc" -#endif +#define EFX_DRIVER_VERSION "3.0"#ifdef EFX_ENABLE_DEBUG
Signature · 7 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 4/5 sfc: Disable setting feature flags that are not implemented
In reply to Ben Hutchings--- drivers/net/sfc/ethtool.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/sfc/ethtool.c +0 -1
@@ -888,7 +888,6 @@ const struct ethtool_ops efx_ethtool_ops = {/* Need to enable/disable TSO-IPv6 too */ .set_tso = efx_ethtool_set_tso, .get_flags = ethtool_op_get_flags, - .set_flags = ethtool_op_set_flags, .get_sset_count = efx_ethtool_get_sset_count, .self_test = efx_ethtool_self_test, .get_strings = efx_ethtool_get_strings,
Signature · 7 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 5/5 sfc: Record hardware RX hash on each skb where possible
In reply to Ben Hutchings--- drivers/net/sfc/efx.c | 1 + drivers/net/sfc/ethtool.c | 12 ++++++++++++ drivers/net/sfc/falcon.c | 4 +++- drivers/net/sfc/net_driver.h | 4 +++- drivers/net/sfc/rx.c | 23 +++++++++++++++++++++++ drivers/net/sfc/selftest.c | 3 +++ drivers/net/sfc/siena.c | 5 ++++- 7 files changed, 49 insertions(+), 3 deletions(-)
drivers/net/sfc/efx.c +1 -0
@@ -480,6 +480,7 @@ static void efx_init_channels(struct efx_nic *efx)*/ efx->rx_buffer_len = (max (EFX_PAGE_IP_ALIGN ,NET_IP_ALIGN ) +EFX_MAX_FRAME_LEN (efx->net_dev->mtu) + + efx->type->rx_buffer_hash_size + efx->type->rx_buffer_padding); efx->rx_buffer_order =get_order (efx->rx_buffer_len +sizeof (struct efx_rx_page_state ));
drivers/net/sfc/ethtool.c +12 -0
@@ -546,6 +546,17 @@ static u32 efx_ethtool_get_rx_csum(struct net_device *net_dev)return efx->rx_checksum_enabled; } +static int efx_ethtool_set_flags (struct net_device *net_dev,u32 data) +{ +struct efx_nic *efx =netdev_priv (net_dev); +u32 supported = efx->type->offload_features Ð_FLAG_RXHASH ; + +if (data & ~supported) +return -EOPNOTSUPP ; + +return ethtool_op_set_flags (net_dev, data); +} +static void efx_ethtool_self_test (struct net_device *net_dev,struct ethtool_test *test,u64 *data) {
@@ -888,6 +899,7 @@ const struct ethtool_ops efx_ethtool_ops = {/* Need to enable/disable TSO-IPv6 too */ .set_tso = efx_ethtool_set_tso, .get_flags = ethtool_op_get_flags, + .set_flags = efx_ethtool_set_flags, .get_sset_count = efx_ethtool_get_sset_count, .self_test = efx_ethtool_self_test, .get_strings = efx_ethtool_get_strings,
drivers/net/sfc/falcon.c +3 -1
@@ -1581,6 +1581,7 @@ static void falcon_init_rx_cfg(struct efx_nic *efx)EFX_SET_OWORD_FIELD (reg,FRF_BZ_RX_XOFF_MAC_TH , data_xoff_thr);EFX_SET_OWORD_FIELD (reg,FRF_BZ_RX_XON_TX_TH , ctrl_xon_thr);EFX_SET_OWORD_FIELD (reg,FRF_BZ_RX_XOFF_TX_TH , ctrl_xoff_thr); +EFX_SET_OWORD_FIELD (reg,FRF_BZ_RX_HASH_INSRT_HDR ,1 );EFX_SET_OWORD_FIELD (reg,FRF_BZ_RX_INGR_EN ,1 ); }/* Always enable XOFF signal from RX FIFO. We enable
@@ -1861,6 +1862,7 @@ struct efx_nic_type falcon_b0_nic_type = { .evq_ptr_tbl_base = FR_BZ_EVQ_PTR_TBL, .evq_rptr_tbl_base = FR_BZ_EVQ_RPTR, .max_dma_mask = DMA_BIT_MASK(FSF_AZ_TX_KER_BUF_ADDR_WIDTH), + .rx_buffer_hash_size = 0x10, .rx_buffer_padding = 0, .max_interrupt_mode = EFX_INT_MODE_MSIX, .phys_addr_channels = 32, /* Hardware limit is 64, but the legacy
@@ -1868,7 +1870,7 @@ struct efx_nic_type falcon_b0_nic_type = {* channels */ .tx_dc_base = 0x130000, .rx_dc_base = 0x100000, - .offload_features = NETIF_F_IP_CSUM, + .offload_features = NETIF_F_IP_CSUM | NETIF_F_RXHASH, .reset_world_flags = ETH_RESET_IRQ, };
drivers/net/sfc/net_driver.h +3 -1
@@ -845,7 +845,8 @@ static inline unsigned int efx_port_num(struct efx_nic *efx)* @evq_ptr_tbl_base: Event queue pointer table base address * @evq_rptr_tbl_base: Event queue read-pointer table base address * @max_dma_mask: Maximum possible DMA mask -* @rx_buffer_padding: Padding added to each RX buffer +* @rx_buffer_hash_size: Size of hash at start of RX buffer +* @rx_buffer_padding: Size of padding at end of RX buffer * @max_interrupt_mode: Highest capability interrupt mode supported * from &enum efx_init_mode. * @phys_addr_channels: Number of channels with physically addressed
@@ -889,6 +890,7 @@ struct efx_nic_type {unsigned int evq_ptr_tbl_base;unsigned int evq_rptr_tbl_base;u64 max_dma_mask; +unsigned int rx_buffer_hash_size;unsigned int rx_buffer_padding;unsigned int max_interrupt_mode;unsigned int phys_addr_channels;
drivers/net/sfc/rx.c +23 -0
@@ -101,6 +101,19 @@ static inline unsigned int efx_rx_buf_size(struct efx_nic *efx)return PAGE_SIZE << efx->rx_buffer_order; } +static inline u32 efx_rx_buf_hash (struct efx_rx_buffer *buf) +{ +#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS ) ||NET_IP_ALIGN %4 ==0 +return __le32_to_cpup ((const __le32 *)buf->data); +#else +const u8 *data = (const u8 *)buf->data; +return ((u32 )data[0 ] | + (u32 )data[1 ] <<8 | + (u32 )data[2 ] <<16 | + (u32 )data[3 ] <<24 ); +#endif +} +/** * efx_init_rx_buffers_skb - create EFX_RX_BATCH skb-based RX buffers *
@@ -441,6 +454,7 @@ static void efx_rx_packet_lro(struct efx_channel *channel,/* Pass the skb/page into the LRO engine */ if (rx_buf->page) { +struct efx_nic *efx = channel->efx;struct page *page = rx_buf->page;struct sk_buff *skb;
@@ -453,6 +467,11 @@ static void efx_rx_packet_lro(struct efx_channel *channel,return ; } +if (efx->net_dev->features &NETIF_F_RXHASH ) + skb->rxhash =efx_rx_buf_hash (rx_buf); + rx_buf->data += efx->type->rx_buffer_hash_size; + rx_buf->len -= efx->type->rx_buffer_hash_size; +skb_shinfo (skb)->frags[0 ].page = page;skb_shinfo (skb)->frags[0 ].page_offset =efx_rx_buf_offset (rx_buf);
@@ -572,6 +591,10 @@ void __efx_rx_packet(struct efx_channel *channel,skb_put (rx_buf->skb, rx_buf->len); +if (efx->net_dev->features &NETIF_F_RXHASH ) + rx_buf->skb->rxhash =efx_rx_buf_hash (rx_buf); +skb_pull (rx_buf->skb, efx->type->rx_buffer_hash_size); +/* Move past the ethernet header. rx_buf->data still points * at the ethernet header */ rx_buf->skb->protocol = eth_type_trans(rx_buf->skb,
drivers/net/sfc/selftest.c +3 -0
@@ -258,6 +258,9 @@ void efx_loopback_rx_packet(struct efx_nic *efx, payload = &state->payload; + buf_ptr += efx->type->rx_buffer_hash_size; + pkt_len -= efx->type->rx_buffer_hash_size; + received = (struct efx_loopback_payload *) buf_ptr; received->ip.saddr = payload->ip.saddr;if (state->offload_csum)
drivers/net/sfc/siena.c +4 -1
@@ -331,6 +331,7 @@ static int siena_init_nic(struct efx_nic *efx)efx_reado (efx, &temp,FR_AZ_RX_CFG );EFX_SET_OWORD_FIELD (temp,FRF_BZ_RX_DESC_PUSH_EN ,0 ); +EFX_SET_OWORD_FIELD (temp,FRF_BZ_RX_HASH_INSRT_HDR ,1 );EFX_SET_OWORD_FIELD (temp,FRF_BZ_RX_INGR_EN ,1 );efx_writeo (efx, &temp,FR_AZ_RX_CFG );
@@ -636,6 +637,7 @@ struct efx_nic_type siena_a0_nic_type = { .evq_ptr_tbl_base = FR_BZ_EVQ_PTR_TBL, .evq_rptr_tbl_base = FR_BZ_EVQ_RPTR, .max_dma_mask = DMA_BIT_MASK(FSF_AZ_TX_KER_BUF_ADDR_WIDTH), + .rx_buffer_hash_size = 0x10, .rx_buffer_padding = 0, .max_interrupt_mode = EFX_INT_MODE_MSIX, .phys_addr_channels = 32, /* Hardware limit is 64, but the legacy
@@ -643,6 +645,7 @@ struct efx_nic_type siena_a0_nic_type = {* channels */ .tx_dc_base = 0x88000, .rx_dc_base = 0x68000, - .offload_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM, + .offload_features = (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | + NETIF_F_RXHASH), .reset_world_flags = ETH_RESET_MGMT << ETH_RESET_SHARED_SHIFT, };
Signature · 6 lines
1.6.2.5 -- Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH net-next-2.6 5/5] sfc: Record hardware RX hash on each skb where possible
David,
Unfortunately, this version of the patch can hit a hardware bug that results in bogus hashes. Let me know whether you've applied it, and I'll send an incremental or a replacement patch.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.