Netdev List
 help / color / mirror / Atom feed
* Re: [patch] bridge: cleanup: remove unused assignment
From: Herbert Xu @ 2010-03-20 11:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: David S. Miller, Stephen Hemminger, YOSHIFUJI Hideaki,
	Paul E. McKenney, Michael Braun, bridge, netdev, kernel-janitors
In-Reply-To: <20100320112049.GU5331@bicker>

On Sat, Mar 20, 2010 at 02:20:49PM +0300, Dan Carpenter wrote:
> We never actually use iph again so this assignment can be removed.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply

* [patch] bridge: cleanup: remove unused assignment
From: Dan Carpenter @ 2010-03-20 11:20 UTC (permalink / raw)
  To: Herbert Xu
  Cc: David S. Miller, Stephen Hemminger, YOSHIFUJI Hideaki,
	Paul E. McKenney, Michael Braun, bridge, netdev, kernel-janitors

We never actually use iph again so this assignment can be removed.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 6980625..9f0c4f0 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1003,8 +1003,6 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br,
 	if (!pskb_may_pull(skb2, sizeof(*ih)))
 		goto out;
 
-	iph = ip_hdr(skb2);
-
 	switch (skb2->ip_summed) {
 	case CHECKSUM_COMPLETE:
 		if (!csum_fold(skb2->csum))

^ permalink raw reply related

* LRO (Large Receice Offload) and UDP
From: Mark Ryden @ 2010-03-20 11:15 UTC (permalink / raw)
  To: netdev; +Cc: themann

Hello,

I have a question about LRO ("Large Receive Offload") and I will
appreciate if somebody can answer in short (for me, 2-3 sentences are
enough). I have
noticed that LRO handles only TCP packets. Thus, the TCP flag is checked and
non TCP packets are not handled by LRO.
(see the check of LRO_TCP in __lro_proc_skb(), net/ipv4/inet_lro.c).

My question is: why can't the LRO mechanism be applied to UDP ? Or can
it be applied, but is not implemented yet or does not worth to be applied ?

Rgs,
Mark

^ permalink raw reply

* Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module
From: Wolfgang Grandegger @ 2010-03-20  7:55 UTC (permalink / raw)
  To: Ira W. Snyder
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, sameo-VuQAYsv1563Yd54FQh9/CA
In-Reply-To: <20100319215227.GF13672-lulEs6mt1IksTUYHLfqkUA@public.gmane.org>

Ira W. Snyder wrote:
> On Fri, Mar 19, 2010 at 09:13:37PM +0100, Wolfgang Grandegger wrote:
>> Ira W. Snyder wrote:
>>> On Fri, Mar 19, 2010 at 04:45:09PM +0100, Wolfgang Grandegger wrote:
>>>> Ira W. Snyder wrote:
>>>>> On Fri, Mar 19, 2010 at 10:01:14AM +0100, Wolfgang Grandegger wrote:
>>>>>> Hi Ira,
>>>>>>
>>>>>> we already discussed this patch on the SocketCAN mailing list and there
>>>>>> are just a few minor issues and the request to add support for the new
>>>>>> "berr-reporting" option, if feasible. See:
>>>>>>
>>>>>>   commit 52c793f24054f5dc30d228e37e0e19cc8313f086
>>>>>>   Author: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
>>>>>>   Date:   Mon Feb 22 22:21:17 2010 +0000
>>>>>>
>>>>>>     can: netlink support for bus-error reporting and counters
>>>>>>     
>>>>>>     This patch makes the bus-error reporting configurable and allows to
>>>>>>     retrieve the CAN TX and RX bus error counters via netlink interface.
>>>>>>     I have added support for the SJA1000. The TX and RX bus error counters
>>>>>>     are also copied to the data fields 6..7 of error messages when state
>>>>>>     changes are reported.
>>>>>>
>>>>>> Should not be a big deal.
>>>>>>
>>>>> I think this patch came along since my last post of the driver. I must
>>>>> have missed it. I'll try and add support.
>>>> No problem, it's really new. Just just need to enable BEI depending on
>>>> CAN_CTRLMODE_BERR_REPORTING.
>>>>
>>> I have one final question about this.
>>>
>>> The documentation for the firmware isn't very specific here. I believe
>>> that in order to get any kind of error messages, I need the bus error
>>> feature turned on. What is the expected behavior of an SJA1000 with the
>>> BEI (bus error interrupt) turned off? Will you still get warning
>>> messages for ERROR_ACTIVE -> ERROR_PASSIVE state transitions?
>> Yes. State transitions are enabled with EI and EPI.
>>
> 
> I cannot set the registers directly, but I think I got it right. See
> below.
> 
>>> I'm not sure how I would go about testing this feature, either. Ideas?
>> Send messages without cable connected and watch the error messages with
>> "candump any,0:0,#ffffffff". With "ip ... berr-reporting on" you should
>> see additional bus-errors.
>>
> 
> Ok, I tried this. On one controller, I turned on bus-error reporting. On
> the other, I turn off bus-error reporting. I then tried sending lots of
> messages with the cable unplugged. Here is what happened:
> 
> bus-error reporting on:
> Lots of CAN_ERR_BUSERR messages are flooded in candump. There is also a
> CAN_ERR_CRTL_TX_WARNING message, when there are too many TX errors.

OK, you will now also understand why bus-error reporting is off by
default. On low-end systems bus-error flooding may even hang the system.

> bus-error reporting off:
> There was only one message reported before the controller went into
> ERROR-WARNING state. It was the same CAN_ERR_CRTL_TX_WARNING message as
> above. There was no flooding of CAN_ERR_BUSERR messages.
> 
> Does this seem right? It seems pretty good to me.

Yes, I'm just missing an error-passive message. What state does "ip -d
link show can0" report.

>>> I also noticed that I can enable "self test mode" and "listen only mode"
>>> using the same firmware command. It appears that there are netlink
>>> messages for this as well. Should I try and support these, too? I don't
>>> really have any use for them (yet). I assume "self test mode" is
>>> equivalent to "loopback mode" in the netlink messages.
>> List-only is straight forward while "self test mode" is not exactly like
>> "loopback mode", IIRC. Feel free to send a follow-up patch when you have
>> time for a thorough implementation and testing. It's also on my to-do
>> list for the SJA1000.
>>
> 
> Ok, then I'll put this off for a while. Feel free to pester me about it
> when there is a working implementation in the SJA1000 driver for me to
> borrow from. :)

I will let you know when I have something working.

Wolfgang.

^ permalink raw reply

* Re: [PATCH 00/12] l2tp: Introduce L2TPv3 support
From: David Miller @ 2010-03-20  6:23 UTC (permalink / raw)
  To: jchapman; +Cc: netdev
In-Reply-To: <20100318102127.14576.98388.stgit@bert.katalix.com>


Doesn't even build:

net/l2tp/l2tp_ip.c:600: error: ‘compat_udp_setsockopt’ undeclared here (not in a function)
net/l2tp/l2tp_ip.c:601: error: ‘compat_udp_getsockopt’ undeclared here (not in a function)

