]> git.karo-electronics.de Git - mv-sheeva.git/log
mv-sheeva.git
13 years agonet: Add sendmmsg socket system call
Anton Blanchard [Mon, 2 May 2011 20:21:35 +0000 (20:21 +0000)]
net: Add sendmmsg socket system call

This patch adds a multiple message send syscall and is the send
version of the existing recvmmsg syscall. This is heavily
based on the patch by Arnaldo that added recvmmsg.

I wrote a microbenchmark to test the performance gains of using
this new syscall:

http://ozlabs.org/~anton/junkcode/sendmmsg_test.c

The test was run on a ppc64 box with a 10 Gbit network card. The
benchmark can send both UDP and RAW ethernet packets.

64B UDP

batch   pkts/sec
1       804570
2       872800 (+ 8 %)
4       916556 (+14 %)
8       939712 (+17 %)
16      952688 (+18 %)
32      956448 (+19 %)
64      964800 (+20 %)

64B raw socket

batch   pkts/sec
1       1201449
2       1350028 (+12 %)
4       1461416 (+22 %)
8       1513080 (+26 %)
16      1541216 (+28 %)
32      1553440 (+29 %)
64      1557888 (+30 %)

We see a 20% improvement in throughput on UDP send and 30%
on raw socket send.

[ Add sparc syscall entries. -DaveM ]

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: call dev_alloc_name from register_netdevice
Jiri Pirko [Sat, 30 Apr 2011 01:21:32 +0000 (01:21 +0000)]
net: call dev_alloc_name from register_netdevice

Force dev_alloc_name() to be called from register_netdevice() by
dev_get_valid_name(). That allows to remove multiple explicit
dev_alloc_name() calls.

The possibility to call dev_alloc_name in advance remains.

This also fixes veth creation regresion caused by
84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: function descriptions format fixed
Dmitry Kravkov [Wed, 4 May 2011 23:52:40 +0000 (23:52 +0000)]
bnx2x: function descriptions format fixed

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>
13 years agobnx2x: update year to 2011 and version to 1.62.12-0
Dmitry Kravkov [Wed, 4 May 2011 23:51:13 +0000 (23:51 +0000)]
bnx2x: update year to 2011 and version to 1.62.12-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>
13 years agobnx2x: improve memory handling, low memory recovery flows
Dmitry Kravkov [Wed, 4 May 2011 23:50:33 +0000 (23:50 +0000)]
bnx2x: improve memory handling, low memory recovery flows

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>
13 years agobnx2x: Do storage mac address validation for SF mode.
Dmitry Kravkov [Wed, 4 May 2011 23:49:53 +0000 (23:49 +0000)]
bnx2x: Do storage mac address validation for SF mode.

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>
13 years agobnx2x: allow WoL on every function in MF modes
Dmitry Kravkov [Wed, 4 May 2011 23:49:11 +0000 (23:49 +0000)]
bnx2x: allow WoL on every function in MF modes

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>
13 years agobnx2x: link report improvements
Vladislav Zolotarov [Wed, 4 May 2011 23:48:23 +0000 (23:48 +0000)]
bnx2x: link report improvements

To avoid link notification duplication

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: removed not used definitions
Giuseppe CAVALLARO [Thu, 5 May 2011 00:10:50 +0000 (00:10 +0000)]
stmmac: removed not used definitions

Reported-by: Karim Hamiti <karim.hamiti@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: rename can_try_module_get to can_get_proto
Kurt Van Dijck [Tue, 3 May 2011 18:42:04 +0000 (18:42 +0000)]
can: rename can_try_module_get to can_get_proto

can: rename can_try_module_get to can_get_proto

can_try_module_get does return a struct can_proto.
The name explains what is done in so much detail that a caller
may not notice that a struct can_proto is locked/unlocked.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: make struct can_proto const
Kurt Van Dijck [Tue, 3 May 2011 18:40:57 +0000 (18:40 +0000)]
can: make struct can_proto const

