Commit Graph
100 Commits
Author SHA1 Message Date
stephen hemminger de6be6c1f7 sky2: don't do GRO on second port
There's something very important I forgot to tell you.
 What?

 Don't cross the GRO streams.
 Why?

 It would be bad.
 I'm fuzzy on the whole good/bad thing. What do you mean, "bad"?

 Try to imagine all the Internet as you know it stopping instantaneously
  and every bit in every packet swapping at the speed of light.
 Total packet reordering.
 Right. That's bad. Okay. All right. Important safety tip. Thanks, Hubert

The simplest way to stop this is just avoid doing GRO on the second port.
Very few Marvell boards support two ports per ring, and GRO is just
an optimization.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-09-01 14:49:33 -07:00
Stephen Hemminger 17134d9673 PCI: bus speed strings should be const
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
2010-08-31 15:28:00 -07:00
Stephen Hemminger 3b06c21e84 floppy: make controller const
The struct cont_t is just a set of virtual function pointers.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:52:31 +02:00
Stephen Hemminger 01b6b67eda floppy: use warning macros
Convert assertions to use WARN().  There are several error checks in the
code for things that should never happen.  Convert them to standard
warnings so kerneloops.org will see them.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:43 +02:00
Stephen Hemminger b862f26fe1 floppy: use wait_event_interruptible
Convert wait loops to use wait_event_ macros.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:41 +02:00
Stephen Hemminger 21af544804 floppy: fix signed/unsigned warnings
Ioctl cmd value is unsigned, so change normalize_ioctl

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:39 +02:00
Stephen Hemminger be1c0fbfb4 floppy: cmos attribute should be static
As reported by sparse, cmos attribute is local.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:37 +02:00
Stephen Hemminger 575cfc673e floppy: use atomic type for usage_count
The usage_count was being protected by a lock which was only there to
create an atomic counter.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:36 +02:00
Stephen Hemminger 41a55b4de3 floppy: silence warning during disk test
The first thing the floppy does is read block 0 to test geometry and to
test for disk presence.  If disk is not present this causes a console
warning message about failed I/O.  Set flag to silence.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:34 +02:00
Stephen Hemminger be7a12bb1a floppy: remove unnecessary inlines
These routines are all big enough that is better to let the compiler
decide to inline or not.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:32 +02:00
Stephen Hemminger 285203c8ff floppy: initialize debug jiffies offset
Set debug jiffies offset at initialization.  Avoids wierd values showing
up if debugging enabled.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
2010-08-07 18:15:30 +02:00
stephen hemminger d7100da026 ppp: make channel_ops const
The PPP channel ops structure should be const.
Cleanup the declarations to use standard C99 format.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-08-04 21:53:17 -07:00
stephen hemminger 66d50d2550 u32: negative offset fix
It was possible to use a negative offset in a u32 match to reference
the ethernet header or other parts of the link layer header.
This fixes the regression caused by:

commit fbc2e7d9cf
Author: Changli Gao <[email protected]>
Date:   Wed Jun 2 07:32:42 2010 -0700

    cls_u32: use skb_header_pointer() to dereference data safely

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-08-02 22:07:45 -07:00
Stephen Hemminger de38483010 net: ingress filter message limit
If user misconfigures ingress and causes a redirection loop, don't
overwhelm the log.  This is also a error case so make it unlikely.
Found by inspection, luckily not in real system.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-08-01 00:33:23 -07:00
Stephen Hemminger 7736a05a32 PCI: sparse warning (trivial)
Assigning zero where NULL should be used.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
2010-07-30 09:29:13 -07:00
stephen hemminger eeaf61d889 bridge: add rcu_read_lock on transmit
Long ago, when bridge was converted to RCU, rcu lock was equivalent
to having preempt disabled. RCU has changed a lot since then and
bridge code was still assuming the since transmit was called with
bottom half disabled, it was RCU safe.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-07-28 10:50:55 -07:00
stephen hemminger 3b87956ea6 net sched: fix race in mirred device removal
This fixes hang when target device of mirred packet classifier
action is removed.