You can't do this like this, as the header providing these
declarations is private to net/ipv4/

Respin your entire patch set once you've resolved this and
also please fix these fundamental whitespace errors emitted
by git when I apply your patches:

Applying: l2tp: Relocate pppol2tp driver to new net/l2tp directory
Applying: l2tp: Split pppol2tp driver into separate l2tp and ppp parts
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:118: new blank line at EOF.
+
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:133: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Applying: ppp: Add ppp_dev_name() exported function
Applying: l2tp: Add ppp device name to L2TP ppp session data
Applying: l2tp: Add L2TPv3 protocol support
Applying: l2tp: Update PPP-over-L2TP driver to work over L2TPv3
Applying: l2tp: Add L2TPv3 IP encapsulation (no UDP) support
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:61: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Applying: netlink: Export genl_lock() API for use by modules
Applying: l2tp: Add netlink control API for L2TP
Applying: l2tp: Add L2TP ethernet pseudowire support
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:25: space before tab in indent.
   	  used as a control protocol and for data encapsulation to set
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:26: space before tab in indent.
   	  up Pseudowires for transporting layer 2 Packet Data Units
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:27: space before tab in indent.
   	  across an IP network [RFC3931].
/home/davem/src/GIT/net-next-2.6/.git/rebase-apply/patch:12: new blank line at EOF.
+
warning: 4 lines add whitespace errors.
Applying: l2tp: Add support for static unmanaged L2TPv3 tunnels
Applying: l2tp: Update documentation

Thanks.

^ permalink raw reply

* Re: [PATCH] tcp: Fix tcp_mark_head_lost() with packets == 0
From: David Miller @ 2010-03-20  5:44 UTC (permalink / raw)
  To: lennart.schulte; +Cc: netdev, ilpo.jarvinen, hannemann
In-Reply-To: <1268828189-22182-1-git-send-email-lennart.schulte@nets.rwth-aachen.de>

From: Lennart Schulte <lennart.schulte@nets.rwth-aachen.de>
Date: Wed, 17 Mar 2010 13:16:29 +0100

> A packet is marked as lost in case packets == 0, although nothing should be done.
> This results in a too early retransmitted packet during recovery in some cases.
> This small patch fixes this issue by returning immediately.
> 
> Signed-off-by: Lennart Schulte <lennart.schulte@nets.rwth-aachen.de>
> Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH] net: ipmr/ip6mr: fix potential out-of-bounds vif_table access
From: David Miller @ 2010-03-20  5:44 UTC (permalink / raw)
  To: kaber; +Cc: netdev
In-Reply-To: <4BA0FD7E.4050201@trash.net>

From: Patrick McHardy <kaber@trash.net>
Date: Wed, 17 Mar 2010 17:04:14 +0100

> My appologies for using git-show again. Correctly formatted
> patch attached.

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 3/3] netlink: fix unaligned access in nla_get_be64()
From: David Miller @ 2010-03-20  5:44 UTC (permalink / raw)
  To: pablo; +Cc: netdev, kaber
In-Reply-To: <20100316233044.4185.69099.stgit@decadence>

From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Wed, 17 Mar 2010 00:30:44 +0100

> This patch fixes a unaligned access in nla_get_be64() that was
> introduced by myself in a17c859849402315613a0015ac8fbf101acf0cc1.
> 
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

Applied.

^ permalink raw reply

* Re: [PATCH 1/1] KS8695: update ksp->next_rx_desc_read at the end of rx loop
From: David Miller @ 2010-03-20  5:44 UTC (permalink / raw)
  To: yegorslists; +Cc: eric.dumazet, netdev
In-Reply-To: <f69abfc31003170240u717283egf2c66adfaaa9aca7@mail.gmail.com>

From: Yegor Yefremov <yegorslists@googlemail.com>
Date: Wed, 17 Mar 2010 10:40:10 +0100

> KS8695: update ksp->next_rx_desc_read at the end of rx loop
> 
> There is no need to adjust the next rx descriptor after each packet,
> so do it only once at the end of the routine.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Applied.

^ permalink raw reply

* Re: [PATCH] igb: Add support for 82576 ET2 Quad Port Server Adapter
From: David Miller @ 2010-03-20  4:11 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, carolyn.wyborny
In-Reply-To: <20100319160747.10902.61121.stgit@localhost.localdomain>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Mar 2010 09:07:48 -0700

> From: Carolyn Wyborny <carolyn.wyborny@intel.com>
> 
> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v3] ipv4: check rt_genid in dst_check
From: David Miller @ 2010-03-20  4:08 UTC (permalink / raw)
  To: timo.teras; +Cc: netdev
In-Reply-To: <1268990420-527-1-git-send-email-timo.teras@iki.fi>

From: Timo Teras <timo.teras@iki.fi>
Date: Fri, 19 Mar 2010 11:20:20 +0200

> Xfrm_dst keeps a reference to ipv4 rtable entries on each
> cached bundle. The only way to renew xfrm_dst when the underlying
> route has changed, is to implement dst_check for this. This is
> what ipv6 side does too.
> 
> The problems started after 87c1e12b5eeb7b30b4b41291bef8e0b41fc3dde9
> which fixed a bug causing xfrm_dst to not get reused, until that all
> lookups always generated new xfrm_dst with new route reference
> and path mtu worked. But after the fix, the old routes started
> to get reused even after they were expired causing pmtu to break
> (well it would occationally work if the rtable gc had run recently
> and marked the route obsolete causing dst_check to get called).
> 
> Signed-off-by: Timo Teras <timo.teras@iki.fi>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks!

^ permalink raw reply

* Re: [PATCH] ipv4: check rt_genid in dst_check
From: David Miller @ 2010-03-20  4:08 UTC (permalink / raw)
  To: herbert; +Cc: timo.teras, netdev
In-Reply-To: <20100319090022.GA23751@gondor.apana.org.au>

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 19 Mar 2010 17:00:22 +0800

> On Fri, Mar 19, 2010 at 04:56:00PM +0800, Herbert Xu wrote:
>> 
>> I'll send a patch to remove the same check on the IPv6 path.
> 
> ipv6: Remove redundant dst NULL check in ip6_dst_check
> 
> As the only path leading to ip6_dst_check makes an indirect call
> through dst->ops, dst cannot be NULL in ip6_dst_check.
> 
> This patch removes this check in case it misleads people who
> come across this code.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied.

^ permalink raw reply

* Re: [PATCH] TCP: check min TTL on received ICMP packets
From: David Miller @ 2010-03-20  4:08 UTC (permalink / raw)
  To: shemminger; +Cc: netdev, pekkas
In-Reply-To: <20100318142732.4de0f8d7@nehalam>

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 18 Mar 2010 14:27:32 -0700

> 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 <shemminger@vyatta.com>
  
Applied.

> Please apply to 2.6.33 since it basically a "follow correct RFC"
> fix to original GTSM patch.

Queued up for -stable, thanks!

^ permalink raw reply