commit 53914b67993c724cec585863755c9ebc8446e83b had the
same message. That commit did put everything in place but
did not make can_proto const itself.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Wed, 4 May 2011 20:54:50 +0000 (13:54 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6

13 years agoipv6: Use flowi4->{daddr,saddr} in ipip6_tunnel_xmit().
David S. Miller [Wed, 4 May 2011 19:46:24 +0000 (12:46 -0700)]
ipv6: Use flowi4->{daddr,saddr} in ipip6_tunnel_xmit().

Instead of rt->rt_{dst,src}

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Kill rt->rt_{src, dst} usage in IP GRE tunnels.
David S. Miller [Wed, 4 May 2011 19:33:34 +0000 (12:33 -0700)]
ipv4: Kill rt->rt_{src, dst} usage in IP GRE tunnels.

First, make callers pass on-stack flowi4 to ip_route_output_gre()
so they can get at the fully resolved flow key.

Next, use that in ipgre_tunnel_xmit() to avoid the need to use
rt->rt_{dst,src}.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Pass explicit saddr/daddr args to ipmr_get_route().
David S. Miller [Wed, 4 May 2011 19:18:54 +0000 (12:18 -0700)]
ipv4: Pass explicit saddr/daddr args to ipmr_get_route().

This eliminates the need to use rt->rt_{src,dst}.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: Cleanup PCIe bus speed info
Don Skidmore [Tue, 26 Apr 2011 08:00:00 +0000 (08:00 +0000)]
ixgbe: Cleanup PCIe bus speed info

PCIe connections should be expressed as GT/s (GigaTransfers per second)
instead of the current Gb/s (Gigabits per second).  In addition, it is
incorrect because (due to PCIe gen 1 & 2 having a 20% overhead) the
actually data rate, when expressed in Gb/s, is only 80% of the rate of
GT/s.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: improve EEPROM read/write operations
Emil Tantilov [Wed, 20 Apr 2011 08:49:06 +0000 (08:49 +0000)]
ixgbe: improve EEPROM read/write operations

Introduce buffered read/writes which greatly improves performance on
parts with large EEPROMs.

Previously reading/writing a word requires taking/releasing of synchronization
semaphores which adds 10ms to each operation. The optimization is to
read/write in buffers, but make sure the semaphore is not held for >500ms
according to the datasheet.

Since we can't read the EEPROM page size ixgbe_detect_eeprom_page_size() is
used to discover the EEPROM size when needed and keeps the result in
word_page_size for the rest of the run time.

Use buffered reads for ethtool -e.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix sparse warning
Emil Tantilov [Thu, 14 Apr 2011 07:46:41 +0000 (07:46 +0000)]
ixgbe: fix sparse warning

warning: symbol 'before' shadows an earlier one

Convert large macros to functions similar to e1000e.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix typo error with software defined pins on 82599
Don Skidmore [Wed, 13 Apr 2011 07:01:52 +0000 (07:01 +0000)]
ixgbe: fix typo error with software defined pins on 82599

Correcting a simple typo with enabling software defined pins.  I don't
believe this was causing any issues but this is how it was meant to be
implemented.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: Use function pointer for ixgbe_acquire/release_swfw_sync()
Emil Tantilov [Wed, 13 Apr 2011 04:56:15 +0000 (04:56 +0000)]
ixgbe: Use function pointer for ixgbe_acquire/release_swfw_sync()

Change remaining direct calls to function pointers.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigbvf: remove bogus phys_id
stephen hemminger [Tue, 5 Apr 2011 04:26:27 +0000 (04:26 +0000)]
igbvf: remove bogus phys_id

This device lies about supporting phys_id. Remove it and just
let the upper layer report not supported.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigb: Add check for invalid size to igb_get_invariants_82575()
Carolyn Wyborny [Wed, 4 May 2011 04:29:51 +0000 (04:29 +0000)]
igb: Add check for invalid size to igb_get_invariants_82575()

Recent commits have changed how EEPROM size is checked and if the size
word is misconfigured, the driver will fail to load.  This patch adds a
check for invalid size word in the EEPROM and uses default size instead
for 82576 parts.

Reported-by: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgb: convert to set_phys_id
Jeff Kirsher [Tue, 3 May 2011 05:17:34 +0000 (05:17 +0000)]
ixgb: convert to set_phys_id

Based on the original patch sent by Stephen Hemminger.

This version incorporates the ethtool changes that Bruce Allan
submitted.

CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
13 years agoipv4: In ip_build_and_send_pkt() use 'saddr' and 'daddr' args passed in.
David S. Miller [Wed, 4 May 2011 19:03:30 +0000 (12:03 -0700)]
ipv4: In ip_build_and_send_pkt() use 'saddr' and 'daddr' args passed in.

Instead of rt->rt_{dst,src}

The only tricky part is source route option handling.

If the source route option is enabled we can't just use plain 'daddr',
we have to use opt->opt.faddr.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoe100: fix build warning
Emil Tantilov [Wed, 27 Apr 2011 08:51:29 +0000 (08:51 +0000)]
e100: fix build warning

In function 'e100_hw_init':
warning: 'err' may be used uninitialized in this 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>
13 years agoipv4: Use flowi4->{daddr,saddr} in ipip_tunnel_xmit().
David S. Miller [Wed, 4 May 2011 18:10:28 +0000 (11:10 -0700)]
ipv4: Use flowi4->{daddr,saddr} in ipip_tunnel_xmit().

Instead of rt->rt_{dst,src}

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agox86/net: only select BPF_JIT when NET is enabled
Randy Dunlap [Wed, 4 May 2011 18:06:05 +0000 (11:06 -0700)]
x86/net: only select BPF_JIT when NET is enabled

Fix kconfig unmet dependency warning: HAVE_BPF_JIT depends on NET, so
make the "select" of it depend on NET also.

warning: (X86) selects HAVE_BPF_JIT which has unmet direct dependencies (NET)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: Use flowi4's {saddr,daddr} in sctp_v4_dst_saddr() and sctp_v4_get_dst()
David S. Miller [Wed, 4 May 2011 03:55:05 +0000 (20:55 -0700)]
sctp: Use flowi4's {saddr,daddr} in sctp_v4_dst_saddr() and sctp_v4_get_dst()

Instead of rt->rt_{src,dst}

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Use flowi4's {saddr,daddr} in igmpv3_newpack() and igmp_send_report()
David S. Miller [Wed, 4 May 2011 03:53:12 +0000 (20:53 -0700)]
ipv4: Use flowi4's {saddr,daddr} in igmpv3_newpack() and igmp_send_report()

Instead of rt->rt_{src,dst}

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agolibcxgbi: Use flowi4's saddr in cxgbi_check_route().
David S. Miller [Wed, 4 May 2011 03:43:40 +0000 (20:43 -0700)]
libcxgbi: Use flowi4's saddr in cxgbi_check_route().

Instead of rt->rt_src

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopptp: Use flowi4's daddr/saddr in pptp_xmit().
David S. Miller [Wed, 4 May 2011 03:41:42 +0000 (20:41 -0700)]
pptp: Use flowi4's daddr/saddr in pptp_xmit().

Instead of rt->rt_{src,dst}

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Make caller provide on-stack flow key to ip_route_output_ports().
David S. Miller [Wed, 4 May 2011 03:25:42 +0000 (20:25 -0700)]
ipv4: Make caller provide on-stack flow key to ip_route_output_ports().

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp: Use flowi4->saddr in dccp_v4_connect()
David S. Miller [Wed, 4 May 2011 03:06:41 +0000 (20:06 -0700)]
dccp: Use flowi4->saddr in dccp_v4_connect()

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Renamt struct rtable's rt_tos to rt_key_tos.
David S. Miller [Wed, 4 May 2011 02:45:15 +0000 (19:45 -0700)]
ipv4: Renamt struct rtable's rt_tos to rt_key_tos.

To more accurately reflect that it is purely a routing
cache lookup key and is used in no other context.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Rework ipmr_rt_fib_lookup() flow key initialization.
David S. Miller [Wed, 4 May 2011 02:42:43 +0000 (19:42 -0700)]
ipv4: Rework ipmr_rt_fib_lookup() flow key initialization.

Use information from the skb as much as possible, currently
this means daddr, saddr, and TOS.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/stmmac: Move "#include <linux/platform_device.h>" to linux/stmmac.h
Viresh KUMAR [Mon, 2 May 2011 18:36:45 +0000 (18:36 +0000)]
net/stmmac: Move "#include <linux/platform_device.h>" to linux/stmmac.h

stmmac.h uses struct platform_device and doesn't include
<linux/platform_device.h>. Whereas drivers/net/stmmac/stmmac.h includes it, but
doesn't directly use it. And so we get following compilation warning while using
this file:
warning: ‘struct platform_device’ declared inside parameter list

This patch includes <linux/platform_device.h> in linux/stmmac.h and removes it
from drivers/net/stmmac/stmmac.h

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: dont hold rtnl mutex during netlink dump callbacks
Eric Dumazet [Wed, 27 Apr 2011 22:56:07 +0000 (22:56 +0000)]
net: dont hold rtnl mutex during netlink dump callbacks

Four years ago, Patrick made a change to hold rtnl mutex during netlink
dump callbacks.

I believe it was a wrong move. This slows down concurrent dumps, making
good old /proc/net/ files faster than rtnetlink in some situations.

This occurred to me because one "ip link show dev ..." was _very_ slow
on a workload adding/removing network devices in background.

All dump callbacks are able to use RCU locking now, so this patch does
roughly a revert of commits :

1c2d670f366 : [RTNETLINK]: Hold rtnl_mutex during netlink dump callbacks
6313c1e0992 : [RTNETLINK]: Remove unnecessary locking in dump callbacks

This let writers fight for rtnl mutex and readers going full speed.

It also takes care of phonet : phonet_route_get() is now called from rcu
read section. I renamed it to phonet_route_get_rcu()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Remi Denis-Courmont <remi.denis-courmont@nokia.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
David S. Miller [Mon, 2 May 2011 22:04:46 +0000 (15:04 -0700)]
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge

13 years agoipv4: Make sure flowi4->{saddr,daddr} are always set.
David S. Miller [Mon, 2 May 2011 21:37:45 +0000 (14:37 -0700)]
ipv4: Make sure flowi4->{saddr,daddr} are always set.

Slow path output route resolution always makes sure that
->{saddr,daddr} are set, and also if we trigger into IPSEC resolution
we initialize them as well, because xfrm_lookup() expects them to be
fully resolved.

But if we hit the fast path and flowi4->flowi4_proto is zero, we won't
do this initialization.

Therefore, move the IPSEC path initialization to the route cache
lookup fast path to make sure these are always set.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobatman-adv: Make bat_priv->primary_if an rcu protected pointer
Marek Lindner [Wed, 20 Apr 2011 13:40:58 +0000 (15:40 +0200)]
batman-adv: Make bat_priv->primary_if an rcu protected pointer

The rcu protected macros rcu_dereference() and rcu_assign_pointer()
for the bat_priv->primary_if need to be used, as well as spin/rcu locking.

Otherwise we might end up using a primary_if pointer pointing to already
freed memory.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: fix gw_node_update() and gw_election()
Antonio Quartulli [Mon, 25 Apr 2011 20:44:32 +0000 (22:44 +0200)]
batman-adv: fix gw_node_update() and gw_election()

This is a regression from c4aac1ab9b973798163b34939b522f01e4d28ac9

- gw_node_update() doesn't add a new gw_node in case of empty curr_gw.
This means that at the beginning no gw_node is added, leading to an
empty gateway list.

- gw_election() is terminating in case of curr_gw == NULL. It has to
terminate in case of curr_gw != NULL

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: Move definition of atomic_dec_not_zero() into main.h
Antonio Quartulli [Wed, 20 Apr 2011 07:52:56 +0000 (09:52 +0200)]
batman-adv: Move definition of atomic_dec_not_zero() into main.h

atomic_dec_not_zero() is very useful and it is currently defined
multiple times. So it is possible to move it in main.h

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: orig_hash_find() manages rcu_lock/unlock internally
Antonio Quartulli [Sat, 16 Apr 2011 09:30:57 +0000 (11:30 +0200)]
batman-adv: orig_hash_find() manages rcu_lock/unlock internally

orig_hash_find() manages rcu_lock/unlock internally and doesn't need to
be surrounded by rcu_read_lock() / rcu_read_unlock() anymore

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agonet/igb/e1000/e1000e: more robust ethtool duplex/speed configuration
David Decotigny [Wed, 27 Apr 2011 18:32:43 +0000 (18:32 +0000)]
net/igb/e1000/e1000e: more robust ethtool duplex/speed configuration

This makes sure that one cannot request a 99Mbps full-duplex and get a
100Mbps half-duplex configuration in return due to the way the
speed/duplex parameters are handled internally.

Tested: e1000 works
Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotulip/de2104x: don't report different speeds depending on port type
David Decotigny [Wed, 27 Apr 2011 18:32:42 +0000 (18:32 +0000)]
tulip/de2104x: don't report different speeds depending on port type

Initial driver reported different speeds depending on the port being
used. This advertises the speed to be 10Mbps in any case, which is
what it actually is on the wire.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoacenic: Fix using the specified speed when configuring NIC
David Decotigny [Wed, 27 Apr 2011 18:32:41 +0000 (18:32 +0000)]
acenic: Fix using the specified speed when configuring NIC

This tells the NIC to take the speed specified by ethtool into account
when configuring the NIC, instead of keeping the previous speed.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: cosmetic: Use ethtool ethtool_cmd_speed API
David Decotigny [Wed, 27 Apr 2011 18:32:40 +0000 (18:32 +0000)]
ethtool: cosmetic: Use ethtool ethtool_cmd_speed API

This updates the network drivers so that they don't access the
ethtool_cmd::speed field directly, but use ethtool_cmd_speed()
instead.

For most of the drivers, these changes are purely cosmetic and don't
fix any problem, such as for those 1GbE/10GbE drivers that indirectly
call their own ethtool get_settings()/mii_ethtool_gset(). The changes
are meant to enforce code consistency and provide robustness with
future larger throughputs, at the expense of a few CPU cycles for each
ethtool operation.

All drivers compiled with make allyesconfig ion x86_64 have been
updated.

Tested: make allyesconfig on x86_64 + e1000e/bnx2x work
Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Use full 32 bit speed range in ethtool's set_settings
David Decotigny [Wed, 27 Apr 2011 18:32:39 +0000 (18:32 +0000)]
ethtool: Use full 32 bit speed range in ethtool's set_settings

This makes sure the ethtool's set_settings() callback of network
drivers don't ignore the 16 most significant bits when ethtool calls
their set_settings().

All drivers compiled with make allyesconfig on x86_64 have been
updated.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Call ethtool's get/set_settings callbacks with cleaned data
David Decotigny [Wed, 27 Apr 2011 18:32:38 +0000 (18:32 +0000)]
ethtool: Call ethtool's get/set_settings callbacks with cleaned data

This makes sure that when a driver calls the ethtool's
get/set_settings() callback of another driver, the data passed to it
is clean. This guarantees that speed_hi will be zeroed correctly if
the called callback doesn't explicitely set it: we are sure we don't
get a corrupted speed from the underlying driver. We also take care of
setting the cmd field appropriately (ETHTOOL_GSET/SSET).

This applies to dev_ethtool_get_settings(), which now makes sure it
sets up that ethtool command parameter correctly before passing it to
drivers. This also means that whoever calls dev_ethtool_get_settings()
does not have to clean the ethtool command parameter. This function
also becomes an exported symbol instead of an inline.

All drivers visible to make allyesconfig under x86_64 have been
updated.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: cosmetics: enforce const-ness in ethtool_cmd_speed
David Decotigny [Wed, 27 Apr 2011 18:32:37 +0000 (18:32 +0000)]
ethtool: cosmetics: enforce const-ness in ethtool_cmd_speed

The 'ep' argument of ethtool_cmd_speed is not altered: advertise it in
protoype. +Indentation fix. Also add comments to advise using the
ethtool_cmd_speed API to get/set the link speed.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: Support for GBE port settings
Sony Chacko [Thu, 28 Apr 2011 11:48:19 +0000 (11:48 +0000)]
qlcnic: Support for GBE port settings

Enable setting speed and auto negotiation parameters for GbE ports.
Hardware do not support half duplex setting currently.

o Update driver version to 5.0.17.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: support rcv ring configuration through ethtool
Sucheta Chakraborty [Thu, 28 Apr 2011 11:48:18 +0000 (11:48 +0000)]
qlcnic: support rcv ring configuration through ethtool

o Support ethtool command ETHTOOL_GCHANNELS and ETHTOOL_SCHANNELS.
o Number of rcv rings configuration depend upon number of msix vector.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4, ipv6, bonding: Restore control over number of peer notifications
Ben Hutchings [Tue, 26 Apr 2011 15:25:52 +0000 (15:25 +0000)]
ipv4, ipv6, bonding: Restore control over number of peer notifications

For backward compatibility, we should retain the module parameters and
sysfs attributes to control the number of peer notifications
(gratuitous ARPs and unsolicited NAs) sent after bonding failover.
Also, it is possible for failover to take place even though the new
active slave does not have link up, and in that case the peer
notification should be deferred until it does.

Change ipv4 and ipv6 so they do not automatically send peer
notifications on bonding failover.

Change the bonding driver to send separate NETDEV_NOTIFY_PEERS
notifications when the link is up, as many times as requested.  Since
it does not directly control which protocols send notifications, make
num_grat_arp and num_unsol_na aliases for a single parameter.  Bump
the bonding version number and update its documentation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Acked-by: Brian Haley <brian.haley@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopktgen: create num frags requested
amit salecha [Fri, 22 Apr 2011 16:22:20 +0000 (16:22 +0000)]
pktgen: create num frags requested

Pktgen doesn't generate number of frags requested.
Divide packet size by number of frags and fill that in every frags.

Example:
With packet size 1470, it generate only 11 frags. Initial frags
get lenght 706, 353, 177....so on. Last frag get divided by 2.

Now with this fix, each frags will get 78 bytes.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobpf: depends on MODULES
Eric Dumazet [Fri, 29 Apr 2011 17:20:53 +0000 (10:20 -0700)]
bpf: depends on MODULES

module_alloc() and module_free() are available only if CONFIG_MODULES=y

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Get route daddr from flow key in l2tp_ip_connect().
David S. Miller [Fri, 29 Apr 2011 06:50:49 +0000 (23:50 -0700)]
ipv4: Get route daddr from flow key in l2tp_ip_connect().

Now that output route lookups update the flow with
destination address selection, we can fetch it from
fl4->daddr instead of rt->rt_dst

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Get route daddr from flow key in tcp_v4_connect().
David S. Miller [Fri, 29 Apr 2011 06:50:32 +0000 (23:50 -0700)]
ipv4: Get route daddr from flow key in tcp_v4_connect().

Now that output route lookups update the flow with
destination address selection, we can fetch it from
fl4->daddr instead of rt->rt_dst

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Get route daddr from flow key in inet_csk_route_req().
David S. Miller [Fri, 29 Apr 2011 06:50:09 +0000 (23:50 -0700)]
ipv4: Get route daddr from flow key in inet_csk_route_req().

Now that output route lookups update the flow with
destination address selection, we can fetch it from
fl4->daddr instead of rt->rt_dst

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Get route daddr from flow key in ip4_datagram_connect().
David S. Miller [Fri, 29 Apr 2011 06:49:45 +0000 (23:49 -0700)]
ipv4: Get route daddr from flow key in ip4_datagram_connect().

Now that output route lookups update the flow with
destination address selection, we can fetch it from
fl4->daddr instead of rt->rt_dst

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Get route daddr from flow key in dccp_v4_connect().
David S. Miller [Fri, 29 Apr 2011 06:49:30 +0000 (23:49 -0700)]
ipv4: Get route daddr from flow key in dccp_v4_connect().

Now that output route lookups update the flow with
destination address selection, we can fetch it from
fl4->daddr instead of rt->rt_dst

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Fetch route saddr from flow key in l2tp_ip_connect().
David S. Miller [Fri, 29 Apr 2011 06:17:58 +0000 (23:17 -0700)]
ipv4: Fetch route saddr from flow key in l2tp_ip_connect().

Now that output route lookups update the flow with
source address selection, we can fetch it from
fl4->saddr instead of rt->rt_src

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Fetch route saddr from flow key in tcp_v4_connect().
David S. Miller [Fri, 29 Apr 2011 06:17:31 +0000 (23:17 -0700)]
ipv4: Fetch route saddr from flow key in tcp_v4_connect().

Now that output route lookups update the flow with
source address selection, we can fetch it from
fl4->saddr instead of rt->rt_src

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Fetch route saddr from flow key in ip4_datagram_connect().
David S. Miller [Fri, 29 Apr 2011 06:17:16 +0000 (23:17 -0700)]
ipv4: Fetch route saddr from flow key in ip4_datagram_connect().

Now that output route lookups update the flow with
source address selection, we can fetch it from
fl4->saddr instead of rt->rt_src

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Fetch route saddr from flow key in inet_sk_reselect_saddr().
David S. Miller [Fri, 29 Apr 2011 06:16:53 +0000 (23:16 -0700)]
ipv4: Fetch route saddr from flow key in inet_sk_reselect_saddr().

Now that output route lookups update the flow with
source address selection, we can fetch it from
fl4->saddr instead of rt->rt_src

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Remove now superfluous code in ip_route_connect().
David S. Miller [Fri, 29 Apr 2011 06:13:17 +0000 (23:13 -0700)]
ipv4: Remove now superfluous code in ip_route_connect().

Now that output route lookups update the flow with
source address et al. selections, the fl4->{saddr,daddr}
assignments here are no longer necessary.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Use caller's on-stack flowi as-is in output route lookups.
David S. Miller [Thu, 28 Apr 2011 21:48:42 +0000 (14:48 -0700)]
ipv4: Use caller's on-stack flowi as-is in output route lookups.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Use non-zero allocations in dst_alloc().
David S. Miller [Thu, 28 Apr 2011 21:31:47 +0000 (14:31 -0700)]
net: Use non-zero allocations in dst_alloc().

Make dst_alloc() and it's users explicitly initialize the entire
entry.

The zero'ing done by kmem_cache_zalloc() was almost entirely
redundant.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Make dst_alloc() take more explicit initializations.
David S. Miller [Thu, 28 Apr 2011 21:13:38 +0000 (14:13 -0700)]
net: Make dst_alloc() take more explicit initializations.

Now the dst->dev, dev->obsolete, and dst->flags values can
be specified as well.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agol2tp: Fix inet_opt conversion.
David S. Miller [Thu, 28 Apr 2011 20:54:06 +0000 (13:54 -0700)]
l2tp: Fix inet_opt conversion.

We don't actually hold the socket lock at this point, so the
rcu_dereference_protected() isn't' correct.  Thanks to Eric
Dumazet for pointing this out.

Thankfully, we're only interested in fetching the faddr value
if srr is enabled, so we can simply make this an RCU sequence
and use plain rcu_dereference().

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: ibmveth: force reconfiguring checksum settings on startup
Michał Mirosław [Thu, 28 Apr 2011 01:59:15 +0000 (11:59 +1000)]
net: ibmveth: force reconfiguring checksum settings on startup

Commit b9367bf3ee6d ("net: ibmveth: convert to hw_features") accidentally
removed call to ibmveth_set_csum_offload() in ibmveth_probe(). Put the
call back where it was, but with additional error checking provided
by ibmveth_set_features().

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
[sfr: dev -> netdev]
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: fix memory leak in qlcnic_blink_led.
Sucheta Chakraborty [Wed, 27 Apr 2011 14:43:44 +0000 (14:43 +0000)]
qlcnic: fix memory leak in qlcnic_blink_led.

o Memory allocated in ETHTOOL_ACTIVE mode, is not getting freed. So,
  in ETHTOOL_ID_INACTIVE mode, return after freeing allocated memory.
o Using set bit instead of blink_down field, as it is also required
  in internal Loopback test and etc.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Convert u32 flag,flg2,flg3 uses to bitmap
Joe Perches [Tue, 26 Apr 2011 08:12:10 +0000 (08:12 +0000)]
tg3: Convert u32 flag,flg2,flg3 uses to bitmap

Using a bitmap instead of separate u32 flags allows a consistent, simpler
and more extensible mechanism to determine capabilities.

Convert bitmasks to enum.
Add tg3_flag, tg3_flag_clear and tg3_flag_set.
Convert the flag & bitmask tests.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: allow user to change NETIF_F_HIGHDMA
Michał Mirosław [Fri, 22 Apr 2011 06:31:16 +0000 (06:31 +0000)]
net: allow user to change NETIF_F_HIGHDMA

NETIF_F_HIGHDMA is like any other TX offloads, so allow user to toggle it.
This is needed later for bridge and bonding convertsion to hw_features.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobridge: convert br_features_recompute() to ndo_fix_features
Michał Mirosław [Fri, 22 Apr 2011 06:31:16 +0000 (06:31 +0000)]
bridge: convert br_features_recompute() to ndo_fix_features

Note: netdev_update_features() needs only rtnl_lock as br->port_list
is only changed while holding it.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: fix netdev_increment_features()
Michał Mirosław [Fri, 22 Apr 2011 06:31:16 +0000 (06:31 +0000)]
net: fix netdev_increment_features()

Simplify and fix netdev_increment_features() to conform to what is
stated in netdevice.h comments about NETIF_F_ONE_FOR_ALL.
Include FCoE segmentation and VLAN-challedged flags in computation.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet:use help function of skb_checksum_start_offset to calculate offset
Shan Wei [Fri, 22 Apr 2011 11:07:41 +0000 (19:07 +0800)]
net:use help function of skb_checksum_start_offset to calculate offset

Although these are equivalent, but the skb_checksum_start_offset() is more readable.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinet: add RCU protection to inet->opt
Eric Dumazet [Thu, 21 Apr 2011 09:45:37 +0000 (09:45 +0000)]
inet: add RCU protection to inet->opt

We lack proper synchronization to manipulate inet->opt ip_options

Problem is ip_make_skb() calls ip_setup_cork() and
ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options),
without any protection against another thread manipulating inet->opt.

