Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] netdevice.h: Add RDMA private pointer to the net_device structure
From: Stephen Hemminger @ 2005-10-03 20:54 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: netdev, openib-general
In-Reply-To: <1128365323.4397.38.camel@hal.voltaire.com>

On 03 Oct 2005 14:48:44 -0400
Hal Rosenstock <halr@voltaire.com> wrote:

> netdevice.h: Add RDMA private pointer to the net_device structure
> 
> Signed-off-by: Hal Rosenstock <halr@voltaire.com>

Who is going to use it? Is RDMA being submitted for code review?

-- 
Stephen Hemminger <shemminger@osdl.org>
OSDL http://developer.osdl.org/~shemminger

^ permalink raw reply

* Re: [PATCH] netdevice.h: Add RDMA private pointer to the net_device structure
From: Hal Rosenstock @ 2005-10-03 20:53 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev, openib-general
In-Reply-To: <20051003135407.072aaff6@dxpl.pdx.osdl.net>

On Mon, 2005-10-03 at 16:54, Stephen Hemminger wrote:
> On 03 Oct 2005 14:48:44 -0400
> Hal Rosenstock <halr@voltaire.com> wrote:
> 
> > netdevice.h: Add RDMA private pointer to the net_device structure
> > 
> > Signed-off-by: Hal Rosenstock <halr@voltaire.com>
> 
> Who is going to use it? Is RDMA being submitted for code review?

IB (and ultimately RDMA) will use it.

-- Hal

^ permalink raw reply

* [PATCH] netdevice.h: Add RDMA private pointer to the net_device structure
From: Hal Rosenstock @ 2005-10-03 18:48 UTC (permalink / raw)
  To: netdev; +Cc: openib-general

netdevice.h: Add RDMA private pointer to the net_device structure

Signed-off-by: Hal Rosenstock <halr@voltaire.com>

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -366,6 +366,7 @@ struct net_device
        void                    *ip6_ptr;       /* IPv6 specific data */
        void                    *ec_ptr;        /* Econet specific data */
        void                    *ax25_ptr;      /* AX.25 specific data */
