dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

1571 Commits

Author SHA1 Message Date
Bruce Allan 944ce011cf e1000e: cleanup calls to setup_physical_interface function pointer
Call the MAC ops setup_physical_interface function pointer instead of the
MAC-family-specific function to conform to the rest of the driver design.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 21:38:13 -08:00
Bruce Allan 44abd5c127 e1000e: cleanup use of check_reset_block function pointer
Replace e1000_check_reset_block() inline function with calls to the PHY ops
check_reset_block function pointer.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 21:36:53 -08:00
Bruce Allan 48768329ef e1000e: cleanup use of check_mng_mode function pointer
Replace e1000_check_mng_mode() inline function with calls to the MAC ops
check_mng_mode function pointer.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 21:35:53 -08:00
Bruce Allan 1a46b40fbb e1000e: cleanup: rename e1000e_setup_link() and call as function pointer
Rename e1000e_setup_link() to e1000e_setup_link_generic() to signify the
function is used for more than one MAC-family type.  The 82571-family has
a custom setup_link function which also calls the generic function.  The
ich8lan-family has a custom function which should just be called via the
function pointer.  The 80003es2lan-family just uses the generic function.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 21:34:15 -08:00
Bruce Allan d1964eb138 e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer
Rename e1000e_id_led_init() to e1000e_id_led_init_generic() to signify the
function is used for more than one MAC-family type.  For the ich8lan MAC
family, some MACs use the generic function and others use the function
e1000_id_led_init_pchlan().  In all cases where e1000e_id_led_init() was
called directly, change to call the function pointer to be consistent with
the driver design.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 21:32:49 -08:00
Linus Torvalds b52b80023f One InfiniBand/RDMA regression fix for 3.3:
- mlx4 SR-IOV changes added static exported functions, which doesn't
    build on powerpc at least.  Fix from Doug Ledford for this.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABCAAGBQJPSEe5AAoJEENa44ZhAt0hIoUP/jwpxojruN8c7PuJesp3sne2
 45xxH0OsPSFdYTBnNZGtL3MWnzp88YjoggRvrKGmiEc/vitDTveL8/j+jFatl/d5
 o5yBq9wsSKgU3jJiczT21WBOIg2I8KGgdWozNSO8rUl++fHJGgH1sCSmf8biomnk
 dlHZbA4ZszH1bxHh406GK/+cP5jjKlTLqkixz/156fsopMxzHBaJycOmzSPpHl9s
 ykrVv3n/mhrc3zBgx5y9aU+LhcchZH6CBQOzLBks1c4w8AFXTxIMAQRhkBVnDksi
 zZhg5E05zRkynr27zebNnu6Y6hfWamfCHkM6krJLXL/QRfN0LmoLvdtW2HRffrHW
 9eOzEdmh9i5wHSeH5zhQAE17yttpWQCNN1thGv3oe2uGj7ItmtA1yc/5q8opwBU3
 bl4/saNVdK8DGtpGZjCmPBnsOl9IgMmYMn5haRmOhDvD4/B93OHl+2iQi50vPJHS
 bBvYG03OTHYs9QexDANDv3Q9VmxGRCBXcZkQblAqofgO3dLgCQdddwn0VHt9xDfK
 5Hp31vPs5pGfT6AkPHREHNNvj27Ve1erjrODNVI/Qr2CIkaoiQ/6oR+9ZMrAFsnb
 uyhNDzt4yuMrfA3T/7sAITL6hFLkVHYL2lSorFr5BXZ4cusYlzUYHRbtiR17Vsye
 1KNTElxLI9fmD5xJSY6N
 =mHhD
 -----END PGP SIGNATURE-----

Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

One InfiniBand/RDMA regression fix for 3.3:

 - mlx4 SR-IOV changes added static exported functions, which doesn't
   build on powerpc at least.  Fix from Doug Ledford for this.

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  mlx4_core: Exported functions can't be static
2012-02-24 20:03:14 -08:00
David S. Miller b072342e26 Merge branch 'sfc-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc 2012-02-24 22:12:44 -05:00
Ben Hutchings ff3bc1e752 sfc: Fix assignment of ip_summed for pre-allocated skbs
When pre-allocating skbs for received packets, we set ip_summed =
CHECKSUM_UNNCESSARY.  We used to change it back to CHECKSUM_NONE when
the received packet had an incorrect checksum or unhandled protocol.