Another thread can change inet->opt pointer and free old one under us.

Use RCU to protect inet->opt (changed to inet->inet_opt).

Instead of handling atomic refcounts, just copy ip_options when
necessary, to avoid cache line dirtying.

We cant insert an rcu_head in struct ip_options since its included in
skb->cb[], so this patch is large because I had to introduce a new
ip_options_rcu structure.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: filter: Just In Time compiler for x86-64
Eric Dumazet [Wed, 20 Apr 2011 09:27:32 +0000 (09:27 +0000)]
net: filter: Just In Time compiler for x86-64

In order to speedup packet filtering, here is an implementation of a
JIT compiler for x86_64

It is disabled by default, and must be enabled by the admin.

echo 1 >/proc/sys/net/core/bpf_jit_enable

It uses module_alloc() and module_free() to get memory in the 2GB text
kernel range since we call helpers functions from the generated code.

EAX : BPF A accumulator
EBX : BPF X accumulator
RDI : pointer to skb   (first argument given to JIT function)
RBP : frame pointer (even if CONFIG_FRAME_POINTER=n)
r9d : skb->len - skb->data_len (headlen)
r8  : skb->data

To get a trace of generated code, use :

echo 2 >/proc/sys/net/core/bpf_jit_enable

Example of generated code :

# tcpdump -p -n -s 0 -i eth1 host 192.168.20.0/24