If a mirror or redirection action is configured to cause packets
to go to another device, the classifier holds a ref count, but was assuming
the adminstrator cleaned up all redirections before removing. The fix
is to add a notifier and cleanup during unregister.

The new list is implicitly protected by RTNL mutex because
it is held during filter add/delete as well as notifier.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-07-24 21:04:20 -07:00
Stephen Hemminger dd4ba83dc1 gre: propagate ipv6 transport class
This patch makes IPV6 over IPv4 GRE tunnel propagate the transport
class field from the underlying IPV6 header to the IPV4 Type Of Service
field. Without the patch, all IPV6 packets in tunnel look the same to QoS.

This assumes that IPV6 transport class is exactly the same
as IPv4 TOS. Not sure if that is always the case?  Maybe need
to mask off some bits.

The mask and shift to get tclass is copied from ipv6/datagram.c

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-07-08 21:35:58 -07:00
stephen hemminger 9f888160bd ipv6: fix NULL reference in proxy neighbor discovery
The addition of TLLAO option created a kernel OOPS regression
for the case where neighbor advertisement is being sent via
proxy path.  When using proxy, ipv6_get_ifaddr() returns NULL
causing the NULL dereference.

Change causing the bug was:
commit f7734fdf61
Author: Octavian Purdila <[email protected]>
Date:   Fri Oct 2 11:39:15 2009 +0000

    make TLLAO option for NA packets configurable

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-06-25 21:16:57 -07:00
stephen hemminger 25442e06d2 bridge: fdb cleanup runs too often
It is common in end-node, non STP bridges to set forwarding
delay to zero; which causes the forwarding database cleanup
to run every clock tick. Change to run only as soon as needed
or at next ageing timer interval which ever is sooner.

Use round_jiffies_up macro rather than attempting round up
by changing value.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-06-17 13:49:14 -07:00
stephen hemminger c6b20d941b ppp: eliminate shadowed variable name
Sparse complains about shadowed declaration of skb. So use other
name.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-06-02 05:16:23 -07:00
Stephen Hemminger b7bb0a1291 gfs: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:20 -04:00
Stephen Hemminger 537d81ca7c ocfs: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:20 -04:00
Stephen Hemminger 365f0cb9d2 jffs2: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:20 -04:00
Stephen Hemminger 46e58764f0 xfs: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:19 -04:00
Stephen Hemminger 94d09a98cd reiserfs: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:19 -04:00
Stephen Hemminger 11e2752807 ext4: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:19 -04:00
Stephen Hemminger d1f21049f9 ext3: constify xattr handlers
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:19 -04:00
Stephen Hemminger 749c72efa4 ext2: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:18 -04:00
Stephen Hemminger f01cbd3f81 btrfs: constify xattr_handler
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:18 -04:00
Stephen Hemminger bb4354538e fs: xattr_handler table should be const
The entries in xattr handler table should be immutable (ie const)
like other operation tables.

Later patches convert common filesystems. Uncoverted filesystems
will still work, but will generate a compiler warning.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Al Viro <[email protected]>
2010-05-21 18:31:18 -04:00
stephen hemminger b60b6592ba net sched: cleanup and rate limit warning
If the user has a bad classification configuration, and gets a packet
that goes through too many steps. Chances are more packets will arrive,
and the message spew will overrun syslog because it is not rate limited.
And because it is not tagged with appropriate priority it can't not be screened.