Commit bc8acf2c8c ('drivers/net: avoid
some skb->ip_summed initializations') mistakenly replaced the latter
assignment with a DEBUG-only assertion that ip_summed ==
CHECKSUM_NONE.  This assertion is always false, but it seems no-one
has exercised this code path in a DEBUG build.

Fix this by moving our assignment of CHECKSUM_UNNECESSARY into
efx_rx_packet_gro().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-25 00:10:22 +00:00
Santosh Nayak 21ca54e99b enic: Fix endianness bug.
Sparse complaints the endian bug.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 17:53:03 -05:00
Danny Kukawka 2d5ba83551 xscale/ixp2000/ixpdev: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Lennert Buytenhek <kernel@wantstofly.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 15:41:00 -05:00
Danny Kukawka d558950efc sun/sunqe: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 15:40:59 -05:00
Danny Kukawka f794e7efe4 ixgbevf: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 15:40:59 -05:00
Danny Kukawka bbf7bd2f04 dec/tulip/de4x5: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 15:40:59 -05:00
Danny Kukawka 66dc92eddf cirrus/mac89x0: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM instead
of custom code.

Use memcpy to set the address to dev->dev_addr in set_mac_address,
instead of mxing it up in a for loop with printing a debug msg.

Check also if the given address is valid.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 15:40:59 -05:00
Danny Kukawka f27fd49962 amd/hplance.c: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 15:40:59 -05:00
Tushar Dave e29b5d8f08 v2 e1000: Neaten e1000_dump function
Use pr_<level> for printk
Use temporary instead of multiple pr_conts
Coalesce formats.

Save a few bytes of object code too:

$ size drivers/net/ethernet/intel/e1000/e1000_main.o*
   text	   data	    bss	    dec	    hex	filename
  60507	    369	  14120	  74996	  124f4
drivers/net/ethernet/intel/e1000/e1000_main.o.new
  60717	    369	  14176	  75262	  125fe
drivers/net/ethernet/intel/e1000/e1000_main.o.old

Removed printing of pktdata.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 02:03:43 -08:00
Joe Perches 542c3f4ea9 e1000: Neaten e1000_config_dsp_after_link_change
Separate a complicated bit of e1000_config_dsp_after_link_change
into a new static function e1000_1000Mb_check_cable_length.

Reduces indentation and adds a bit of clarity.

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 02:02:13 -08:00
Bruce Allan dffcdde769 e1000e: cosmetic comment changes to make lines less than 80 characters
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:59:37 -08:00
Bruce Allan b4d8e21dd8 e1000e: cosmetic change to boolean comparisons
Recent discussions on LKML, kernel-janitors, linux-wireless and netdev
have suggested boolean comparisons should use logical operators instead of
equality comparisons with true/false.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:58:27 -08:00
Ben Greear 79d0c1d26e r8169: Support RX-FCS flag.
This allows the NIC to receive the Ethernet FCS
and pass it up the stack, allowing sniffers and
other interested programs to inspect the FCS.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-24 01:56:32 -08:00
Ben Greear 6bbe021d40 r8169: Support RX-ALL flag.
This allows the NIC to receive packets with bad FCS and
Runts, which can help when sniffing.

NOTE:  r8169, at least on my NIC, silently drops packets
with bad FCS instead of counting them.  It seems they are
only received in any fashion if the RxCRC flag is set
(which this patch allows).

Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-24 01:56:27 -08:00
Ben Greear eeb69aa443 8139too: Support RX-FCS flag.
This allows the NIC to pass the Ethernet FCS on up
the stack, and is useful when sniffing networks.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-24 01:56:24 -08:00
Ben Greear d95089dc54 8139too: Support RX-ALL logic.
This allows the NIC to receive Runts and frames with bad
Ethernet Frame Checksums (FCS).

Useful to sniffing & diagnosing bad networks.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2012-02-24 01:56:08 -08:00
Ben Greear b0d1562c82 e1000: Support RX-FCS flag.
This allows the NIC to pass the Ethernet Frame Checksum
(FCS) up the stack.  Useful when sniffing packets.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:53:39 -08:00
Ben Greear 11a78dcf35 e1000: Support sending custom Ethernet CRC.
Good for testing the RX logic for bad CRC handling.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:45:57 -08:00
Ben Greear cf955e6c96 e1000e: Support RXALL feature flag.
This allows the NIC to receive all frames available, including
those with bad FCS, un-matched vlans, ethernet control frames,
and more.

Tested by sending frames with bad FCS.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:44:50 -08:00
Ben Greear 943146de22 e1000e: Support sending custom Ethernet CRC.
This can aid with testing the RX logic for bad
CRCs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:41:00 -08:00
Ben Greear 0184039a4b e1000e: Support RXFCS feature flag.
This enables enabling/disabling reception of the Ethernet
FCS.  This can be useful when sniffing packets.

For e1000e, enabling RXFCS can change the default
behaviour for how the NIC handles CRC.  Disabling RXFCS
will take the NIC back to defaults, which can be configured
as part of the module options.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-24 01:23:06 -08:00
Christian Riesch 5d69703263 davinci_emac: Do not free all rx dma descriptors during init
This patch fixes a regression that was introduced by

commit 0a5f384677
davinci_emac: Add Carrier Link OK check in Davinci RX Handler

Said commit adds a check whether the carrier link is ok. If the link is
not ok, the skb is freed and no new dma descriptor added to the rx dma
channel. This causes trouble during initialization when the carrier
status has not yet been updated. If a lot of packets are received while
netif_carrier_ok returns false, all dma descriptors are freed and the
rx dma transfer is stopped.

The bug occurs when the board is connected to a network with lots of
traffic and the ifconfig down/up is done, e.g., when reconfiguring
the interface with DHCP.

The bug can be reproduced by flood pinging the davinci board while doing
ifconfig eth0 down
ifconfig eth0 up
on the board.

After that, the rx path stops working and the overrun value reported
by ifconfig is counting up.

This patch reverts commit 0a5f384677
and instead issues warnings only if cpdma_chan_submit returns -ENOMEM.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: <stable@vger.kernel.org>
Cc: Hegde, Vinay <vinay.hegde@ti.com>
Cc: Cyril Chemparathy <cyril@ti.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 03:25:10 -05:00
Christian Riesch 7c3a95a15a davinci_mdio: Correct bitmask for clock divider value
The CLKDIV bitfield in the MDIO Control Register is a 16 bit field,
therefore the CLKDIV value may range from 0 to 0xffff.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 03:24:18 -05:00
Christian Riesch b4ad042813 davinci_cpdma: Fix channel number written to teardown registers
chan->chan_num is 0..CPDMA_MAX_CHANNELS-1 for tx channels and
CPDMA_MAX_CHANNELS..2*CPDMA_MAX_CHANNELS-1 for rx channels. However,
the rx and tx teardown registers expect zero based channel numbering.

Since the upper bits of the registers are reserved, the teardown also
worked before, this patch is cleanup only.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 03:23:37 -05:00
Yevgeny Petrilin 1e0f03d57d mlx4_core: Fixing array indexes when setting port types
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 01:52:45 -05:00
Sathya Perla d708f6039b be2net: update driver version
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 01:50:16 -05:00
Sathya Perla 1ca7ba921e be2net: enable RSS for ipv6 pkts
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 01:50:16 -05:00
Sathya Perla 1cfafab965 be2net: reset queue address after freeing
This will prevent double free in some cases where be_clear() is called
for cleanup when be_setup() fails half-way.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 01:50:16 -05:00
Sathya Perla 0ae57bb3df be2net: fix tx completion cleanup
As a part of be_close(), instead of waiting for a max of 200ms for each TXQ,
wait for a total of 200ms for completions from all TXQs to arrive.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 01:50:16 -05:00
Sathya Perla 191eb75631 be2net: cancel be_worker during EEH recovery
EEH recovery involves ring cleanup and re-creation. The worker
thread must not run during EEH cleanup/resume.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-24 01:50:16 -05:00
Danny Kukawka 504f9b5a6b ethernet: unify return value of .ndo_set_mac_address if address is invalid
Unify return value of .ndo_set_mac_address if the given address
isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does
if is_valid_ether_addr() fails.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-23 17:03:20 -05:00
David S. Miller 32d219ed61 Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next 2012-02-23 14:30:46 -05:00
Doug Ledford 22c8bff6fa mlx4_core: Exported functions can't be static
At least on powerpc, it breaks the build if exported functions are
static.  Fix some static exported functions introduced with the mlx4
SR-IOV support added in 3.3-rc1.

Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-02-22 23:00:38 -08:00
Matt Carlson 21f7638e6f tg3: Create timer helper functions
This patch seeks to clean up the timer related code.  It begins by
moving one-time timer setup code from tg3_open() to tg3_init_one().
It then creates a function that encapsulates the code needed to start
the timer.  A tg3_timer_stop() function was added for parity.  Finally,
this patch moves all the timer functions to a more suitable location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-23 01:57:17 -05:00
Matt Carlson c71013597d tg3: Clear RECOVERY_PENDING with reset_task_cancel
If an error happens in the tx completion thread, tg3_reset_task will be
scheduled and TX_RECOVERY_PENDING will be set.  The TX_RECOVERY_PENDING
flag causes tg3_poll[_msix] to return early before doing much of its
work.  Tg3_reset_task() gets canceled when the configuration of the
device is changing, which always results in a chip reset.  When this
happens, the TX_RECOVERY_PENDING flag may be left set, which would
unnecessarily hinder tg3_poll from doing work.  This patch fixes the
problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-23 01:57:17 -05:00
Matt Carlson d13ba512cb tg3: Remove SPEED_UNKNOWN checks
tg3_phy_copper_begin() has code that configures the link
advertisements through the use of the link_config.speed and
link_config.duplex members.  The driver does not internally use these
members in this way, nor is it (currently) permitted via the ethtool
interface.  This patch removes the dead code.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-23 01:57:17 -05:00
Matt Carlson 34655ad638 tg3: Fix link check in tg3_adjust_link
The tg3 driver tried to detect link changes by comparing the tg3 local
active_speed member with SPEED_UNKNOWN (or formerly SPEED_INVALID).
This check is not correct, since phylib will never set its speed member
to either of these two values.  The code only appeared to work because
tg3 initializes active_speed to SPEED_INVALID during tg3_init_one.  This
patch introduces a new "old_link" tg3 member and then compares the
phy_device's link member against it to detect link state changes.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-23 01:57:17 -05:00
Ben Hutchings 73e0026fb2 sfc: Correct efx_for_each_possible_channel_tx_queue() to skip non-TX channels
efx_for_each_possible_channel_tx_queue() should do nothing for RX-only
or extra channels.  The current definition results in allocating
additional unused hardware TX queues when using the mqprio qdisc and
either separate_tx_channels or SR-IOV.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-23 00:45:50 +00:00
Ben Hutchings 2d0cc56da3 sfc: Minor formatting cleanup
Fix some indentation and line continuations.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-22 20:48:38 +00:00
Ben Hutchings c92aaff18e sfc: Reverse initial buffer table allocation to allow for later resizing
We have a very simple way of allocating buffer table entries to
queues, which is just to take the next one available.  The extra
channels are the highest numbered channels but they need to be
allocated the lowest entries so that the traffic channels can be
allocated new entries without any collisions.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-22 20:48:08 +00:00
Ben Hutchings 01cb543db8 sfc: Correct validation of peer_page_count in efx_vfdi_set_status_page()
efx_vfdi_set_status_page() validates the peer page count by
calculating the size of a request containing that many addresses and
comparing that with the maximum valid request size (4KB).  The
calculation involves a multiplication that may overflow on a 32-bit
system.

We use kcalloc() to allocate memory to store the addresses; that also
does a multiplication and it does check for integer overflow, so any
values larger than 0x1fffffff will be rejected.  However, values in
the range [0x1fffffffc, 0x1fffffff] pass boh tests and result in an
attempt to allocate nearly 4GB on the heap.  This should be rejected
rather quickly as it's obviously impossible on a 32-bit system, and
indeed the maximum possible heap allocation is 32MB.  Still, let's
make absolutely sure by fixing the initial validation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-22 20:48:08 +00:00
Ben Hutchings c3cb2a8741 sfc: Specify that the VFDI status page has page alignment and size
This requirement was meant to be implied in the name 'status page'.
One out-of-tree VF driver allocates a buffer using the structure size
and not a full page - hence the current odd specification - but in
practice that allocation will be padded and aligned to at least 4KB.
Therefore, we can specify this and have the option to extend the
structure up to 4KB without worrying about VF drivers using odd-shaped
buffers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-22 20:48:07 +00:00
RongQing.Li 0541743b4b ethernet/broadcom: ip6_route_output() never returns NULL.
ip6_route_output() never returns NULL, so it is wrong to
check if the return value is NULL.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-22 15:30:14 -05:00
Danny Kukawka b049aadca3 3com/typhoon: reuse eth_mac_addr()
Use eth_mac_addr() for .ndo_set_mac_address, remove
typhoon_set_mac_address() since it do currently the same as
eth_mac_addr(). Additional advantage: eth_mac_addr() already
checks if the given address is valid.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Dave Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-22 14:46:37 -05:00
Guo-Fu Tseng ba9adbe67e jme: Fix FIFO flush issue
Set the RX FIFO flush watermark lower.
According to Federico and JMicron's reply,
setting it to 16QW would be stable on most platforms.
Otherwise, user might experience packet drop issue.

CC: stable@kernel.org
Reported-by: Federico Quagliata <federico@quagliata.org>
Fixed-by: Federico Quagliata <federico@quagliata.org>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-22 14:44:41 -05:00
Davidlohr Bueso f274fd9a03 tg3: remove IRQF_SAMPLE_RANDOM flag
This driver is the last user of the IRQF_SAMPLE_RANDOM flag for net drivers, and since add_*_randomness
interfaces have now deprecated the flag as a source of external noise, we can remove it.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-22 14:43:48 -05:00
Yevgeny Petrilin 3d8f93083b mlx4: Setting new port types after all interfaces unregistered
In port type change flow, need to set the new port types only after
all interfaces have finished the unregister process.
Otherwise, during unregister, one of the interfaces might issue a SET_PORT
command with wrong port types, it can cause bad FW behavior.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-21 15:27:24 -05:00
Yevgeny Petrilin 730c41d5ba mlx4: Replacing pool_lock with mutex
Under the spinlock we call request_irq(), which allocates memory with GFP_KERNEL,
This causes the following trace when DEBUG_SPINLOCK is enabled, it can cause
the following trace:

 BUG: spinlock wrong CPU on CPU#2, ethtool/2595
 lock: ffff8801f9cbc2b0, .magic: dead4ead, .owner: ethtool/2595, .owner_cpu: 0
 Pid: 2595, comm: ethtool Not tainted 3.0.18 #2
 Call Trace:
 spin_bug+0xa2/0xf0
 do_raw_spin_unlock+0x71/0xa0
 _raw_spin_unlock+0xe/0x10
 mlx4_assign_eq+0x12b/0x190 [mlx4_core]
 mlx4_en_activate_cq+0x252/0x2d0 [mlx4_en]
 ? mlx4_en_activate_rx_rings+0x227/0x370 [mlx4_en]
 mlx4_en_start_port+0x189/0xb90 [mlx4_en]
 mlx4_en_set_ringparam+0x29a/0x340 [mlx4_en]
 dev_ethtool+0x816/0xb10
 ? dev_get_by_name_rcu+0xa4/0xe0
 dev_ioctl+0x2b5/0x470
 handle_mm_fault+0x1cd/0x2d0
 sock_do_ioctl+0x5d/0x70
 sock_ioctl+0x79/0x2f0
 do_vfs_ioctl+0x8c/0x340
 sys_ioctl+0xa1/0xb0
 system_call_fastpath+0x16/0x1b

Replacing with mutex, which is enough in this case.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-21 15:27:23 -05:00
Dmitry Kravkov 0b0a635f79 bnx2x: update driver version to 1.72.10-0
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 19:34:08 -05:00
Dmitry Kravkov fe603b4d68 bnx2x: add gro_check
The patch provides workaround for BUG in FW 7.2.16,
which in GRO mode may miscalculate buffer and
place on SGE one frag less than it could.
It may happen only for some MTUs, we mark these MTUs
with gro_check flag during device initialization or
MTU change.

Next FW should include fix for the issue and the
patch could be reverted.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 19:34:08 -05:00
Michael Chan e65de0716f cnic: update for FW 7.2.xx
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 19:34:08 -05:00
Dmitry Kravkov 621b4d66b2 use FW 7.2.16
The patch integrates FW 7.2.16 HSI and implements driver
part of GRO flow.

FW 7.2.16 adds the ability to aggregate packets for GRO
(and not just LRO) and also fixes some bugs.

1. Added new aggregation mode: GRO. In this mode packets are aggregated
   such that the original packets can be reconstructed by the OS.
2. 57712 HW bug workaround - initialized all CAM TM registers to 0x32.
3. Adding the FCoE statistics structures to the BNX2X HSI.
4. Wrong configuration of TX HW input buffer size may cause theoretical
   performance effect. Performed configuration fix.
5. FCOE - Arrival of packets beyond task IO size can lead to crash.
   Fix firmware data-in flow.
6. iSCSI - In rare cases of on-chip termination the graceful termination
   timer hangs, and the termination doesn't complete. Firmware fix to MSL
   timer tolerance.
7. iSCSI - Chip hangs when target sends FIN out-of-order or with isles
   open at the initiator side. Firmware implementation corrected to drop
   FIN received out-of-order or with isles still open.
8. iSCSI - Chip hangs when in case of retransmission not aligned to 4-bytes
   from the beginning of iSCSI PDU. Firmware implementation corrected
   to support arbitrary aligned retransmissions.
9. iSCSI - Arrival of target-initiated NOP-IN during intense ISCSI traffic
   might lead to crash. Firmware fix to relevant flow.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 19:34:07 -05:00
Jack Morgenstein 3d7474734b mlx4_core: Do not map BF area if capability is 0
BF can be disabled in some cases, the capability field, bf_reg_size is set
to zero in this case. Don't map the BF area in this case, it would cause
failures.  In addition, leaving the BF area unmapped
also alerts the ETH driver to not use BF.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 19:26:34 -05:00
Roopa Prabhu 2b68c18194 enic: Add support for fw init command on sriov vf's
This patch fixes enic_probe to do a fw init devcmd for sriov vfs.
This enables vf driver in the guest to get into adapter init state without
having to explicitly issue an init fw cmd with portprofile info. But a
successful init on the vf will require the port profile information to be
pre-provisioned by the hypervisor via the pf

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 00:51:41 -05:00
Roopa Prabhu b476583354 enic: Fix ndo_set_vf_mac and ndo_set_vf_port to set/get the sriov vf's mac
This patch fixes the ndo_set_vf_mac netdev op to set the sriov vf mac
in adapter using the new fw devcmd CMD_SET_MAC_ADDR. During port profile
associate the pf driver gets the vf mac using CMD_GET_MAC_ADDR.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 00:51:41 -05:00
Roopa Prabhu d6c81bc6dc enic: Add new fw devcmd to set mac address of an interface
This patch adds a new devcmd CMD_SET_MAC_ADDR to set the mac address of an
interface.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 00:51:41 -05:00
Roopa Prabhu b13423ee0c enic: rename CMD_MAC_ADDR to CMD_GET_MAC_ADDR
firmware devcmd CMD_MAC_ADDR gets the mac address of a vnic from adapter.
This patch renames it to CMD_GET_MAC_ADDR more appropriately.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 00:51:40 -05:00
David S. Miller 5277f7a6c2 ll_temac: Fix build.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-20 00:46:06 -05:00
Danny Kukawka 5055d2f236 adi: adapt to eth_hw_addr_random() and changes in arch/blackfin
Adapt adi ethernet driver to changes in bfin_get_ether_addr()
from arch/blackfin. bfin_get_ether_addr() returns now a state.
Set a random mac address via new eth_hw_addr_random() in case
the return value is not 0.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: change the logic to reduce unneeded checks

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 19:03:04 -05:00
Masanari Iida 772301b618 ethernet: Fix typo in lantiq_etop.c
Correct spelling "platfom" to "platform" in
drivers/net/ethernet/lantiq_etop.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 19:02:42 -05:00
Michal Schmidt 56ad315250 bnx2x: make bnx2x_close() static again
Commit 8304859a "bnx2x: add fan failure event handling" made the function
bnx2x_close() non-static unnecessarily. The function is not called from
other sources. Make it static again.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 19:02:41 -05:00
Nikola Pajkovsky 64f0a836f6 b44: remove __exit from b44_pci_exit()
WARNING: drivers/net/ethernet/broadcom/built-in.o(.init.text+0x5d): Section mismatch in reference from the function b44_init() to the function .exit.text:b44_pci_exit()

module exits with b44_cleanup()

Signed-off-by: Nikola Pajkovsky <n.pajkovsky@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 18:57:51 -05:00
Dan Carpenter 32aa64f77e net/ethernet: ks8851_mll: signedness bug in ks8851_probe()
netdev->irq is unsigned, so it's never less than zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 18:57:51 -05:00
Eric Dumazet 11aad99af6 atl1c: dont use highprio tx queue
This driver attempts to use two TX rings but lacks proper support :

1) IRQ handler only takes care of TX completion on first TX ring
2) the stop/start logic uses the legacy functions (for non multiqueue
drivers)

