1
0
Fork 0
Commit Graph

349206 Commits (43dc4e0158a343e4f6dc400b925bf4a945f4978b)

Author SHA1 Message Date
Donald Dutile 43dc4e0158 ixgbe: Limit number of reported VFs to device specific value
ixgbe claims it supports 64 VFs in its SRIOV capability
structure, but the driver only supports 63.  Adjust it
so sysfs sriov configuration checking will check with
the proper totalvf value.

Signed-off-by: Donald Dutile <ddutile@redhat.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:10 -08:00
Greg Rose da36b64736 ixgbe: Implement PCI SR-IOV sysfs callback operation
Implement callbacks in the driver for the new PCI bus driver
interface that allows the user to enable/disable SR-IOV VFs
in a device via the sysfs interface.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:07 -08:00
Greg Rose 66dcfd7569 ixgbe: Modularize SR-IOV enablement code
In preparation for enable/disable of SR-IOV via the PCI sysfs interface
move some core SR-IOV enablement code that would be common to module
parameter usage or callback from the PCI bus driver to a separate
function so that it can be used by either method.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:34:01 -08:00
Greg Rose 60a1a6800d ixgbe: Make mailbox ops initialization unconditional
There is no actual dependency on initialization of the mailbox ops on
whether SR-IOV is enabled or not and it doesn't hurt to go ahead and
initialize ops unconditionally.  Move the initialization into the device
probe so that the mailbox ops are initialized at the time we have the
board info necessary to do it.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
CC: Don Dutile <ddutile@redhat.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:53 -08:00
Jacob Keller b205c0de49 ixgbe: only compile ixgbe_debugfs.o when enabled
This patch modifies ixgbe_debugfs.c and the Makefile for the ixgbe
driver to only compile the file when the config is enabled. This means
we can remove the #ifdef inside the ixgbe_debugfs.c file.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:29 -08:00
Alexander Duyck 39dfb71bc0 ixgbe: Inline Rx PTP descriptor handling
This change is meant to inline the Rx PTP descriptor handling.  The main
motivation is to avoid unnecessary jumps into function calls that we then
immediately exit because we are not performing timestamps.

The net result of this change is that ixgbe_ptp_rx_tstamp drops from .5% CPU
utilization in my performance runs to 0%, and the only value tested is the Rx
descriptor which should already be warm in the cache if not stored in a
register.

Cc: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:29 -08:00
Jacob Keller b1e50f7ac7 ixgbe: Fix overwriting of rx_mtrl in ixgbe_ptp_hwtstamp_ioctl
This patch corrects a bug introduced by commit f3444d8b. The rxmtrl value for
the UDP port to timestamp on was moved above the switch statement, but was
overwritten to 0 if the ioctl selected one of the V1 filters.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:28 -08:00
Jacob Keller 12ff3f3b6c ixgbe: add warning when scheduling reset
This patch adds warnings when a reset of the adapter is scheduled so that the
user can see log of why the reset occurred.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:28 -08:00
Jacob Keller 891dc0821d ixgbe: Add ptp work item to poll for the Tx timestamp
This patch copies the igb implementation of Tx timestamps, which uses a work
item to poll for the Tx timestamp. In addition it adds a timeout value of 15
seconds, after which it will stop polling.

This is necessary due to an issue with the descriptor being marked done before
the Tx timestamp event has occurred. These two events don't correlate, so using
the done bit on the descriptor as indication that the timestamp must already
have been taken leads to potentially dropped Tx timestamps (especially under
heavy packet load)

Reported-by: Matthew Vick <matthew.vick@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:33:28 -08:00
Jacob Keller 6cb562d668 ixgbe: Use watchdog check in favor of BPF for detecting latched timestamp
This patch removes ixgbe_ptp_match, and the corresponding packet filtering from
ixgbe driver. This code was previously causing some issues within the hotpath of
the driver. However the code also provided a check against possible frozen Rx
timestamp due to dropped packets when the Rx ring is full. This patch provides a
replacement solution based on the watchdog.