flen=18 proglen=147 pass=3 image=ffffffffa00b5000
JIT code: ffffffffa00b5000: 55 48 89 e5 48 83 ec 60 48 89 5d f8 44 8b 4f 60
JIT code: ffffffffa00b5010: 44 2b 4f 64 4c 8b 87 b8 00 00 00 be 0c 00 00 00
JIT code: ffffffffa00b5020: e8 24 7b f7 e0 3d 00 08 00 00 75 28 be 1a 00 00
JIT code: ffffffffa00b5030: 00 e8 fe 7a f7 e0 24 00 3d 00 14 a8 c0 74 49 be
JIT code: ffffffffa00b5040: 1e 00 00 00 e8 eb 7a f7 e0 24 00 3d 00 14 a8 c0
JIT code: ffffffffa00b5050: 74 36 eb 3b 3d 06 08 00 00 74 07 3d 35 80 00 00
JIT code: ffffffffa00b5060: 75 2d be 1c 00 00 00 e8 c8 7a f7 e0 24 00 3d 00
JIT code: ffffffffa00b5070: 14 a8 c0 74 13 be 26 00 00 00 e8 b5 7a f7 e0 24
JIT code: ffffffffa00b5080: 00 3d 00 14 a8 c0 75 07 b8 ff ff 00 00 eb 02 31
JIT code: ffffffffa00b5090: c0 c9 c3

BPF program is 144 bytes long, so native program is almost same size ;)

(000) ldh      [12]
(001) jeq      #0x800           jt 2    jf 8
(002) ld       [26]
(003) and      #0xffffff00
(004) jeq      #0xc0a81400      jt 16   jf 5
(005) ld       [30]
(006) and      #0xffffff00
(007) jeq      #0xc0a81400      jt 16   jf 17
(008) jeq      #0x806           jt 10   jf 9
(009) jeq      #0x8035          jt 10   jf 17
(010) ld       [28]
(011) and      #0xffffff00
(012) jeq      #0xc0a81400      jt 16   jf 13
(013) ld       [38]
(014) and      #0xffffff00
(015) jeq      #0xc0a81400      jt 16   jf 17
(016) ret      #65535
(017) ret      #0

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Kill RTO_CONN.
David S. Miller [Tue, 26 Apr 2011 21:58:35 +0000 (14:58 -0700)]
ipv4: Kill RTO_CONN.

It's not used by anything in the kernel, and defined in net/route.h so
never exported to userspace.

Therefore we can safely remove it.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Remove erroneous check in igmpv3_newpack() and igmp_send_report().
David S. Miller [Tue, 26 Apr 2011 20:57:47 +0000 (13:57 -0700)]
ipv4: Remove erroneous check in igmpv3_newpack() and igmp_send_report().

Output route resolution never returns a route with rt_src set to zero
(which is INADDR_ANY).

Even if the flow key for the output route lookup specifies INADDR_ANY
for the source address, the output route resolution chooses a real
source address to use in the final route.

This test has existed forever in igmp_send_report() and David Stevens
simply copied over the erroneous test when implementing support for
IGMPv3.

Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agoipv4: Sanitize and simplify ip_route_{connect,newports}()
David S. Miller [Tue, 26 Apr 2011 20:28:44 +0000 (13:28 -0700)]
ipv4: Sanitize and simplify ip_route_{connect,newports}()

These functions are used together as a unit for route resolution
during connect().  They address the chicken-and-egg problem that
exists when ports need to be allocated during connect() processing,
yet such port allocations require addressing information from the
routing code.

It's currently more heavy handed than it needs to be, and in
particular we allocate and initialize a flow object twice.

Let the callers provide the on-stack flow object.  That way we only
need to initialize it once in the ip_route_connect() call.

Later, if ip_route_newports() needs to do anything, it re-uses that
flow object as-is except for the ports which it updates before the
route re-lookup.

Also, describe why this set of facilities are needed and how it works
in a big comment.

Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agor8169: fix merge conflict fix.
Francois Romieu [Wed, 27 Apr 2011 20:52:22 +0000 (13:52 -0700)]
r8169: fix merge conflict fix.

- use adequate MAC_VER id
  (see 01dc7fec4025f6bb72b6b98ec88b375346b6dbbb)
- remove duplicate rtl_firmware_info record
- remove duplicate functions

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: clean up route lookup calls
Vlad Yasevich [Tue, 26 Apr 2011 21:54:17 +0000 (21:54 +0000)]
sctp: clean up route lookup calls

Change the call to take the transport parameter and set the
cached 'dst' appropriately inside the get_dst() function calls.

This will allow us in the future  to clean up source address
storage as well.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: remove useless arguments from get_saddr() call
Vlad Yasevich [Tue, 26 Apr 2011 21:53:20 +0000 (21:53 +0000)]
sctp: remove useless arguments from get_saddr() call

There is no point in passing a destination address to
a get_saddr() call.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: make sctp over IPv6 work with IPsec
Vlad Yasevich [Tue, 26 Apr 2011 21:52:27 +0000 (21:52 +0000)]
sctp: make sctp over IPv6 work with IPsec

SCTP never called xfrm_output after it's v6 route lookups so
that never really worked with ipsec.  Additioanlly, we never
passed port nubmers and protocol in the flowi, so any port
based policies were never applied as well.  Now that we can
fixed ipv6 routing lookup code, using ip6_dst_lookup_flow()
and pass port numbers.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: cache the ipv6 source after route lookup
Vlad Yasevich [Tue, 26 Apr 2011 21:51:31 +0000 (21:51 +0000)]
sctp: cache the ipv6 source after route lookup

The ipv6 routing lookup does give us a source address,
but instead of filling it into the dst, it's stored in
the flowi.  We can use that instead of going through the
entire source address selection again.
Also the useless ->dst_saddr member of sctp_pf is removed.
And sctp_v6_dst_saddr() is removed, instead by introduce
sctp_v6_to_addr(), which can be reused to cleanup some dup
code.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: fix sctp to work with ipv6 source address routing
Weixing Shi [Tue, 26 Apr 2011 21:36:32 +0000 (21:36 +0000)]
sctp: fix sctp to work with ipv6 source address routing