This means all packets witk skb mark set to 1 are sent through high
queue but are never cleaned and queue eventualy fills and block the
device, triggering the infamous "NETDEV WATCHDOG" message.

Lets use a single TX ring to fix the problem, this driver is not a real
multiqueue one yet.

Minimal fix for stable kernels.

Reported-by: Thomas Meyer <thomas@m3y3r.de>
Tested-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jay Cliburn <jcliburn@gmail.com>
Cc: Chris Snook <chris.snook@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 18:57:50 -05:00
David S. Miller 32efe08d77 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c

Small minor conflict in bnx2x, wherein one commit changed how
statistics were stored in software, and another commit
fixed endianness bugs wrt. reading the values provided by
the chip in memory.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-19 16:03:15 -05:00
Danny Kukawka da19431646 cisco/enic: use eth_hw_addr_random() instead of random_ether_addr()
Use dev_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v3: adapt to net-next
v2: use bitops, adapt to eth_hw_addr_random(), add a comment

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-18 01:50:43 -05:00
Tobias Klauser b4a466765d net: ethernet: xilinx: Convert xilinx_axienet to module_platform_driver
Follow commit db62f684. Convert the driver to use the
module_platform_driver() macro which makes the code a bit smaller and
simpler.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 16:07:19 -05:00
Danny Kukawka 6a214fd414 atheros eth: set addr_assign_type if random_ether_addr() used
Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

Fix error handling in atl1c_probe(). If atl1c_read_mac_addr()
couldn't get the hw mac address, and a random mac address get
set return the error code. Don't go to err_eeprom in
atl1c_probe(), use the generated MAC address in this case.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: use bitops

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 15:58:06 -05:00
Danny Kukawka 939d2254fc ethoc: set addr_assign_type if random_ether_addr() used
Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

Fixed ethoc_set_mac_address() to check if the given mac
address is valid and set also dev_addr of the net_device.
Check also the return value of ethoc_set_mac_address() in
ethoc_probe().

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: set net_device->dev_addr in ethoc_set_mac_address(),
    check if given address is valid

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
2012-02-17 15:58:06 -05:00
Danny Kukawka 067fb4c819 igbvf: reset netdevice addr_assign_type if changed
Reset the state of addr_assign_type to NET_ADDR_PERM as soon as
the MAC get changed via .ndo_set_mac_address.

v2: use bitops to reset addr_assign_type

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 15:58:06 -05:00
Danny Kukawka 5a5e7c3644 xilinx ll_temac: use eth_hw_addr_random() instead of random_ether_addr()
Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: reworked to prevent using an extra variable

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 15:58:05 -05:00
Danny Kukawka baf1d3788e davinci_emac: use eth_hw_addr_random() instead of random_ether_addr()
Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

Remove one memcpy from emac_dev_setmac_addr() since this is a
duplicate: it's already done some lines above.

v2: use bitops, adapt to eth_hw_addr_random, remove a memcpy

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 15:52:31 -05:00
Danny Kukawka 43aabec51e lantiq_etop: set addr_assign_type if random_ether_addr() used
Set addr_assign_type correctly to NET_ADDR_RANDOM in case
a random MAC address was generated and assigned to the netdevice.

v2: added comment, renamed bool variable to random_mac

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 15:52:31 -05:00
Danny Kukawka 7718f2c27d au1000_eth: use eth_hw_addr_random() instead of random_ether_addr()
Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

v2: adapt to eth_hw_addr_random()

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-17 15:52:30 -05:00
Yoshihiro Shimoda 71cc7c37af net: sh_eth: add support for VLAN tag filtering
Some controllers have TSU. It can register one VLAN tag, and it can
filter other VLAN tag by hardware.
If vlan_rx_add_vid() is called twice or more, the driver will disable
the filtering.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-16 17:08:09 -05:00
Yoshihiro Shimoda 6743fe6df4 net: sh_eth: add support for multicast filtering
Some controllers have TSU. It can filter multicast by hardware.
This patch supports it.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-16 17:08:09 -05:00
Yoshihiro Shimoda 6ba88021c3 net: sh_eth: modify a condition of ioremap for TSU
If the controller has TSU, the each channel needs TSU registers.
This patch also fixes the iounmap condition in the sh_eth_drv_remove().

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-16 17:08:09 -05:00
Yoshihiro Shimoda 150647fb2c net: sh_eth: change the condition of initialization
The SH7757 has 2 Fast Ethernet and 2 Gigabit Ethernet, and the first
Gigabit channel needs the initialization. So, this patch adds the
parameter of "needs_init", and if the sh_eth_plat_data is set it
to 1, the driver will initialize the channel.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-16 17:08:09 -05:00
Yoshihiro Shimoda 3acbc9715a net: sh_eth: add the value of tsu to the SH7757's GETHER
The SH7757's GETHER has TSU registers. So, this patch adds the value
of ".tsu = 1" in the sh_eth_cpu_data.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-16 17:08:09 -05:00
David S. Miller d5df7c4156 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next 2012-02-16 17:08:06 -05:00
Ben Hutchings cd2d5b529c sfc: Add SR-IOV back-end support for SFC9000 family
On the SFC9000 family, each port has 1024 Virtual Interfaces (VIs),
each with an RX queue, a TX queue, an event queue and a mailbox
register.  These may be assigned to up to 127 SR-IOV virtual functions
per port, with up to 64 VIs per VF.

We allocate an extra channel (IRQ and event queue only) to receive
requests from VF drivers.

There is a per-port limit of 4 concurrent RX queue flushes, and queue
flushes may be initiated by the MC in response to a Function Level
Reset (FLR) of a VF.  Therefore, when SR-IOV is in use, we submit all
flush requests via the MC.

The RSS indirection table is shared with VFs, so the number of RX
queues used in the PF is limited to the number of VIs per VF.

This is almost entirely the work of Steve Hodgson, formerly
shodgson@solarflare.com.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:13 +00:00
Ben Hutchings 28e47c498a sfc: Allocate SRAM between buffer table and descriptor caches at init time
Each port has a block of 64-bit SRAM that is divided between buffer
table and descriptor cache regions at initialisation time.  Currently
we use a fixed allocation, but it needs to be changed to support
larger numbers of queues.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:12 +00:00
Ben Hutchings a9a5250627 sfc: Pass NIC structure into efx_wanted_parallelism()
This lets us identify the NIC affected in case of failure, and
will be necessary to adjust for SR-IOV constraints.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:11 +00:00
Ben Hutchings 7f967c011a sfc: Add support for 'extra' channel types
Abstract some of the channel operations to allow for 'extra'
channels that do not have RX or TX queues.

- Try to assign a channel to each extra channel type that is enabled
  for the NIC, but gracefully degrade if we can't allocate sufficient
  MSI-X vectors
- Allow each extra channel type to generate its own channel name
- Allow channel types to disable reallocation and reinitialisation
  of their channels

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:10 +00:00
Ben Hutchings a16e5b246c sfc: Make all CPU/IRQ/channel/queue counts unsigned
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:09 +00:00
Ben Hutchings 5bbe2f4f64 sfc: Make buffer table indices and counts consistently unsigned
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:08 +00:00
Steve Hodgson a606f4325d sfc: Disable flow control during flushes
The TX DMA engine issues upstream read requests when there is room in
the TX FIFO for the completion. However, the fetches for the rest of
the packet might be delayed by any back pressure.  Since a flush must
wait for an EOP, the entire flush may be delayed by back pressure.