* Re: [net-2.6 PATCH] ixgbe: Set IXGBE_RSC_CB(skb)->DMA field to zero after unmapping the address
From: David Miller @ 2010-03-20  4:06 UTC (permalink / raw)
  To: jeffrey.t.kirsher
  Cc: netdev, gospo, mallikarjuna.chilakala, peter.p.waskiewicz.jr
In-Reply-To: <20100319144132.10528.79305.stgit@localhost.localdomain>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Mar 2010 07:41:33 -0700

> From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
> 
> As per Simon Horman's feedback set IXGBE_RSC_CB(skb)->dma to zero
> after unmapping HWRSC DMA address to avoid double freeing.
> 
> Signed-off-by:  Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [net-2.6 PATCH] ixgbe: fix for real_num_tx_queues update issue
From: David Miller @ 2010-03-20  4:06 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, vasu.dev
In-Reply-To: <20100319143242.10230.9964.stgit@localhost.localdomain>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Mar 2010 07:33:10 -0700

> From: Vasu Dev <vasu.dev@intel.com>
> 
> Currently netdev_features_change is called before fcoe tx queues
> setup is done, so this patch moves calling of netdev_features_change
> after tx queues setup is done in ixgbe_init_interrupt_scheme, so
> that real_num_tx_queues is updated correctly on each fcoe enable
> or disable.
> 
> This allows additional fcoe queues updated correctly in vlan driver
> for their correct queue selection.
> 
> Signed-off-by: Vasu Dev <vasu.dev@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [net-2.6 PATCH 3/3] ixgbevf: Message formatting cleanups
From: David Miller @ 2010-03-20  4:06 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose
In-Reply-To: <20100319130031.9799.3151.stgit@localhost.localdomain>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Mar 2010 06:00:31 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> Clean up some text output formatting.
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [net-2.6 PATCH 2/3] ixgbevf: Shorten up delay timer for watchdog task
From: David Miller @ 2010-03-20  4:06 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose
In-Reply-To: <20100319130011.9799.97156.stgit@localhost.localdomain>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Mar 2010 06:00:12 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> The recovery from PF reset works better when you shorten up the delay
> until the watchdog task executes.
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [net-2.6 PATCH 1/3] ixgbevf: Fix VF Stats accounting after reset
From: David Miller @ 2010-03-20  4:06 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, gospo, gregory.v.rose
In-Reply-To: <20100319125950.9799.70157.stgit@localhost.localdomain>

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 19 Mar 2010 05:59:52 -0700

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> The counters in the 82599 Virtual Function are not clear on read.  They
> accumulate to the maximum value and then roll over.  They are also not
> cleared when the VF executes a soft reset, so it is possible they are
> non-zero when the driver loads and starts.  This has all been accounted
> for in the code that keeps the stats up to date but there is one case
> that is not.  When the PF driver is reset the counters in the VF are
> all reset to zero.  This adds an additional accounting overhead into
> the VF driver when the PF is reset under its feet.  This patch adds
> additional counters that are used by the VF driver to accumulate and
> save stats after a PF reset has been detected.  Prior to this patch
> displaying the stats in the VF after the PF has reset would show
> bogus data.
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-next-2.6 2/2] can: sja1000: add read/write routines for 8, 16 and 32-bit register access
From: Wolfram Sang @ 2010-03-20  3:56 UTC (permalink / raw)
  To: Yegor Yefremov
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4BA35704.2060909-ZJVcf1zZPRSebONBosFW4Q@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 561 bytes --]

On Fri, Mar 19, 2010 at 11:50:44AM +0100, Yegor Yefremov wrote:
> SJA1000: add read/write routines for 8, 16 and 32-bit register access
> 
> add routines for 8, 16 and 32-bit access like in 
> drivers/i2c/busses/i2c-pca-platform.c
> 
> Signed-off-by: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>

Acked-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 188 bytes --]

_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core

^ permalink raw reply

* Re: [Bugme-new] [Bug 15541] New: POLLIN bit is set when there is OOB data only
From: David Miller @ 2010-03-20  2:42 UTC (permalink / raw)
  To: akpm; +Cc: Alexandra.Kossovsky, bugzilla-daemon, bugme-daemon, netdev
In-Reply-To: <20100319155541.731eec28.akpm@linux-foundation.org>


The patch is already in Linus's tree Andrew.

Stephen Hemminger forwarded this bugzilla entry to netdev
an I applied the patch a few days ago.

^ permalink raw reply

* [PATCH] netlink: use the appropriate namespace pid
From: Tom Goff @ 2010-03-20  1:38 UTC (permalink / raw)
  To: netdev

This was included in OpenVZ kernels but wasn't integrated upstream.
>From git://git.openvz.org/pub/linux-2.6.24-openvz:

	commit 5c69402f18adf7276352e051ece2cf31feefab02
	Author: Alexey Dobriyan <adobriyan@openvz.org>
	Date:   Mon Dec 24 14:37:45 2007 +0300

	    netlink: fixup ->tgid to work in multiple PID namespaces

Signed-off-by: Tom Goff <thomas.goff@boeing.com>
---
 net/netlink/af_netlink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 320d042..b5ac0cd 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -545,7 +545,7 @@ static int netlink_autobind(struct socket *sock)
 	struct hlist_head *head;
 	struct sock *osk;
 	struct hlist_node *node;
-	s32 pid = current->tgid;
+	s32 pid = task_tgid_vnr(current);
 	int err;
 	static s32 rover = -4097;
 
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH] netdev: don't always reset iflink when registering
From: Tom Goff @ 2010-03-20  1:39 UTC (permalink / raw)
  To: netdev

Bound tunnel devices set their iflink to the ifindex of the underlying
network interface when created.  It shouldn't be reset by the
registration process.

Signed-off-by: Tom Goff <thomas.goff@boeing.com>
---
 net/core/dev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 59d4394..c00d625 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5067,7 +5067,8 @@ int register_netdevice(struct net_device *dev)
 	netdev_set_addr_lockdep_class(dev);
 	netdev_init_queue_locks(dev);
 
-	dev->iflink = -1;
+	if (dev->iflink <= 0)
+		dev->iflink = -1;
 
 	/* Init, if this function is available */
 	if (dev->netdev_ops->ndo_init) {
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH] net_sched: make traffic control network namespace aware
From: Tom Goff @ 2010-03-20  1:40 UTC (permalink / raw)
  To: netdev

Mostly minor changes to add a net argument to various functions and
remove initial network namespace checks.

Make /proc/net/psched per network namespace.

Signed-off-by: Tom Goff <thomas.goff@boeing.com>
---
 net/sched/act_api.c |   45 ++++++++++----------
 net/sched/cls_api.c |   30 ++++++--------
 net/sched/sch_api.c |  112 ++++++++++++++++++++++++++++++++------------------
 3 files changed, 107 insertions(+), 80 deletions(-)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 64f5e32..7a558da 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -667,7 +667,8 @@ nlmsg_failure:
 }
 
 static int
-act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event)
+act_get_notify(struct net *net, u32 pid, struct nlmsghdr *n,
+	       struct tc_action *a, int event)
 {
 	struct sk_buff *skb;
 
@@ -679,7 +680,7 @@ act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event)
 		return -EINVAL;
 	}
 