In the below test case, using the source address routing,
sctp can not work.
Node-A
1)ifconfig eth0 inet6 add 2001:1::1/64
2)ip -6 rule add from 2001:1::1 table 100 pref 100
3)ip -6 route add 2001:2::1 dev eth0 table 100
4)sctp_darn -H 2001:1::1 -P 250 -l &
Node-B
1)ifconfig eth0 inet6 add 2001:2::1/64
2)ip -6 rule add from 2001:2::1 table 100 pref 100
3)ip -6 route add 2001:1::1 dev eth0 table 100
4)sctp_darn -H 2001:2::1 -P 250 -h 2001:1::1 -p 250 -s

root cause:
Node-A and Node-B use the source address routing, and
at begining, source address will be NULL,sctp will
search the  routing table by the destination address,
because using the source address routing table, and
the result dst_entry will be NULL.

solution:
walk through the bind address list to get the source
address and then lookup the routing table again to get
the correct dst_entry.

Signed-off-by: Weixing Shi <Weixing.Shi@windriver.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: convert to ethtool set_phys_id
Emil Tantilov [Sat, 16 Apr 2011 06:12:51 +0000 (06:12 +0000)]
ixgbe: convert to ethtool set_phys_id

Based on the original patch submitted by Stephen Hemminger.

This patch makes the following changes:
- Change ETHTOOL_ID_INACTIVE return value to 2 (blinks/sec)
- Fix restoring of IXGBE_LEDCTL

CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix X540 ethtool loopback test.
Don Skidmore [Sat, 16 Apr 2011 05:29:14 +0000 (05:29 +0000)]
ixgbe: fix X540 ethtool loopback test.

On X540 we need to set the MACC.FLU bit to 1 in order to force the link
up before entering MAC loopback.  This is only used in the ethtool loopback
test, which was failing.  This patch corrects it.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: Bump version
Don Skidmore [Thu, 14 Apr 2011 07:40:11 +0000 (07:40 +0000)]
ixgbe: Bump version

Bump the driver version number to better match up with the out of tree
driver that has similar functionality.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: enable SCTP checksum offload for X540
Don Skidmore [Tue, 12 Apr 2011 09:42:11 +0000 (09:42 +0000)]
ixgbe: enable SCTP checksum offload for X540

X540 supports SCTP checksum offload so enable it.  It was overlooked when X540
support was initially added to the driver.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: do not clear FCoE DDP error status for received ABTS
Yi Zou [Sat, 9 Apr 2011 08:34:12 +0000 (08:34 +0000)]
ixgbe: do not clear FCoE DDP error status for received ABTS

The ddp->err is initialized to be 1 to make sure outstanding DDP context is
guaranteed to be invalidated when HW is not auto-invalidating it. However,
in case of receiving ABTS response for a DDPed I/O, the ddp->err was cleared,
bypassing the invalidating of the DDP context from upper protocol stack when
ixgbe_fcoe_ddp_put() is called. This bug is fixed here by updating the error
only when FCP_RSP is received.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix static functions
John Fastabend [Tue, 12 Apr 2011 02:44:55 +0000 (02:44 +0000)]
ixgbe: fix static functions

Define functions as static added C=1 (sparse) to my make line
brought these to my attention.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: remove ntuple display support
Alexander Duyck [Sat, 9 Apr 2011 05:34:06 +0000 (05:34 +0000)]
ixgbe: remove ntuple display support

This change removes the ntuple display support from ixgbe.  The reason for
this change is to resolve a number of issues in the way display filtering
is handled.

I plan to add support for displaying these filters via the network flow
classifier interface.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: add LED blink code for x540
Emil Tantilov [Fri, 8 Apr 2011 01:24:05 +0000 (01:24 +0000)]
ixgbe: add LED blink code for x540

Implement blink_led_start and blink_led_stop functions for x540
using the MACC register.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: add support for 64k EEPROM for 82599
Emil Tantilov [Fri, 1 Apr 2011 08:17:19 +0000 (08:17 +0000)]
ixgbe: add support for 64k EEPROM for 82599

82599 supports up to 32k EEPROM addressing via EERD register. If we
wish to address larger EEPROM this have to be done via serial interface.
This patch adds function ixgbe_read_eeprom_82599 which selects the best
method to read the EEPROM.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: register defines cleanup
Emil Tantilov [Thu, 31 Mar 2011 09:36:24 +0000 (09:36 +0000)]
ixgbe: register defines cleanup

Remove duplicates.
Fix incorrect defines.
Fix/Update comments.
Fix whitespace.
Add new register defines.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: explicitly disable 100H for x540
Emil Tantilov [Thu, 31 Mar 2011 09:36:12 +0000 (09:36 +0000)]
ixgbe: explicitly disable 100H for x540

100H is not supported on this HW, but the bit is set on the PHY.
This can result in link at 100F when advertising only 1000F.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe1000e: implement ethtool set_phys_id
Bruce Allan [Sat, 16 Apr 2011 00:34:40 +0000 (00:34 +0000)]
e1000e: implement ethtool set_phys_id

Based on a patch from Stephen Hemminger <shemminger@vyatta.com>.

The new ethtool set_phys_id takes over controlling the LED for
identifying boards.  This fixes the lockout during that period.
For this device lots of extra infrastructure can also be removed by
using set_phys_id.

v2: - return blink frequency for parts that do not support blink in h/w
    - add blink_led function pointers for devices that do support blink
      in h/w to cleanup the test for this functionality

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Tue, 26 Apr 2011 19:16:46 +0000 (12:16 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Resolved logic conflicts causing a build failure due to
drivers/net/r8169.c changes using a patch from Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>