Mitigate this by disabling flow control before the flushes are
started.  Since PF and VF flushes run in parallel introduce
fc_disable, a reference count of the number of flushes outstanding.

The same principle could be applied to Falcon, but that
would bring with it its own testing.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:07 +00:00
Ben Hutchings 90893000e2 sfc: Generalise event generation to cover VF-owned event queues
For SR-IOV we will need to send events to event queues that belong to
VFs serviced by other drivers.  Change the parameters of
efx_generate_event() to allow this and declare it extern.

While we're at it, remove the existing declaration under the wrong
name efx_nic_generate_event().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:06 +00:00
Ben Hutchings 9d9a6973a8 sfc: Use proper function to test for RX channel in efx_poll()
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:25:06 +00:00
Ben Hutchings 9f2cb71c2b sfc: Leave interrupts and event queues enabled whenever we can
When SR-IOV is enabled we may receive FLR (Function-Level Reset)
events, associated queue flush events and requests from VF drivers at
any time.  Therefore we need to keep event queues and interrupts
enabled whenever possible.

Currently we stop interrupt-driven event processing before flushing RX
and TX queues; efx_nic_flush_queues() then polls event queues for
flush events and discards any others it finds.  Change it to work with
the regular event handling functions.

Currently efx_start_channel() fills RX queues synchronously when a
device is brought up.  This could now race with NAPI, so change it to
send fill events.

This was almost entirely written by Steve Hodgson, formerly
shodgson@solarflare.com.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:24:46 +00:00
Ben Hutchings 2ae75dac30 sfc: Generate RX fill events based on RX queues, not channels
This makes it harder to accidentally send such events to TX-only
channels.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:15:03 +00:00
Ben Hutchings 4ef594eb89 sfc: Generalise driver event generation
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:14:59 +00:00
Ben Hutchings 055e0ad014 sfc: Correct MAC filter bitfield definitions
The RMFT_DEST_MAC and TMFT_SRC_MAC register fields were previously
documented as 44 bits wide, whereas a MAC address has 48 bits.
Thankfully the hardware uses the correct width and the driver has
used separate definitions that divide each of these into 32-bit and
16-bit fields.

Fix the initial definitions for these fields and rewrite the latter
definitions to use them.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:11:31 +00:00
Ben Hutchings 3d885e3921 sfc: Add support for TX MAC filters
On Siena each TX queue can be configured to send only packets for
which there is a TX MAC filter that matches the source MAC address,
queue ID, and optionally VID.  This will be used to implement the
'spoofchk' feature for SR-IOV virtual functions.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:11:30 +00:00
Ben Hutchings c274d65c94 sfc: Add support for configuring RX unicast/multicast default filters
On Siena all received packets that don't match a more specific filter
will match the unicast or multicast default filter.  Currently we
leave these set to the default values (RSS with base queue number of
0).  Allow them to be reconfigured to select a single RX queue.

These default filters are programmed through the FILTER_CTL register,
but we represent them internally as an additional table of size 2.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-16 00:11:24 +00:00
Divy Le Ray e90c9db236 cxgb3: update firmware version
Hi Dave,