To this end, whenever a packet consumes the Rx timestamp it stores the jiffy
value in the rx_ring structure. Watchdog updates its own jiffy timer whenever
there is no valid timestamp in the registers.

If watchdog detects a valid timestamp in the registers, (meaning that no Rx
packet has consumed it yet) it will check which time is most recent, the last
time in the watchdog, or any time in the rx_rings. If the most recent "event"
was more than 5seconds ago, it will flush the Rx timestamp and print a warning
message to the syslog.

Reported-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:57 -08:00
Jacob Keller f2f33387f9 ixgbe: Update ptp_overflow check comment and jiffies
This patch fixes the comment on ptp_overflow_check to match up with what is
currently used as the parameters. Also change the jiffies check to use
time_is_after_jiffies macro.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:57 -08:00
Jacob Keller aeb8264847 ixgbe: add missing supported filters to get_ts_info
This patch updates the filters for ethtool's get_ts_info to return support for
all filters which can be supported by upscaling to ptp_v2_event. The intent
behind this change is due to reasoning that we do in fact support the
filters. (hwtstamp_ioctl returns success after setting the filter to the
upscaled version). In this way we can remain consistent over which filters are
supported via the get_ts_info ioctl and which filters are in practice actually
supported.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:57 -08:00
Jacob Keller dfcc4615f0 ixgbe: ethtool ixgbe_diag_test cleanup
This patch cleans up the ethtool diagnostics test by ensuring that the tests
work properly regardless of what state the adapter was in. The SRIOV VF check is
done at the beginning, forgoing the link test. The if_running -> dev_close is
moved before the link test, as well as a call to enable the Tx laser. This
ensures that the link test will return valid results even when adapter was
previously down. Also, a call to disable the Tx laser is added if the device
was down before the start. This ensures consistent behavior of the Tx laser
before and after the diagnostic checks. The end result is consistent behavior
regardless of device state.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-23 14:32:31 -08:00
David S. Miller 93b9c1ddd3 Merge branch 'testing' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
Steffen Klassert says:

====================
1) Add a statistic counter for invalid output states and
   remove a superfluous state valid check, from Li RongQing.

2) Probe for asynchronous block ciphers instead of synchronous block
   ciphers to make the asynchronous variants available even if no
   synchronous block ciphers are found, from Jussi Kivilinna.

3) Make rfc3686 asynchronous block cipher and make use of
   the new asynchronous variant, from Jussi Kivilinna.

4) Replace some rwlocks by rcu, from Cong Wang.

5) Remove some unused defines.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 14:00:16 -05:00
Ariel Elior 4c133c39ae bnx2x: SR-IOV version compatibility bugfix
When posting a message on the bulletin board, the PF calculates crc
over the message and places the result in the message. When the VF
samples the Bulletin Board it copies the message aside and validates
this crc. The length of the message is crucial here and must be the
same in both parties. Since the PF is running in the Hypervisor and
the VF is running in a Vm, they can possibly be of different versions.
As the Bulletin Board is designed to grow forward in future versions,
in the VF the length must not be the size of the message structure
but instead it should be a field in the message itself.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:30 -05:00
Yuval Mintz ca9bdb9b27 bnx2x: Fix compilation with stop-on-error
Commit 823e1d9 caused bnx2x to fail once BNX2X_STOP_ON_ERROR is set.
Fixes compilation by moving function declarations between header files.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Michael Chan ad9b4359c7 cnic, bnx2x: Add CNIC_DRV_STATE_HANDLES_IRQ to ethdev->drv_state
In INTA mode, cnic and bnx2x share the same IRQ.  During chip reset,
for example, cnic will stop servicing IRQs after it has shutdown the
cnic hardware resources.  However, the shared IRQ is still active as
bnx2x needs to finish the reset.  There is a window when bnx2x does
not know that cnic is no longer handling IRQ and things don't always
work properly.