-	return rtnl_unicast(skb, &init_net, pid);
+	return rtnl_unicast(skb, net, pid);
 }
 
 static struct tc_action *
@@ -749,7 +750,8 @@ static struct tc_action *create_a(int i)
 	return act;
 }
 
-static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
+static int tca_action_flush(struct net *net, struct nlattr *nla,
+			    struct nlmsghdr *n, u32 pid)
 {
 	struct sk_buff *skb;
 	unsigned char *b;
@@ -808,7 +810,7 @@ static int tca_action_flush(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
 	nlh->nlmsg_flags |= NLM_F_ROOT;
 	module_put(a->ops->owner);
 	kfree(a);
-	err = rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
+	err = rtnetlink_send(skb, net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
 	if (err > 0)
 		return 0;
 
@@ -825,7 +827,8 @@ noflush_out:
 }
 
 static int
-tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event)
+tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
+	      u32 pid, int event)
 {
 	int i, ret;
 	struct nlattr *tb[TCA_ACT_MAX_PRIO+1];
@@ -837,7 +840,7 @@ tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event)
 
 	if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) {
 		if (tb[1] != NULL)
-			return tca_action_flush(tb[1], n, pid);
+			return tca_action_flush(net, tb[1], n, pid);
 		else
 			return -EINVAL;
 	}
@@ -858,7 +861,7 @@ tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event)
 	}
 
 	if (event == RTM_GETACTION)
-		ret = act_get_notify(pid, n, head, event);
+		ret = act_get_notify(net, pid, n, head, event);
 	else { /* delete */
 		struct sk_buff *skb;
 
@@ -877,7 +880,7 @@ tca_action_gd(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int event)
 
 		/* now do the delete */
 		tcf_action_destroy(head, 0);
-		ret = rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC,
+		ret = rtnetlink_send(skb, net, pid, RTNLGRP_TC,
 				     n->nlmsg_flags&NLM_F_ECHO);
 		if (ret > 0)
 			return 0;
@@ -888,8 +891,8 @@ err:
 	return ret;
 }
 
-static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
-			  u16 flags)
+static int tcf_add_notify(struct net *net, struct tc_action *a,
+			  u32 pid, u32 seq, int event, u16 flags)
 {
 	struct tcamsg *t;
 	struct nlmsghdr *nlh;
@@ -922,7 +925,7 @@ static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event,
 	nlh->nlmsg_len = skb_tail_pointer(skb) - b;
 	NETLINK_CB(skb).dst_group = RTNLGRP_TC;
 
-	err = rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, flags&NLM_F_ECHO);
+	err = rtnetlink_send(skb, net, pid, RTNLGRP_TC, flags&NLM_F_ECHO);
 	if (err > 0)
 		err = 0;
 	return err;
@@ -935,7 +938,8 @@ nlmsg_failure:
 
 
 static int
-tcf_action_add(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int ovr)
+tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
+	       u32 pid, int ovr)
 {
 	int ret = 0;
 	struct tc_action *act;
@@ -953,7 +957,7 @@ tcf_action_add(struct nlattr *nla, struct nlmsghdr *n, u32 pid, int ovr)
 	/* dump then free all the actions after update; inserted policy
 	 * stays intact
 	 * */
-	ret = tcf_add_notify(act, pid, seq, RTM_NEWACTION, n->nlmsg_flags);
+	ret = tcf_add_notify(net, act, pid, seq, RTM_NEWACTION, n->nlmsg_flags);
 	for (a = act; a; a = act) {
 		act = a->next;
 		kfree(a);
@@ -969,9 +973,6 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	u32 pid = skb ? NETLINK_CB(skb).pid : 0;
 	int ret = 0, ovr = 0;
 
-	if (!net_eq(net, &init_net))
-		return -EINVAL;
-
 	ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
 	if (ret < 0)
 		return ret;
@@ -994,15 +995,17 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 		if (n->nlmsg_flags&NLM_F_REPLACE)
 			ovr = 1;
 replay:
-		ret = tcf_action_add(tca[TCA_ACT_TAB], n, pid, ovr);
+		ret = tcf_action_add(net, tca[TCA_ACT_TAB], n, pid, ovr);
 		if (ret == -EAGAIN)
 			goto replay;
 		break;
 	case RTM_DELACTION:
-		ret = tca_action_gd(tca[TCA_ACT_TAB], n, pid, RTM_DELACTION);
+		ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
+				    pid, RTM_DELACTION);
 		break;
 	case RTM_GETACTION:
-		ret = tca_action_gd(tca[TCA_ACT_TAB], n, pid, RTM_GETACTION);
+		ret = tca_action_gd(net, tca[TCA_ACT_TAB], n,
+				    pid, RTM_GETACTION);
 		break;
 	default:
 		BUG();
@@ -1042,7 +1045,6 @@ find_dump_kind(const struct nlmsghdr *n)
 static int
 tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
 {
-	struct net *net = sock_net(skb->sk);
 	struct nlmsghdr *nlh;
 	unsigned char *b = skb_tail_pointer(skb);
 	struct nlattr *nest;
@@ -1052,9 +1054,6 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
 	struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
 	struct nlattr *kind = find_dump_kind(cb->nlh);
 
-	if (!net_eq(net, &init_net))
-		return 0;
-
 	if (kind == NULL) {
 		printk("tc_dump_action: action bad kind\n");
 		return 0;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 3725d8f..4a795d9 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -98,8 +98,9 @@ out:
 }
 EXPORT_SYMBOL(unregister_tcf_proto_ops);
 
-static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n,
-			  struct tcf_proto *tp, unsigned long fh, int event);
+static int tfilter_notify(struct net *net, struct sk_buff *oskb,
+			  struct nlmsghdr *n, struct tcf_proto *tp,
+			  unsigned long fh, int event);
 
 
 /* Select new prio value from the range, managed by kernel. */
@@ -137,9 +138,6 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	int err;
 	int tp_created = 0;
 
-	if (!net_eq(net, &init_net))
-		return -EINVAL;
-
 replay:
 	t = NLMSG_DATA(n);
 	protocol = TC_H_MIN(t->tcm_info);
@@ -158,7 +156,7 @@ replay:
 	/* Find head of filter chain. */
 
 	/* Find link */
-	dev = __dev_get_by_index(&init_net, t->tcm_ifindex);
+	dev = __dev_get_by_index(net, t->tcm_ifindex);
 	if (dev == NULL)
 		return -ENODEV;
 
@@ -282,7 +280,7 @@ replay:
 			*back = tp->next;
 			spin_unlock_bh(root_lock);
 
-			tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER);
+			tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER);
 			tcf_destroy(tp);
 			err = 0;
 			goto errout;
@@ -305,10 +303,10 @@ replay:
 		case RTM_DELTFILTER:
 			err = tp->ops->delete(tp, fh);
 			if (err == 0)
-				tfilter_notify(skb, n, tp, fh, RTM_DELTFILTER);
+				tfilter_notify(net, skb, n, tp, fh, RTM_DELTFILTER);
 			goto errout;
 		case RTM_GETTFILTER:
-			err = tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER);
+			err = tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER);
 			goto errout;
 		default:
 			err = -EINVAL;
@@ -324,7 +322,7 @@ replay:
 			*back = tp;
 			spin_unlock_bh(root_lock);
 		}
-		tfilter_notify(skb, n, tp, fh, RTM_NEWTFILTER);
+		tfilter_notify(net, skb, n, tp, fh, RTM_NEWTFILTER);
 	} else {
 		if (tp_created)
 			tcf_destroy(tp);
@@ -370,8 +368,9 @@ nla_put_failure:
 	return -1;
 }
 
-static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n,
-			  struct tcf_proto *tp, unsigned long fh, int event)
+static int tfilter_notify(struct net *net, struct sk_buff *oskb,
+			  struct nlmsghdr *n, struct tcf_proto *tp,
+			  unsigned long fh, int event)
 {
 	struct sk_buff *skb;
 	u32 pid = oskb ? NETLINK_CB(oskb).pid : 0;
@@ -385,7 +384,7 @@ static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n,
 		return -EINVAL;
 	}
 
-	return rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC,
+	return rtnetlink_send(skb, net, pid, RTNLGRP_TC,
 			      n->nlmsg_flags & NLM_F_ECHO);
 }
 
@@ -418,12 +417,9 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
 	const struct Qdisc_class_ops *cops;
 	struct tcf_dump_args arg;
 
-	if (!net_eq(net, &init_net))
-		return 0;
-
 	if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm)))
 		return skb->len;
-	if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
+	if ((dev = __dev_get_by_index(net, tcm->tcm_ifindex)) == NULL)
 		return skb->len;
 
 	if (!tcm->tcm_parent)
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 6cd4910..6d6fe16 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -34,10 +34,12 @@
 #include <net/netlink.h>
 #include <net/pkt_sched.h>
 
-static int qdisc_notify(struct sk_buff *oskb, struct nlmsghdr *n, u32 clid,
+static int qdisc_notify(struct net *net, struct sk_buff *oskb,
+			struct nlmsghdr *n, u32 clid,
 			struct Qdisc *old, struct Qdisc *new);
-static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n,
-			 struct Qdisc *q, unsigned long cl, int event);
+static int tclass_notify(struct net *net, struct sk_buff *oskb,
+			 struct nlmsghdr *n, struct Qdisc *q,
+			 unsigned long cl, int event);
 
 /*
 
@@ -638,11 +640,12 @@ void qdisc_tree_decrease_qlen(struct Qdisc *sch, unsigned int n)
 }
 EXPORT_SYMBOL(qdisc_tree_decrease_qlen);
 
-static void notify_and_destroy(struct sk_buff *skb, struct nlmsghdr *n, u32 clid,
+static void notify_and_destroy(struct net *net, struct sk_buff *skb,
+			       struct nlmsghdr *n, u32 clid,
 			       struct Qdisc *old, struct Qdisc *new)
 {
 	if (new || old)
-		qdisc_notify(skb, n, clid, old, new);
+		qdisc_notify(net, skb, n, clid, old, new);
 
 	if (old)
 		qdisc_destroy(old);
@@ -662,6 +665,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 		       struct Qdisc *new, struct Qdisc *old)
 {
 	struct Qdisc *q = old;
+	struct net *net = dev_net(dev);
 	int err = 0;
 
 	if (parent == NULL) {
@@ -698,12 +702,13 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 		}
 
 		if (!ingress) {
-			notify_and_destroy(skb, n, classid, dev->qdisc, new);
+			notify_and_destroy(net, skb, n, classid,
+					   dev->qdisc, new);
 			if (new && !new->ops->attach)
 				atomic_inc(&new->refcnt);
 			dev->qdisc = new ? : &noop_qdisc;
 		} else {
-			notify_and_destroy(skb, n, classid, old, new);
+			notify_and_destroy(net, skb, n, classid, old, new);
 		}
 
 		if (dev->flags & IFF_UP)
@@ -721,7 +726,7 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
 				err = -ENOENT;
 		}
 		if (!err)
-			notify_and_destroy(skb, n, classid, old, new);
+			notify_and_destroy(net, skb, n, classid, old, new);
 	}
 	return err;
 }
@@ -947,10 +952,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	struct Qdisc *p = NULL;
 	int err;
 
-	if (!net_eq(net, &init_net))
-		return -EINVAL;
-
-	if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
+	if ((dev = __dev_get_by_index(net, tcm->tcm_ifindex)) == NULL)
 		return -ENODEV;
 
 	err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL);
@@ -990,7 +992,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 		if ((err = qdisc_graft(dev, p, skb, n, clid, NULL, q)) != 0)
 			return err;
 	} else {
-		qdisc_notify(skb, n, clid, NULL, q);
+		qdisc_notify(net, skb, n, clid, NULL, q);
 	}
 	return 0;
 }
@@ -1009,16 +1011,13 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	struct Qdisc *q, *p;
 	int err;
 
-	if (!net_eq(net, &init_net))
-		return -EINVAL;
-
 replay:
 	/* Reinit, just in case something touches this. */
 	tcm = NLMSG_DATA(n);
 	clid = tcm->tcm_parent;
 	q = p = NULL;
 
-	if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
+	if ((dev = __dev_get_by_index(net, tcm->tcm_ifindex)) == NULL)
 		return -ENODEV;
 
 	err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL);
@@ -1105,7 +1104,7 @@ replay:
 		return -EINVAL;
 	err = qdisc_change(q, tca);
 	if (err == 0)
-		qdisc_notify(skb, n, clid, NULL, q);
+		qdisc_notify(net, skb, n, clid, NULL, q);
 	return err;
 
 create_n_graft:
@@ -1195,8 +1194,9 @@ nla_put_failure:
 	return -1;
 }
 