This patch is sent in conjunction with the cxgb3 firmware update submission on linux-firmware.
(https://lkml.org/lkml/2012/2/13/27)

Cheers,
Divy

From: Divy Le Ray <divy@chelsio.com>

This patch updates the firmware version cxgb3 is requesting to 7.12.0.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:48:19 -05:00
Jan Weitzel 6c23e41322 net/ethernet: ks8851_mll fix irq handling
There a two different irq variables ks->irq and netdev->irq.
Only ks->irq is set on probe, so disabling irq in ks_start_xmit fails.

This patches remove ks->irq from private data and use only netdev->irq.

Tested on a kernel 3.0 based OMAP4430 SMP Board

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:41:10 -05:00
Danny Kukawka 16387605a5 renesas/sh_eth.c: fix linux/interrupt.h included twice
Remove double include of linux/interrupt.h.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:34:17 -05:00
Danny Kukawka 7ce5d22219 net: use eth_hw_addr_random() and reset addr_assign_type
Use eth_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.

v2: adapt to renamed eth_hw_addr_random()

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:34:17 -05:00
Danny Kukawka f2cedb63df net: replace random_ether_addr() with eth_hw_addr_random()
Replace usage of random_ether_addr() with eth_hw_addr_random()
to set addr_assign_type correctly to NET_ADDR_RANDOM.

Change the trivial cases.

v2: adapt to renamed eth_hw_addr_random()

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:34:16 -05:00
Mintz Yuval a1e785e02b bnx2x: allow all functions to display the phy FW version
The phy FW version is stored in regular memory, no MDC-MDIO access or
any special locks are required to read it in the current implementation.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:50 -05:00
Mintz Yuval 04f2d51313 bnx2x: removed code re-checking memory base after device open
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:50 -05:00
Mintz Yuval 10bd1f243c bnx2x: allow BCM84833 phy to advertise 100Base-T speeds
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 82fa848c11 bnx2x: notify cnic of address of info-to-the-mcp
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval d760fc37b0 bnx2x: allocate smaller Rx rings for 1G functions
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval afa13b4b94 bnx2x: allocate memory dynamically in ethtool self-test.
From: Merav Sicron <meravs@broadcom.com>

Current ethtool self tests usesa large buffer on stack. This patch replaces
that array by dynamically allocated memory

Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 817a8aa8cf bnx2x: force 10G on 84833 phy should be autoneg with only 10G advertised
From: Yaniv Rosner <yaniv.rosner@broadcom.com>

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 1b85ae5273 bnx2x: added autoneg-restart after link advertisement changes
From: Yaniv Rosner <yaniv.rosner@broadcom.com>

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 9e7e8399c5 bnx2x: ethtool publishes link partners speed and FC
Following the changes in the ethtool source code, this patch enables
the bnx2x driver to publish the Link partner's capabilities s, when ethtool
is used on an interface which completed autoneg.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:48 -05:00
Mintz Yuval e18c56b2e9 bnx2x: half duplex support added for several boards
From: Yaniv Rosner <yaniv.rosner@broadcom.com>

Several boards require an additional HW bit written in-order to enable
half duplex.

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:48 -05:00
Mintz Yuval 1355b704b9 bnx2x: consistent statistics after internal driver reload
Currently bnx2x statistics are reset by inner driver reload, e.g. by MTU
change. This patch fixes this issue - from now on statistics should only
be reset upon device closure.
Thanks to Michal Schmidt <mschmidt@redhat.com> for his initial patch
regarding this issue.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:48 -05:00
Giuseppe CAVALLARO 78a5249fc9 stmmac: update the driver version to Feb 2012 (v2)
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:52:10 -05:00
Giuseppe CAVALLARO cf3f047b9a stmmac: move hw init in the probe (v2)
This patch moves the MAC HW initialization and
the HW feature verification from the open to the probe
function as D. Miller suggested.
So the patch actually reorganizes and tidies-up some parts of
the driver and indeed fixes some problem when tune its HW features.
These can be overwritten by looking at the HW cap register at
run-time and that generated problems.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:52:10 -05:00
Francesco Virlinzi 7a13f8f5b6 stmmac: request_irq when use an ext wake irq line (v2)
In case of we use an external Wake-Up IRQ line
(priv->wol_irq != dev->irq) we need to invoke the
request_irq.

Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:52:10 -05:00
Giuseppe CAVALLARO 1cc5a73518 stmmac: do not discard frame on dribbling bit assert
If this bit is set and the CRC error is reset, then the packet is valid.
Only report this as stat info.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:52:10 -05:00
Eugenia Emantayev 9f5b6c632e mlx4: add unicast steering entries to resource_tracker
Add unicast steering entries to resource tracker.
Do qp_detach also for these entries when VF doesn't shut down gracefully.
Otherwise there is leakage of these resources, since they are not tracked.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:50:16 -05:00
Eugenia Emantayev 2531188b47 mlx4: fix QP tree trashing
When adding new unicast steer entry, before moving qp to state ready,
actually before calling mlx4_RST2INIT_QP_wrapper(), there were added
a lot of entries with local_qpn=0 into radix tree.
This fact impacted the get_res() function and proper functioning
of resource tracker in addition to adding trash entries into radix tree.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@melllanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:50:16 -05:00
Eugenia Emantayev 75c6062cb7 mlx4: fix buffer overrun
When passing MLX4_UC_STEER=1 it was translated to value 2
after mlx4_QP_ATTACH_wrapper. Therefore in new_steering_entry()
unicast steer entries were added to index 2 of array of size 2.
Fixing this bug by shift right to one position.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 14:50:15 -05:00
Eric Dumazet 3013dc0cce 3c59x: shorten timer period for slave devices
Jean Delvare reported bonding on top of 3c59x adapters was not detecting
network cable removal fast enough.

3c59x indeed uses a 60 seconds timer to check link status if carrier is
on, and 5 seconds if carrier is off.

This patch reduces timer period to 5 seconds if device is a bonding
slave.

Reported-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Jean Delvare <jdelvare@suse.de>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 16:28:23 -05:00
Michal Schmidt fc54363752 bnx2x: remove the 'poll' module option
'poll' was a debugging option, but turning it on these days leads to
kernel panic. Remove it.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:39:45 -05:00
Eugenia Emantayev eb40d89276 mlx4: add unicast steering entries to resource_tracker
Add unicast steering entries to resource tracker.
Do qp_detach also for these entries when VF doesn't shut down gracefully.
Otherwise there is leakage of these resources, since they are not tracked.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:59 -05:00
Eugenia Emantayev f1f75f0e2b mlx4: attach multicast with correct flag
mlx4_multicast_attach/detach() should use always MLX4_MC_STEER flag

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:58 -05:00
Eugenia Emantayev de9b43dbb8 mlx4: remove redundant adding of steering type to gid
mlx4_uc_steer_add/release() should not add MLX4_UC_STEER flag to gid.
It is added in mlx4_unicast_attach/detach().

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:58 -05:00
Eugenia Emantayev deb8b3e849 mlx4: remove unnecessary variables and arguments
mlx4_qp_attach/detach_common() don't use hash variable, move it to find_entry()
static find_entry() in mcg.c doesn't use steer argument

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:58 -05:00
Eugenia Emantayev 45b5136551 mlx4: remove unused field high_prios
Remove unnecessary field high_prios from mlx4_steer struct and initialization

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:58 -05:00
Eugenia Emantayev 0ee9f1dd7b mlx4: fix QP tree trashing
When adding new unicast steer entry, before moving qp to state ready,
actually before calling mlx4_RST2INIT_QP_wrapper(), there were added
a lot of entries with local_qpn=0 into radix tree.
This fact impacted the get_res() function and proper functioning
of resource tracker in addition to adding trash entries into radix tree.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@melllanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:58 -05:00
Eugenia Emantayev 58a30d6a3c mlx4_core: fix buffer overrun
When passing MLX4_UC_STEER=1 it was translated to value 2
after mlx4_QP_ATTACH_wrapper. Therefore in new_steering_entry()
unicast steer entries were added to index 2 of array of size 2.
Fixing this bug by shift right to one position.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-14 14:11:57 -05:00
Matt Carlson 9e056c0320 tg3: Update copyright
This patch updates the copyright dates in the tg3 driver.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:08 -05:00
Matt Carlson e740522e6d tg3: Use *_UNKNOWN ethtool definitions
This patch replaces tg3's private SPEED_INVALID and DUPLEX_INVALID
definitions with SPEED_UNKNOWN and DUPLEX_UNKNOWN respectively.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:08 -05:00
Matt Carlson c6700ce224 tg3: Remove unneeded link_config.orig_... members
This patch removes the unneeded link_config.orig_* members.  When the
phy is in a low power state, the TG3_PHYFLG_IS_LOW_POWER flag solely
determines how the link is configured.  When the phy is powered back up,
it can resume using the original settings.

For the phylib case, the link configuration still needs to be saved, but
since the phylib maintains its own configuration, we can repurpose the
(unused in this case) tg3 link configuration members.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:07 -05:00
Matt Carlson 2855b9fe41 tg3: Remove unused link config code
When tg3 devices are shutdown, the driver uses the
TG3_PHYFLG_IS_LOW_POWER flag to enable a static phy configuration.
Any attempt to use the link configuration variables is dead code.  This
patch removes such code.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:06 -05:00
Matt Carlson 42b123b129 tg3: Consolidate ASIC rev detection code
Detecting the ASIC revision of a device is getting to be an increasingly
complex process.  This patch consolidates all the ASIC rev detection
code to a single routine for better maintainability.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:06 -05:00
Matt Carlson b28f389d92 tg3: Reduce UMP event collision window
The tg3 driver needs to submit a few phy register values to the UMP
firmware each time the link state changes.  Up until now, the driver
would wait for the previous event to complete, then proceed to gather
data through a series of phy accesses.  Since phy accesses are
relatively slow, it is possible for another thread to attempt to submit
its own event while the UMP code is still construction its message.

This patch seeks to minimize the collision window as much as possible by
preloading the phy data.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:06 -05:00
Matt Carlson 4227822499 tg3: Fix NVRAM page writes on newer devices
On newer devices, the hardware expects the NVRAM address register
to be written only once per NVRAM page.  To do otherwise causes NVRAM
corruption.  This patch fixes the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:05 -05:00
Matt Carlson 3198e07fd6 tg3: Fix copper autoneg adv checks
When checking the autoneg advertisements, the driver failed to include
the master and master enable bits for the bcm5701.  This patch fixes the
problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:05 -05:00
Matt Carlson b546e46f5c tg3: Fix stats while interface is down
If the tg3 interface is down, the driver will return ethtool stats
uninitialized.  This patch zeroes out the destination stat buffer in
such a case.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:04 -05:00
Matt Carlson 3906969189 tg3: Disable new DMA engine for 57766
A bug was found in the new DMA engine for the 57766.  This patch
disables it, which causes the device to fallback to the old DMA engine.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:04 -05:00
David S. Miller 16dc459cee Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next 2012-02-13 18:47:20 -05:00
Ben Hutchings 7c43161c11 sfc: Warn if unable to create MTDs
Log an explicit warning if we are unable to create MTDs for a net
device.  Also correct the comment about why mtd_device_register() may
fail; there is no longer an MTD table to fill up.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-13 23:40:50 +00:00
Ben Hutchings 5b6262d0cc sfc: Replace some literal constants with EFX_PAGE_SIZE/EFX_BUF_SIZE
The 'page size' for PCIe DMA, i.e. the alignment of boundaries at
which DMA must be broken, is 4KB.  Name this value as EFX_PAGE_SIZE
and use it in efx_max_tx_len().  Redefine EFX_BUF_SIZE as
EFX_PAGE_SIZE since its value is also a result of that requirement,
and use it in efx_init_special_buffer().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-13 23:40:49 +00:00
Ben Hutchings fadac6aae1 sfc: Do not retry hardware probe if it schedules a reset
If efx_pci_probe_main() schedules an INVISIBLE or ALL reset (but
nothing more drastic), we retry it up to 5 times.  So far as I'm
aware, this was a workaround for bugs in Falcon A0 which were fixed
in production silicon.  Remove the retry.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-13 23:40:48 +00:00
Ben Hutchings d9ab70079a sfc: Skip RX end-of-batch work on channels without an RX queue
The code in efx_process_channel() to update the RX queue after each
batch of RX completions works out as a no-op on a TX-only channel
where the RX queue structure is set to all-zeroes, but
(1) efx_channel_get_rx_queue() will BUG() if DEBUG is defined, and
(2) it's a waste of time.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-13 23:40:38 +00:00
Bruce Allan 5015e53a4c e1000e: cleanup goto statements to exit points without common work
Per ./Documentation/CodingStyle, goto statements are acceptable for the
centralized exiting of functions when there are multiple exit points which
share common work such as cleanup.  When no common work is required for
multiple exit points, the function should just return at these exit points
instead of doing an unnecessary jump to a centralized return.  This patch
cleans up the inappropriate use of goto statements, and removes unnecessary
variables (or move to a smaller scope) where possible as a result of the
cleanups.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:30:16 -08:00
Bruce Allan 2a31b37a89 e1000e: potentially incorrect return for e1000e_setup_fiber_serdes_link
In the unlikely event that e1000_poll_fiber_serdes_link_generic() is called
and it returns an error, the returned error code value is not propagated to
the caller of e1000e_setup_fiber_serdes_link().

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:28:31 -08:00
Bruce Allan e561a705a6 e1000e: potentially incorrect return for e1000_init_hw_ich8lan
In the unlikely event that e1000_setup_link_ich8lan() returns an error,
the returned error code value is not propagated to the caller of
e1000_init_hw_ich8lan().

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:28:23 -08:00
Bruce Allan 3fa8293634 e1000e: cleanup: minor whitespace addition (insert blank line separator)
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:22:32 -08:00
Bruce Allan f71dde6a44 e1000e: cleanup: remove unnecessary variable initializations
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:21:28 -08:00
Bruce Allan f764956fd6 e1000e: cleanup: remove unnecessary test and return
Fall-through to a return statement that effectively does the same.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:20:00 -08:00
Bruce Allan 55920b5eae e1000e: cleanup: remove unnecessary variable ret_val
ret_val gets initialized to -E1000_ERR_NVM and never set differently, so
get rid of it and just return -E1000_ERR_NVM.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:18:52 -08:00
Bruce Allan f1a3fe17f9 e1000e: cleanup: remove unreachable statement
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:16:23 -08:00
Bruce Allan d7eb33840b e1000e: potentially incorrect return for e1000_set_d3_lplu_state_ich8lan
In the unlikely event that e1e_wphy() returns an error, the returned error
code is not propogated to the caller of e1000_set_d3_lplu_state_ich8lan().
With this change, there is a rare possibility that ret_val might not get
set so it must be initialized.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 13:15:03 -08:00
Cousson, Benoit fbcf88b883 ks8851: Fix NOHZ local_softirq_pending 08 warning
This fix a similar problem as in 72092cc453
and 481a819914 ("can:
fix NOHZ local_softirq_pending 08 warning"). This fix replaces netif_rx()
with netif_rx_ni() which has to be used from process/softirq context.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:09 -05:00
Eric Dumazet 66d885cba6 bnx2x: fix bnx2x_storm_stats_update() on big endian
commit 619c5cb688 (New 7.0 FW: bnx2x, cnic, bnx2i, bnx2fc) added new
sparse warnings.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Vladislav Zolotarov <vladz@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:09 -05:00
Florian Fainelli 7465ac3c2f ixp4xx-eth: fix PHY name to match MDIO bus name
Commit 0869b3a4: ixp4xx-eth: use an unique MDIO bus name changed
the MDIO bus name from "0" to "ixp4xx-eth-0", as a result the PHY
name is not longer appropriate and will not match the MDIO bus name
so PHY connection will not succeed, fix that.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:09 -05:00
Florian Fainelli b0c06e12b6 octeon: fix PHY name to match MDIO bus name
Commit "d6c25be: mdio-octeon: use an unique MDIO bus name" changed the
octeon MDIO bus name from "0" to "mdio-octeon-0", change the PHY
formatting logic to account for that name change, so that PHY connection
on this bus succeeds.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:09 -05:00
Florian Fainelli ea51ade939 fec: fix PHY name to match fixed MDIO bus name
Commit "391420f7: fec: use an unique MDIO bus name" first modified
the MDIO bus name to include the platform name, then in commit
"a7ed07d5: net: fec: correct phy_name buffer length when init phy_name"
the PHY name formatting was fixed in the case the PHY matches a PHY
driver.

The FEC driver however, also handles the case where we want to attach
to the fixed MDIO bus name, which was previously named "0", and now
"fixed-0". Change the PHY formatting logic to account for that.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:09 -05:00
Florian Fainelli c56e9e2ae7 bcm63xx-enet: fix PHY name to match MDIO bus name
Commit 3e617506: bcm63xx_enet: use an unique MDIO bus name introduced
a regression in the PHY connection logic, since the PHY name was formatted
to expect the bus name to be "0" or "1", whereas it is now "bcm63xx-enet-0"
or "bcm63xx-enet-1".

Reported-by: Joel EJC <joel_ejc@yahoofr>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:08 -05:00
Florian Fainelli a19c5d6841 cpmac: fix PHY name to match MDIO bus name
Commit d1733f07: cpmac: use an unique MDIO bus name changed the MDIO bus
name from "1" to "cpmac-1", this breaks the PHY connection logic because
the PHY name still uses the old bus names "0" and "1", fix that to
always use the mdio bus id instead.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:04:08 -05:00
Axel Lin 758ff235b3 mlx4: Fix kcalloc parameters swapped
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 16:00:58 -05:00
Matt Carlson c5665a538d tg3: Move transmit comment to a better location
This patch moves a comment in the transmit path to a better location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:33 -05:00
Matt Carlson 4b40952268 tg3: Eliminate unneeded prototype
This patch eliminates the unneeded tg3_halt_cpu() prototype and moves
the tg3_setup_phy() prototype closer to where it is needed.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson 16c7fa7dfe tg3: Relocate tg3_find_peer
This patch relocates tg3_find_peer to eliminate a prototype.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson dbe9b92a60 tg3: Move tg3_nvram_write_block functions
This patch moves the tg3_nvram_write_block functions higher in the file
to eliminate a prototype.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson ccd5ba9db5 tg3: Move tg3_set_rx_mode
This patch moves __tg3_set_rx_mode above its first use and moves
tg3_set_rx_mode down closer to where the netdev_ops functions should be.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson faf1627ac1 tg3: Move tg3_change_mtu to a better location
This patch moves tg3_change_mtu to a better location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson 9a21fb8fc3 tg3: Relocate tg3_reset_task
This patch moves tg3_reset_task further down in the file where it makes
more sense to be.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:31 -05:00
Matt Carlson ebf3312e78 tg3: Move tg3_restart_hw to a better location
This patch relocates tg3_restart_hw() to a better location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:31 -05:00
Bruce Allan 826072555b e1000e: cleanup: always return 0
These are a few instances of returning a value that can only be 0 so just
use a 'return 0' to make it more obvious.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 12:28:55 -08:00
Bruce Allan 7eb61d8194 e1000e: cleanup: remove unnecessary assignments just before returning
Just return the appropriate value.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 12:28:44 -08:00
Bruce Allan 8649f43196 e1000e: potential incorrect return for e1000_setup_copper_link_80003es2lan
In the unlikely event that e1000e_setup_copper_link() returns an error,
the returned error code value is not propogated to the caller of
e1000_setup_copper_link_80003es2lan().

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 12:28:37 -08:00
Bruce Allan 520d6f225f e1000e: potentially incorrect return for e1000_cfg_kmrn_10_100_80003es2lan
In the unlikely event that e1e_wphy() returns an error, the returned error
code value is not propogated to the caller of
e1000_cfg_kmrn_10_100_80003es2lan().

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 12:28:30 -08:00
Bruce Allan 75ce153270 e1000e: cleanup: rename goto labels to be more meaningful
In the following functions, rename the generic 'out' goto label to the more
descriptive 'release' to indicate the type of common work that is done
before exiting the functions.  No functional change, cosmetic only.

e1000_sw_lcd_config_ich8lan()
e1000_oem_bits_config_ich8lan()
e1000_init_phy_wakeup()
e1000e_write_phy_reg_bm()
e1000e_read_phy_reg_bm()
e1000e_read_phy_reg_bm2()

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 12:28:19 -08:00
Bruce Allan ffacd472c4 e1000e: cleanup: use goto for common work needed by multiple exit points
There are two exit points of e1000e_write_nvm_spi() which require the
nvm->ops.release() function pointer called just before exiting.
Consolidate the two duplicate pieces of common work with a goto.  With
this change, the value ret_val will need to be returned instead of 0.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-13 12:28:10 -08:00
Uwe Kleine-König fafdbf84d7 trivial: typo hnalder -> handler
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:41 -05:00
Masanari Iida 0f09a343da stmicro: Fix typo in stmmac_pci.c and stmmac_platform.c
Correct spelling "drivr" to "driver" in
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:41 -05:00
Roopa Prabhu 73c2ae763a enic: remove assignment of random mac on enic vf
This patch removes random mac assignment on vf's. The vf's will start with
a zero mac and with upcoming support in fw/driver, a vf mac can be set
via the pf. vf's also support ndo_set_mac_address. This decision was made
based on the fact that a random mac on a vf is not really needed. And this
will reduce some of the problems with the vf's getting a new mac on
every driver load/unload (one of them being udev renaming the device on ever
load/unload and reboot).

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: sujith sankar <ssujith@cisco.com>
Signed-off-by: ChingWei Chang <cwchang@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:41 -05:00
Roopa Prabhu 9f1de88ddd enic: Fix address deregistration for sriov vf during port profile disassociate
This patch fixes erroneous PF address deregistration in cases where
a port profile disassociate is called on an already disassociated interface.

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: sujith sankar <ssujith@cisco.com>
Signed-off-by: ChingWei Chang <cwchang@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:41 -05:00
Sathya Perla 10ef9ab432 be2net: event queue re-design
v2: Fixed up the bad typecasting pointed out by David...

In the current design 8 TXQs are serviced by 1 EQ, while each RSS queue
is serviced by a separate EQ. This is being changed as follows:

- Upto 8 EQs will be used (based on the availabilty of msix vectors).
Each EQ will handle 1 RSS and 1 TX ring. The default non-RSS RX queue and
MCC queue are handled by the last EQ.

- On cards which provide support, upto 8 RSS rings will be used, instead
of the current limit of 4.

The new design allows spreading the TX multi-queue completion processing
across multiple CPUs unlike the previous design.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:40 -05:00
Joe Perches 23677ce317 drivers/net: Remove boolean comparisons to true/false
Booleans should not be compared to true or false
but be directly tested or tested with !.

Done via cocci script:

@@
bool t;
@@
- t == true
+ t
@@
bool t;
@@
- t != true
+ !t
@@
bool t;
@@
- t == false
+ !t
@@
bool t;
@@
- t != false
+ t

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:40 -05:00
Danny Kukawka 1a0d6ae579 rename dev_hw_addr_random and remove redundant second
Renamed dev_hw_addr_random to eth_hw_addr_random() to reflect that
this function only assign a random ethernet address (MAC). Removed
the second parameter (u8 *hwaddr), it's redundant since the also
given net_device already contains net_device->dev_addr.
Set it directly.

Adapt igbvf and ixgbevf to the changed function.

Small fix for ixgbevf_probe(): if ixgbevf_sw_init() fails
(which means the device got no dev_addr) handle the error and
jump to err_sw_init as already done by igbvf in similar case.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:46:41 -05:00
Masanari Iida 72e60278d7 aeroflex: Fix typo in greth.c
Correct spelling "reseting" to "resetting" in
drivers/net/ethernet/aeroflex/greth.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:45:38 -05:00
David S. Miller 3cc26e36a0 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next 2012-02-12 17:05:16 -05:00
David S. Miller d5ef8a4d87 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/infiniband/hw/nes/nes_cm.c

Simple whitespace conflict.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-10 23:32:28 -05:00
Alexander Duyck 8a0da21be8 ixgbe: Combine post-DMA processing of sk_buff fields into single function
This change combines a number of post-DMA Rx packet processing functions
into a single function.  The advantage of this is that it combines most of
the Rx descriptor processing into one spot so it should all be warm in the
cache.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 15:56:31 -08:00
Alexander Duyck e4f740287f ixgbe: Drop the _ADV of descriptor macros since all ixgbe descriptors are ADV
It doesn't make much sense to differentiate between advanced and legacy
descriptors when the only descriptors that ixgbe uses are advanced
descriptors.  As such we can drop the _ADV suffix since all ixgbe
descriptors are automatically advanced.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 15:55:58 -08:00
Alexander Duyck f56e0cb1fe ixgbe: Add function for testing status bits in Rx descriptor
This change adds a small function for testing Rx status bits in the
descriptor.  The advantage to this is that we can avoid unnecessary
byte swaps on big endian systems.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 15:51:33 -08:00
Alexander Duyck f990b79bc8 ixgbe: Let the Rx buffer allocation clear status bits instead of cleanup
This change makes it so that we always clear the status/error bits in the
Rx descriptor in the allocation path instead of the cleanup path.  The
advantage to this is that we spend less time modifying data.  As such we
can modify the data once and then let it go cold in the cache instead of
writing it, reading it, and then writing it again.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 15:49:14 -08:00
Alexander Duyck 1d2024f61e ixgbe: Address fact that RSC was not setting GSO size for incoming frames
This patch is meant to address the fact that RSC has not been setting the
gso_size value on the skb.  As a result performance on lossy TCP
connections was negatively impacted.  This change resolves the issue by
setting gso_size to the average size for incoming packets.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 15:44:19 -08:00
Alexander Duyck 4c1975d77b ixgbe: Minor refactor of RSC
This change addresses several issue.

First I had left the use of the next and prev skb pointers floating around
in the code and they were overdue to be pulled since I had rewritten the
RSC code in the out-of-tree driver some time ago to address issues brought
up by David Miller in regards to this.

I am also now defaulting to always leaving the first buffer unmapped on any
packet and then unmapping it after we read the EOP descriptor.  This allows
a simplification of the path with less branching.

Instead of counting packets received the code was changed some time ago to
track the number of buffers received.  This leads to inaccurate counting
when you compare numbers of packets received by the hardware versus what is
tracked by the software.  To correct this I am revising things so that the
append_cnt value for RSC accurately tracks the number of frames received.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 15:42:09 -08:00
Linus Torvalds 8df54d622a Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Quoth David:

1) GRO MAC header comparisons were ethernet specific, breaking other
   link types.  This required a multi-faceted fix to cure the originally
   noted case (Infiniband), because IPoIB was lying about it's actual
   hard header length.  Thanks to Eric Dumazet, Roland Dreier, and
   others.

2) Fix build failure when INET_UDP_DIAG is built in and ipv6 is modular.
   From Anisse Astier.

