Commit Graph

95 Commits (4c48381786159ba3f3d8a33d967aeb049341a220)

Author SHA1 Message Date
Dhananjay Phadke 06db58c0cd netxen: remove unnecessary structures
Remove unnecessary offsetof calulations on these structures:
netxen_board_info, netxen_user_old_info, netxen_new_user_info.

The offsets into the flash are fixed, don't need to be calculated.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-05 12:40:14 -07:00
Dhananjay Phadke 4f96b988e8 netxen: clean up firmware version checks
NX2031 firmware version will never be > 4.0.0, so replace
(adapter->fw_major < 4) checks with pci revision ID check.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-27 11:15:25 -07:00
Dhananjay Phadke 6598b169b8 netxen: enable ip addr hashing
NX3031 hardware requires local IP addresses for packet
accumulation (LRO). IP address hashing is required to
distinguish a local TCP flow from others (forwarded or
guest).

This patch adds listener for IP and netdev events and
configures IP address in the firmware.

Signed-off-by: Amit Kumar Salecha <amit@netxen.com>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-27 10:55:19 -07:00
Dhananjay Phadke 68b3cae082 netxen: refresh firmware info after reset
o move dma mask update to netxen_start_firmware() so that
  if firmware changes across suspend (e.g. file -> flash)
  it reflects right dma mask.
o re-read firmware capabilities after firmware reset.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-27 10:54:18 -07:00
Dhananjay Phadke b2af9cb06d netxen: fix deadlock on dev close
netxen: fix deadlock on dev close

The tx ring accounting fix in commit cb2107be43
("netxen: fix tx ring accounting") introduced intermittent
deadlock when inteface is going down.

This was possibly combined effect of speculative tx pause,
calling netif_tx_lock instead of queue lock and unclean
synchronization with napi which could end up unmasking
interrupt.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-20 08:23:31 -07:00
Dhananjay Phadke cb2107be43 netxen: fix tx ring accounting
This forces every update of tx ring producer to check for
availability of space for next full TSO command. Earlier
firmware control commands didn't care to pause tx queue.

Stop the tx queue if there's not enough space to transmit one full
LSO command left on the tx ring after current transmit. This avoids
returning NETDEV_TX_BUSY after checking distance between producer
and consumer on every cpu.

Restart the tx queue only if we have cleaned up enough tx
descriptors.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-18 00:46:14 -07:00
Dhananjay Phadke d173346040 netxen: fix detection of cut-thru firmware mode
Fix the detection of cut-thru mode of the hardware (direct dma
to host) to mode configured in SRE (ingress block) rather than
onboard memory control.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-18 00:46:14 -07:00
Dhananjay Phadke 23b6cc425d netxen: trivial register access cleanup
Remove unnecessary length parameter since it's always 4 bytes.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-09 13:13:37 -07:00
Dhananjay Phadke 3d0a3cc9d7 netxen: fix bonding support
o Pause traffic during mac addr change.
o Enable setting mac address for NX3031.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-06 15:33:36 -07:00
Dhananjay Phadke 5cf4d323f8 netxen: fix mac list management
o use standard linked list api for mac addr list management
  in NX3031.
o release mac addresses in firmware in dev close().

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-06 15:33:36 -07:00
Dhananjay Phadke 22527864ed netxen: fix race in tx ring acccess
Fix the distance check between tx ring producer and consumer that
could lead to tx ring wrap around.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-06 15:33:35 -07:00
Dhananjay Phadke f7185c7123 netxen: fix firmware download
o hold the firmware in memory across suspend, since filesystem
  may not be up after resuming.
o reset the chip after requesting firmware, to minimize downtime
  for NC-SI.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-28 22:44:31 -07:00
Dhananjay Phadke 4ea528a151 netxen: refactor netxen_recv_context struct
o move related fields into netxen_recv_context struct.
o allocate rx buffer and descriptor rings dynamically.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-28 22:44:31 -07:00
Dhananjay Phadke ea7eaa39ff netxen: cache align register map table
Aligning register offset translation table imporves performance
on rx side.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08 15:58:31 -07:00
Dhananjay Phadke f98a9f693b netxen: sanitize function names
Replace superfluous wrapper functions with two macros:

NXWR32 replaces netxen_nic_reg_write, netxen_nic_write_w0,
netxen_nic_read_w1, netxen_crb_writelit_adapter.

NXRD32 replaces netxen_nic_reg_read, netxen_nic_read_w0,
netxen_nic_read_w1.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08 15:58:29 -07:00
Dhananjay Phadke 1fbe632358 netxen: annotate register access functions
o remove unnecessary length parameter since register access
  width is fixed 4 byte.
o remove superfluous pci_read_normalize and pci_write_normalize
  functions.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08 15:58:28 -07:00
Dhananjay Phadke 3bf26ce3f4 netxen: async link event handling
Add support for asynchronous events from firmware,
received over one of the rx rings.

Add support for event based phy interrupts, enhanced links
status reporting from firmware.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08 15:58:27 -07:00
Dhananjay Phadke d877f1e344 netxen: refactor transmit code
o move tx stuff into nx_host_tx_ring structure, this will
  help managing multiple tx rings in future.
o sanitize some variable names

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08 15:58:25 -07:00
Dhananjay Phadke e98e3350c0 netxen: code cleanup
o remove unused structure defs.
o remove unnecessary includes.
o replace enums with specific #defines.
o reduce footprint of stats structure.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-08 15:58:24 -07:00
David S. Miller 2d6a5e9500 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/igb/igb_main.c
	drivers/net/qlge/qlge_main.c
	drivers/net/wireless/ath9k/ath9k.h
	drivers/net/wireless/ath9k/core.h
	drivers/net/wireless/ath9k/hw.c
2009-03-17 15:01:30 -07:00
Dhananjay Phadke bd257ed9f1 netxen: fix firmware download warnings
Fix following warnings, by using integer firmware types.

drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_load_firmware':
drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1146: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior
drivers/net/netxen/netxen_nic_hw.c:1159: warning: comparison with string literal results in unspecified behavior

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-17 13:14:22 -07:00
Dhananjay Phadke d8b100c5da netxen: add receive side scaling (rss) support
This patch enables the load balancing capability of firmware
and hardware to spray traffic into different cpus through
separate rx msix interrupts.

The feature is being enabled for NX3031, NX2031 (old) will be
enabled later. This depends on msi-x and compatibility with
msi and legacy is maintained by enabling single rx ring.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14 14:00:33 -07:00
Dhananjay Phadke 438627c77b netxen: sanitize variable names
o remove max_ prefix from ring sizes, since they don't really
  represent max possible sizes.
o cleanup naming of rx ring types (normal, jumbo, lro).
o simplify logic to choose rx ring size, gig ports get half
  rx ring of 10 gig ports.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14 14:00:32 -07:00
Dhananjay Phadke 0b72e659a1 netxen: add suspend resume support
Detach network interface on PCI suspend and recreate hardware
context after resumes.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14 14:00:31 -07:00
Dhananjay Phadke fbb52f2272 netxen: fix endianness in serial number
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14 14:00:31 -07:00
Dhananjay Phadke de9307c686 netxen: remove old flash check.
Remove flash size check which made sense only for ancient
boards with 1MB flash. The check is based on values read
from specific locations and fails with firmware size changes.

This prevents driver from getting right mac addresses.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-14 11:40:08 -07:00
Dhananjay Phadke 1e2d0059fc netxen: annotate board_config and board_type
Remove huge board config structure from each instance, read
only necessary fields from flash.

Replace board_type with port_type (1G/10G), there's another
board_type field describing card type (SFP/XFP/CX4).

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-10 05:10:04 -07:00
Dhananjay Phadke 567c6c4e2b netxen: firmware download improvements
o set port mode after resetting device.
o prefer cut-through firmware (doesn't require on-card memory).
o load flashed firmware if newer.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-03 00:05:27 -08:00
Dhananjay Phadke 5d242f1cee netxen: update copyright
Extend copyright into 2009 and update address.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-27 01:00:44 -08:00
Dhananjay Phadke dbf64b10fa netxen: cleanup unused code
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24 16:39:03 -08:00
Dhananjay Phadke ba599d4f0d netxen: firmware download support
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24 16:38:22 -08:00
Dhananjay Phadke 39754f4410 netxen: ratelimit error prints
If for some reason, read from card memory fails the console
get flooded with failure prints. This patch confines print
under printk_ratelimit().

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-17 20:27:02 -08:00
Dhananjay Phadke d8313ce0f1 netxen: fix sparse warnings
Fix following sparse warnings (multiple instances)

warning: restricted degrades to integer
warning: cast to restricted type
warning: incorrect type in argument 3 (different signedness)
warning: context imbalance in 'netxen_nic_hw_write_wx_2M' - different
lock contexts for basic block

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-17 20:26:44 -08:00
Dhananjay Phadke 03e678ee96 netxen: hold tx lock while sending firmware commands
Some firmware commands like mac address addition/deletion are sent
on the transmit ring. So need to hold the tx lock before touching
tx producer/consumer indices.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:49:43 -08:00
Dhananjay Phadke 06e9d9f978 netxen: cleanup mac list on driver unload
This fixes a tiny memory leak when driver is unloaded. The mac
address list maintained in netxen_adapter needs to deleted when
driver is going down.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:49:22 -08:00
Dhananjay Phadke 27c915a4d8 netxen: firmware init fix
o Fix order or rom register writes.
o Reduce udelays when writing rom registers.

This cuts the firmware init time by 40%.

o Do not reset core/memory clocks when reinitializing driver.
  Firmware willl handle this when initialized.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:49:00 -08:00
Dhananjay Phadke c7860a2aec netxen: fix link speed reporting for some boards
o Read negotiated link speed when link state changes.
o Fix link speed reporting for hybrid nic boards, which have both 1Gbps and
  10Gbps ports.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:48:32 -08:00
Dhananjay Phadke 391587c344 netxen: fix ipv6 offload and tx cleanup
o fix the ip/tcp hdr offset in tx descriptors for ipv6.
o cleanup xmit function, move the tso checks into separate function,
  this reduces unnecessary endian conversions back and forth.
o optimize macros to initialize tx descriptors.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:48:11 -08:00
Dhananjay Phadke 2edbb45442 netxen: fix endianness in firmware commands
o Set restricted (little endian) data types in firmware command
  requests and responses.
o Remove unnecessary conversion to LE when writing registers.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-14 20:47:30 -08:00
Hannes Eder f8057b7fef drivers/net/netxen: fix sparse warnings: use NULL pointer instead of plain integer
Fix this sparse warnings:

  drivers/net/netxen/netxen_nic_hw.c:1462:18: warning: Using plain integer as NULL pointer
  drivers/net/netxen/netxen_nic_hw.c:1536:18: warning: Using plain integer as NULL pointer

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-26 00:04:26 -08:00
Wang Chen 4cf1653aa9 netdevice: safe convert to netdev_priv() #part-2
We have some reasons to kill netdev->priv:
1. netdev->priv is equal to netdev_priv().
2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously
   netdev_priv() is more flexible than netdev->priv.
But we cann't kill netdev->priv, because so many drivers reference to it
directly.

This patch is a safe convert for netdev->priv to netdev_priv(netdev).
Since all of the netdev->priv is only for read.
But it is too big to be sent in one mail.
I split it to 4 parts and make every part smaller than 100,000 bytes,
which is max size allowed by vger.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-12 23:38:14 -08:00
Dhananjay Phadke 11d89d6393 netxen: update driver version
Raise driver version to 4.0.11.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-14 04:43:32 -04:00
Dhananjay Phadke 9dc28efeee netxen: fix mac addr setup
For NX3031 mac addr should be read from firmware. mac addr in flash
is still valid, but can be overridden by firmware if running in
virtualization environment.

For old revisions, mac addr is retrieved directly from flash.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-14 04:43:05 -04:00
Andrew Morton 11a859e591 drivers/net/netxen/netxen_nic_hw.c: fix printk warnings
drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_nic_pci_mem_read_direct':
drivers/net/netxen/netxen_nic_hw.c:1414: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'u64'
drivers/net/netxen/netxen_nic_hw.c: In function 'netxen_nic_pci_mem_write_direct':
drivers/net/netxen/netxen_nic_hw.c:1487: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'u64'

You don't know what type was used for u64 hence they cannot be printed without
casting.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07 02:21:17 -04:00
Dhananjay Phadke 9ad27643f3 netxen: fix promisc mode, mtu setting
For NX3031, multicast filtering, promisc mode, and max frame size
setting is handled by firmware, driver needs to send request to
enable/disable it.

For old chip revisions / firmware, driver still sets it directly.

Added function pointer to set mtu according to chip revision.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07 02:11:10 -04:00
Dhananjay Phadke a70f939338 netxen: add new board types
Add couple of new board configurations based on NX3031 chip.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07 02:11:08 -04:00
Dhananjay Phadke 24a7a45511 netxen: fix link status, link speed
For NX3031, the phy is managed by firmware, so driver should avoid
setting any phy registers.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-08-07 02:11:07 -04:00
Dhananjay Phadke 58735567b6 netxen: update driver version
Change driver version to 4.0.0. Netxen firmwares as old as
v3.4.216 are supported.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22 17:52:56 -04:00
Dhananjay Phadke cd1f8160e0 netxen: enable tso6, intr coalescing.
Enable tso6 and ipv6 checksum, interrupt coalescing for NX3031.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22 17:52:54 -04:00
Dhananjay Phadke c9fc891f86 netxen: mtu, mac, link status changes
MAC addr, multicast filters, mtu are set through firmware commands
in firmware v4.0.0+ because of virtualization of physical ports.
Link status is also read from registers allocated by firmware for
each virtual port.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-07-22 17:52:11 -04:00