-static int qdisc_notify(struct sk_buff *oskb, struct nlmsghdr *n,
-			u32 clid, struct Qdisc *old, struct Qdisc *new)
+static int qdisc_notify(struct net *net, struct sk_buff *oskb,
+			struct nlmsghdr *n, u32 clid,
+			struct Qdisc *old, struct Qdisc *new)
 {
 	struct sk_buff *skb;
 	u32 pid = oskb ? NETLINK_CB(oskb).pid : 0;
@@ -1215,7 +1215,7 @@ static int qdisc_notify(struct sk_buff *oskb, struct nlmsghdr *n,
 	}
 
 	if (skb->len)
-		return rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
+		return rtnetlink_send(skb, net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
 
 err_out:
 	kfree_skb(skb);
@@ -1274,15 +1274,12 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
 	int s_idx, s_q_idx;
 	struct net_device *dev;
 
-	if (!net_eq(net, &init_net))
-		return 0;
-
 	s_idx = cb->args[0];
 	s_q_idx = q_idx = cb->args[1];
 
 	rcu_read_lock();
 	idx = 0;
-	for_each_netdev_rcu(&init_net, dev) {
+	for_each_netdev_rcu(net, dev) {
 		struct netdev_queue *dev_queue;
 
 		if (idx < s_idx)
@@ -1334,10 +1331,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	u32 qid = TC_H_MAJ(clid);
 	int err;
 
-	if (!net_eq(net, &init_net))
-		return -EINVAL;
-
-	if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
+	if ((dev = __dev_get_by_index(net, tcm->tcm_ifindex)) == NULL)
 		return -ENODEV;
 
 	err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL);
@@ -1418,10 +1412,10 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 			if (cops->delete)
 				err = cops->delete(q, cl);
 			if (err == 0)
-				tclass_notify(skb, n, q, cl, RTM_DELTCLASS);
+				tclass_notify(net, skb, n, q, cl, RTM_DELTCLASS);
 			goto out;
 		case RTM_GETTCLASS:
-			err = tclass_notify(skb, n, q, cl, RTM_NEWTCLASS);
+			err = tclass_notify(net, skb, n, q, cl, RTM_NEWTCLASS);
 			goto out;
 		default:
 			err = -EINVAL;
@@ -1434,7 +1428,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 	if (cops->change)
 		err = cops->change(q, clid, pid, tca, &new_cl);
 	if (err == 0)
-		tclass_notify(skb, n, q, new_cl, RTM_NEWTCLASS);
+		tclass_notify(net, skb, n, q, new_cl, RTM_NEWTCLASS);
 
 out:
 	if (cl)
@@ -1486,8 +1480,9 @@ nla_put_failure:
 	return -1;
 }
 
-static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n,
-			  struct Qdisc *q, unsigned long cl, int event)
+static int tclass_notify(struct net *net, struct sk_buff *oskb,
+			 struct nlmsghdr *n, struct Qdisc *q,
+			 unsigned long cl, int event)
 {
 	struct sk_buff *skb;
 	u32 pid = oskb ? NETLINK_CB(oskb).pid : 0;
@@ -1501,7 +1496,7 @@ static int tclass_notify(struct sk_buff *oskb, struct nlmsghdr *n,
 		return -EINVAL;
 	}
 
-	return rtnetlink_send(skb, &init_net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
+	return rtnetlink_send(skb, net, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
 }
 
 struct qdisc_dump_args
@@ -1576,12 +1571,9 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb)
 	struct net_device *dev;
 	int t, s_t;
 
-	if (!net_eq(net, &init_net))
-		return 0;
-
 	if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm)))
 		return 0;
-	if ((dev = dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL)
+	if ((dev = dev_get_by_index(net, tcm->tcm_ifindex)) == NULL)
 		return 0;
 
 	s_t = cb->args[0];
@@ -1701,15 +1693,55 @@ static const struct file_operations psched_fops = {
 	.llseek = seq_lseek,
 	.release = single_release,
 };
+
+static int __net_init psched_net_init(struct net *net)
+{
+	struct proc_dir_entry *e;
+
+	e = proc_net_fops_create(net, "psched", 0, &psched_fops);
+	if (e == NULL)
+		return -ENOMEM;
+
+	return 0;
+}
+
+static void __net_exit psched_net_exit(struct net *net)
+{
+	proc_net_remove(net, "psched");
+
+	return;
+}
+#else
+static int __net_init psched_net_init(struct net *net)
+{
+	return 0;
+}
+
+static void __net_exit psched_net_exit(struct net *net)
+{
+}
 #endif
 
+static struct pernet_operations psched_net_ops = {
+	.init = psched_net_init,
+	.exit = psched_net_exit,
+};
+
 static int __init pktsched_init(void)
 {
+	int err;
+
+	err = register_pernet_subsys(&psched_net_ops);
+	if (err) {
+		printk(KERN_ERR "pktsched_init: "
+		       "cannot initialize per netns operations\n");
+		return err;
+	}
+
 	register_qdisc(&pfifo_qdisc_ops);
 	register_qdisc(&bfifo_qdisc_ops);
 	register_qdisc(&pfifo_head_drop_qdisc_ops);
 	register_qdisc(&mq_qdisc_ops);
-	proc_net_fops_create(&init_net, "psched", 0, &psched_fops);
 
 	rtnl_register(PF_UNSPEC, RTM_NEWQDISC, tc_modify_qdisc, NULL);
 	rtnl_register(PF_UNSPEC, RTM_DELQDISC, tc_get_qdisc, NULL);
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH] Cosmetic:Partially remove deprecated __initcall() and change to
From: Justin P. Mattock @ 2010-03-19 23:24 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: trivial, linux-arm-kernel, linux-audit, uclinux-dist-devel,
	linux-cris-kernel, linux-ia64, linux-mips, linux-parisc,
	linux-s390, selinux, sparclinux, x86, netdev, linux-kernel
In-Reply-To: <4BA40115.2000509@xenotime.net>

On 03/19/2010 03:56 PM, Randy Dunlap wrote:
> On 03/19/10 12:51, Justin P. Mattock wrote:
>> After doing some things on a small issue,
>> I noticed through web surfing, that there were patches
>> submitted pertaining that __initcall is deprecated,
>> and device_initcall should be used.
>
> Where was this discussion?  Do you have any pointers to it?
>

The best info on this is scripts/checkpatch.pl
line #2664

when I found this I just did a quick search of __initcall
(which gives hits here and there)
https://patchwork.kernel.org/patch/23344/
(also found others at around 2008 or so)

> I don't see any mention of __initcall being deprecated in
> Linus' mainline git tree, or in linux-next, or in mmotm.
> Where are those patches?
>

I don't know(I'm out of the social pipeline when it comes to Linux news, 
and updates)..
like in the explanation part of the patch
I was looking into something else, then ran into this,
so as a break(from what I was originally doing)
decided to do this and submit.

>
>> So as a change of subject(since what I was looking at
>> was frustrating me),I decided to grep the whole tree
>> and make the change(partially).
>>
>> Currently I'm running this patch on my system, kernel compiles
>> without any errors or warnings.(thought there would be a speed increase
>> but didn't see much(if any)).
>
> No, __initcall(x) is just a shorthand version of typing
> device_initcall(x).  They do the same thing.
>

yep, that's what I found out as well(reason for the cosmetic
in the subject line).

>> Biggest problem I have though is testing this on other hardware types
>> (I only have a macbook,and an iMac).
>> So please if you have the access to other arch/hardware types please
>> test.
>>
>> Now what I mean by partially is the __initcall function is still
>> there, so(if any) userspace apps/libs depend on this it's there
>> so they dont break and/or any other subsystem, that needs time
>> to make the changes.
>
> The only thing that might be affected is building out-of-tree drivers,
> but those are easy to fix.
>

alright..main concern is making sure things don't break in the 
kernel(even though things do).