3) Off by ones and other bug fixes in netprio_cgroup from Neil Horman.

4) ipv4 TCP reset generation needs to respect any network interface
   binding from the socket, otherwise route lookups might give a
   different result than all the other segments received.  From Shawn
   Lu.

5) Fix unintended regression in ipv4 proxy ARP responses, from Thomas
   Graf.

6) Fix SKB under-allocation bug in sh_eth, from Yoshihiro Shimoda.

7) Revert skge PCI mapping changes that are causing crashes for some
   folks, from Stephen Hemminger.

8) IPV4 route lookups fill in the wildcarded fields of the given flow
   lookup key passed in, which is fine most of the time as this is
   exactly what the caller's want.  However there are a few cases that
   want to retain the original flow key values afterwards, so handle
   those cases properly.  Fix from Julian Anastasov.

9) IGB/IXGBE VF lookup bug fixes from Greg Rose.

10) Properly null terminate filename passed to ethtool flash device
    method, from Ben Hutchings.

11) S3 resume fix in via-velocity from David Lv.

12) Fix double SKB free during xmit failure in CAIF, from Dmitry
    Tarnyagin.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
  net: Don't proxy arp respond if iif == rt->dst.dev if private VLAN is disabled
  ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr.
  netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m
  netprio_cgroup: don't allocate prio table when a device is registered
  netprio_cgroup: fix an off-by-one bug
  bna: fix error handling of bnad_get_flash_partition_by_offset()
  isdn: type bug in isdn_net_header()
  net: Make qdisc_skb_cb upper size bound explicit.
  ixgbe: ethtool: stats user buffer overrun
  ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state
  ixgbe: do not update real num queues when netdev is going away
  ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size
  ixgbe: Fix case of Tx Hang in PF with 32 VFs
  ixgbe: fix vf lookup
  igb: fix vf lookup
  e1000: add dropped DMA receive enable back in for WoL
  gro: more generic L2 header check
  IPoIB: Stop lying about hard_header_len and use skb->cb to stash LL addresses
  zd1211rw: firmware needs duration_id set to zero for non-pspoll frames
  net: enable TC35815 for MIPS again
  ...
2012-02-10 14:18:46 -08:00
Emil Tantilov d9dd966d7f igb: fix warning about unused function
This patch fixes a warning about unused function when CONFIG_PM_SLEEP
is not selected in the kernel config:

igb_main.c: warning: `igb_suspend` defined but not used [W-unused-function]

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:07:39 -08:00
Bruce Allan f92518ddec e1000e: replace '1' with 'true' for boolean get_link_status
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:07:25 -08:00
Bruce Allan ec34c170da e1000e: pass pointer to hw struct for e1000_init_mac_params_XXX()
The e1000_init_mac_params_XXX() functions (where XXX is one of the three
MAC-family types 80003es2lan, 82571 and ich8lan) was not meant to require a
pointer to the adapter struct but does require a pointer to the hw struct.
Pass that pointer in to the functions instead.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:07:12 -08:00
Bruce Allan 07914ee3cc e1000e: use true/false for bool autoneg_false
v2 - replaced mac->autoneg_failed == false with !mac->autoneg_failed

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:06:58 -08:00
Bruce Allan 668018d747 e1000e: remove unnecessary parentheses
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:06:44 -08:00
Bruce Allan fe1e980f24 e1000e: remove unnecessary returns from void functions
...and convert some goto's which simply return to just return.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:06:30 -08:00
Bruce Allan 4bcf053baf e1000e: remove test that is always false
warning: comparison of unsigned expression < 0 is always false

Remove an unnecessary test that is reported when compiling driver with W=1.
The test is unnecessary because Intel wired GbE hardware older (i.e. less)
than 82571 is not supported by this driver.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-10 00:06:07 -08:00
Linus Torvalds ae5cdd405b Minor char-misc fixes for 3.3-rc3
Nothing big here, some Kconfig fixes for the MISC_DEVICES config option
 that was being used incorrectly, and some other minor bug fixes.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iEYEABECAAYFAk80HSAACgkQMUfUDdst+ymFsQCghwKbV9B9z5fgUXYwFQJ/pD2j
 GhsAn3J2mhhHN/vtSPQAN9Vu59Xb/tCi
 =VZaE
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Minor char-misc fixes for 3.3-rc3

Nothing big here, some Kconfig fixes for the MISC_DEVICES config option
that was being used incorrectly, and some other minor bug fixes.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

* tag 'char-misc-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  mmc: cb710 core: Add missing spin_lock_init for irq_lock of struct cb710_chip
  cs5535-mfgpt: don't call __init function from __devinit
  vmw_balloon: fix for a -Wuninitialized warning
  drivers: misc: Remove MISC_DEVICES config option
  c2port: fix build error for duramar2150 due to missing header.
2012-02-09 13:51:13 -08:00
Dan Carpenter 027a3b617c bna: fix error handling of bnad_get_flash_partition_by_offset()
The current error handling doesn't work because we flash_part is a u32
so the checks for negative error codes don't work.  I considered making
things signed but I don't know the hardware enough to say if that's a
problem.  Really, we don't use the error codes so just returning zero
for all problems is fine.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-09 15:43:30 -05:00
Eddie Wai 4cbbb04dc1 cnic: Update VLAN ID during ISCSI_UEVENT_PATH_UPDATE
This will support the new VLAN attribute in the iSCSI iface file.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-09 14:03:50 -05:00
Jeffrey Huang 0cb1f4b960 cnic: set error flag when iSCSI connection fails
to speed up error recovery due to SPQ failures.  The error flag will
expedite the recovery process by skipping the timeouts.

Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-09 14:03:50 -05:00
Russell King 6ad1b61400 ARM: sa11x0: neponset: provide function to manipulate NCR_0
Rather than having direct register accesses to NCR_0 scattered amongst
the code, provide a function instead.  This contains the necessary
race protection for this platform, ensuring that updates to this
register are safe.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-02-09 15:34:14 +00:00
John Fastabend 9cc00b51a3 ixgbe: ethtool: stats user buffer overrun
If the number of tx/rx queues changes the ethtool ioctl
ETHTOOL_GSTATS may overrun the userspace buffer. This
occurs because the general practice in user space to
query stats is to issue a ETHTOOL_GSSET cmd to learn the
buffer size needed, allocate the buffer, then call
ETHTOOL_GSTIRNGS and ETHTOOL_GSTATS. If the number of
real_num_queues is changed or flow control attributes
are changed after ETHTOOL_GSSET but before the
ETHTOOL_GSTRINGS/ETHTOOL_GSTATS a user space buffer
overrun occurs.

To fix the overrun always return the max buffer size
needed from get_sset_count() then return all strings
and stats from get_strings()/get_ethtool_stats().

This _will_ change the output from the ioctl() call
which could break applications and script parsing in
theory. I believe these changes should not break existing
tools because the only changes will be more {tx|rx}_queues
and the {tx|rx}_pb_* stats will always be returned.
Existing scripts already need to handle changing number
of queues because this occurs today depending on system
and current features. The {tx|rx}_pb_* stats are at the
end of the output and should be handled by scripts today
regardless.

Finally get_ethtool_stats and get_strings are free-form
outputs tools parsing these outputs should be defensive
anyways. In the end these updates are better then
having a tool segfault because of a buffer overrun.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:27:47 -08:00
John Fastabend 5facb8e0c4 ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state
Users expect the up2tc mapping to be maintained across a DCB
enable/disable/enable transition. And since we maintain all
the other DCB attributes we should do this for up2tc mappings
as well just to be consistent. Also without this we break
user space applications that expect this to occur that
previously worked.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:27:41 -08:00
Yi Zou 9d837ea2b7 ixgbe: do not update real num queues when netdev is going away
If the netdev is already in NETREG_UNREGISTERING/_UNREGISTERED state, do not
update the real num tx queues. netdev_queue_update_kobjects() is already
called via remove_queue_kobjects() at NETREG_UNREGISTERING time. So, when
upper layer driver, e.g., FCoE protocol stack is monitoring the netdev
event of NETDEV_UNREGISTER and calls back to LLD ndo_fcoe_disable() to remove
extra queues allocated for FCoE, the associated txq sysfs kobjects are already
removed, and trying to update the real num queues would cause something like
below:

...
PID: 25138  TASK: ffff88021e64c440  CPU: 3   COMMAND: "kworker/3:3"
 #0 [ffff88021f007760] machine_kexec at ffffffff810226d9
 #1 [ffff88021f0077d0] crash_kexec at ffffffff81089d2d
 #2 [ffff88021f0078a0] oops_end at ffffffff813bca78
 #3 [ffff88021f0078d0] no_context at ffffffff81029e72
 #4 [ffff88021f007920] __bad_area_nosemaphore at ffffffff8102a155
 #5 [ffff88021f0079f0] bad_area_nosemaphore at ffffffff8102a23e
 #6 [ffff88021f007a00] do_page_fault at ffffffff813bf32e
 #7 [ffff88021f007b10] page_fault at ffffffff813bc045
    [exception RIP: sysfs_find_dirent+17]
    RIP: ffffffff81178611  RSP: ffff88021f007bc0  RFLAGS: 00010246
    RAX: ffff88021e64c440  RBX: ffffffff8156cc63  RCX: 0000000000000004
    RDX: ffffffff8156cc63  RSI: 0000000000000000  RDI: 0000000000000000
    RBP: ffff88021f007be0   R8: 0000000000000004   R9: 0000000000000008
    R10: ffffffff816fed00  R11: 0000000000000004  R12: 0000000000000000
    R13: ffffffff8156cc63  R14: 0000000000000000  R15: ffff8802222a0000
    ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 #8 [ffff88021f007be8] sysfs_get_dirent at ffffffff81178c07
 #9 [ffff88021f007c18] sysfs_remove_group at ffffffff8117ac27
#10 [ffff88021f007c48] netdev_queue_update_kobjects at ffffffff813178f9
#11 [ffff88021f007c88] netif_set_real_num_tx_queues at ffffffff81303e38
#12 [ffff88021f007cc8] ixgbe_set_num_queues at ffffffffa0249763 [ixgbe]
#13 [ffff88021f007cf8] ixgbe_init_interrupt_scheme at ffffffffa024ea89 [ixgbe]
#14 [ffff88021f007d48] ixgbe_fcoe_disable at ffffffffa0267113 [ixgbe]
#15 [ffff88021f007d68] vlan_dev_fcoe_disable at ffffffffa014fef5 [8021q]
#16 [ffff88021f007d78] fcoe_interface_cleanup at ffffffffa02b7dfd [fcoe]
#17 [ffff88021f007df8] fcoe_destroy_work at ffffffffa02b7f08 [fcoe]
#18 [ffff88021f007e18] process_one_work at ffffffff8105d7ca
#19 [ffff88021f007e68] worker_thread at ffffffff81060513
#20 [ffff88021f007ee8] kthread at ffffffff810648b6
#21 [ffff88021f007f48] kernel_thread_helper at ffffffff813c40f4

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:26:52 -08:00
Alexander Duyck 642c680e93 ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size
This patch fixes an issue in which RSC will generate corrupted frames when
PAGE_SIZE is larger than 8K.  Specifically it looks like that in 2.6.39 a
change was made so that GRO would always have at least 16 frags available
for coalescing, but the ixgbe RSC logic was not updated.  As such the RSC
feature would generate a frame larger than 64K and then overflow the value
in the IP length field.

To correct that I am now basing things on the PAGE_SIZE.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:26:46 -08:00
Greg Rose 4cd6923d34 ixgbe: Fix case of Tx Hang in PF with 32 VFs
A check for the number of VFs allocated should have used a greater than
equal operator instead of just greater than.  This caused allocation of
exactly 32 VFs to not enable the PF transmit and receive enables.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Robert E Garrett <robertX.e.garrett@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:25:49 -08:00
Greg Rose a4b08329c7 ixgbe: fix vf lookup
Recent addition of code to find already allocated VFs failed to take
account that systems with 2 or more multi-port SR-IOV capable controllers
might have already enabled VFs.  Make sure that the VFs the function is
finding are actually subordinate to the particular instance of the adapter
that is looking for them and not subordinate to some device that has
previously enabled SR-IOV.

This bug exists in 3.2 stable as well as 3.3 release candidates.

CC: stable@vger.kernel.org
Reported-by: David Ahern <daahern@cisco.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Robert E Garrett <robertX.e.garrett@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:25:42 -08:00
Greg Rose 0629292117 igb: fix vf lookup
Recent addition of code to find already allocated VFs failed to take
account that systems with 2 or more multi-port SR-IOV capable controllers
might have already enabled VFs.  Make sure that the VFs the function is
finding are actually subordinate to the particular instance of the adapter
that is looking for them and not subordinate to some device that has
previously enabled SR-IOV.

This is applicable to 3.2+ kernels.

CC: stable@vger.kernel.org
Reported-by: David Ahern <daahern@cisco.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Robert E Garrett <robertX.e.garrett@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:24:29 -08:00
Dean Nelson b868179c47 e1000: add dropped DMA receive enable back in for WoL
Commit d5bc77a223 broke Wake-on-LAN by
inadvertently dropping the enabling of DMA receives.

Restore the enabling of DMA receives for WoL.

This is applicable to 3.1+ stable trees.