+       void                    *rdma_ptr;      /* RDMA specific data */
 
 /*
  * Cache line mostly used on receive path (including eth_type_trans())

^ permalink raw reply

* [patch] airo: fix resume
From: Michal Schmidt @ 2005-10-03 11:44 UTC (permalink / raw)
  To: Benjamin Reed; +Cc: Jeff Garzik, netdev

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Cisco Aironet doesn't resume properly from swsusp, because the resume 
method confuses a PM_EVENT_* for a PCI power state. It thinks that it is 
resuming from PCI_D1 and doesn't do the necessary initialization of the 
card.

Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>


[-- Attachment #2: airo-fix-resume.diff --]
[-- Type: text/plain, Size: 719 bytes --]

--- linux-vanilla/drivers/net/wireless/airo.c	2005-09-29 20:44:01.000000000 +0200
+++ linux-mich/drivers/net/wireless/airo.c	2005-10-01 15:07:34.000000000 +0200
@@ -5515,12 +5515,13 @@ static int airo_pci_resume(struct pci_de
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct airo_info *ai = dev->priv;
 	Resp rsp;
+	pci_power_t prev_state = pdev->current_state;
 
-	pci_set_power_state(pdev, 0);
+	pci_set_power_state(pdev, PCI_D0);
 	pci_restore_state(pdev);
-	pci_enable_wake(pdev, pci_choose_state(pdev, ai->power), 0);
+	pci_enable_wake(pdev, PCI_D0, 0);
 
-	if (ai->power.event > 1) {
+	if (prev_state != PCI_D1) {
 		reset_card(dev, 0);
 		mpi_init_descriptors(ai);
 		setup_card(ai, dev->dev_addr, 0);

^ permalink raw reply

* Get rid of everything you owe with out sending another dime
From: abraham stephens @ 2005-10-03 10:53 UTC (permalink / raw)
  To: Loni Crawford; +Cc: olson, ralf, joseph, apache-bounce, dmsdk, netdev

Eliminate all you are indebted for without mailing another cent.  Stop the
embarrassing telephone calls. Bring a stop to the sending of checks! Believe
it or not a good number lending orgizations not following the banking laws
here. Amazing but correct! Visit our web site for detailed information
concerning our procedure at N O  expense or requirement. You have naught to
lose and heaps to reap.

http://uk.geocities.com/dena_schrader/?we=7s.Eradicate all that you owe
with out mailing an other dime
Conprehensive info or to discontinue getting or to comprehend postal
address


A cluster of tall trees with leafy tops stood a short distance outside the
walls, and here the boy landed and sat down to rest in the refreshing shade.
The city seemed as hushed and still as if it were deserted, and before him
stretched the vast plain of white, heated sands
He strained his eyes to catch a glimpse of the band of warriors he had
passed, but they were moving slowly and had not yet appeared

^ permalink raw reply

* ignore, just a test ....
From: Frank Pavlic @ 2005-10-03 10:19 UTC (permalink / raw)
  To: linux-net, netdev, linux-kernel

test

^ permalink raw reply

* Re: [PATCH] fix ipv6 fragment ID selection at slow path
From: Herbert Xu @ 2005-10-03  0:18 UTC (permalink / raw)
  To: Yan Zheng; +Cc: linux-kernel, netdev, roque
In-Reply-To: <433FED06.8070806@gmail.com>

Yan Zheng <yzcorp@gmail.com> wrote:
> 
> --- linux-2.6.13.2/net/ipv6/ip6_output.c        2005-09-17 09:02:12.000000000 +0800
> +++ linux/net/ipv6/ip6_output.c 2005-10-02 22:12:54.000000000 +0800
> @@ -701,7 +701,7 @@
>                 */
>                fh->nexthdr = nexthdr;
>                fh->reserved = 0;
> -               if (frag_id) {
> +               if (!frag_id) {
>                        ipv6_select_ident(skb, fh);
>                        frag_id = fh->identification;
>                } else

This patch makes sense to me.

Please add a Signed-off-by line and send the patch to
davem@davemloft.net and yoshfuji@linux-ipv6.org.

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

* Re: [RFC: 2.6 patch] net/sunrpc/: possible cleanups
From: Adrian Bunk @ 2005-10-02 14:41 UTC (permalink / raw)
  To: Alexey Dobriyan
  Cc: David Miller, neilb, trond.myklebust, linux-kernel, nfs, netdev
In-Reply-To: <20051001164019.GB8633@mipter.zuzino.mipt.ru>

On Sat, Oct 01, 2005 at 08:40:19PM +0400, Alexey Dobriyan wrote:
> On Sat, Oct 01, 2005 at 04:20:41PM +0200, Adrian Bunk wrote:
> > -/* Just increments the mechanism's reference count and returns its input: */
> > -struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
> > -
> 
> > -struct gss_api_mech *
> > +static struct gss_api_mech *
> >  gss_mech_get(struct gss_api_mech *gm)
> 
> Comment is lost.


The comment made sense for the prototype at the header, but the function 
now has only one caller in the file where it's defined.


If someone needs a comment to figure out what a function whose complete 
contents is

static struct gss_api_mech *
gss_mech_get(struct gss_api_mech *gm)
{
        __module_get(gm->gm_owner);
        return gm;
}

does, the problem is not a missing comment.


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

^ permalink raw reply

* [PATCH] fix ipv6 fragment ID selection at slow path
From: Yan Zheng @ 2005-10-02 14:21 UTC (permalink / raw)
  To: linux-kernel, netdev, roque

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



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

--- linux-2.6.13.2/net/ipv6/ip6_output.c	2005-09-17 09:02:12.000000000 +0800
+++ linux/net/ipv6/ip6_output.c	2005-10-02 22:12:54.000000000 +0800
@@ -701,7 +701,7 @@
 		 */
 		fh->nexthdr = nexthdr;
 		fh->reserved = 0;
-		if (frag_id) {
+		if (!frag_id) {
 			ipv6_select_ident(skb, fh);
 			frag_id = fh->identification;
 		} else

^ permalink raw reply

* Re: Fw: [Bugme-new] [Bug 5194] New: IPSec related OOps in 2.6.13
From: Krzysztof Oledzki @ 2005-10-01 19:40 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Andrew Morton, netdev, bugme-daemon@kernel-bugs.osdl.org,
	Matt LaPlante, Linux Kernel Mailing List, David S. Miller
In-Reply-To: <20050906122029.GB4594@gondor.apana.org.au>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 665 bytes --]



On Tue, 6 Sep 2005, Herbert Xu wrote:

> On Tue, Sep 06, 2005 at 04:08:56AM -0700, Andrew Morton wrote:
>>
>> Problem Description:
>>
>> Oops: 0000 [#1]
>> PREEMPT
>> Modules linked in:
>> CPU:    0
>> EIP:    0060:[<c01f562c>]    Not tainted VLI
>> EFLAGS: 00010216   (2.6.13)
>> EIP is at sha1_update+0x7c/0x160
>
> Thanks for the report.  Matt LaPlante had exactly the same problem
> a couple of days ago.  I've tracked down now to my broken crypto
> cipher wrapper functions which will step over a page boundary if
> it's not aligned correctly.

This bug is resolved. I believe we can close it.

Best regards,


 			Krzysztof Olędzki

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Herbert Xu @ 2005-10-01 19:29 UTC (permalink / raw)
  To: Suzanne Wood; +Cc: Robert.Olsson, davem, linux-kernel, netdev, paulmck, walpole
In-Reply-To: <200510011837.j91IbE01012915@rastaban.cs.pdx.edu>

On Sat, Oct 01, 2005 at 11:37:14AM -0700, Suzanne Wood wrote:
> 
> But the following may be worth considering.
> 
>   > It is also probably good to retain the old __in_dev_get()
> and deprecate it.

I think it's better to get rid of it actually so that if there are
external modules using this they can make sure that they're using
the right function.

Cheers,
-- 
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

* Re: Starfire (Adaptec) kernel 2.6.13+ panics on AMD64 NFS server
From: Hendrik Visage @ 2005-10-01 19:21 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Andrew Morton, linux-net, linux-kernel, ionut, Jeff Garzik,
	netdev
In-Reply-To: <20050930223915.GA17562@gondor.apana.org.au>

On 10/1/05, Herbert Xu <herbert@gondor.apana.org.au> wrote:
> You must never call skb_checksum_help unless the packet is meant to
> be checksummed by the hardware.  So starfire is the guilty party here.
>
> This patch makes it do the check and also check for errors from
> skb_checksum_help.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanx Herbert,
 at least on 2.6.14_rc2 the patch appears to work for my stress test :)

--
Hendrik Visage

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Suzanne Wood @ 2005-10-01 18:37 UTC (permalink / raw)
  To: herbert; +Cc: Robert.Olsson, davem, linux-kernel, netdev, paulmck, walpole

Please excuse this restatement of an earlier concern.

  > From suzannew Sat Oct  1 11:00:28 2005

  > With the spotlight leaving in_dev_get, we have the parallel question 
  > of in_dev_put() and __in_dev_put()  both defined with refcnt 
  > decrement, but the preceding underscore may lend itself to an
  > inadvertant pairing and refcnt inaccuracy.

Dave Miller already addressed this question in 
http://www.ussg.iu.edu/hypermail/linux/kernel/0509.3/0757.html 

  > It may not be reasonable to rename __in_dev_put for its parallel definition
  > since its current usage is with __in_dev_get_rtnl() which does not increment 
  > refcnt. 

But the following may be worth considering.

  > It is also probably good to retain the old __in_dev_get()
and deprecate it.

Thank you.

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Paul E. McKenney @ 2005-10-01 18:04 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Suzanne Wood, Robert.Olsson, davem, linux-kernel, netdev, walpole
In-Reply-To: <20051001071248.GA15990@gondor.apana.org.au>

On Sat, Oct 01, 2005 at 05:12:48PM +1000, Herbert Xu wrote:
> On Fri, Sep 30, 2005 at 11:56:41PM -0700, Suzanne Wood wrote:
> > 
> > But it is interesting to have discarded what was developed yesterday
> > to minimize rcu_dereference impact:
> >
> > >> ----- Original message  -----
> > >> From: Herbert Xu <herbert@gondor.apana.org.au>
> > >> Date: Fri, 30 Sep 2005 11:19:07 +1000
> > >> 
> > >> On Thu, Sep 29, 2005 at 06:16:03PM -0700, Paul E. McKenney wrote:
> > >>> 
> > >>> OK, how about this instead?
> > >>> 
> > >>> rcu_read_lock();
> > >>> in_dev = dev->ip_ptr;
> > >>> if (in_dev) {
> > >>> atomic_inc(&rcu_dereference(in_dev)->refcnt);
> > >>> }
> > >>> rcu_read_unlock();
> > >>> return in_dev;
> > >> 
> > >> Looks great. 
> > 
> > while adding a function call level by wrapping  __in_dev_get_rcu
> > with in_dev_get as suggested here.
> 
> It might look different, but it should compile to the same result.
> GCC should be smart enough to combine the two branches and produce a
> memory barrier only when in_dev is not NULL.
>  
> > The other thing I'd hoped to address in pktgen.c was 
> > removing the __in_dev_put() which decrements refcnt 
> > while __in_dev_get_rcu() does not increment.
> 
> Well spotted.
> 
> Here is a patch on top of the last one to fix this bogus decrement.

Both this and Herbert's prior patch look good to me!

							Thanx, Paul

> Signed-off-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

> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -1673,7 +1673,6 @@ static void pktgen_setup_inject(struct p
>  					pkt_dev->saddr_min = in_dev->ifa_list->ifa_address;
>  					pkt_dev->saddr_max = pkt_dev->saddr_min;
>  				}
> -				__in_dev_put(in_dev);	
>  			}
>  			rcu_read_unlock();
>  		}

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Suzanne Wood @ 2005-10-01 18:00 UTC (permalink / raw)
  To: herbert; +Cc: Robert.Olsson, davem, linux-kernel, netdev, paulmck, walpole

With the spotlight leaving in_dev_get, we have the parallel question 
of in_dev_put() and __in_dev_put()  both defined with refcnt 
decrement, but the preceding underscore may lend itself to an
inadvertant pairing and refcnt inaccuracy.

In the following  cscope of linux-2.6.14-rc2 prior to Herbert's patches 
which remove the occurence in pktgen.c and the others are
paired with __in_dev_get_rtnl(), except xfrm4_policy.c():

C symbol: __in_dev_put
  File           Function              Line
  File           Function              Line
0 inetdevice.h   <global>               172 #define __in_dev_put(idev) atomic_dec(&(idev)->refcnt)
1 pktgen.c       pktgen_setup_inject   1687 __in_dev_put(in_dev);
2 devinet.c      inet_rtm_deladdr       412 __in_dev_put(in_dev);
3 igmp.c         igmp_gq_timer_expire   686 __in_dev_put(in_dev);
4 igmp.c         igmp_ifc_timer_expire  698 __in_dev_put(in_dev);
5 igmp.c         igmp_heard_query       801 __in_dev_put(in_dev);
6 igmp.c         ip_mc_down            1228 __in_dev_put(in_dev);
7 igmp.c         ip_mc_down            1231 __in_dev_put(in_dev);
8 igmp.c         ip_mc_find_dev        1310 __in_dev_put(idev);
9 xfrm4_policy.c xfrm4_dst_ifdown       280 __in_dev_put(loopback_idev);

It may not be reasonable to rename __in_dev_put for its parallel definition
since its current usage is with __in_dev_get_rtnl() which does not increment 
refcnt. 

It is also probably good to retain the old __in_dev_get() 
and __in_dev_put() and deprecate them.

Old business:  this is probably stating the obvious,
with Herbert's patches in place, none of the test patch
I'd submitted 8 Sept should take effect.

Thank you.
Suzanne

----- Original Message ----- 
From: "Herbert Xu" <herbert@gondor.apana.org.au>
Sent: Saturday, October 01, 2005 12:12 AM

> On Fri, Sep 30, 2005 at 11:56:41PM -0700, Suzanne Wood wrote:
>> 
>> The other thing I'd hoped to address in pktgen.c was 
>> removing the __in_dev_put() which decrements refcnt 
>> while __in_dev_get_rcu() does not increment.
> 
> Well spotted.
> 
> Here is a patch on top of the last one to fix this bogus decrement.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

^ permalink raw reply

* Re: [RFC: 2.6 patch] net/sunrpc/: possible cleanups
From: Alexey Dobriyan @ 2005-10-01 16:40 UTC (permalink / raw)
  To: Adrian Bunk
  Cc: David Miller, neilb, trond.myklebust, linux-kernel, nfs, netdev
In-Reply-To: <20051001142041.GB4212@stusta.de>

On Sat, Oct 01, 2005 at 04:20:41PM +0200, Adrian Bunk wrote:
> -/* Just increments the mechanism's reference count and returns its input: */
> -struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
> -

> -struct gss_api_mech *
> +static struct gss_api_mech *
>  gss_mech_get(struct gss_api_mech *gm)

Comment is lost.

^ permalink raw reply

* Re: [ANNOUNCE] Release of nf-HiPAC 0.9.0
From: Michael Bellion @ 2005-10-01 15:38 UTC (permalink / raw)
  To: Harald Welte; +Cc: linux-kernel, linux-net, netdev
In-Reply-To: <20050930123334.GW4168@sunbeam.de.gnumonks.org>

Hi

> > I am happy to announce the release of nf-HiPAC version 0.9.0
>
> Looking forward to talking to you about it next week!

Yes, I am looking forward to meet you and the rest of the netfilter developers 
again at the workshop next week too. The workshop has always been a lot of 
fun with a lot of interesting discussions. With the 2 days of the workshop 
and the 2 extra days of hacking on code there will probably be plenty of time 
to talk about the current state and future directions of the HiPAC project.

See you next week
	Michael Bellion

^ permalink raw reply

* Giai Phap Marketting bang cach gui email cho khach hang
From: Dich Vu Gui Email @ 2005-10-01 15:34 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

Toi dang co danh sach hon 200.000 dia chi email danh cho quy vi can quang ba san pham, thuong hieu. Bao gom cac dia chi email
@hn.vnn.vn
@fpt.vn
@netnam.vn
@ten_cong_ty.com.vn
....
Va rat nhieu cac domain khac.
Ty le email chinh xac la 98%.

Khuyen mai them chuong trinh gui email rat manh
Gia 1.500.000/1 danh sach.
Hoac 300.000/1lan gui email.
Lien lac qua dia chi email: dich_vu_email@gmail.com hoac YM: dich_vu_email

^ permalink raw reply

* Giai Phap Marketting bang cach gui email cho khach hang
From: Dich Vu Gui Email @ 2005-10-01 15:34 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

Toi dang co danh sach hon 200.000 dia chi email danh cho quy vi can quang ba san pham, thuong hieu. Bao gom cac dia chi email
@hn.vnn.vn
@fpt.vn
@netnam.vn
@ten_cong_ty.com.vn
....
Va rat nhieu cac domain khac.
Ty le email chinh xac la 98%.

Khuyen mai them chuong trinh gui email rat manh
Gia 1.500.000/1 danh sach.
Hoac 300.000/1lan gui email.
Lien lac qua dia chi email: dich_vu_email@gmail.com hoac YM: dich_vu_email

^ permalink raw reply

* [RFC: 2.6 patch] net/sunrpc/: possible cleanups
From: Adrian Bunk @ 2005-10-01 14:20 UTC (permalink / raw)
  To: David Miller; +Cc: neilb, trond.myklebust, linux-kernel, nfs, netdev

This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global function:
  - xdr.c: xdr_decode_string
- remove the following unneeded EXPORT_SYMBOL's:
  - auth_gss/gss_mech_switch.c: gss_mech_get
  - auth_gss/gss_mech_switch.c: gss_mech_get_by_name
  - auth_gss/gss_mech_switch.c: gss_mech_get_by_pseudoflavor
  - auth_gss/gss_mech_switch.c: gss_pseudoflavor_to_service
  - auth_gss/gss_mech_switch.c: gss_service_to_auth_domain_name
  - auth_gss/gss_mech_switch.c: gss_mech_put
  - sunrpc_syms.c: rpc_wake_up_next
  - sunrpc_syms.c: rpc_new_child
  - sunrpc_syms.c: rpc_run_child
  - sunrpc_syms.c: rpc_new_task
  - sunrpc_syms.c: rpc_release_task
  - sunrpc_syms.c: rpc_release_client
  - sunrpc_syms.c: xprt_udp_slot_table_entries
  - sunrpc_syms.c: xprt_tcp_slot_table_entries
  - sunrpc_syms.c: svc_drop
  - sunrpc_syms.c: svc_authenticate
  - sunrpc_syms.c: xdr_decode_string

Please review which of these patches do make sense and which conflict 
with pending patches.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

This patch was already sent on:
- 30 May 2005
- 7 May 2005

 include/linux/sunrpc/clnt.h           |    1 -
 include/linux/sunrpc/gss_api.h        |    3 ---
 include/linux/sunrpc/xdr.h            |    2 --
 net/sunrpc/auth_gss/gss_mech_switch.c |   13 +------------
 net/sunrpc/clnt.c                     |    3 ++-
 net/sunrpc/sunrpc_syms.c              |   11 -----------
 net/sunrpc/xdr.c                      |    4 +++-
 7 files changed, 6 insertions(+), 31 deletions(-)

--- linux-2.6.12-rc3-mm3-full/include/linux/sunrpc/gss_api.h.old	2005-05-05 23:05:01.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/include/linux/sunrpc/gss_api.h	2005-05-05 23:05:10.000000000 +0200
@@ -110,9 +110,6 @@
 /* Similar, but get by pseudoflavor. */
 struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32);
 
-/* Just increments the mechanism's reference count and returns its input: */
-struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
-
 /* For every succesful gss_mech_get or gss_mech_get_by_* call there must be a
  * corresponding call to gss_mech_put. */
 void gss_mech_put(struct gss_api_mech *);
--- linux-2.6.12-rc3-mm3-full/net/sunrpc/auth_gss/gss_mech_switch.c.old	2005-05-05 23:05:17.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/net/sunrpc/auth_gss/gss_mech_switch.c	2005-05-05 23:19:33.000000000 +0200
@@ -133,14 +133,13 @@
 
 EXPORT_SYMBOL(gss_mech_unregister);
 
-struct gss_api_mech *
+static struct gss_api_mech *
 gss_mech_get(struct gss_api_mech *gm)
 {
 	__module_get(gm->gm_owner);
 	return gm;
 }
 
-EXPORT_SYMBOL(gss_mech_get);
 
 struct gss_api_mech *
 gss_mech_get_by_name(const char *name)
@@ -160,8 +159,6 @@
 
 }
 
-EXPORT_SYMBOL(gss_mech_get_by_name);
-
 static inline int
 mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor)
 {
@@ -193,8 +190,6 @@
 	return gm;
 }
 
-EXPORT_SYMBOL(gss_mech_get_by_pseudoflavor);
-
 u32
 gss_pseudoflavor_to_service(struct gss_api_mech *gm, u32 pseudoflavor)
 {
@@ -207,8 +202,6 @@
 	return 0;
 }
 
-EXPORT_SYMBOL(gss_pseudoflavor_to_service);
-
 char *
 gss_service_to_auth_domain_name(struct gss_api_mech *gm, u32 service)
 {
@@ -221,16 +214,12 @@
 	return NULL;
 }
 
-EXPORT_SYMBOL(gss_service_to_auth_domain_name);
-
 void
 gss_mech_put(struct gss_api_mech * gm)
 {
 	module_put(gm->gm_owner);
 }
 
-EXPORT_SYMBOL(gss_mech_put);
-
 /* The mech could probably be determined from the token instead, but it's just
  * as easy for now to pass it in. */
 int
--- linux-2.6.12-rc3-mm3-full/include/linux/sunrpc/clnt.h.old	2005-05-05 23:05:45.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/include/linux/sunrpc/clnt.h	2005-05-05 23:05:50.000000000 +0200
@@ -134,7 +134,6 @@
 void		rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset);
 void		rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
 size_t		rpc_max_payload(struct rpc_clnt *);
-int		rpc_ping(struct rpc_clnt *clnt, int flags);
 
 static __inline__
 int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags)
--- linux-2.6.12-rc3-mm3-full/net/sunrpc/clnt.c.old	2005-05-05 23:05:58.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/net/sunrpc/clnt.c	2005-05-05 23:06:21.000000000 +0200
@@ -63,6 +63,7 @@
 static u32 *	call_header(struct rpc_task *task);
 static u32 *	call_verify(struct rpc_task *task);
 
+static int	rpc_ping(struct rpc_clnt *clnt, int flags);
 
 static int
 rpc_setup_pipedir(struct rpc_clnt *clnt, char *dir_name)
@@ -1178,7 +1179,7 @@
 	.p_decode = rpcproc_decode_null,
 };
 
-int rpc_ping(struct rpc_clnt *clnt, int flags)
+static int rpc_ping(struct rpc_clnt *clnt, int flags)
 {
 	struct rpc_message msg = {
 		.rpc_proc = &rpcproc_null,
--- linux-2.6.12-rc3-mm3-full/include/linux/sunrpc/xdr.h.old	2005-05-05 23:06:40.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/include/linux/sunrpc/xdr.h	2005-05-05 23:07:23.000000000 +0200
@@ -91,7 +91,6 @@
 u32 *	xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len);
 u32 *	xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len);
 u32 *	xdr_encode_string(u32 *p, const char *s);
-u32 *	xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen);
 u32 *	xdr_encode_netobj(u32 *p, const struct xdr_netobj *);
 u32 *	xdr_decode_netobj(u32 *p, struct xdr_netobj *);
@@ -147,7 +146,6 @@
 extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int);
 extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int);
 extern int read_bytes_from_xdr_buf(struct xdr_buf *, int, void *, int);
-extern int write_bytes_to_xdr_buf(struct xdr_buf *, int, void *, int);
 
 /*
  * Helper structure for copying from an sk_buff.
--- linux-2.6.12-rc3-mm3-full/net/sunrpc/xdr.c.old	2005-05-05 23:06:52.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/net/sunrpc/xdr.c	2005-05-05 23:07:56.000000000 +0200
@@ -95,6 +95,7 @@
 	return xdr_encode_array(p, string, strlen(string));
 }
 
+#if 0
 u32 *
 xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen)
 {
@@ -115,6 +116,7 @@
 	*sp = string;
 	return p + XDR_QUADLEN(len);
 }
+#endif  /*  0  */
 
 u32 *
 xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen)
@@ -882,7 +884,7 @@
 }
 
 /* obj is assumed to point to allocated memory of size at least len: */
-int
+static int
 write_bytes_to_xdr_buf(struct xdr_buf *buf, int base, void *obj, int len)
 {
 	struct xdr_buf subbuf;
--- linux-2.6.12-rc3-mm3-full/net/sunrpc/sunrpc_syms.c.old	2005-05-05 23:07:30.000000000 +0200
+++ linux-2.6.12-rc3-mm3-full/net/sunrpc/sunrpc_syms.c	2005-05-05 23:36:43.000000000 +0200
@@ -29,15 +29,10 @@
 EXPORT_SYMBOL(rpc_execute);
 EXPORT_SYMBOL(rpc_init_task);
 EXPORT_SYMBOL(rpc_sleep_on);
-EXPORT_SYMBOL(rpc_wake_up_next);
 EXPORT_SYMBOL(rpc_wake_up_task);
-EXPORT_SYMBOL(rpc_new_child);
-EXPORT_SYMBOL(rpc_run_child);
 EXPORT_SYMBOL(rpciod_down);
 EXPORT_SYMBOL(rpciod_up);
-EXPORT_SYMBOL(rpc_new_task);
 EXPORT_SYMBOL(rpc_wake_up_status);
-EXPORT_SYMBOL(rpc_release_task);
 
 /* RPC client functions */
 EXPORT_SYMBOL(rpc_create_client);
@@ -45,7 +40,6 @@
 EXPORT_SYMBOL(rpc_bind_new_program);
 EXPORT_SYMBOL(rpc_destroy_client);
 EXPORT_SYMBOL(rpc_shutdown_client);
-EXPORT_SYMBOL(rpc_release_client);
 EXPORT_SYMBOL(rpc_killall_tasks);
 EXPORT_SYMBOL(rpc_call_sync);
 EXPORT_SYMBOL(rpc_call_async);
@@ -63,8 +57,6 @@
 /* Client transport */
 EXPORT_SYMBOL(xprt_create_proto);
 EXPORT_SYMBOL(xprt_set_timeout);
-EXPORT_SYMBOL(xprt_udp_slot_table_entries);
-EXPORT_SYMBOL(xprt_tcp_slot_table_entries);
 
 /* Client credential cache */
 EXPORT_SYMBOL(rpcauth_register);
@@ -81,7 +73,6 @@
 EXPORT_SYMBOL(svc_create_thread);
 EXPORT_SYMBOL(svc_exit_thread);
 EXPORT_SYMBOL(svc_destroy);
-EXPORT_SYMBOL(svc_drop);
 EXPORT_SYMBOL(svc_process);
 EXPORT_SYMBOL(svc_recv);
 EXPORT_SYMBOL(svc_wake_up);
@@ -89,7 +80,6 @@
 EXPORT_SYMBOL(svc_reserve);
 EXPORT_SYMBOL(svc_auth_register);
 EXPORT_SYMBOL(auth_domain_lookup);
-EXPORT_SYMBOL(svc_authenticate);
 EXPORT_SYMBOL(svc_set_client);
 
 /* RPC statistics */
@@ -122,7 +112,6 @@
 
 /* Generic XDR */
 EXPORT_SYMBOL(xdr_encode_string);
-EXPORT_SYMBOL(xdr_decode_string);
 EXPORT_SYMBOL(xdr_decode_string_inplace);
 EXPORT_SYMBOL(xdr_decode_netobj);
 EXPORT_SYMBOL(xdr_encode_netobj);

^ permalink raw reply

* ball Approved E GP.  antiquarian
From: demarcus matherly @ 2005-10-01 13:41 UTC (permalink / raw)
  To: Jarred Bartash; +Cc: daniel, linux-xfs-outgoing, reese, hunter, ljp


It's cheaper to your local drugg sttore.
Eliminate your pressure with our antidote.
Trusted universal carriage network for all deliveries.
Most of shoppers concur that ours is lesser cost.
For correct consumption, a professional will reassesses your meedical form.
I just taking in my antidotes, they are thump up, yes!! Syd J --DC.

http://uk.geocities.com/ainfocometrue/?mmnibmb


"The universe," he observed, "makes rather an indifferent parent, I am
afraid." 


flame-proof  datamonitor  dburch AH02 elaan  crescimento
And for what? For a mere folly, a masquerade, a little thing that he could
not let go. AND HE COULD EVEN LET IT GO, he told himself. But he had
promised to be in London at mid- summer, and he knew that he would go. . . .
It was impossible to live like this any longer. 
And this, then, was to be the disaster that his old professor had foreseen
for him: the crack in the wall, the crash, the cloud of dust. And he could
not understand how it had come about. He felt that he himself was unchanged,
that he was still there, the same man he had been five years ago, and that
he was sitting stupidly by and letting some resolute offshoot of himself
spoil his life for him. This new force was not he, it was but a part of him.
He would not even admit that it was stronger than he; but it was more
active. It was by its energy that this new feeling got the better of him.
His . was the woman who had made his life, gratified his pride, given
direction to his tastes and habits. The life they led together seemed to him
beautiful. Winifred still was, as she had always been, Romance for him, and
whenever he was deeply stirred he turned to her. When the grandeur and
beauty of the world challenged him-- as it challenges even the most
self-absorbed people-- he always answered with her name. That was his reply
to the question put by the mountains and the stars; to all the spiritual
aspects of life. In his feeling for his . there was all the tenderness, all
the pride, all the devotion of which he was capable. There was everything
but energy; the energy of youth which must register itself and cut its name
before it passes. This new feeling was so fresh, so unsatisfied and light of
foot. It ran and was not wearied, anticipated him everywhere. It put a
girdle round the earth while he was going from New York to Moorlock. At this
moment, it was tingling through him, exultant, and live as quicksilver,
whispering, "In July you will be in England." 

^ permalink raw reply

* [PATCH] sysctl_net.c:36: error: 'core_table' undeclared here
From: Russell King @ 2005-10-01 13:35 UTC (permalink / raw)
  To: netdev

During the build for ARM machine type "fortunet", this error occurred:

  CC      net/sysctl_net.o
net/sysctl_net.c:36: error: 'core_table' undeclared here (not in a function)

The ARM configuration which produced this error can be found in:
 arch/arm/configs/fortunet_defconfig

where the relevant options are:
CONFIG_SYSCTL=y
CONFIG_NET=y
# CONFIG_INET is not set

core_table appears to be declared in net/sock.h.  if CONFIG_INET were
defined, net/sock.h would have been included via:
  sysctl_net.c -> net/ip.h -> linux/ip.h -> net/sock.h

so include it directly.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

(This patch is completely untested atm; we're waiting for the machine
to complete an existing build run.  However, I think this is fairly
obviously correct.)

diff --git a/net/sysctl_net.c b/net/sysctl_net.c
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -16,6 +16,8 @@
 #include <linux/mm.h>
 #include <linux/sysctl.h>
 
+#include <net/sock.h>
+
 #ifdef CONFIG_INET
 #include <net/ip.h>
 #endif


-- 
Russell King

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Herbert Xu @ 2005-10-01  7:12 UTC (permalink / raw)
  To: Suzanne Wood; +Cc: Robert.Olsson, davem, linux-kernel, netdev, paulmck, walpole
In-Reply-To: <200510010656.j916ufhT007410@rastaban.cs.pdx.edu>

[-- Attachment #1: Type: text/plain, Size: 1442 bytes --]

On Fri, Sep 30, 2005 at 11:56:41PM -0700, Suzanne Wood wrote:
> 
> But it is interesting to have discarded what was developed yesterday
> to minimize rcu_dereference impact:
>
> >> ----- Original message  -----
> >> From: Herbert Xu <herbert@gondor.apana.org.au>
> >> Date: Fri, 30 Sep 2005 11:19:07 +1000
> >> 
> >> On Thu, Sep 29, 2005 at 06:16:03PM -0700, Paul E. McKenney wrote:
> >>> 
> >>> OK, how about this instead?
> >>> 
> >>> rcu_read_lock();
> >>> in_dev = dev->ip_ptr;
> >>> if (in_dev) {
> >>> atomic_inc(&rcu_dereference(in_dev)->refcnt);
> >>> }
> >>> rcu_read_unlock();
> >>> return in_dev;
> >> 
> >> Looks great. 
> 
> while adding a function call level by wrapping  __in_dev_get_rcu
> with in_dev_get as suggested here.

It might look different, but it should compile to the same result.
GCC should be smart enough to combine the two branches and produce a
memory barrier only when in_dev is not NULL.
 
> The other thing I'd hoped to address in pktgen.c was 
> removing the __in_dev_put() which decrements refcnt 
> while __in_dev_get_rcu() does not increment.

Well spotted.

Here is a patch on top of the last one to fix this bogus decrement.

Signed-off-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

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

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1673,7 +1673,6 @@ static void pktgen_setup_inject(struct p
 					pkt_dev->saddr_min = in_dev->ifa_list->ifa_address;
 					pkt_dev->saddr_max = pkt_dev->saddr_min;
 				}
-				__in_dev_put(in_dev);	
 			}
 			rcu_read_unlock();
 		}

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Suzanne Wood @ 2005-10-01  6:56 UTC (permalink / raw)
  To: herbert
  Cc: Robert.Olsson, davem, linux-kernel, netdev, paulmck, suzannew,
	walpole

Many thanks for addressing this issue.

----- Original Message ----- 
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Sat, 1 Oct 2005 11:13:12 +1000
> 
> On Thu, Sep 29, 2005 at 06:06:50PM -0700, Suzanne Wood wrote:
>> 
>> Are there three cases then?  RCU protection with refcnt, RCU without refcnt,
>> and the bare cast of the dereference? 
> 
> Correct.
> 
> The following patch renames __in_dev_get() to __in_dev_get_rtnl() and
> introduces __in_dev_get_rcu() to cover the second case.
> 
> 1) RCU with refcnt should use in_dev_get().
> 2) RCU without refcnt should use __in_dev_get_rcu().
> 3) All others must hold RTNL and use __in_dev_get_rtnl().
> 

The naming to indicate purpose looks good and the leading underscores
in the prior work did seem to imply wrapping to add functionality.

But it is interesting to have discarded what was developed yesterday
to minimize rcu_dereference impact:

>> ----- Original message  -----
>> From: Herbert Xu <herbert@gondor.apana.org.au>
>> Date: Fri, 30 Sep 2005 11:19:07 +1000
>> 
>> On Thu, Sep 29, 2005 at 06:16:03PM -0700, Paul E. McKenney wrote:
>>> 
>>> OK, how about this instead?
>>> 
>>> rcu_read_lock();
>>> in_dev = dev->ip_ptr;
>>> if (in_dev) {
>>> atomic_inc(&rcu_dereference(in_dev)->refcnt);
>>> }
>>> rcu_read_unlock();
>>> return in_dev;
>> 
>> Looks great. 

while adding a function call level by wrapping  __in_dev_get_rcu
with in_dev_get as suggested here.

> -- 
> diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
> --- a/include/linux/inetdevice.h
> +++ b/include/linux/inetdevice.h
> @@ -142,13 +142,21 @@ static __inline__ int bad_mask(u32 mask,
> 
> #define endfor_ifa(in_dev) }
> 
> +static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
> +{
> + struct in_device *in_dev = dev->ip_ptr;
> + if (in_dev)
> + in_dev = rcu_dereference(in_dev);
> + return in_dev;
> +}
> +
> static __inline__ struct in_device *
> in_dev_get(const struct net_device *dev)
> {
>  struct in_device *in_dev;
> 
>  rcu_read_lock();
> - in_dev = dev->ip_ptr;
> + in_dev = __in_dev_get_rcu(dev);
>  if (in_dev)
>  atomic_inc(&in_dev->refcnt);
>  rcu_read_unlock();
> @@ -156,7 +164,7 @@ in_dev_get(const struct net_device *dev)
> }
> 
> static __inline__ struct in_device *
> -__in_dev_get(const struct net_device *dev)
> +__in_dev_get_rtnl(const struct net_device *dev)
> {
>  return (struct in_device*)dev->ip_ptr;
> }

The other thing I'd hoped to address in pktgen.c was 
removing the __in_dev_put() which decrements refcnt 
while __in_dev_get_rcu() does not increment.

> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -1667,7 +1667,7 @@ static void pktgen_setup_inject(struct p
>  struct in_device *in_dev; 
> 
>  rcu_read_lock();
> - in_dev = __in_dev_get(pkt_dev->odev);
> + in_dev = __in_dev_get_rcu(pkt_dev->odev);
>  if (in_dev) {
>  if (in_dev->ifa_list) {
>  pkt_dev->saddr_min = in_dev->ifa_list->ifa_address;

     pkt_dev->saddr_max = pkt_dev->saddr_min;
    }
-   __in_dev_put(in_dev); 
   }
   rcu_read_unlock();

Thank you very much again for resolving this by clarifying both the 
RCU and RTNL usages.

^ permalink raw reply

* Re: [RFC][PATCH] identify in_dev_get rcu read-side critical sections
From: Herbert Xu @ 2005-10-01  1:13 UTC (permalink / raw)
  To: Suzanne Wood; +Cc: paulmck, Robert.Olsson, davem, linux-kernel, netdev, walpole
In-Reply-To: <200509300106.j8U16obP021064@rastaban.cs.pdx.edu>

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

On Thu, Sep 29, 2005 at 06:06:50PM -0700, Suzanne Wood wrote:
> 
> Are there three cases then?  RCU protection with refcnt, RCU without refcnt,
> and the bare cast of the dereference? 

Correct.

The following patch renames __in_dev_get() to __in_dev_get_rtnl() and
introduces __in_dev_get_rcu() to cover the second case.

1) RCU with refcnt should use in_dev_get().
2) RCU without refcnt should use __in_dev_get_rcu().
3) All others must hold RTNL and use __in_dev_get_rtnl().

There is one exception in net/ipv4/route.c which is in fact a pre-existing
race condition.  I've marked it as such so that we remember to fix it.

This patch is based on suggestions and prior work by Suzanne Wood and
Paul McKenney.

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

Cheers,
-- 
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

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

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2776,7 +2776,7 @@ static u32 bond_glean_dev_ip(struct net_
 		return 0;
 
 	rcu_read_lock();
-	idev = __in_dev_get(dev);
+	idev = __in_dev_get_rcu(dev);
 	if (!idev)
 		goto out;
 
diff --git a/drivers/net/wan/sdlamain.c b/drivers/net/wan/sdlamain.c
--- a/drivers/net/wan/sdlamain.c
+++ b/drivers/net/wan/sdlamain.c
@@ -57,6 +57,7 @@
 #include <linux/ioport.h>	/* request_region(), release_region() */
 #include <linux/wanrouter.h>	/* WAN router definitions */
 #include <linux/wanpipe.h>	/* WANPIPE common user API definitions */
+#include <linux/rcupdate.h>
 
 #include <linux/in.h>
 #include <asm/io.h>		/* phys_to_virt() */
@@ -1268,37 +1269,41 @@ unsigned long get_ip_address(struct net_
 	
 	struct in_ifaddr *ifaddr;
 	struct in_device *in_dev;
+	unsigned long addr = 0;
 
-	if ((in_dev = __in_dev_get(dev)) == NULL){
-		return 0;
+	rcu_read_lock();
+	if ((in_dev = __in_dev_get_rcu(dev)) == NULL){
+		goto out;
 	}
 
 	if ((ifaddr = in_dev->ifa_list)== NULL ){
-		return 0;
+		goto out;
 	}
 	
 	switch (option){
 
 	case WAN_LOCAL_IP:
-		return ifaddr->ifa_local;
+		addr = ifaddr->ifa_local;
 		break;
 	
 	case WAN_POINTOPOINT_IP:
-		return ifaddr->ifa_address;
+		addr = ifaddr->ifa_address;
 		break;	
 
 	case WAN_NETMASK_IP:
-		return ifaddr->ifa_mask;
+		addr = ifaddr->ifa_mask;
 		break;
 
 	case WAN_BROADCAST_IP:
-		return ifaddr->ifa_broadcast;
+		addr = ifaddr->ifa_broadcast;
 		break;
 	default:
-		return 0;
+		break;
 	}
 
-	return 0;
+out:
+	rcu_read_unlock();
+	return addr;
 }	
 
 void add_gateway(sdla_t *card, struct net_device *dev)
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
--- a/drivers/net/wan/syncppp.c
+++ b/drivers/net/wan/syncppp.c
@@ -769,7 +769,7 @@ static void sppp_cisco_input (struct spp
 		u32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */
 #ifdef CONFIG_INET
 		rcu_read_lock();
-		if ((in_dev = __in_dev_get(dev)) != NULL)
+		if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
 		{
 			for (ifa=in_dev->ifa_list; ifa != NULL;
 				ifa=ifa->ifa_next) {
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -1352,7 +1352,7 @@ static unsigned char *strip_make_packet(
 		struct in_device *in_dev;
 
 		rcu_read_lock();
-		in_dev = __in_dev_get(strip_info->dev);
+		in_dev = __in_dev_get_rcu(strip_info->dev);
 		if (in_dev == NULL) {
 			rcu_read_unlock();
 			return NULL;
@@ -1508,7 +1508,7 @@ static void strip_send(struct strip *str
 
 		brd = addr = 0;
 		rcu_read_lock();
-		in_dev = __in_dev_get(strip_info->dev);
+		in_dev = __in_dev_get_rcu(strip_info->dev);
 		if (in_dev) {
 			if (in_dev->ifa_list) {
 				brd = in_dev->ifa_list->ifa_broadcast;
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -37,6 +37,7 @@
 #include <linux/proc_fs.h>
 #include <linux/ctype.h>
 #include <linux/blkdev.h>
+#include <linux/rcupdate.h>
 #include <asm/io.h>
 #include <asm/processor.h>
 #include <asm/hardware.h>
@@ -358,9 +359,10 @@ static __inline__ int led_get_net_activi
 	/* we are running as tasklet, so locking dev_base 
 	 * for reading should be OK */
 	read_lock(&dev_base_lock);
+	rcu_read_lock();
 	for (dev = dev_base; dev; dev = dev->next) {
 	    struct net_device_stats *stats;
-	    struct in_device *in_dev = __in_dev_get(dev);
+	    struct in_device *in_dev = __in_dev_get_rcu(dev);
 	    if (!in_dev || !in_dev->ifa_list)
 		continue;
 	    if (LOOPBACK(in_dev->ifa_list->ifa_local))
@@ -371,6 +373,7 @@ static __inline__ int led_get_net_activi
 	    rx_total += stats->rx_packets;
 	    tx_total += stats->tx_packets;
 	}
+	rcu_read_unlock();
 	read_unlock(&dev_base_lock);
 
 	retval = 0;
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -5200,7 +5200,7 @@ qeth_free_vlan_addresses4(struct qeth_ca
 	if (!card->vlangrp)
 		return;
 	rcu_read_lock();
-	in_dev = __in_dev_get(card->vlangrp->vlan_devices[vid]);
+	in_dev = __in_dev_get_rcu(card->vlangrp->vlan_devices[vid]);
 	if (!in_dev)
 		goto out;
 	for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) {
@@ -7725,7 +7725,7 @@ qeth_arp_constructor(struct neighbour *n
 		goto out;
 
 	rcu_read_lock();
-	in_dev = rcu_dereference(__in_dev_get(dev));
+	in_dev = __in_dev_get_rcu(dev);
 	if (in_dev == NULL) {
 		rcu_read_unlock();
 		return -EINVAL;
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -142,13 +142,21 @@ static __inline__ int bad_mask(u32 mask,
 
 #define endfor_ifa(in_dev) }
 
+static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
+{
+	struct in_device *in_dev = dev->ip_ptr;
+	if (in_dev)
+		in_dev = rcu_dereference(in_dev);
+	return in_dev;
+}
+
 static __inline__ struct in_device *
 in_dev_get(const struct net_device *dev)
 {
 	struct in_device *in_dev;
 
 	rcu_read_lock();
-	in_dev = dev->ip_ptr;
+	in_dev = __in_dev_get_rcu(dev);
 	if (in_dev)
 		atomic_inc(&in_dev->refcnt);
 	rcu_read_unlock();
@@ -156,7 +164,7 @@ in_dev_get(const struct net_device *dev)
 }
 
 static __inline__ struct in_device *
-__in_dev_get(const struct net_device *dev)
+__in_dev_get_rtnl(const struct net_device *dev)
 {
 	return (struct in_device*)dev->ip_ptr;
 }
diff --git a/net/atm/clip.c b/net/atm/clip.c
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -310,7 +310,7 @@ static int clip_constructor(struct neigh
 	if (neigh->type != RTN_UNICAST) return -EINVAL;
 
 	rcu_read_lock();
-	in_dev = rcu_dereference(__in_dev_get(dev));
+	in_dev = __in_dev_get_rcu(dev);
 	if (!in_dev) {
 		rcu_read_unlock();
 		return -EINVAL;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -703,7 +703,7 @@ int netpoll_setup(struct netpoll *np)
 
 	if (!np->local_ip) {
 		rcu_read_lock();
-		in_dev = __in_dev_get(ndev);
+		in_dev = __in_dev_get_rcu(ndev);
 
 		if (!in_dev || !in_dev->ifa_list) {
 			rcu_read_unlock();
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1667,7 +1667,7 @@ static void pktgen_setup_inject(struct p
 			struct in_device *in_dev; 
 
 			rcu_read_lock();
-			in_dev = __in_dev_get(pkt_dev->odev);
+			in_dev = __in_dev_get_rcu(pkt_dev->odev);
 			if (in_dev) {
 				if (in_dev->ifa_list) {
 					pkt_dev->saddr_min = in_dev->ifa_list->ifa_address;
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -406,7 +406,7 @@ static int econet_sendmsg(struct kiocb *
 		unsigned long network = 0;
 
 		rcu_read_lock();
-		idev = __in_dev_get(dev);
+		idev = __in_dev_get_rcu(dev);
 		if (idev) {
 			if (idev->ifa_list)
 				network = ntohl(idev->ifa_list->ifa_address) & 
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -241,7 +241,7 @@ static int arp_constructor(struct neighb
 	neigh->type = inet_addr_type(addr);
 
 	rcu_read_lock();
-	in_dev = rcu_dereference(__in_dev_get(dev));
+	in_dev = __in_dev_get_rcu(dev);
 	if (in_dev == NULL) {
 		rcu_read_unlock();
 		return -EINVAL;
@@ -990,8 +990,8 @@ static int arp_req_set(struct arpreq *r,
 			ipv4_devconf.proxy_arp = 1;
 			return 0;
 		}
-		if (__in_dev_get(dev)) {
-			__in_dev_get(dev)->cnf.proxy_arp = 1;
+		if (__in_dev_get_rtnl(dev)) {
+			__in_dev_get_rtnl(dev)->cnf.proxy_arp = 1;
 			return 0;
 		}
 		return -ENXIO;
@@ -1096,8 +1096,8 @@ static int arp_req_delete(struct arpreq 
 				ipv4_devconf.proxy_arp = 0;
 				return 0;
 			}
-			if (__in_dev_get(dev)) {
-				__in_dev_get(dev)->cnf.proxy_arp = 0;
+			if (__in_dev_get_rtnl(dev)) {
+				__in_dev_get_rtnl(dev)->cnf.proxy_arp = 0;
 				return 0;
 			}
 			return -ENXIO;
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -351,7 +351,7 @@ static int inet_insert_ifa(struct in_ifa
 
 static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa)
 {
-	struct in_device *in_dev = __in_dev_get(dev);
+	struct in_device *in_dev = __in_dev_get_rtnl(dev);
 
 	ASSERT_RTNL();
 
@@ -449,7 +449,7 @@ static int inet_rtm_newaddr(struct sk_bu
 		goto out;
 
 	rc = -ENOBUFS;
-	if ((in_dev = __in_dev_get(dev)) == NULL) {
+	if ((in_dev = __in_dev_get_rtnl(dev)) == NULL) {
 		in_dev = inetdev_init(dev);
 		if (!in_dev)
 			goto out;
@@ -584,7 +584,7 @@ int devinet_ioctl(unsigned int cmd, void
 	if (colon)
 		*colon = ':';
 
-	if ((in_dev = __in_dev_get(dev)) != NULL) {
+	if ((in_dev = __in_dev_get_rtnl(dev)) != NULL) {
 		if (tryaddrmatch) {
 			/* Matthias Andree */
 			/* compare label and address (4.4BSD style) */
@@ -748,7 +748,7 @@ rarok:
 
 static int inet_gifconf(struct net_device *dev, char __user *buf, int len)
 {
-	struct in_device *in_dev = __in_dev_get(dev);
+	struct in_device *in_dev = __in_dev_get_rtnl(dev);
 	struct in_ifaddr *ifa;
 	struct ifreq ifr;
 	int done = 0;
@@ -791,7 +791,7 @@ u32 inet_select_addr(const struct net_de
 	struct in_device *in_dev;
 
 	rcu_read_lock();
-	in_dev = __in_dev_get(dev);
+	in_dev = __in_dev_get_rcu(dev);
 	if (!in_dev)
 		goto no_in_dev;
 
@@ -818,7 +818,7 @@ no_in_dev:
 	read_lock(&dev_base_lock);
 	rcu_read_lock();
 	for (dev = dev_base; dev; dev = dev->next) {
-		if ((in_dev = __in_dev_get(dev)) == NULL)
+		if ((in_dev = __in_dev_get_rcu(dev)) == NULL)
 			continue;
 
 		for_primary_ifa(in_dev) {
@@ -887,7 +887,7 @@ u32 inet_confirm_addr(const struct net_d
 
 	if (dev) {
 		rcu_read_lock();
-		if ((in_dev = __in_dev_get(dev)))
+		if ((in_dev = __in_dev_get_rcu(dev)))
 			addr = confirm_addr_indev(in_dev, dst, local, scope);
 		rcu_read_unlock();
 
@@ -897,7 +897,7 @@ u32 inet_confirm_addr(const struct net_d
 	read_lock(&dev_base_lock);
 	rcu_read_lock();
 	for (dev = dev_base; dev; dev = dev->next) {
-		if ((in_dev = __in_dev_get(dev))) {
+		if ((in_dev = __in_dev_get_rcu(dev))) {
 			addr = confirm_addr_indev(in_dev, dst, local, scope);
 			if (addr)
 				break;
@@ -957,7 +957,7 @@ static int inetdev_event(struct notifier
 			 void *ptr)
 {
 	struct net_device *dev = ptr;
-	struct in_device *in_dev = __in_dev_get(dev);
+	struct in_device *in_dev = __in_dev_get_rtnl(dev);
 
 	ASSERT_RTNL();
 
@@ -1078,7 +1078,7 @@ static int inet_dump_ifaddr(struct sk_bu
 		if (idx > s_idx)
 			s_ip_idx = 0;
 		rcu_read_lock();
-		if ((in_dev = __in_dev_get(dev)) == NULL) {
+		if ((in_dev = __in_dev_get_rcu(dev)) == NULL) {
 			rcu_read_unlock();
 			continue;
 		}
@@ -1149,7 +1149,7 @@ void inet_forward_change(void)
 	for (dev = dev_base; dev; dev = dev->next) {
 		struct in_device *in_dev;
 		rcu_read_lock();
-		in_dev = __in_dev_get(dev);
+		in_dev = __in_dev_get_rcu(dev);
 		if (in_dev)
 			in_dev->cnf.forwarding = on;
 		rcu_read_unlock();
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -173,7 +173,7 @@ int fib_validate_source(u32 src, u32 dst
 
 	no_addr = rpf = 0;
 	rcu_read_lock();
-	in_dev = __in_dev_get(dev);
+	in_dev = __in_dev_get_rcu(dev);
 	if (in_dev) {
 		no_addr = in_dev->ifa_list == NULL;
 		rpf = IN_DEV_RPFILTER(in_dev);
@@ -607,7 +607,7 @@ static int fib_inetaddr_event(struct not
 static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
 	struct net_device *dev = ptr;
-	struct in_device *in_dev = __in_dev_get(dev);
+	struct in_device *in_dev = __in_dev_get_rtnl(dev);
 
 	if (event == NETDEV_UNREGISTER) {
 		fib_disable_ip(dev, 2);
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1087,7 +1087,7 @@ fib_convert_rtentry(int cmd, struct nlms
 		rta->rta_oif = &dev->ifindex;
 		if (colon) {
 			struct in_ifaddr *ifa;
-			struct in_device *in_dev = __in_dev_get(dev);
+			struct in_device *in_dev = __in_dev_get_rtnl(dev);
 			if (!in_dev)
 				return -ENODEV;
 			*colon = ':';
@@ -1268,7 +1268,7 @@ int fib_sync_up(struct net_device *dev)
 			}
 			if (nh->nh_dev == NULL || !(nh->nh_dev->flags&IFF_UP))
 				continue;
-			if (nh->nh_dev != dev || __in_dev_get(dev) == NULL)
+			if (nh->nh_dev != dev || !__in_dev_get_rtnl(dev))
 				continue;
 			alive++;
 			spin_lock_bh(&fib_multipath_lock);
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1323,7 +1323,7 @@ static struct in_device * ip_mc_find_dev
 	}
 	if (dev) {
 		imr->imr_ifindex = dev->ifindex;
-		idev = __in_dev_get(dev);
+		idev = __in_dev_get_rtnl(dev);
 	}
 	return idev;
 }
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1104,10 +1104,10 @@ static int ipgre_open(struct net_device 
 			return -EADDRNOTAVAIL;
 		dev = rt->u.dst.dev;
 		ip_rt_put(rt);
-		if (__in_dev_get(dev) == NULL)
+		if (__in_dev_get_rtnl(dev) == NULL)
 			return -EADDRNOTAVAIL;
 		t->mlink = dev->ifindex;
-		ip_mc_inc_group(__in_dev_get(dev), t->parms.iph.daddr);
+		ip_mc_inc_group(__in_dev_get_rtnl(dev), t->parms.iph.daddr);
 	}
 	return 0;
 }
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -149,7 +149,7 @@ struct net_device *ipmr_new_tunnel(struc
 		if (err == 0 && (dev = __dev_get_by_name(p.name)) != NULL) {
 			dev->flags |= IFF_MULTICAST;
 
-			in_dev = __in_dev_get(dev);
+			in_dev = __in_dev_get_rtnl(dev);
 			if (in_dev == NULL && (in_dev = inetdev_init(dev)) == NULL)
 				goto failure;
 			in_dev->cnf.rp_filter = 0;
@@ -278,7 +278,7 @@ static int vif_delete(int vifi)
 
 	dev_set_allmulti(dev, -1);
 
-	if ((in_dev = __in_dev_get(dev)) != NULL) {
+	if ((in_dev = __in_dev_get_rtnl(dev)) != NULL) {
 		in_dev->cnf.mc_forwarding--;
 		ip_rt_multicast_event(in_dev);
 	}
@@ -421,7 +421,7 @@ static int vif_add(struct vifctl *vifc, 
 		return -EINVAL;
 	}
 
-	if ((in_dev = __in_dev_get(dev)) == NULL)
+	if ((in_dev = __in_dev_get_rtnl(dev)) == NULL)
 		return -EADDRNOTAVAIL;
 	in_dev->cnf.mc_forwarding++;
 	dev_set_allmulti(dev, +1);
diff --git a/net/ipv4/netfilter/ip_conntrack_netbios_ns.c b/net/ipv4/netfilter/ip_conntrack_netbios_ns.c
--- a/net/ipv4/netfilter/ip_conntrack_netbios_ns.c
+++ b/net/ipv4/netfilter/ip_conntrack_netbios_ns.c
@@ -58,7 +58,7 @@ static int help(struct sk_buff **pskb,
 		goto out;
 
 	rcu_read_lock();
-	in_dev = __in_dev_get(rt->u.dst.dev);
+	in_dev = __in_dev_get_rcu(rt->u.dst.dev);
 	if (in_dev != NULL) {
 		for_primary_ifa(in_dev) {
 			if (ifa->ifa_broadcast == iph->daddr) {
diff --git a/net/ipv4/netfilter/ipt_REDIRECT.c b/net/ipv4/netfilter/ipt_REDIRECT.c
--- a/net/ipv4/netfilter/ipt_REDIRECT.c
+++ b/net/ipv4/netfilter/ipt_REDIRECT.c
@@ -93,7 +93,7 @@ redirect_target(struct sk_buff **pskb,
 		newdst = 0;
 		
 		rcu_read_lock();
-		indev = __in_dev_get((*pskb)->dev);
+		indev = __in_dev_get_rcu((*pskb)->dev);
 		if (indev && (ifa = indev->ifa_list))
 			newdst = ifa->ifa_local;
 		rcu_read_unlock();
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2128,7 +2128,7 @@ int ip_route_input(struct sk_buff *skb, 
 		struct in_device *in_dev;
 
 		rcu_read_lock();
-		if ((in_dev = __in_dev_get(dev)) != NULL) {
+		if ((in_dev = __in_dev_get_rcu(dev)) != NULL) {
 			int our = ip_check_mc(in_dev, daddr, saddr,
 				skb->nh.iph->protocol);
 			if (our
@@ -2443,7 +2443,9 @@ static int ip_route_output_slow(struct r
 		err = -ENODEV;
 		if (dev_out == NULL)
 			goto out;
-		if (__in_dev_get(dev_out) == NULL) {
+
+		/* RACE: Check return value of inet_select_addr instead. */
+		if (__in_dev_get_rtnl(dev_out) == NULL) {
 			dev_put(dev_out);
 			goto out;	/* Wrong error code */
 		}
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1806,7 +1806,7 @@ static void sit_add_v4_addrs(struct inet
 	}
 
         for (dev = dev_base; dev != NULL; dev = dev->next) {
-		struct in_device * in_dev = __in_dev_get(dev);
+		struct in_device * in_dev = __in_dev_get_rtnl(dev);
 		if (in_dev && (dev->flags & IFF_UP)) {
 			struct in_ifaddr * ifa;
 
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c
--- a/net/irda/irlan/irlan_eth.c
+++ b/net/irda/irlan/irlan_eth.c
@@ -310,7 +310,7 @@ void irlan_eth_send_gratuitous_arp(struc
 #ifdef CONFIG_INET
 	IRDA_DEBUG(4, "IrLAN: Sending gratuitous ARP\n");
 	rcu_read_lock();
-	in_dev = __in_dev_get(dev);
+	in_dev = __in_dev_get_rcu(dev);
 	if (in_dev == NULL)
 		goto out;
 	if (in_dev->ifa_list)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -147,7 +147,7 @@ static void sctp_v4_copy_addrlist(struct
 	struct sctp_sockaddr_entry *addr;
 
 	rcu_read_lock();
-	if ((in_dev = __in_dev_get(dev)) == NULL) {
+	if ((in_dev = __in_dev_get_rcu(dev)) == NULL) {
 		rcu_read_unlock();
 		return;
 	}

^ 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