Add a flag to tell bnx2x that cnic is handling IRQ.  The flag is set
before the first cnic IRQ is expected and cleared when no more cnic
IRQs are expected, so there should be no race conditions.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Yuval Mintz 580d9d0813 bnx2x: correct memory release scheme
Fix an incorrect SR-IOV memory release which was committed in 1ab4434.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Yuval Mintz 86564c3f0f bnx2x: Remove many sparse warnings
Remove most of the sparse warnings in the bnx2x compilation
(i.e., thus resulting when compiling with `C=2 CF=-D__CHECK_ENDIAN__').

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Yuval Mintz 80bfe5cc1b bnx2x: Modify unload conditions
Don't unload the bnx2x driver if its in a recovery process, or if
the previous load have failed.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:29 -05:00
Dmitry Kravkov c3146eb676 bnx2x: Correct memory preparation and release
Since commit 15192a8cf there have been a memory leak upon rmmod
of the bnx2x driver.

This corrects the memory leak and corrects the zeroing of internal
memories upon driver load.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:28 -05:00
Yuval Mintz 6ab20355c0 bnx2x: Add missing VFs reference in macros
Add missing 57712_VF and 57800_VF to CHIP_IS_E2 and CHIP_IS_E3
macros (missing from commit 8395be5).

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:28 -05:00
Yuval Mintz 04c4673665 bnx2x: Add additional debug information
Add/Revise several debug prints in the bnx2x driver - on regular flows
as well as error flows.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:28 -05:00
Yuval Mintz 0926d499e2 bnx2x: correct usleep_range usage
Change the incorrect usage of `usleep_range(1000, 1000)' into
`usleep_range(1000, 2000)'.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:28 -05:00
Yuval Mintz 924d75ab3d bnx2x: reorganization and beautification
Slightly changes the bnx2x code without `true' functional changes.
Changes include:
 1. Gathering macros into a single macro when combination is used multiple
    times.
 2. Exporting parts of functions into their own functions.
 3. Return values after if-else instead of only on the else condition
    (where current flow would simply return same value later in the code)
 4. Removing some unnecessary code (either dead-code or incorrect conditions)

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:27 -05:00
Yuval Mintz 2de67439c1 bnx2x: Semantic renovation
Mostly corrects white spaces, indentations, and comments.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:58:27 -05:00
Claudiu Manoil f5ae62799a gianfar: Restore promisc mode on gfar_init_mac()
Reactivate promiscuous mode in H/W upon gfar_init_mac(), if the
net dev requires it (IFF_PROMISC flag set).
This way the promisc mode is preserved accross device reset conditions
like tx timeout, device restore, a.s.o.

Signed-off-by: Voncken C Acksys <cedric.voncken@acksys.fr>
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:54:11 -05:00
David S. Miller c617f398ed Merge branch 'soreuseport'
Tom Herbert says:

====================
This series implements so_reuseport (SO_REUSEPORT socket option) for
TCP and UDP.  For TCP, so_reuseport allows multiple listener sockets
to be bound to the same port.  In the case of UDP, so_reuseport allows
multiple sockets to bind to the same port.  To prevent port hijacking
all sockets bound to the same port using so_reuseport must have the
same uid.  Received packets are distributed to multiple sockets bound
to the same port using a 4-tuple hash.

The motivating case for so_resuseport in TCP would be something like
a web server binding to port 80 running with multiple threads, where
each thread might have it's own listener socket.  This could be done
as an alternative to other models: 1) have one listener thread which
dispatches completed connections to workers. 2) accept on a single
listener socket from multiple threads.  In case #1 the listener thread
can easily become the bottleneck with high connection turn-over rate.
In case #2, the proportion of connections accepted per thread tends
to be uneven under high connection load (assuming simple event loop:
while (1) { accept(); process() }, wakeup does not promote fairness
among the sockets.  We have seen the  disproportion to be as high
as 3:1 ratio between thread accepting most connections and the one
accepting the fewest.  With so_reusport the distribution is
uniform.

The TCP implementation has a problem in that the request sockets for a
listener are attached to a listener socket.  If a SYN is received, a
listener socket is chosen and request structure is created (SYN-RECV
state).  If the subsequent ack in 3WHS does not match the same port
by so_reusport, the connection state is not found (reset) and the
request structure is orphaned.  This scenario would occur when the
number of listener sockets bound to a port changes (new ones are
added, or old ones closed).  We are looking for a solution to this,
maybe allow multiple sockets to share the same request table...

The motivating case for so_reuseport in UDP would be something like a
DNS server.  An alternative would be to recv on the same socket from
multiple threads.  As in the case of TCP, the load across these threads
tends to be disproportionate and we also see a lot of contection on
the socket lock.  Note that SO_REUSEADDR already allows multiple UDP
sockets to bind to the same port, however there is no provision to
prevent hijacking and nothing to distribute packets across all the
sockets sharing the same bound port.  This patch does not change the
semantics of SO_REUSEADDR, but provides usable functionality of it
for unicast.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:44:10 -05:00
Tom Herbert 72289b96c9 soreuseport: UDP/IPv6 implementation
Motivation for soreuseport would be something like a DNS server.  An
alternative would be to recv on the same socket from multiple threads.
As in the case of TCP, the load across these threads tends to be
disproportionate and we also see a lot of contection on the socket lock.
Note that SO_REUSEADDR already allows multiple UDP sockets to bind to
the same port, however there is no provision to prevent hijacking and
nothing to distribute packets across all the sockets sharing the same
bound port.  This patch does not change the semantics of SO_REUSEADDR,
but provides usable functionality of it for unicast.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:44:01 -05:00
Tom Herbert 5ba24953e9 soreuseport: TCP/IPv6 implementation
Motivation for soreuseport would be something like a web server
binding to port 80 running with multiple threads, where each thread
might have it's own listener socket.  This could be done as an
alternative to other models: 1) have one listener thread which
dispatches completed connections to workers. 2) accept on a single
listener socket from multiple threads.  In case #1 the listener thread
can easily become the bottleneck with high connection turn-over rate.
In case #2, the proportion of connections accepted per thread tends
to be uneven under high connection load (assuming simple event loop:
while (1) { accept(); process() }, wakeup does not promote fairness
among the sockets.  We have seen the  disproportion to be as high
as 3:1 ratio between thread accepting most connections and the one
accepting the fewest.  With so_reusport the distribution is
uniform.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:44:01 -05:00
Tom Herbert ba418fa357 soreuseport: UDP/IPv4 implementation
Allow multiple UDP sockets to bind to the same port.

Motivation soreuseport would be something like a DNS server.  An
alternative would be to recv on the same socket from multiple threads.
As in the case of TCP, the load across these threads tends to be
disproportionate and we also see a lot of contection on the socketlock.
Note that SO_REUSEADDR already allows multiple UDP sockets to bind to
the same port, however there is no provision to prevent hijacking and
nothing to distribute packets across all the sockets sharing the same
bound port.  This patch does not change the semantics of SO_REUSEADDR,
but provides usable functionality of it for unicast.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:44:01 -05:00
Tom Herbert da5e36308d soreuseport: TCP/IPv4 implementation
Allow multiple listener sockets to bind to the same port.

Motivation for soresuseport would be something like a web server
binding to port 80 running with multiple threads, where each thread
might have it's own listener socket.  This could be done as an
alternative to other models: 1) have one listener thread which
dispatches completed connections to workers. 2) accept on a single
listener socket from multiple threads.  In case #1 the listener thread
can easily become the bottleneck with high connection turn-over rate.
In case #2, the proportion of connections accepted per thread tends
to be uneven under high connection load (assuming simple event loop:
while (1) { accept(); process() }, wakeup does not promote fairness
among the sockets.  We have seen the  disproportion to be as high
as 3:1 ratio between thread accepting most connections and the one
accepting the fewest.  With so_reusport the distribution is
uniform.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:44:01 -05:00
Tom Herbert 055dc21a1d soreuseport: infrastructure
Definitions and macros for implementing soreusport.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:44:00 -05:00
Matt Wilson 4a633a602c xen-netback: allow changing the MAC address of the interface
Sometimes it is useful to be able to change the MAC address of the
interface for netback devices. For example, when using ebtables it may
be useful to be able to distinguish traffic from different interfaces
without depending on the interface name.

Reported-by: Nikita Borzykh <sample.n@gmail.com>
Reported-by: Paul Harvey <stockingpaul@hotmail.com>
Cc: netdev@vger.kernel.org
Cc: xen-devel@lists.xen.org
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Matt Wilson <msw@amazon.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-23 13:42:20 -05:00
Cong Wang e39363a9de netpoll: fix an uninitialized variable
Fengguang reported:

   net/core/netpoll.c: In function 'netpoll_setup':
   net/core/netpoll.c:1049:6: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]