CC: stable@vger.stable.org
Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Dean Nelson <dnelson@redhat.com>
Tested-by: Tobias Klausmann <klausman@schwarzvogel.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-09 01:24:23 -08:00
Dan Carpenter a584b7ae4e netxen_nic: signedness bug in netxen_md_entry_err_chk()
"esize" should be signed because it can be negative here.  For example,
when we call it in netxen_parse_md_template(), it could be -1 from the
return value of netxen_md_L2Cache().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-08 19:57:55 -05:00
Pradeep A. Dalvi 1ab0d2ec9a netdev: ethernet dev_alloc_skb to netdev_alloc_skb
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-08 18:46:38 -05:00
Pradeep A. Dalvi dae2e9f430 netdev: ethernet dev_alloc_skb to netdev_alloc_skb
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-08 18:46:38 -05:00
Masanari Iida 8c1a7f5283 stmmac: Fix typo in stmmac_pci.c
Correct spelling "regiser" to "register" in
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-08 15:29:15 -05:00
Pradeep A. Dalvi 31a4c8b827 mace: Fix build for mace due to netdev_alloc_skb
Refs:
1. pmac32_defconfig
http://kisskb.ellerman.id.au/kisskb/buildresult/5583746/
2. ppc6xx_defconfig
http://kisskb.ellerman.id.au/kisskb/buildresult/5584116/

Confirmed any such occurances from all failed defconfigs &
in net-next sources with
grep -nrs "netdev_alloc_skb" drivers/net/ethernet/ | grep -v ","

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-08 15:23:52 -05:00
David S. Miller 7280f5ae0d sonice: Fix build due to botched netdev_alloc_skb() conversion.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 15:28:15 -05:00
Atsushi Nemoto a1728800be net: enable TC35815 for MIPS again
8<----------------------------------------------------------------------
From: Ralf Roesch <ralf.roesch@rw-gmbh.de>
Date: Wed, 16 Nov 2011 09:33:50 +0100
Subject: [PATCH] net: enable TC35815 for MIPS again

TX493[8,9] MIPS SoCs support 2 Ethernet channels of type TC35815
which are connected to the internal PCI controller.
And JMR3927 MIPS board has a TC35815 chip on board.
These dependencies were lost on movement to drivers/net/ethernet/toshiba.

Signed-off-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC: stable@vger.kernel.org [3.2+]
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:40:44 -05:00
Eric Dumazet bb7d92e3e3 sh-eth: use netdev stats structure and fix dma_map_single
No need to maintain a parallel net_device_stats structure in
sh_eth_private, since we have a generic one in netdev

Fix two dma_map_single() incorrect parameters, passing skb->tail instead
of skb->data. Seems that there is no corresponding dmap_unmap_single()
calls for the moment in this driver.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:38:57 -05:00
Yoshihiro Shimoda fdb37a7f84 net: sh_eth: fix skb_over_panic happen
When this GETHER controller received a large frame (about 1800 bytes
or more), skb_over_panic() happened. This is because the previous
driver set the RFLR to 0x1000 (4096 bytes) and the skb allocate size
is smaller than 4096 bytes. So, the controller accepted such a frame.

The controller can discard a large frame by the RFLR setting.
So, the patch modifies the value of RFLR to mtu + ETH_HLEN +
VLAN_HLEN + ETH_FCS_LEN.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:37:30 -05:00
Fabio Estevam b72061a3cb net: fec: Fix build due to wrong dev annotation
commit 21a4e469 (netdev: ethernet dev_alloc_skb to netdev_alloc_skb)
should have used "ndev" instead of "dev".

This causes the following build errors:

drivers/net/ethernet/freescale/fec.c: In function 'fec_enet_rx':
drivers/net/ethernet/freescale/fec.c:714: error: 'dev' undeclared (first use in this function)
drivers/net/ethernet/freescale/fec.c:714: error: (Each undeclared identifier is reported only once
drivers/net/ethernet/freescale/fec.c:714: error: for each function it appears in.)
drivers/net/ethernet/freescale/fec.c: In function 'fec_enet_alloc_buffers':
drivers/net/ethernet/freescale/fec.c:1213: error: 'dev' undeclared (first use in this function)

Fix it, so that fec driver can be built again.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:32:50 -05:00
Jesper Juhl 3f61cd879c bnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails.
We allocate memory for 'new_data' with kmalloc(). If we get the memory
we then try to build_skb() and if that should fail (which it can) we
do not enter 'if (likely(skb)) {' and actually use 'new_data' but
instead fall through to the 'drop:' label and end up returning from
the function without ever assigning 'new'data' to anything or freeing
it. That leaks the memory allocated to 'new_data'.

This patch fixes the memory leak by doing a kfree(new_data) in the
case where build_skb() fails (or where allocation of 'new_data' itself
fails, but in taht case it's just a harmless kfree(NULL)).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:13:33 -05:00
stephen hemminger aadf1f0fc8 Revert "skge: check for PCI dma mapping errors"
As reported by several people...

The code in rx_clean was panic'ing so revert
commit d0249e4443.
Will redo DMA mapping checks as new patches for a later release.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 12:51:10 -05:00
Bruce Allan 0e15df490e e1000e: minor whitespace and indentation cleanup
Cleanup of some whitespace and indentation of a single code block.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:18:09 -08:00
Bruce Allan e885d762b7 e1000e: fix sparse warnings with -D__CHECK_ENDIAN__
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:16:54 -08:00
Bruce Allan a2a5b3235d e1000e: fix checkpatch warning from MINMAX test
WARNING: min() should probably be min_t(unsigned int, 4, skb->data_len)

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:15:52 -08:00
Bruce Allan 24b706b2f4 e1000e: cleanup - use braces in both branches of a conditional statement
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:14:50 -08:00
Bruce Allan f23efdff77 e1000e: cleanup e1000_set_phys_id
Use the existing hw pointer.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:13:17 -08:00
Bruce Allan 66092f5925 e1000e: cleanup e1000_init_mac_params_82571()
Combine two switch statements into one, convert a nebulous pointer to one
that is a bit more in keeping with the rest of the driver code and cleanup
some coding style.  No change in functionality, just cosmetic changes.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:12:14 -08:00
Bruce Allan e68782ed78 e1000e: cleanup e1000_init_mac_params_80003es2lan()
Combine two switch statements into one, convert a nebulous pointer to one
that is a bit more in keeping with the rest of the driver code and remove
some dead code (there are no 80003es2lan devices with fiber).  No change in
functionality, just cosmetic changes.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:11:10 -08:00
Bruce Allan 9e2d7657e2 e1000e: cleanup - check return values consistently
The majority of the e1000e code checks most function return values using a
test like 'if (ret_val)' or 'if (!ret_val)' but there are a few instances
of 'if (ret_val == 0)'.  This patch converts the latter to the former for
consistency.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:10:07 -08:00
Bruce Allan f36bb6cacd e1000e: add missing initializers reported when compiling with W=1
warning: missing initializer

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:09:14 -08:00
Tushar Dave b04e36bac5 e1000: Adding e1000_dump function
When TX hang occurs e1000_dump prints TX ring, RX ring and Device registers.

Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 04:01:46 -08:00
Mitch A Williams ab50a2a430 igbvf: refactor Interrupt Throttle Rate code
The existing ITR code is broken and confusing, with lots of similarly-named
variables that do different things. Additionally, after the driver carefully
determines the optimal interrupt rate for the adapter, it then
ignores it and always writes a fixed, suboptimal value.

This patch refactors that code to make variable names more descriptive of
what they actually do, and then actually writes the calculated result to
the hardware.

Preliminary testing shows that netperf TCP_STREAM tests goes from ~918Mbps
to ~940Mbps, and TCP_RR goes from ~2k transactions/sec up to > 8k.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Robert E Garrett <robertX.e.garrett@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-02-07 03:49:23 -08:00
Thadeu Lima de Souza Cascardo 7e2eb99cc6 mlx4: fix DMA mapping leak when allocation fails
mlx4_en_prepare_rx_desc does not correctly clean up after it finds an
allocation failure. It should unmap a page before calling put_page, but
it only calls the later.

This bug would prevent a device removal using hotplug after setting the
device MTU to 9000 and opening the network interface. After the fix, we
still see the allocation failure with MTU 9000, but we are able to
remove the device.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 14:42:28 -05:00
Thadeu Lima de Souza Cascardo 68355f7113 mlx4: allow device removal by fixing dma unmap size
After opening the network interface, Mellanox ConnectX device cannot be
removed by hotplug because it has not properly unmapped all DMA memory.

It happens that mlx4_en_activate_rx_rings overrides the variable that
keeps the size of the memory mapped.

This is fixed by passing to mlx4_en_destroy_rx_ring the same size that is
given to mlx4_en_create_rx_ring.

After applying this patch, hot unplugging the device works after opening
the interface.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 14:42:28 -05:00
Eugenia Emantayev 4c41b36737 mlx4_core: use correct port for steering
Use port number for correct steering (list per port).
Before the fix all steering entries (for both physical ports)
were managed in first port structures, so we had leakage of resources
for port 2.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 12:10:11 -05:00
Eugenia Emantayev 4df9950406 mlx4_core: use correct flag for unicast_promisc
Use MLX4_DEV_CAP_FLAG_VEP_UC_STEER for unicast_promisc_add/remove
Unicast entries were managed in wrong data structures.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 12:10:11 -05:00
Eugenia Emantayev f08ad06c05 mlx4_core: fix memory leak at multi_func_cleanup
Perform cleanup also in non-master flow.
The VFs use communication channel as well.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 12:10:11 -05:00
Pradeep A Dalvi c056b734e5 netdev: ethernet dev_alloc_skb to netdev_alloc_skb
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 11:52:27 -05:00
Pradeep A Dalvi 21a4e46995 netdev: ethernet dev_alloc_skb to netdev_alloc_skb
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 11:48:09 -05:00
Pradeep A Dalvi 1d26643054 netdev: ethernet dev_alloc_skb to netdev_alloc_skb
Replaced deprecating dev_alloc_skb with netdev_alloc_skb in drivers/net/ethernet
  - Removed extra skb->dev = dev after netdev_alloc_skb

Signed-off-by: Pradeep A Dalvi <netdev@pradeepdalvi.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-06 11:41:20 -05:00
Michael Chan 3238a9be4d cnic: Add FCoE parity error recovery
When bnx2x returns error on FCoE SPQ messages, generate an error
completion to bnx2fc immediately to speed up error recovery.  This
will eliminate length timeouts and spped up the reset of the device.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-05 22:42:00 -05:00
Vlad Zolotarov 94bf91baf3 bnx2: Add missing memory barrier in bnx2_start_xmit()
Sync DMA descriptor before hitting the TX mailbox for weak memory model
CPUs.

There has been discussions several years ago about this.  Some believe
that writel() should guarantee ordering.  Others want explicit barriers
if necessary.  Today writel() does not have the ordering guarantee and
many other drivers use explicit barriers.

Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-05 22:42:00 -05:00