Added the qdisc to the message to try and give some more context when
the message does arrive.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Jamal Hadi Salim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-17 23:23:13 -07:00
stephen hemminger 207024b947 pfkey: add severity to printk
Put severity level on pfkey printk messages

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-17 23:23:13 -07:00
stephen hemminger 62db5cfd70 xfrm: add severity to printk
Serious oh sh*t messages converted to WARN().
Add KERN_NOTICE severity to the unknown policy type messages.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-17 23:23:13 -07:00
stephen hemminger 6ff9c3644e net sched: printk message severity
The previous patch encourage me to go look at all the messages in
the network scheduler and fix them. Many messages were missing
any severity level. Some serious ones that should never happen
were turned into WARN(), and the random noise messages that were
handled changed to pr_debug().

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-17 23:23:12 -07:00
Stephen Hemminger eedf042a63 ipv6: fix the bug of address check
The duplicate address check code got broken in the conversion
to hlist (2.6.35).  The earlier patch did not fix the case where
two addresses match same hash value. Use two exit paths,
rather than depending on state of loop variables (from macro).

Based on earlier fix by Shan Wei.

Signed-off-by: Stephen Hemminger <[email protected]>
Reviewed-by: Shan Wei <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-17 22:27:12 -07:00
stephen hemminger f0cd15081a tbf: stop wanton destruction of children (v2)
Several netem users use TBF for rate control. But every time the parameters
of TBF are changed it destroys the child qdisc, requiring reconfigation.
Better to just keep child qdisc and just notify it of changed limit.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-17 17:44:35 -07:00
Stephen Hemminger 0f87ee0856 squashfs: xattr fix sparse warnings
Sparse does not like inline function declared without body,
because it is not part of the standard kernel practice.

The xattr_handler tables can be declared static.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Phillip Lougher <[email protected]>
2010-05-17 20:06:56 +01:00
Stephen Hemminger aa5b1894cb squashfs: xattr_lookup sparse fix
Sparse detected that unsigned pointer was being passed as int pointer.

Signed-off-by: Stephen Hemminger <[email protected]>
[fixed up to deal with code refactoring]
Signed-off-by: Phillip Lougher <[email protected]>
2010-05-17 20:02:03 +01:00
stephen hemminger 28a16c9796 bridge: change console message interface
Use one set of macro's for all bridge messages.

Note: can't use netdev_XXX macro's because bridge is purely
virtual and has no device parent.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-15 23:10:02 -07:00
stephen hemminger cfb478da70 bridge: netpoll cleanup
Move code around so that the ifdef for NETPOLL_CONTROLLER don't have to
show up in main code path. The control functions should be in helpers
that are only compiled if needed.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-15 23:10:01 -07:00
stephen hemminger e0a67e2dd9 sky2: version 1.28
Version 1.28

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-05-14 03:06:22 -07:00
Stephen Hemminger 654d0fbdc8 netfilter: cleanup printk messages
Make sure all printk messages have a severity level.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
2010-05-13 15:02:08 +02:00
Stephen Hemminger af5676039a netfilter: change NF_ASSERT to WARN_ON
Change netfilter asserts to standard WARN_ON. This has the
benefit of backtrace info and also causes netfilter errors
to show up on kerneloops.org.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
2010-05-13 15:00:20 +02:00
Stephen Hemminger 3afc7cc38c Staging: hv: storvsc module descriptions
Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 14:15:34 -07:00
Stephen Hemminger 48c9f7c30b Staging: hv: block_operations can be const
Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 14:15:34 -07:00
Stephen Hemminger 1ec28abbf8 Staging: hv: add module description to blkvsc
Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 14:15:34 -07:00
Stephen Hemminger f82f4ad7bf Staging: hv: add basic ethtool support
Ethtool allows querying device information and controlling parameters.
For now just add ability to turn on/off scatter/gather.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:36:10 -07:00
Stephen Hemminger b220f5f925 Staging: hv: add transmit flow control
Keep track of the number of pages sent over transmit and stop
before going over.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:36:10 -07:00
Stephen Hemminger 6048718d71 Staging: hv: transmit scatter gather support
The transmit management of pages was confusing for handling
fragmented SKB's. (But since NETIF_F_SG was never set, the code was never hit).

The parameter AdditionalRequestPageBufferCount is always one,
(and leads to ugly code), so just inline and add comments.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:36:09 -07:00
Stephen Hemminger 9f8bd8bacf Staging: hv: use existing Ethernet header size
Use ETH_ALEN to indicate that MAC address is Ethernet.
Also use Linux printk format for mac addresses.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:36:09 -07:00
Stephen Hemminger 450d7a4b7a Staging: hv: ring parameter
The ring size parameter should be number of pages (not bytes).
Add module parameter information as well.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:36:09 -07:00
Stephen Hemminger 7880fc54c9 Staging: hv: cleanup network driver
Minor stuff:
   * Add module description
   * Remove variable set but never used.
   * Move variable inside conditional

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:36:09 -07:00
Stephen Hemminger 9495c282ba Staging: hv: handle skb allocation failure
Some fixes to receive handling:
  * Dieing with assertion failure when running out of memory is not ok
  * Use newer alloc function to get aligned skb
  * Dropped statistic is supposed to be incremented only by
    driver it was responsible for the drop.

Compile tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:35:34 -07:00
Stephen Hemminger b852fdcefc Staging: hv: use network device stats
The network device structure has space already reserved for statistics.

Compile tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-05-11 11:35:34 -07:00
stephen hemminger 81a2e36df7 forcedeth: Stay in NAPI as long as there's work
The following does the same thing without the extra overhead
of testing all the registers. It also handles the out of memory
case.

Signed-off-by: Stephen Hemminger <[email protected]>
Tested-by: Tom Herbert <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-30 16:15:38 -07:00
Stephen Hemminger 546d9e101e Staging: hv: name network device ethX rather than sethX
This patch makes the HyperV network device use the same naming scheme as
other virtual drivers (Xen, KVM). In an ideal world, userspace tools
would not care what the name is, but some users and applications do
care. Vyatta CLI is one of the tools that does depend on what the name
is.

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2010-04-30 09:30:10 -07:00
stephen hemminger afe0159d93 bridge: multicast_flood cleanup
Move some declarations around to make it clearer which variables
are being used inside loop.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-27 18:13:55 -07:00
stephen hemminger 83f6a740b4 bridge: multicast port group RCU fix
The recently introduced bridge mulitcast port group list was only
partially using RCU correctly. It was missing rcu_dereference()
and missing the necessary barrier on deletion.

The code should have used one of the standard list methods (list or hlist)
instead of open coding a RCU based link list.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-27 18:13:54 -07:00
stephen hemminger 168d40ee3d bridge: multicast flood
Fix unsafe usage of RCU. Would never work on Alpha SMP because
of lack of rcu_dereference()

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-27 18:13:54 -07:00
stephen hemminger 7e80c12448 bridge: simplify multicast_add_router
By coding slightly differently, there are only two cases
to deal with: add at head and add after previous entry.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-27 18:13:53 -07:00
stephen hemminger dcdca2c49b bridge: multicast router list manipulation
I prefer that the hlist be only accessed through the hlist macro
objects. Explicit twiddling of links (especially with RCU) exposes
the code to future bugs.

Compile tested only.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-27 12:53:24 -07:00
stephen hemminger 7180f7751d bridge: use is_multicast_ether_addr
Use existing inline function.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-27 12:53:24 -07:00
Stephen Hemminger bf73130d7f sky2: add support for receive hashing
Sky2 hardware supports hardware receive hash calculation.
Now that Receive Packet Steering is available, add support
to enable it.

This version does not depend on CONFIG_RPS. Also set_flags rejects
all values except RXHASH, so driver won't have to change next time
somebody adds a new one.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-24 20:04:12 -07:00
stephen hemminger efe91932e7 sky2: size status ring based on Tx/Rx ring
Sky2 status ring must be big enough to handle worst case number
of status messages. It was being oversized (to handle dual port cards),
and excessive number of tx ring entries were allowed. This patch reduces
the footprint and makes sure the value is enough.