in !CONFIG_IPV6 case, we may error out without initializing
'err'.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 23:18:59 -05:00
Cong Wang 9647bb80a5 ipv6: remove duplicated declaration of ip6_fragment()
It is declared in:
include/net/ip6_route.h:187:int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));

and net/ip6_route.h is already included.

Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 23:18:59 -05:00
David S. Miller 930d52c012 Merge branch 'legacy-isa-delete' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
Paul Gortmaker says:

====================
The Ethernet-HowTo was maintained for roughly 10 years, from 1993 to 2003.
Fortunately sane hardware probing and auto detection (via PCI and ISA/PnP)
largely made the document a relic of the past, hence it being abandoned
a decade ago.

However, there is one last useful thing that we can extract from the
effort made in maintaining that document.  We can use it to guide us
with respect to what rare, experimental and/or super ancient 10Mbit
ISA drivers don't make sense to maintain in-tree anymore.

Nobody will argue that ISA is obsolete.  Availability went away at about
the time Pentium3 motherboards moved from 500MHz Slot1/SECC processors
to the green 500MHz Socket 370 Pentium3 chips, at the turn of the century.

In theory, it is possible that someone could still be running one of these
12+ year old P3 machines and want 3.9+ bleeding edge kernels (but unlikely).
In light of the above (remote) possibility, we can defer the removal of some
ISA network drivers that were highly popular and well tested.  Typically
that means the stuff more from the mid to late '90s, some with ISA PnP
support, like the 3c509, the wd/SMC 8390 based stuff, PCnet/lance etc.

