Eric Dumazet [Wed, 26 Nov 2008 09:08:18 +0000 (01:08 -0800)]
net: release skb->dst in sock_queue_rcv_skb()
When queuing a skb to sk->sk_receive_queue, we can release its dst,
not anymore needed. Since current cpu did the dst_hold(), refcount is
probably still hot int this cpu caches.
This avoids readers to access the original dst to decrement its
refcount, possibly a long time after packet reception. This should
speedup UDP and RAW receive path.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Wed, 26 Nov 2008 05:16:35 +0000 (21:16 -0800)]
net: Use a percpu_counter for sockets_allocated
Instead of using one atomic_t per protocol, use a percpu_counter
for "sockets_allocated", to reduce cache line contention on
heavy duty network servers.
Note : We revert commit (248969ae31e1b3276fc4399d67ce29a5d81e6fd9
net: af_unix can make unix_nr_socks visbile in /proc),
since it is not anymore used after sock_prot_inuse_add() addition
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Found that while trying average rate policing, it was possible to
request average rate policing without a rate estimator. This results
in no policing which is harmless but incorrect.
Since policing could be setup in two steps, need to check
in the kernel.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Fix the defactoring of ei_XXX functions in 8390 and 8390p.
Remove the tx_timeout hack since no driver including the 3c503
overrides tx_timeout at this time, looks like a legacy thing.
Also, since several drivers all have same hooks, provide common
netdev_ops.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Wed, 26 Nov 2008 02:00:48 +0000 (18:00 -0800)]
netns xfrm: per-netns sysctls
Make
net.core.xfrm_aevent_etime
net.core.xfrm_acq_expires
net.core.xfrm_aevent_rseqth
net.core.xfrm_larval_drop
sysctls per-netns.
For that make net_core_path[] global, register it to prevent two
/proc/net/core antries and change initcall position -- xfrm_init() is called
from fs_initcall, so this one should be fs_initcall at least.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Wed, 26 Nov 2008 01:58:31 +0000 (17:58 -0800)]
netns PF_KEY: part 2
* interaction with userspace -- take netns from userspace socket.
* in ->notify hook take netns either from SA or explicitly passed --
we don't know if SA/SPD flush is coming.
* stub policy migration with init_net for now.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Wed, 26 Nov 2008 01:16:11 +0000 (17:16 -0800)]
netns xfrm: per-netns xfrm_state_all list
This is done to get
a) simple "something leaked" check
b) cover possible DoSes when other netns puts many, many xfrm_states
onto a list.
c) not miss "alien xfrm_state" check in some of list iterators in future.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 01:00:05 +0000 (17:00 -0800)]
atlx: fix warning in drivers/net/atlx/atl2.c
fix this warning:
drivers/net/atlx/atl2.c: In function ‘atl2_request_irq’:
drivers/net/atlx/atl2.c:644: warning: unused variable ‘err’
'err' is unused in the !CONFIG_PCI_MSI case.
Instead of further increasing the #ifdeffery in this function,
restructure the code a bit and get rid of the #ifdef. This
relies on the fact that pci_enable_msi() will always fail in
the !CONFIG_PCI_MSI case.
There should be no change in driver behavior.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 00:59:21 +0000 (16:59 -0800)]
bluetooth: fix warning in net/bluetooth/rfcomm/sock.c
fix this warning:
net/bluetooth/rfcomm/sock.c: In function ‘rfcomm_sock_ioctl’:
net/bluetooth/rfcomm/sock.c:795: warning: unused variable ‘sk’
perhaps BT_DEBUG() should be improved to do printf format checking
instead of the #ifdef, but that looks quite intrusive: each bluetooth
.c file undefines the macro.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 00:58:19 +0000 (16:58 -0800)]
ax25: fix warning in net/ax25/sysctl_net_ax25.c
fix this warning:
net/ax25/sysctl_net_ax25.c:27: warning: ‘min_ds_timeout’ defined but not used
net/ax25/sysctl_net_ax25.c:27: warning: ‘max_ds_timeout’ defined but not used
These are only used in the CONFIG_AX25_DAMA_SLAVE case.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 00:57:30 +0000 (16:57 -0800)]
dccp: fix warning in net/dccp/options.c
this warning:
net/dccp/options.c: In function ‘dccp_parse_options’:
net/dccp/options.c:67: warning: ‘value’ may be used uninitialized in this function
is a bogus GCC warning. The compiler does not recognize the relation
between "value" and "mandatory" variables: the code flow can ever reach
the "out_invalid_option:" label if 'mandatory' is set to 1, and when
'mandatory' is non-zero, we'll always have 'value' initialized.
Help out the compiler by annotating the variable.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 00:53:32 +0000 (16:53 -0800)]
mlx4: fix error path in drivers/net/mlx4/en_rx.c
this warning:
drivers/net/mlx4/en_rx.c: In function ‘mlx4_en_activate_rx_rings’:
drivers/net/mlx4/en_rx.c:412: warning: ‘err’ may be used uninitialized in this function
Triggers because 'err' is uninitialized in the following input
conditions: priv->rx_ring_num is zero and mlx4_en_fill_rx_buffers()
fails.
But even if ->rx_ring_num is nonzero, 'err' will be zero if
mlx4_en_fill_rx_buffers() fails and mlx4_en_activate_rx_rings() returns
success - incorrectly.
So it's best to keep the error code uptodate on mlx4_en_fill_rx_buffers()
calls as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 00:49:37 +0000 (16:49 -0800)]
sunrpc: fix warning in net/sunrpc/xprtrdma/svc_rdma_transport.c
this warning:
net/sunrpc/xprtrdma/svc_rdma_transport.c: In function ‘svc_rdma_accept’:
net/sunrpc/xprtrdma/svc_rdma_transport.c:830: warning: ‘dma_mr_acc’ may be used uninitialized in this function
triggers because GCC does not recognize the (correct) flow connection
between need_dma_mr and dma_mr_acc.
Annotate it.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Ingo Molnar [Wed, 26 Nov 2008 00:48:12 +0000 (16:48 -0800)]
niu: fix warnings in drivers/net/niu.c
these warnings:
drivers/net/niu.c: In function ‘serdes_init_niu_1g_serdes’:
drivers/net/niu.c:451: warning: ‘sig’ may be used uninitialized in this function
drivers/net/niu.c: In function ‘serdes_init_niu_10g_serdes’:
drivers/net/niu.c:550: warning: ‘sig’ may be used uninitialized in this function
triggers because GCC does not recognize that the max_retry loop
always initializes 'sig', due to max_retry != 0.
Annotate them.
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Lezcano [Wed, 26 Nov 2008 00:46:37 +0000 (16:46 -0800)]
netns: filter out uevent not belonging to init_net
This patch will filter out the uevent not related to the init_net.
Without this patch if a network device is created in a network
namespace with the same name as one network device belonging to the
initial network namespace (eg. eth0), when the network namespace
will die and the network device will be destroyed, an event will
be sent and catched by the udevd daemon. That will result to have
the real network device to be shutdown because the udevd/uevent are
not namespace aware.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Robert Olsson [Wed, 26 Nov 2008 00:43:52 +0000 (16:43 -0800)]
ixgbe: Naming interrupt vectors
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Robert Olsson [Wed, 26 Nov 2008 00:41:57 +0000 (16:41 -0800)]
niu: Naming interrupt vectors.
A patch to put names on the niu interrupt vectors according the syntax below.
This is needed to assign correct affinity.
> So on a multiqueue card with 2 RX queues and 2 TX queues we'd
> have names like:
>
> eth0-rx-0
> eth0-rx-1
> eth0-tx-0
> eth0-tx-1
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Tested-by: Jesper Dangaard Brouer <jdb@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>