Later patch to add RSS increases the number of possible Rx status elements.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-22 18:32:58 -07:00
Stephen Hemminger e802af9cab IPv6: Generic TTL Security Mechanism (final version)
This patch adds IPv6 support for RFC5082 Generalized TTL Security Mechanism.  

Not to users of mapped address; the IPV6 and IPV4 socket options are seperate.
The server does have to deal with both IPv4 and IPv6 socket options
and the client has to handle the different for each family.

On client:
	int ttl = 255;
	getaddrinfo(argv[1], argv[2], &hint, &result);

	for (rp = result; rp != NULL; rp = rp->ai_next) {
		s = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
		if (s < 0) continue;

		if (rp->ai_family == AF_INET) {
			setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
		} else if (rp->ai_family == AF_INET6) {
			setsockopt(s, IPPROTO_IPV6,  IPV6_UNICAST_HOPS, 
					&ttl, sizeof(ttl)))
		}
			
		if (connect(s, rp->ai_addr, rp->ai_addrlen) == 0) {
		   ...

On server:
	int minttl = 255 - maxhops;
   
	getaddrinfo(NULL, port, &hints, &result);
	for (rp = result; rp != NULL; rp = rp->ai_next) {
		s = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol);
		if (s < 0) continue;

		if (rp->ai_family == AF_INET6)
			setsockopt(s, IPPROTO_IPV6,  IPV6_MINHOPCOUNT,
					&minttl, sizeof(minttl));
		setsockopt(s, IPPROTO_IP, IP_MINTTL, &minttl, sizeof(minttl));
			
		if (bind(s, rp->ai_addr, rp->ai_addrlen) == 0)
			break
...

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-22 15:24:53 -07:00
stephen hemminger 5611551103 dst: don't inline dst_ifdown
The function dst_ifdown is called only two places but in a non-
performance critical code path, there is no reason to inline it.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-13 03:32:44 -07:00
stephen hemminger 8595805aaf IPv6: only notify protocols if address is compeletely gone
The notifier for address down should only be called if address is completely
gone, not just being marked as tentative on link transistion. The code
in net-next would case bonding/sctp/s390 to see address disappear on link
down, but they would never see it reappear on link up.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-13 02:29:28 -07:00
stephen hemminger d1f84c63a4 ipv6: additional ref count for hash list unnecessary
Since an address in hash list has to already have a ref count,
no additional ref count is needed.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-13 02:29:28 -07:00
stephen hemminger 27bdb2abcc IPv6: keep tentative addresses in hash table
When link goes down, want address to be preserved but in a tentative
state, therefore it has to stay in hash list.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-13 02:29:27 -07:00
stephen hemminger 93fa159abe IPv6: keep route for tentative address
Recent changes preserve IPv6 address when link goes down (good).
But would cause address to point to dead dst entry (bad).
The simplest fix is to just not delete route if address is
being held for later use.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-04-13 02:29:27 -07:00
stephen hemminger b00fabb402 netdev: ethtool RXHASH flag
This adds ethtool and device feature flag to allow control
of receive hashing offload.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Jeff Garzik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-30 23:51:08 -07:00
stephen hemminger 9badba2543 sky2: avoid duplicate link up on Optima chip
The Optima version has feature to detect link quickly without PHY interrupt,
but it causes duplicate link up events.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-30 19:43:48 -07:00
stephen hemminger 4b7c47aa22 sky2: add XL revisions
Add definitions for Yukon XL revisions.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-30 19:43:48 -07:00
stephen hemminger c1cd0a859a sky2: support Yukon EC_U rev B1 and later
Need to change logic to support later versions of Yukon 2 EC_U chip.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-30 19:43:47 -07:00
Stephen Hemminger 1dcd810024 headerdep: perlcritic warning
Minor perlcritic warning:
headerdep.pl: "return" statement with explicit "undef" at line 84, column 2.  See page 199 of PBP.  (Severity: 5)

The rationale according to PBP is that an explicit return of undef
(contrary to most people's expectations) doesn't
always evaluate as false. It has to with the fact that perl return value
depends on context the function is called. If function is used in
list context, the appropriate return value for false is an empty list;
whereas in scalar context the return value for false is undefined.
By just using a "return" both cases are handled.

In the context of a trivial script this doesn't matter. But one script
may be cut-paste into later code (most people like me only know 50%
of perl), that is why perlcritic always complains

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-23 12:26:38 +01:00
stephen hemminger 88949cf484 IPv6: addrconf cleanup addrconf_verify
The variable regen_advance is only used in the privacy case.
Move it to simplify code and eliminate ifdef's

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 16:09:11 -07:00
Stephen Hemminger e21e8467d3 addrconf: checkpatch fixes
Fix some of the checkpatch complaints.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 16:09:01 -07:00
Stephen Hemminger bcdd553fd3 IPv6: addrconf cleanups
Some minor stuff, reformat comments and add whitespace for clarity

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 16:08:18 -07:00
stephen hemminger 502a2ffd73 ipv6: convert idev_list to list macros
Convert to list macro's for the list of addresses per interface
in IPv6.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 15:45:09 -07:00
stephen hemminger 3a88a81d89 ipv6: user better hash for addrconf
The existing hash function has a couple of issues:
  * it is hardwired to 16 for IN6_ADDR_HSIZE
  * limited to 256 and callers using int
  * use jhash2 rather than some old BSD algorithm

No need for random seed since this is local only (based on assigned
addresses) table.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 15:44:35 -07:00
stephen hemminger 5c578aedcb IPv6: convert addrconf hash list to RCU
Convert from reader/writer lock to RCU and spinlock for addrconf
hash list.

Adds an additional helper macro for hlist_for_each_entry_continue_rcu
to handle the continue case.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 15:44:35 -07:00
stephen hemminger c2e21293c0 ipv6: convert addrconf list to hlist
Using hash list macros, simplifies code and helps later RCU.

This patch includes some initialization that is not strictly necessary,
since an empty hlist node/list is all zero; and list is in BSS
and node is allocated with kzalloc.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 15:44:34 -07:00
stephen hemminger 372e6c8f1f ipv6: convert temporary address list to list macros
Use list macros instead of open coded linked list.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-20 15:44:34 -07:00
stephen hemminger 97e3ecd112 TCP: check min TTL on received ICMP packets
This adds RFC5082 checks for TTL on received ICMP packets.
It adds some security against spoofed ICMP packets
disrupting GTSM protected sessions.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-19 21:00:42 -07:00
stephen hemminger 14bb478983 bridge: per-cpu packet statistics (v3)
The shared packet statistics are a potential source of slow down
on bridged traffic. Convert to per-cpu array, but only keep those
statistics which change per-packet.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-16 21:23:19 -07:00
Stephen Hemminger 634a539e16 selinux: const strings in tables
Several places strings tables are used that should be declared
const.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: James Morris <[email protected]>
2010-03-08 09:33:53 +11:00
Stephen Hemminger bae4cecc09 headers_install: use local file handles
Better practice to use 3 arg open and local file handles.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: WANG Cong <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:43:49 +01:00
Stephen Hemminger dbbe33e99f headers_check: fix perl warnings
According to PBP; best way practice is to use local reference for file
handle and three argument open. Also perl prototypes are a mistake.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: WANG Cong <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:43:07 +01:00
Stephen Hemminger 91416cfdf9 export_report: fix perl warnings
Use local file handles, use three argument open.
Don't modify arguments in perl grep (use sed instead)

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: WANG Cong <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:41:04 +01:00
Stephen Hemminger 9c49fd307a profile2linkerlist: fix perl warnings
Turn on strict checking.
Simplify code by using "unless" statement.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: WANG Cong <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:39:33 +01:00
Stephen Hemminger 86d08e569f namespace: perlcritic warnings
Use local file handle not global.
Make loop and other variables local in scope.

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Hui Zhu <[email protected]>
Cc: Cong Wang <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:38:32 +01:00
Stephen Hemminger a208868fc0 checkversion: perl cleanup
Turn on strict checking.
Use three arguement open
Standard practice in perl is to use undef not zero for false

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Cong Wang <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:22:56 +01:00
Stephen Hemminger 3da2715731 checkincludes: fix perlcritic warnings
Turn on strict checking.
Use local file handles.
Use three argument open.

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Cong Wang <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:19:57 +01:00
Stephen Hemminger 1f2a144f5a scripts: improve checkstack
Cleanup checkstack script:
  * Turn on strict checking
  * Fix resulting error message because the declaration syntax
    was incorrect.
  * Remove incorrect and misleading use of prototype
     - prototype not required for this type of sort function
       because $a and $b are being used in this contex
     - if prototype was being used it should be for both arguments
  * Use closure for sort function

Signed-off-by: Stephen Hemminger <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Arjan van de Ven <[email protected]>
Cc: Cong Wang <[email protected]>
Cc: Michal Marek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
2010-03-07 21:19:09 +01:00
Stephen Hemminger a63ceb4c36 get_maintainer: quote email address with period
Picky mail systems won't accept email addresses where recipient has period
in name; ie.  David S.  Miller <davemloft.net> will not work.

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-03-06 11:26:34 -08:00
Stephen Hemminger 22dd5b0cba get_maintainer: fix perlcritic warnings
perlcritic is a standard checker for Perl Best Practices.  This patch
fixes most of the warnings in the get_maintainer script.  If kernel
programmers are going to have checkpatch they should write clean scripts
as well...

Bareword file handle opened at line 176, column 1.  See pages 202,204 of PBP.  (Severity: 5)
Two-argument "open" used at line 176, column 1.  See page 207 of PBP.  (Severity: 5)
Bareword file handle opened at line 207, column 5.  See pages 202,204 of PBP.  (Severity: 5)
Two-argument "open" used at line 207, column 5.  See page 207 of PBP.  (Severity: 5)
Bareword file handle opened at line 246, column 6.  See pages 202,204 of PBP.  (Severity: 5)
Two-argument "open" used at line 246, column 6.  See page 207 of PBP.  (Severity: 5)
Bareword file handle opened at line 258, column 2.  See pages 202,204 of PBP.  (Severity: 5)
Two-argument "open" used at line 258, column 2.  See page 207 of PBP.  (Severity: 5)
Expression form of "eval" at line 983, column 17.  See page 161 of PBP.  (Severity: 5)
Expression form of "eval" at line 985, column 17.  See page 161 of PBP.  (Severity: 5)
Subroutine prototypes used at line 1186, column 1.  See page 194 of PBP.  (Severity: 5)
Subroutine prototypes used at line 1206, column 1.  See page 194 of PBP.  (Severity: 5)

Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-03-06 11:26:34 -08:00
stephen hemminger 8f37ada5b5 IPv6: fix race between cleanup and add/delete address
This solves a potential race problem during the cleanup process.
The issue is that addrconf_ifdown() needs to traverse address list,
but then drop lock to call the notifier. The version in -next
could get confused if add/delete happened during this window.
Original code (2.6.32 and earlier) was okay because all addresses
were always deleted.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-04 00:39:34 -08:00
stephen hemminger 84e8b803f1 IPv6: addrconf notify when address is unavailable
My recent change in net-next to retain permanent addresses caused regression.
Device refcount would not go to zero when device was unregistered because
left over anycast reference would hold ipv6 dev reference which would hold
device references...

The correct procedure is to call notify chain when address is no longer
available for use.  When interface comes back DAD timer will notify
back that address is available.

Also, link local addresses should be purged when interface is brought
down. The address might be changed.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-04 00:39:33 -08:00
stephen hemminger 5b2a19539c IPv6: addrconf timer race
The Router Solicitation timer races with device state changes
because it doesn't lock the device. Use local variable to avoid
one repeated dereference.

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2010-03-04 00:39:33 -08:00