But a lot of other drivers, typically from the early 1990s were for rare
hardware, and experimental (to the point of requiring a cron job that would
do a test ping, and then ifconfig down/up and/or a rmmod/insmod!).  And
some of these drivers (znet, and lp486e to name two) are physically tied
to platforms with on motherboard ethernet -- of 486 machines that date
from the early 1990s and can only have single digit amounts of memory.

What I'd like to achieve here with this series, is to get rid of those old
drivers that are no longer being used.  In an earlier discussion where
I'd proposed deleting a single driver, Alan suggested we instead dump
all the historical stuff in one go, to make it "...immediately obvious
where the break point is..."[1] and that it was "perfectly reasonable it
(and a pile of other ISA cards) ought to be shown the door"[2].  So that
is the goal here - make a clear line in the sand where the really ancient
stuff finally gets kicked to the curb.

Two old parallel port drivers are considered for removal here as well,
since in early 386/486 ISA machines, the parallel port was typically found
with the UARTS on the multi-I/O ISA controller card.  These drivers also date
from the early 1990's; parallel ports are no longer found on modern boards,
and their performance was not even capable of 10% of 10Mbit bandwidth.

Allow me a preemptive justification against the inevitable comments from
well meaning bystanders who suggest "why not just leave all this alone?".
Dead drivers cost us all if they are left in tree.  If you think that
is false, then please first consider:

-every time you type "git status", you are checking to see if modifications
 have been made by you to all that dead code.

-every time you type "git grep <regex>" you are searching through files
 which contain that dead code that simply does not interest you.

-every time you build a "allyesconfig" and an "allmodconfig" (don't tell
 me you skip this step before submitting your changes to a maintainer),
 you waste CPU cycles building this dead code.

-every time there is a tree wide API change, or cleanup, or file relocation,
 we pay the cost of updating dead code, or moving dead code.

-daily regression tests (take linux-next as the most transparent
 example) spend time building (and possibly running) this dead code.

-hard working people who regularly run auditing tools looking for lurking
 bugs (sparse/coverity/smatch/coccinelle) are wasting time checking for,
 and fixing bugs in this dead code.

This last one is key.  Please take a look at the git history for the
files that are proposed for removal here.  Look at the git history for
any one of them ("git whatchanged --follow drivers/net/.../driver.c")
Mentally sort the changes into two bins -- (1) the robotic tree-wide
changes, and (2) the "look I found a real run-time bug while using this"
category.  You will see that category #2 is essentially empty.

Further to that, realize that drivers don't simply disappear.  We are
not operating in the binary-only distribution space like other OS.  All
these drivers remain in the git history forever.  If a person is an
enthusiast for extreme legacy hardware, they are probably already
customizing their kernel source and building it themselves to support
such systems.  Also keep in mind that they could still build the 3.8
kernel exactly as-is, and run it (or a 3.8.x stable variant of it) for
several more years if they were really determined to cling to these old
experimental ISA drivers for some reason.

In summary, I hope that folks can be pragmatic about this, and not
get swept up in nostalgia.  Ask yourself whether it is realistic to
expect a person would have a genuine use case where they would
need to build a 3.9+ modern kernel and install it on some legacy hardware
that has no option but to absolutely _require_ one of the drivers
that are deleted here.

The following series was created with --irreversible-delete for
ease of review (it skips showing the content of files that are
deleted); however the complete patches can be pulled as per below.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:47:13 -05:00
YOSHIFUJI Hideaki / 吉藤英明 0cc8d8df9b netfilter: Use IS_ERR_OR_NULL().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:28:29 -05:00
YOSHIFUJI Hideaki / 吉藤英明 3f0d2ba0bd ipv6: Use IS_ERR_OR_NULL().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:28:28 -05:00
YOSHIFUJI Hideaki / 吉藤英明 50c3a487d5 ipv4: Use IS_ERR_OR_NULL().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:28:28 -05:00
YOSHIFUJI Hideaki / 吉藤英明 8fbcec241d net: Use IS_ERR_OR_NULL().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:28:28 -05:00
YOSHIFUJI Hideaki / 吉藤英明 2724680bce neigh: Keep neighbour cache entries if number of them is small enough.
Since we have removed NCE (Neighbour Cache Entry) reference from
routing entries, the only refcnt holders of an NCE are its timer
(if running) and its owner table, in usual cases.  As a result,
neigh_periodic_work() purges NCEs over and over again even for
gateways.

It does not make sense to purge entries, if number of them is
very small, so keep them.  The minimum number of entries to keep
is specified by gc_thresh1.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:25:28 -05:00
Nicolas Dichtel 360eb5da66 ipmr: fix sparse warning when testing origin or group
mfc_mcastgrp and mfc_origin are __be32, thus we need to convert INADDR_ANY.
Because INADDR_ANY is 0, this patch just fix sparse warnings.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-01-22 14:24:29 -05:00
Paul Gortmaker 463d413cb7 drivers/net: delete old x86 variant of the seeq8005 driver
The last update to the Ethernet HowTo (over 10 years ago) listed this:

 ------------------------
   SEEQ 8005

   Status: Obsolete, Driver Name: seeq8005

   There is little information about the card included in the driver,
   and hence little information to be put here. If you have a question,
   you are probably best trying to e-mail the driver author as listed
   in the source.

   It was marked obsolete as of the 2.4 series kernels.
 ------------------------

If it was obsolete over a decade ago, the situation can not have
improved with the passage of time, so let us act on that.  Even with
today's improved search engines, I was unable to locate any real
meaningful information on the ISA implementation of this rare chip.

There are ARM and SGI variants of the driver in tree, but they do
not depend on the original x86 driver source or header file.  We
leave those non-x86 drivers to be deleted by the arch maintainers
when they decide to expire those legacy platforms as a whole.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:56 -05:00
Paul Gortmaker 0ffd89e48f drivers/net: delete Digital EtherWorks-3 support.
This is another one that makes sense to target for obsolescence, since
it (a)appeared pre-1995, and (b)was rather rare, and (c)did not
really have any statistically significant active linux user base.

Removing this ISA 10Mbit driver support is unlikely to be even noticed
by the user base of 3.9+ linux kernels, especially when the documentation
clearly indicates the vintage with this text:

	 "...designed to  work with all kernels > 1.1.33"

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:55 -05:00
Paul Gortmaker 1f1c7a5c1d drivers/net: delete old DEC depca ISA drivers support.
These are old ISA 10Mbit cards from the 1st 1/2 of the 1990s and
required manual jumper settings in order to configure them.  Here
we remove them on the premise that they are no longer used in any
modern 3.9+ kernels.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:55 -05:00
Paul Gortmaker fce3cd45e6 drivers/net: delete the really obsolete 8390 based 10Mbit ISA drivers
This is an area I know all too well, after being author of several 8390
drivers, and maintainer of all 8390 drivers during a large part of their
active lifecycle.

To that end, I can say this with a reasonable degree of confidence.
The drivers deleted here represent the earliest (as in early 1990)
hardware and/or rare hardware.  The remaining hardware not deleted
here is the more modern/sane of the lot, with ISA-PnP and jumperless
"soft configuration" like the wd and smc cards had.

The original ne2000 driver (ne.c) gets a pass at this time since
AT/LANTIC based cards that could be both ne2000 or wd-like (with
shared memory) and with jumperless configuration were made in the
mid to late 1990's, and performed reasonably well for their era.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:54 -05:00
Paul Gortmaker bb37f1223a drivers/net: delete old fujitsu based eth16i driver
This is another driver for relatively rare 10Mbit hardware that
originated in the early 1990's.  So we select it for removal at
this point in time as well.

Cc: Mika Kuoppala <miku@iki.fi>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:54 -05:00
Paul Gortmaker 13a80cb8b7 drivers/net: delete at1700 ISA 10Mbit driver
These Fujitsu MB86965 based ISA 10Mbit cards were another of the
relatively rare cards dating from the early 1990s that for one reason
or another didn't seem to get a lot of use in linux.  So we retire it
now with a reasonable degree of confidence that it won't impact anyone.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:53 -05:00
Paul Gortmaker d2477de7a6 drivers/net: delete old 8 bit ISA Racal ni5010 support.
These cards were only available in 8bit format, and in addition
they only had AUI and BNC(10-Base2) interfaces (i.e. no RJ-45).

In fact, they are so rare, that an internet search on these old
cards almost comes up empty, unless the "Micom interlan" name
is used.

This puts them in the equivalent domain as the 3c501, so there
should be no strong opposition to the driver removal, as nobody
is seriously using 3.9+ with 8 bit ISA hardware.

In doing so, the whole "ethernet/racal" category becomes empty,
so we clean up the Makefile/Kconfig and subdir appropriately.

Cc: Andreas Mohr <andi@lisas.de>
Cc: Jan-Pascal van Best <janpascal@vanbest.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2013-01-22 10:39:52 -05:00