I can have a go at the header files, submit
then if it's something people agree they want to do, then they
can go from there(if not it's fine as well).

>> Note:
>> the remaining files that still have __initcall in them are:
>> (according to grep)
>>
>> arch/um/include/shared/init.h
>> include/linux/init.h
>> scripts/checkpatch.pl
>>
>> either I or somebody else, can change this(although a bit
>> concerned about breaking things).
>>
>> Signed-off-by: Justin P. Mattock<justinmattock@gmail.com>
>> ---
>>   Documentation/DocBook/kernel-hacking.tmpl    |    4 ++--
>>   Documentation/cpu-freq/cpu-drivers.txt       |    2 +-
>>   Documentation/kbuild/makefiles.txt           |    2 +-
>>   arch/arm/mach-at91/leds.c                    |    2 +-
>>   arch/arm/mach-clps711x/p720t.c               |    2 +-
>>   arch/arm/mach-ebsa110/leds.c                 |    2 +-
>>   arch/arm/mach-footbridge/cats-hw.c           |    2 +-
>>   arch/arm/mach-footbridge/ebsa285-leds.c      |    2 +-
>>   arch/arm/mach-footbridge/netwinder-hw.c      |    2 +-
>>   arch/arm/mach-footbridge/netwinder-leds.c    |    2 +-
>>   arch/arm/mach-ks8695/leds.c                  |    2 +-
>>   arch/arm/mach-omap1/leds.c                   |    2 +-
>>   arch/arm/mach-omap1/pm.c                     |    2 +-
>>   arch/arm/mach-orion5x/db88f5281-setup.c      |    2 +-
>>   arch/arm/mach-orion5x/rd88f5182-setup.c      |    2 +-
>>   arch/arm/mach-pxa/generic.c                  |    2 +-
>>   arch/arm/mach-pxa/pxa25x.c                   |    2 +-
>>   arch/arm/mach-shark/leds.c                   |    2 +-
>>   arch/blackfin/kernel/bfin_gpio.c             |    2 +-
>>   arch/blackfin/mach-common/pm.c               |    2 +-
>>   arch/cris/arch-v10/kernel/debugport.c        |    2 +-
>>   arch/cris/arch-v10/kernel/fasttimer.c        |    2 +-
>>   arch/cris/arch-v10/mm/init.c                 |    2 +-
>>   arch/cris/arch-v32/kernel/fasttimer.c        |    2 +-
>>   arch/cris/arch-v32/kernel/pinmux.c           |    2 +-
>>   arch/cris/arch-v32/kernel/signal.c           |    2 +-
>>   arch/cris/arch-v32/mach-a3/io.c              |    2 +-
>>   arch/cris/arch-v32/mach-a3/pinmux.c          |    2 +-
>>   arch/cris/arch-v32/mach-fs/io.c              |    2 +-
>>   arch/cris/arch-v32/mach-fs/pinmux.c          |    2 +-
>>   arch/cris/kernel/profile.c                   |    2 +-
>>   arch/cris/kernel/time.c                      |    2 +-
>>   arch/cris/kernel/traps.c                     |    2 +-
>>   arch/frv/kernel/gdb-stub.c                   |    2 +-
>>   arch/frv/kernel/pm-mb93093.c                 |    2 +-
>>   arch/frv/kernel/pm.c                         |    2 +-
>>   arch/frv/kernel/sysctl.c                     |    2 +-
>>   arch/h8300/kernel/gpio.c                     |    2 +-
>>   arch/ia64/hp/sim/simeth.c                    |    2 +-
>>   arch/ia64/hp/sim/simserial.c                 |    2 +-
>>   arch/ia64/kernel/audit.c                     |    2 +-
>>   arch/ia64/kernel/crash.c                     |    2 +-
>>   arch/ia64/kernel/cyclone.c                   |    2 +-
>>   arch/ia64/kernel/perfmon.c                   |    2 +-
>>   arch/ia64/kernel/setup.c                     |    2 +-
>>   arch/ia64/kernel/uncached.c                  |    2 +-
>>   arch/ia64/kernel/unwind.c                    |    2 +-
>>   arch/ia64/mm/init.c                          |    2 +-
>>   arch/mips/Makefile                           |    2 +-
>>   arch/mips/kernel/unaligned.c                 |    2 +-
>>   arch/mips/lasat/sysctl.c                     |    2 +-
>>   arch/mips/math-emu/cp1emu.c                  |    2 +-
>>   arch/mips/nxp/pnx8550/common/proc.c          |    2 +-
>>   arch/mips/sibyte/sb1250/bus_watcher.c        |    2 +-
>>   arch/mn10300/kernel/gdb-stub.c               |    2 +-
>>   arch/mn10300/kernel/mn10300-serial.c         |    2 +-
>>   arch/mn10300/kernel/profile.c                |    2 +-
>>   arch/parisc/kernel/pci-dma.c                 |    2 +-
>>   arch/parisc/kernel/pdc_chassis.c             |    2 +-
>>   arch/powerpc/kernel/audit.c                  |    2 +-
>>   arch/powerpc/kernel/idle.c                   |    2 +-
>>   arch/powerpc/kernel/irq.c                    |    2 +-
>>   arch/powerpc/kernel/proc_powerpc.c           |    2 +-
>>   arch/powerpc/kernel/prom.c                   |    4 ++--
>>   arch/powerpc/kernel/rtas-proc.c              |    2 +-
>>   arch/powerpc/kernel/rtasd.c                  |    2 +-
>>   arch/powerpc/kernel/sysfs.c                  |    2 +-
>>   arch/powerpc/kernel/tau_6xx.c                |    2 +-
>>   arch/powerpc/kernel/vio.c                    |    2 +-
>>   arch/powerpc/platforms/iseries/lpevents.c    |    2 +-
>>   arch/powerpc/platforms/iseries/mf.c          |    2 +-
>>   arch/powerpc/platforms/iseries/proc.c        |    2 +-
>>   arch/powerpc/platforms/iseries/viopath.c     |    2 +-
>>   arch/powerpc/platforms/pseries/eeh.c         |    2 +-
>>   arch/powerpc/platforms/pseries/hvCall_inst.c |    2 +-
>>   arch/powerpc/platforms/pseries/power.c       |    2 +-
>>   arch/powerpc/platforms/pseries/ras.c         |    2 +-
>>   arch/powerpc/platforms/pseries/reconfig.c    |    2 +-
>>   arch/powerpc/xmon/xmon.c                     |    2 +-
>>   arch/s390/appldata/appldata_base.c           |    2 +-
>>   arch/s390/kernel/audit.c                     |    2 +-
>>   arch/s390/kernel/compat_exec_domain.c        |    2 +-
>>   arch/s390/kernel/ipl.c                       |    2 +-
>>   arch/s390/kernel/topology.c                  |    2 +-
>>   arch/sh/boards/board-edosk7760.c             |    2 +-
>>   arch/sh/boards/board-sh7785lcr.c             |    2 +-
>>   arch/sh/boards/mach-cayman/setup.c           |    2 +-
>>   arch/sh/boards/mach-landisk/setup.c          |    2 +-
>>   arch/sh/boards/mach-r2d/setup.c              |    2 +-
>>   arch/sh/boards/mach-sdk7786/setup.c          |    2 +-
>>   arch/sh/boards/mach-se/7206/setup.c          |    2 +-
>>   arch/sh/boards/mach-se/7751/setup.c          |    2 +-
>>   arch/sh/boards/mach-sh03/setup.c             |    2 +-
>>   arch/sh/kernel/traps_64.c                    |    2 +-
>>   arch/sparc/kernel/apc.c                      |    2 +-
>>   arch/sparc/kernel/audit.c                    |    2 +-
>>   arch/sparc/kernel/mdesc.c                    |    2 +-
>>   arch/sparc/kernel/pmc.c                      |    2 +-
>>   arch/um/drivers/mconsole_kern.c              |    8 ++++----
>>   arch/um/drivers/net_kern.c                   |    2 +-
>>   arch/um/drivers/stderr_console.c             |    2 +-
>>   arch/um/drivers/ubd_kern.c                   |    4 ++--
>>   arch/um/kernel/exitcode.c                    |    2 +-
>>   arch/um/kernel/physmem.c                     |    2 +-
>>   arch/um/os-Linux/aio.c                       |    4 ++--
>>   arch/um/os-Linux/skas/mem.c                  |    2 +-
>>   arch/um/os-Linux/skas/process.c              |    2 +-
>>   arch/um/os-Linux/umid.c                      |    2 +-
>>   arch/um/sys-i386/tls.c                       |    2 +-
>>   arch/x86/kernel/audit_64.c                   |    2 +-
>>   arch/x86/kernel/tlb_uv.c                     |    4 ++--
>>   arch/x86/kernel/vsyscall_64.c                |    4 ++--
>>   arch/x86/mm/dump_pagetables.c                |    2 +-
>>   arch/x86/vdso/vdso32-setup.c                 |    4 ++--
>>   arch/x86/vdso/vma.c                          |    2 +-
>>   arch/xtensa/platforms/iss/console.c          |    2 +-
>>   drivers/net/arm/am79c961a.c                  |    2 +-
>>   drivers/net/hamradio/baycom_epp.c            |    1 +
>>   drivers/net/hamradio/baycom_par.c            |    1 +
>>   drivers/net/hamradio/baycom_ser_fdx.c        |    1 +
>>   drivers/net/hamradio/baycom_ser_hdx.c        |    1 +
>>   drivers/s390/char/sclp_cmd.c                 |    2 +-
>>   drivers/s390/char/sclp_config.c              |    2 +-
>>   drivers/s390/char/sclp_cpi_sys.c             |    2 +-
>>   drivers/s390/char/sclp_vt220.c               |    2 +-
>>   drivers/s390/cio/blacklist.c                 |    2 +-
>>   drivers/staging/rtl8192u/ieee80211/api.c     |    2 +-
>>   fs/aio.c                                     |    2 +-
>>   fs/compat_ioctl.c                            |    2 +-
>>   ipc/ipc_sysctl.c                             |    2 +-
>>   ipc/mqueue.c                                 |    2 +-
>>   ipc/util.c                                   |    2 +-
>>   kernel/audit.c                               |    2 +-
>>   kernel/audit_tree.c                          |    2 +-
>>   kernel/dma.c                                 |    2 +-
>>   kernel/futex.c                               |    2 +-
>>   kernel/lockdep_proc.c                        |    2 +-
>>   kernel/pid_namespace.c                       |    2 +-
>>   kernel/posix-cpu-timers.c                    |    2 +-
>>   kernel/posix-timers.c                        |    2 +-
>>   kernel/resource.c                            |    2 +-
>>   kernel/sched_debug.c                         |    2 +-
>>   kernel/time/timer_list.c                     |    2 +-
>>   kernel/time/timer_stats.c                    |    2 +-
>>   kernel/tracepoint.c                          |    2 +-
>>   kernel/utsname_sysctl.c                      |    2 +-
>>   lib/audit.c                                  |    2 +-
>>   lib/debugobjects.c                           |    2 +-
>>   mm/bounce.c                                  |    2 +-
>>   mm/memory.c                                  |    2 +-
>>   mm/mm_init.c                                 |    2 +-
>>   mm/slab.c                                    |    2 +-
>>   mm/slub.c                                    |    2 +-
>>   mm/swapfile.c                                |    2 +-
>>   net/ipv4/syncookies.c                        |    2 +-
>>   net/ipv4/sysctl_net_ipv4.c                   |    2 +-
>>   security/keys/proc.c                         |    2 +-
>>   security/selinux/hooks.c                     |    2 +-
>>   security/selinux/netif.c                     |    2 +-
>>   security/selinux/netlink.c                   |    2 +-
>>   security/selinux/netnode.c                   |    2 +-
>>   security/selinux/netport.c                   |    2 +-
>>   security/selinux/selinuxfs.c                 |    2 +-
>>   security/selinux/ss/services.c               |    2 +-
>>   security/smack/smackfs.c                     |    2 +-
>>   sound/last.c                                 |    2 +-
>>   166 files changed, 176 insertions(+), 172 deletions(-)
>
>

^ permalink raw reply

* Re: [Bugme-new] [Bug 15541] New: POLLIN bit is set when there is OOB data only
From: Andrew Morton @ 2010-03-19 22:55 UTC (permalink / raw)
  To: Alexandra.Kossovsky; +Cc: bugzilla-daemon, bugme-daemon, netdev
In-Reply-To: <bug-15541-10286@http.bugzilla.kernel.org/>


(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Mon, 15 Mar 2010 16:19:43 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=15541
> 
>            Summary: POLLIN bit is set when there is OOB data only
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 2.6.28, 2.6.32, 2.6.33
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: IPV4
>         AssignedTo: shemminger@linux-foundation.org
>         ReportedBy: Alexandra.Kossovsky@oktetlabs.ru
>                 CC: davem@davemloft.net
>         Regression: Yes
> 
> 
> Starting from 2.6.28, Linux kernel has incorrect behaviour when poll() is
> called on TCP socket with out-of-band byte received.
> 
> When TCP socket has OOB byte available (and no normal data), old Linux,
> Solaris, FreeBSD and other systems return POLLPRI bit without POLLRD.  Starting
> from 2.6.28, Linux returns POLLRD | POLLPRI | POLLRDNORM.
> 
> The broken commt is
> http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.28.y.git;a=commitdiff;h=c7004482e8dcb7c3c72666395cfa98a216a4fb70
> .
> Following 1-line patch fixes the problem:
> --- a/net/ipv4/tcp.c 2010-03-15 19:13:45.000000000 +0300
> +++ b/net/ipv4/tcp.c      2010-03-15 19:13:21.000000000 +0300
> @@ -428,7 +428,7 @@
>                 if (tp->urg_seq == tp->copied_seq &&
>                     !sock_flag(sk, SOCK_URGINLINE) &&
>                     tp->urg_data)
> -                       target--;
> +                       target++;
> 
>                 /* Potential race condition. If read of tp below will
>                  * escape above sk->sk_state, we can be illegally awaken
> 

Thanks.

(Please don't send patches via bugzilla - it causes lots of problems with
our usual patch management and review processes.

Please send this patch via email as per Documentation/SubmittingPatches. 
Suitable recipients may be found via scripts/get_maintainer.pl)



^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox