Netdev List
 help / color / mirror / Atom feed
* Re: 2.6.17-rc5-mm3
From: Andrew Morton @ 2006-06-05 18:54 UTC (permalink / raw)
  To: Mel Gorman; +Cc: linux-kernel, netdev
In-Reply-To: <20060605175637.GA16186@skynet.ie>

On Mon, 5 Jun 2006 18:56:37 +0100
mel@csn.ul.ie (Mel Gorman) wrote:

> 
> I am seeing more networking-related funniness with 2.6.17-rc5-mm3 on the
> same machine previously fixed by git-net-llc-fix.patch. The console log is
> below. I've done no investigation work in case it's a known problem.

It's not a known problem, afaik.

> ...
> Starting anacron: [  OK  ]
> Starting atd: [  OK  ]
> Starting Avahi daemon: [  OK  ]
> Starting cups-config-daemon: [  OK  ]
> Starting HAL daemon: [  OK  ]
> Fedora Core release 5 (Bordeaux)
> Kernel 2.6.17-rc5-mm2-autokern1 on an x86_64
> bl6-13.ltc.austin.ibm.com login: -- 0:conmux-control -- time-stamp -- Jun/05/06 10:47:46 --
> -- 0:conmux-control -- time-stamp -- Jun/05/06 10:51:12 --
> BUG: warning at include/net/dst.h:153/dst_release()
> Call Trace:
>  <IRQ> [<ffffffff81228274>] __kfree_skb+0x3c/0xbd
>  [<ffffffff81199568>] tg3_poll+0x1a1/0x94f
>  [<ffffffff8122d80c>] net_rx_action+0xac/0x160
>  [<ffffffff81037904>] __do_softirq+0x48/0xb4
>  [<ffffffff8100a496>] call_softirq+0x1e/0x28
>  [<ffffffff8100b84e>] do_softirq+0x2c/0x7e
>  [<ffffffff8100b6c8>] do_IRQ+0x50/0x59
>  [<ffffffff81007807>] default_idle+0x0/0x54
>  [<ffffffff810097b8>] ret_from_intr+0x0/0xb
>  <EOI>
> Attempt to release alive inet socket ffff81003f8b2780
> BUG: warning at include/net/dst.h:153/dst_release()
> Call Trace:
>  <IRQ> [<ffffffff81228274>] __kfree_skb+0x3c/0xbd
>  [<ffffffff81268fc4>] icmp_rcv+0x17c/0x184
>  [<ffffffff812484ca>] ip_local_deliver+0xfe/0x1bf
>  [<ffffffff812489bf>] ip_rcv+0x434/0x475
>  [<ffffffff8122d615>] netif_receive_skb+0x2c6/0x2e5
>  [<ffffffff81199add>] tg3_poll+0x716/0x94f
>  [<ffffffff8122d80c>] net_rx_action+0xac/0x160<7>Losing some ticks... checking if CPU frequency changed.
>  [<ffffffff81037904>] __do_softirq+0x48/0xb4
>  [<ffffffff8100a496>] call_softirq+0x1e/0x28
>  [<ffffffff8100b84e>] do_softirq+0x2c/0x7e
>  [<ffffffff8100b6c8>] do_IRQ+0x50/0x59
>  [<ffffffff81007807>] default_idle+0x0/0x54
>  [<ffffffff810097b8>] ret_from_intr+0x0/0xb

There are quite a few changes in the net tree.  I guess the first thing to
investigate would be 2.6.17-rc5+origin.patch+git-net.patch.


^ permalink raw reply

* Re: [PATCH 2/3] pci: bcm43xx avoid pci_find_device
From: John W. Linville @ 2006-06-05 18:56 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Jeff Garzik, Greg KH, Linux Kernel Mailing List, linux-pci,
	netdev, mb, st3
In-Reply-To: <4476E69F.6020502@gmail.com>

On Fri, May 26, 2006 at 01:29:12PM +0159, Jiri Slaby wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jeff Garzik napsal(a):
> > Jiri Slaby wrote:
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Jeff Garzik napsal(a):
> >>> The point is that you don't need to loop over the table,
> >>> pci_match_one_device() does that for you.
> >> The problem is, that there is no such function, I think.
> >> If you take a look at pci_dev_present:
> > 
> > The function you want is pci_dev_present().
> Nope, it returns only 0/1.

Did we get a resolution on this?  I don't think Jeff is going to pull
this patch from me until you satisfy him that it is correct... :-)

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [PATCH] Changes to ieee80211.h for user space regulatory daemon
From: John W. Linville @ 2006-06-05 18:59 UTC (permalink / raw)
  To: Larry Finger; +Cc: netdev
In-Reply-To: <447C790E.1030702@lwfinger.net>

On Tue, May 30, 2006 at 11:55:42AM -0500, Larry Finger wrote:
> Attached are two small patches for include/net/ieee80211.h to prepare for 
> later submission of code to implement a user-space daemon that supplies 
> 802.11 regulatory information.
> 
> The first change adds a bit indicating that 802.11h rules are to be applied 
> to a channel. As discussed earlier in this list, a single bit is unlikely 

> @@ -968,6 +968,7 @@ #define IEEE80211_52GHZ_CHANNELS (IEEE80
> 
>  enum {
> 	IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
> +	IEEE80211_CH_80211H_RULES = (1 << 1),
> 	IEEE80211_CH_B_ONLY = (1 << 2),
> 	IEEE80211_CH_NO_IBSS = (1 << 3),
> 	IEEE80211_CH_UNIFORM_SPREADING = (1 << 4),

Any idea why this "hole" was here to begin with?  Was there something
else defined as (1 << 1) previously?  Is it safe to reuse this value?

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: orinoco encodeext + auth patch on lkml
From: John W. Linville @ 2006-06-05 19:02 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: Dan Williams, netdev
In-Reply-To: <1149226685.7053.10.camel@dv>

On Fri, Jun 02, 2006 at 01:38:05AM -0400, Pavel Roskin wrote:
> Hello, Dan!
> 
> On Wed, 2006-05-31 at 08:03 -0400, Dan Williams wrote:
> > Pavel,
> > 
> > Unsure if you saw this.  Slightly annoying he didn't send to netdev, but
> > would be good to take a look at and possibly integrate.  Looks sane to
> > me from 10,000ft.
> > 
> > http://lkml.org/lkml/2006/5/30/433
> 
> Thanks for heads up.  Actually, this e-mail was copied to the orinoco
> mailing list, so I'm aware of it.

Pavel,

I'll count on you to pass this along if/when you feel it is appropriate.

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* [PATCH 2.6.17-rc5] support for TSO over IPv6.
From: Ananda Raju @ 2006-06-05 19:09 UTC (permalink / raw)
  To: netdev, jgarzik
  Cc: leonid.grossman, ravinandan.arakali, rapuru.sriram, ananda.raju,
	sivakumar.subramani

Hi,
	Neterion Xframe adapter supports TSO over IPv6 but the linux kernel 
	don't support TSO over Ipv6. This patch will allow TCP
	Segmentation Offload (TSO) packets to be created over IPv6. 
	
	The following table shows there is significant improvement in
	throughput with normal frames and CPU usage for both normal and jumbo.

        --------------------------------------------------
        |          |     1500        |      9600         |
        |          ------------------|-------------------|
        |          | thru     CPU    |  thru     CPU     |
        --------------------------------------------------
        | TSO OFF  | 1.80   2.0% id  |  5.53   1.0% id   |
        --------------------------------------------------
        | TSO ON   | 2.61   74.0 id  |  5.52   32.0% id  |
        --------------------------------------------------

Please review the patch.

Signed-off-by: Ananda Raju <ananda.raju@neterion.com>
---
diff -upNr netdev.org/drivers/net/s2io.c netdev.ipv6_tso/drivers/net/s2io.c
--- netdev.org/drivers/net/s2io.c	2006-06-02 07:29:22.000000000 -0700
+++ netdev.ipv6_tso/drivers/net/s2io.c	2006-06-02 09:37:50.000000000 -0700
@@ -6211,6 +6211,7 @@ Defaulting to INTA\n");
 #endif
 
 	dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+	dev->features |= NETIF_F_IP6_CSUM;
 	if (sp->high_dma_flag == TRUE)
 		dev->features |= NETIF_F_HIGHDMA;
 #ifdef NETIF_F_TSO
diff -upNr netdev.org/include/linux/netdevice.h netdev.ipv6_tso/include/linux/netdevice.h
--- netdev.org/include/linux/netdevice.h	2006-06-02 07:28:21.000000000 -0700
+++ netdev.ipv6_tso/include/linux/netdevice.h	2006-06-02 08:30:54.000000000 -0700
@@ -310,6 +310,7 @@ struct net_device
 #define NETIF_F_TSO		2048	/* Can offload TCP/IP segmentation */
 #define NETIF_F_LLTX		4096	/* LockLess TX */
 #define NETIF_F_UFO             8192    /* Can offload UDP Large Send*/
+#define NETIF_F_IP6_CSUM	16384   /* Can checksum TCP/UDP over IPv6 */
 
 	struct net_device	*next_sched;
 
diff -upNr netdev.org/net/ipv6/af_inet6.c netdev.ipv6_tso/net/ipv6/af_inet6.c
--- netdev.org/net/ipv6/af_inet6.c	2006-06-02 06:51:57.000000000 -0700
+++ netdev.ipv6_tso/net/ipv6/af_inet6.c	2006-06-02 09:56:05.000000000 -0700
@@ -660,8 +660,11 @@ int inet6_sk_rebuild_header(struct sock 
 		}
 
 		ip6_dst_store(sk, dst, NULL);
-		sk->sk_route_caps = dst->dev->features &
-			~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+		if (dst->dev->features & NETIF_F_IP6_CSUM)
+			sk->sk_route_caps = dst->dev->features;
+		else
+			sk->sk_route_caps = dst->dev->features &
+				~(NETIF_F_IP_CSUM | NETIF_F_TSO);
 	}
 
 	return 0;
diff -upNr netdev.org/net/ipv6/inet6_connection_sock.c netdev.ipv6_tso/net/ipv6/inet6_connection_sock.c
--- netdev.org/net/ipv6/inet6_connection_sock.c	2006-06-02 06:52:06.000000000 -0700
+++ netdev.ipv6_tso/net/ipv6/inet6_connection_sock.c	2006-06-02 09:54:50.000000000 -0700
@@ -187,8 +187,11 @@ int inet6_csk_xmit(struct sk_buff *skb, 
 		}
 
 		ip6_dst_store(sk, dst, NULL);
-		sk->sk_route_caps = dst->dev->features &
-			~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+		if (dst->dev->features & NETIF_F_IP6_CSUM)
+			sk->sk_route_caps = dst->dev->features;
+		else
+			sk->sk_route_caps = dst->dev->features &
+				~(NETIF_F_IP_CSUM | NETIF_F_TSO);
 	}
 
 	skb->dst = dst_clone(dst);
diff -upNr netdev.org/net/ipv6/ip6_output.c netdev.ipv6_tso/net/ipv6/ip6_output.c
--- netdev.org/net/ipv6/ip6_output.c	2006-06-02 06:55:31.000000000 -0700
+++ netdev.ipv6_tso/net/ipv6/ip6_output.c	2006-06-02 08:50:29.000000000 -0700
@@ -147,7 +147,8 @@ static int ip6_output2(struct sk_buff *s
 
 int ip6_output(struct sk_buff *skb)
 {
-	if ((skb->len > dst_mtu(skb->dst) && !skb_shinfo(skb)->ufo_size) ||
+	if ((skb->len > dst_mtu(skb->dst) &&
+	     !(skb_shinfo(skb)->tso_size || skb_shinfo(skb)->ufo_size)) ||
 				dst_allfrag(skb->dst))
 		return ip6_fragment(skb, ip6_output2);
 	else
@@ -229,7 +230,7 @@ int ip6_xmit(struct sock *sk, struct sk_
 	skb->priority = sk->sk_priority;
 
 	mtu = dst_mtu(dst);
-	if ((skb->len <= mtu) || ipfragok) {
+	if ((skb->len <= mtu) || ipfragok || skb_shinfo(skb)->tso_size) {
 		IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
 		return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev,
 				dst_output);
diff -upNr netdev.org/net/ipv6/tcp_ipv6.c netdev.ipv6_tso/net/ipv6/tcp_ipv6.c
--- netdev.org/net/ipv6/tcp_ipv6.c	2006-06-02 06:52:12.000000000 -0700
+++ netdev.ipv6_tso/net/ipv6/tcp_ipv6.c	2006-06-02 09:59:01.000000000 -0700
@@ -271,8 +271,12 @@ static int tcp_v6_connect(struct sock *s
 	inet->rcv_saddr = LOOPBACK4_IPV6;
 
 	ip6_dst_store(sk, dst, NULL);
-	sk->sk_route_caps = dst->dev->features &
-		~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+
+	if (dst->dev->features & NETIF_F_IP6_CSUM)
+		sk->sk_route_caps = dst->dev->features;
+	else
+		sk->sk_route_caps = dst->dev->features &
+			~(NETIF_F_IP_CSUM | NETIF_F_TSO);
 
 	icsk->icsk_ext_hdr_len = 0;
 	if (np->opt)
@@ -931,8 +935,12 @@ static struct sock * tcp_v6_syn_recv_soc
 	 */
 
 	ip6_dst_store(newsk, dst, NULL);
-	newsk->sk_route_caps = dst->dev->features &
-		~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+
+	if (dst->dev->features & NETIF_F_IP6_CSUM)
+		newsk->sk_route_caps = dst->dev->features;
+	else
+		newsk->sk_route_caps = dst->dev->features &
+			~(NETIF_F_IP_CSUM | NETIF_F_TSO);
 
 	newtcp6sk = (struct tcp6_sock *)newsk;
 	inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;


^ permalink raw reply

* Re: [PATCH 2/3] pci: bcm43xx avoid pci_find_device
From: Jiri Slaby @ 2006-06-05 19:10 UTC (permalink / raw)
  To: Jiri Slaby, Jeff Garzik, Greg KH, Linux Kernel Mailing List,
	linux-pci, netdev, mb, st3
In-Reply-To: <20060605185614.GG6068@tuxdriver.com>

John W. Linville napsal(a):
> On Fri, May 26, 2006 at 01:29:12PM +0159, Jiri Slaby wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Jeff Garzik napsal(a):
>>> Jiri Slaby wrote:
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> Jeff Garzik napsal(a):
>>>>> The point is that you don't need to loop over the table,
>>>>> pci_match_one_device() does that for you.
>>>> The problem is, that there is no such function, I think.
>>>> If you take a look at pci_dev_present:
>>> The function you want is pci_dev_present().
>> Nope, it returns only 0/1.
> 
> Did we get a resolution on this?  I don't think Jeff is going to pull
> this patch from me until you satisfy him that it is correct... :-)
Yup: to use pci_get_device in some nice loop.
But unfortunately here is no time now, that's the problem, I'll post corrected
ones next month, sorry.

regards,
-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
\_.-^-._   jirislaby@gmail.com   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E

^ permalink raw reply

* Re: [PATCH, RTF/RFC] bcm43xx: Enable local IRQs while executing periodic work
From: Michael Buesch @ 2006-06-05 19:13 UTC (permalink / raw)
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, bcm43xx-dev-0fE9KPoRgkgATYTw5x5z8w,
	John W. Linville
In-Reply-To: <20060605185433.GF6068-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

On Monday 05 June 2006 20:54, John W. Linville wrote:
> On Tue, May 23, 2006 at 05:23:09PM +0200, Michael Buesch wrote:
> 
> > I would like to get this into wireless-2.6, but before that
> > happens I would like to have a few regression tests by people.
> > Please apply this and run high network traffic for 10-15 minutes.
> > Please enable kernel spinlock lockup and recursion detection
> > while testing.
> 
> It has almost been two weeks...do we want this patch, or not?

The two patches
[PATCH 1/2] bcm43xx: redesign locking
[PATCH 2/2] bcm43xx: preemptible periodic work
are the successors of it. ;) So, no, I don't want that old
and broken patch any longer.

But thanks that you asked. I forgot about it.

-- 
Greetings Michael.

^ permalink raw reply

* Re: [PATCH,RFT] bcm43xx: use softmac-suggested TX rate
From: Michael Buesch @ 2006-06-05 19:15 UTC (permalink / raw)
  To: John W. Linville; +Cc: Daniel Drake, netdev
In-Reply-To: <20060605185147.GE6068@tuxdriver.com>

On Monday 05 June 2006 20:51, John W. Linville wrote:
> On Fri, May 19, 2006 at 08:32:46PM +0200, Michael Buesch wrote:
> > On Friday 19 May 2006 20:44, you wrote:
> > > John W. Linville wrote:
> > > > Do you intend for this to be merged?  Given recent miscommunication,
> > > > I figured I should ask... :-)
> > > 
> > > Nobody has tested it yet, so no, but thanks for asking.
> > > 
> > > I figure it will be easier to find testers once the base patch (softmac 
> > > suggest txrate) has been pushed by you into 2.6.18-rc1 ;)
> > 
> > Next time, please CC the maintainers, so they don't accidentally delete
> > important mail. ;)
> > Can you resend that patch to me in private and I will see if it
> > is good.
> 
> Any more input on this patch?  Do we want it, or not?

I will test it now and send it to you afterwards.

-- 
Greetings Michael.

^ permalink raw reply

* Re: [PATCH,RFT] bcm43xx: use softmac-suggested TX rate
From: John W. Linville @ 2006-06-05 19:17 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Daniel Drake, netdev
In-Reply-To: <200606052115.54366.mb@bu3sch.de>

On Mon, Jun 05, 2006 at 09:15:54PM +0200, Michael Buesch wrote:
> On Monday 05 June 2006 20:51, John W. Linville wrote:
> > On Fri, May 19, 2006 at 08:32:46PM +0200, Michael Buesch wrote:
> > > On Friday 19 May 2006 20:44, you wrote:
> > > > John W. Linville wrote:
> > > > > Do you intend for this to be merged?  Given recent miscommunication,
> > > > > I figured I should ask... :-)
> > > > 
> > > > Nobody has tested it yet, so no, but thanks for asking.
> > > > 
> > > > I figure it will be easier to find testers once the base patch (softmac 
> > > > suggest txrate) has been pushed by you into 2.6.18-rc1 ;)
> > > 
> > > Next time, please CC the maintainers, so they don't accidentally delete
> > > important mail. ;)
> > > Can you resend that patch to me in private and I will see if it
> > > is good.
> > 
> > Any more input on this patch?  Do we want it, or not?
> 
> I will test it now and send it to you afterwards.

OK, I will now 'officially' forget about this patch, and wait for you
to endorse it by re-sending it to me. :-)

Thanks,

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [PATCH] hush noisy ieee80211 CCMP printks
From: John W. Linville @ 2006-06-05 19:22 UTC (permalink / raw)
  To: Jason Lunz; +Cc: Jouni Malinen, netdev
In-Reply-To: <20060605160335.GB25688@knob.reflex>

On Mon, Jun 05, 2006 at 12:03:35PM -0400, Jason Lunz wrote:

> If the messages are actually useful, and unusual, then they should
> probably stay. But I get a LOT of them, and my wireless is working just
> fine.

I'm dropping this patch, based on Jouni's comments.  If you want to
reformulate a patch that make this output controlled by some sort of
debug option (runtime or compile-time), then please do so and post
it for consideration.

Thanks!

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [PATCH,RFT] bcm43xx: use softmac-suggested TX rate
From: Michael Buesch @ 2006-06-05 19:28 UTC (permalink / raw)
  To: John W. Linville; +Cc: Daniel Drake, netdev
In-Reply-To: <20060605191727.GJ6068@tuxdriver.com>

On Monday 05 June 2006 21:17, John W. Linville wrote:
> OK, I will now 'officially' forget about this patch, and wait for you
> to endorse it by re-sending it to me. :-)

Ok, but it depends on this patch, which does not seem to be in your tree, yet.
http://marc.theaimsgroup.com/?l=linux-netdev&m=114651996213569&q=raw

I am not sure where it went, though... .

-- 
Greetings Michael.

^ permalink raw reply

* Re: [PATCH,RFT] bcm43xx: use softmac-suggested TX rate
From: John W. Linville @ 2006-06-05 19:42 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Daniel Drake, netdev
In-Reply-To: <200606052128.55416.mb@bu3sch.de>

On Mon, Jun 05, 2006 at 09:28:55PM +0200, Michael Buesch wrote:
> On Monday 05 June 2006 21:17, John W. Linville wrote:
> > OK, I will now 'officially' forget about this patch, and wait for you
> > to endorse it by re-sending it to me. :-)
> 
> Ok, but it depends on this patch, which does not seem to be in your tree, yet.
> http://marc.theaimsgroup.com/?l=linux-netdev&m=114651996213569&q=raw
> 
> I am not sure where it went, though... .

That is in the 'upstream' branch (stuff queued for 2.6.18) of wireless-2.6.

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [PATCH 2.6.17-rc5] support for TSO over IPv6.
From: Stephen Hemminger @ 2006-06-05 19:43 UTC (permalink / raw)
  To: Ananda Raju
  Cc: netdev, jgarzik, leonid.grossman, ravinandan.arakali,
	rapuru.sriram, ananda.raju, sivakumar.subramani
In-Reply-To: <Pine.GSO.4.10.10606051458530.20246-100000@guinness>

On Mon, 5 Jun 2006 15:09:45 -0400 (EDT)
Ananda Raju <Ananda.Raju@neterion.com> wrote:

> Hi,
> 	Neterion Xframe adapter supports TSO over IPv6 but the linux kernel 
> 	don't support TSO over Ipv6. This patch will allow TCP
> 	Segmentation Offload (TSO) packets to be created over IPv6. 
> 	
> 	The following table shows there is significant improvement in
> 	throughput with normal frames and CPU usage for both normal and jumbo.
> 
>         --------------------------------------------------
>         |          |     1500        |      9600         |
>         |          ------------------|-------------------|
>         |          | thru     CPU    |  thru     CPU     |
>         --------------------------------------------------
>         | TSO OFF  | 1.80   2.0% id  |  5.53   1.0% id   |
>         --------------------------------------------------
>         | TSO ON   | 2.61   74.0 id  |  5.52   32.0% id  |
>         --------------------------------------------------
> 
> Please review the patch.

There is one problem that may mean you have to rethink this.

You ignore the possible case of hardware that can do any kind of checksum
(ie. IP_F_HW_CSUM).  So I think you need to add a new flag NETIF_F_TSO6
for those types of devices, rather than overloading NETIF_F_TSO to mean
"can do TCP segmentation offload for IPV4 or IPV6".

Your proposal:
	ipv4 sum   : NETIF_F_IP_CSUM
	ipv6 sum   : NETIF_F_IP6_CSUM
	hw sum     : NETIF_F_HW_CSUM
	tso, ipv4  : NETIF_F_IP_CSUM + NETIF_F_TSO
	tso, ipv6  : NETIF_F_IP6_CSUM + NETIF_F_TSO

My proposal:
	ipv4 sum   : NETIF_F_IP_CSUM
	ipv6 sum   : NETIF_F_IP6_CSUM
	hw sum     : NETIF_F_HW_CSUM
	tso, ipv4  : NETIF_F_IP_CSUM + NETIF_F_TSO
	tso, ipv6  : NETIF_F_IP6_CSUM + NETIF_F_TSO6
	tso, hw    : NETIF_F_HW_CSUM + NETIF_F_TSO6


^ permalink raw reply

* Re: [PATCH,RFT] bcm43xx: use softmac-suggested TX rate
From: Daniel Drake @ 2006-06-05 19:48 UTC (permalink / raw)
  To: Michael Buesch; +Cc: John W. Linville, netdev
In-Reply-To: <200606052128.55416.mb@bu3sch.de>

Michael Buesch wrote:
> On Monday 05 June 2006 21:17, John W. Linville wrote:
>> OK, I will now 'officially' forget about this patch, and wait for you
>> to endorse it by re-sending it to me. :-)
> 
> Ok, but it depends on this patch, which does not seem to be in your tree, yet.
> http://marc.theaimsgroup.com/?l=linux-netdev&m=114651996213569&q=raw
> 
> I am not sure where it went, though... .

It's in the master branch.

Daniel


^ permalink raw reply

* [PATCH 1/1] LSM-IPsec SELinux Authorize
From: Catherine Zhang @ 2006-06-05 19:56 UTC (permalink / raw)
  To: James Morris, netdev, davem, chrisw, herbert, sds, tjaeger
  Cc: latten, sergeh, gcwilson, czhang.us

Hi, 

This is resubmit of the LSM-IPsec fix patch rebased against 
Linux version 2.6.17-rc4-mm3.

As always, comments are welcome!

Catherine

---

This patch contains a fix for the previous patch that adds security
contexts to IPsec policies and security associations.  In the previous
patch, no authorization (besides the check for write permissions to
SAD and SPD) is required to delete IPsec policies and security
assocations with security contexts.  Thus a user authorized to change
SAD and SPD can bypass the IPsec policy authorization by simply
deleteing policies with security contexts.  To fix this security hole,
an additional authorization check is added for removing security
policies and security associations with security contexts.

Note that if no security context is supplied on add or present on
policy to be deleted, the SELinux module allows the change
unconditionally.  The hook is called on deletion when no context is
present, which we may want to change.  At present, I left it up to the
module.

LSM changes:

The patch adds two new LSM hooks: xfrm_policy_delete and
xfrm_state_delete.  The new hooks are necessary to authorize deletion
of IPsec policies that have security contexts.  The existing hooks
xfrm_policy_free and xfrm_state_free lack the context to do the
authorization, so I decided to split authorization of deletion and
memory management of security data, as is typical in the LSM
interface.

Use:

The new delete hooks are checked when xfrm_policy or xfrm_state are
deleted by either the xfrm_user interface (xfrm_get_policy,
xfrm_del_sa) or the pfkey interface (pfkey_spddelete, pfkey_delete).

SELinux changes:

The new policy_delete and state_delete functions are added.

Signed-off-by: Trent Jaeger <tjaeger@cse.psu.edu>

---

 include/linux/security.h        |   40 +++++++++++++++++++++++++++++++++------
 net/key/af_key.c                |   17 ++++++++++------
 net/xfrm/xfrm_user.c            |   19 +++++++++++-------
 security/dummy.c                |   12 +++++++++++
 security/selinux/hooks.c        |    2 +
 security/selinux/include/xfrm.h |    2 +
 security/selinux/xfrm.c         |   41 ++++++++++++++++++++++++++++++++++++----
 7 files changed, 110 insertions(+), 23 deletions(-)

diff -puN include/linux/security.h~lsm-secpeer-fix include/linux/security.h
--- linux-2.6.17-rc4-mm3/include/linux/security.h~lsm-secpeer-fix	2006-05-31 00:01:35.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/include/linux/security.h	2006-05-31 00:46:13.000000000 -0400
@@ -805,31 +805,37 @@ struct swap_info_struct;
  *	used by the XFRM system.
  *	@sec_ctx contains the security context information being provided by
  *	the user-level policy update program (e.g., setkey).
- *	Allocate a security structure to the xp->selector.security field.
+ *	Allocate a security structure to the xp->security field.
  *	The security field is initialized to NULL when the xfrm_policy is
  *	allocated.
  *	Return 0 if operation was successful (memory to allocate, legal context)
  * @xfrm_policy_clone_security:
  *	@old contains an existing xfrm_policy in the SPD.
  *	@new contains a new xfrm_policy being cloned from old.
- *	Allocate a security structure to the new->selector.security field
- *	that contains the information from the old->selector.security field.
+ *	Allocate a security structure to the new->security field
+ *	that contains the information from the old->security field.
  *	Return 0 if operation was successful (memory to allocate).
  * @xfrm_policy_free_security:
  *	@xp contains the xfrm_policy
- *	Deallocate xp->selector.security.
+ *	Deallocate xp->security.
+ * @xfrm_policy_delete_security:
+ *	@xp contains the xfrm_policy.
+ *	Authorize deletion of xp->security.
  * @xfrm_state_alloc_security:
  *	@x contains the xfrm_state being added to the Security Association
  *	Database by the XFRM system.
  *	@sec_ctx contains the security context information being provided by
  *	the user-level SA generation program (e.g., setkey or racoon).
- *	Allocate a security structure to the x->sel.security field.  The
+ *	Allocate a security structure to the x->security field.  The
  *	security field is initialized to NULL when the xfrm_state is
  *	allocated.
  *	Return 0 if operation was successful (memory to allocate, legal context).
  * @xfrm_state_free_security:
  *	@x contains the xfrm_state.
- *	Deallocate x>sel.security.
+ *	Deallocate x->security.
+ * @xfrm_state_delete_security:
+ *	@x contains the xfrm_state.
+ *	Authorize deletion of x->security.
  * @xfrm_policy_lookup:
  *	@xp contains the xfrm_policy for which the access control is being
  *	checked.
@@ -1298,8 +1304,10 @@ struct security_operations {
 	int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
 	int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
 	void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
+	int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
 	int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
 	void (*xfrm_state_free_security) (struct xfrm_state *x);
+	int (*xfrm_state_delete_security) (struct xfrm_state *x);
 	int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir);
 #endif	/* CONFIG_SECURITY_NETWORK_XFRM */
 
@@ -2934,11 +2942,21 @@ static inline void security_xfrm_policy_
 	security_ops->xfrm_policy_free_security(xp);
 }
 
+static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
+{
+	return security_ops->xfrm_policy_delete_security(xp);
+}
+
 static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
 {
 	return security_ops->xfrm_state_alloc_security(x, sec_ctx);
 }
 
+static inline int security_xfrm_state_delete(struct xfrm_state *x)
+{
+	return security_ops->xfrm_state_delete_security(x);
+}
+
 static inline void security_xfrm_state_free(struct xfrm_state *x)
 {
 	security_ops->xfrm_state_free_security(x);
@@ -2963,6 +2981,11 @@ static inline void security_xfrm_policy_
 {
 }
 
+static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
+{
+	return 0;
+}
+
 static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
 {
 	return 0;
@@ -2972,6 +2995,11 @@ static inline void security_xfrm_state_f
 {
 }
 
+static inline int security_xfrm_state_delete(struct xfrm_policy *xp)
+{
+	return 0;
+}
+
 static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
 {
 	return 0;
diff -puN net/key/af_key.c~lsm-secpeer-fix net/key/af_key.c
--- linux-2.6.17-rc4-mm3/net/key/af_key.c~lsm-secpeer-fix	2006-05-31 00:01:46.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/net/key/af_key.c	2006-05-31 00:04:22.000000000 -0400
@@ -1454,21 +1454,23 @@ static int pfkey_delete(struct sock *sk,
 	if (x == NULL)
 		return -ESRCH;
 
+	if ((err = security_xfrm_state_delete(x)))
+		goto out;
+
 	if (xfrm_state_kern(x)) {
-		xfrm_state_put(x);
-		return -EPERM;
+		err = -EPERM;
+		goto out;
 	}
 	
 	err = xfrm_state_delete(x);
-	if (err < 0) {
-		xfrm_state_put(x);
-		return err;
-	}
+	if (err < 0)
+		goto out;
 
 	c.seq = hdr->sadb_msg_seq;
 	c.pid = hdr->sadb_msg_pid;
 	c.event = XFRM_MSG_DELSA;
 	km_state_notify(x, &c);
+out:
 	xfrm_state_put(x);
 
 	return err;
@@ -2274,11 +2276,14 @@ static int pfkey_spddelete(struct sock *
 
 	err = 0;
 
+	if ((err = security_xfrm_policy_delete(xp)))
+		goto out;
 	c.seq = hdr->sadb_msg_seq;
 	c.pid = hdr->sadb_msg_pid;
 	c.event = XFRM_MSG_DELPOLICY;
 	km_policy_notify(xp, pol->sadb_x_policy_dir-1, &c);
 
+out:
 	xfrm_pol_put(xp);
 	return err;
 }
diff -puN net/xfrm/xfrm_user.c~lsm-secpeer-fix net/xfrm/xfrm_user.c
--- linux-2.6.17-rc4-mm3/net/xfrm/xfrm_user.c~lsm-secpeer-fix	2006-05-31 00:01:54.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/net/xfrm/xfrm_user.c	2006-05-31 00:04:22.000000000 -0400
@@ -427,23 +427,25 @@ static int xfrm_del_sa(struct sk_buff *s
 	if (x == NULL)
 		return -ESRCH;
 
+	if (err = security_xfrm_state_delete(x))
+		goto out;
+
 	if (xfrm_state_kern(x)) {
-		xfrm_state_put(x);
-		return -EPERM;
+		err = -EPERM;
+		goto out;
 	}
 
 	err = xfrm_state_delete(x);
-	if (err < 0) {
-		xfrm_state_put(x);
-		return err;
-	}
+	if (err < 0)
+		goto out;
 
 	c.seq = nlh->nlmsg_seq;
 	c.pid = nlh->nlmsg_pid;
 	c.event = nlh->nlmsg_type;
 	km_state_notify(x, &c);
-	xfrm_state_put(x);
 
+out:
+	xfrm_state_put(x);
 	return err;
 }
 
@@ -1055,6 +1057,8 @@ static int xfrm_get_policy(struct sk_buf
 					      MSG_DONTWAIT);
 		}
 	} else {
+		if (err = security_xfrm_policy_delete(xp))
+			goto out;
 		c.data.byid = p->index;
 		c.event = nlh->nlmsg_type;
 		c.seq = nlh->nlmsg_seq;
@@ -1064,6 +1068,7 @@ static int xfrm_get_policy(struct sk_buf
 
 	xfrm_pol_put(xp);
 
+out:
 	return err;
 }
 
diff -puN security/dummy.c~lsm-secpeer-fix security/dummy.c
--- linux-2.6.17-rc4-mm3/security/dummy.c~lsm-secpeer-fix	2006-05-31 00:02:04.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/security/dummy.c	2006-05-31 00:04:22.000000000 -0400
@@ -810,6 +810,11 @@ static void dummy_xfrm_policy_free_secur
 {
 }
 
+static int dummy_xfrm_policy_delete_security(struct xfrm_policy *xp)
+{
+	return 0;
+}
+
 static int dummy_xfrm_state_alloc_security(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
 {
 	return 0;
@@ -819,6 +824,11 @@ static void dummy_xfrm_state_free_securi
 {
 }
 
+static int dummy_xfrm_state_delete_security(struct xfrm_state *x)
+{
+	return 0;
+}
+
 static int dummy_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
 {
 	return 0;
@@ -1024,8 +1034,10 @@ void security_fixup_ops (struct security
 	set_to_dummy_if_null(ops, xfrm_policy_alloc_security);
 	set_to_dummy_if_null(ops, xfrm_policy_clone_security);
 	set_to_dummy_if_null(ops, xfrm_policy_free_security);
+	set_to_dummy_if_null(ops, xfrm_policy_delete_security);
 	set_to_dummy_if_null(ops, xfrm_state_alloc_security);
 	set_to_dummy_if_null(ops, xfrm_state_free_security);
+	set_to_dummy_if_null(ops, xfrm_state_delete_security);
 	set_to_dummy_if_null(ops, xfrm_policy_lookup);
 #endif	/* CONFIG_SECURITY_NETWORK_XFRM */
 #ifdef CONFIG_KEYS
diff -puN security/selinux/hooks.c~lsm-secpeer-fix security/selinux/hooks.c
--- linux-2.6.17-rc4-mm3/security/selinux/hooks.c~lsm-secpeer-fix	2006-05-31 00:02:11.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/security/selinux/hooks.c	2006-05-31 00:04:22.000000000 -0400
@@ -4400,8 +4400,10 @@ static struct security_operations selinu
 	.xfrm_policy_alloc_security =	selinux_xfrm_policy_alloc,
 	.xfrm_policy_clone_security =	selinux_xfrm_policy_clone,
 	.xfrm_policy_free_security =	selinux_xfrm_policy_free,
+	.xfrm_policy_delete_security =	selinux_xfrm_policy_delete,
 	.xfrm_state_alloc_security =	selinux_xfrm_state_alloc,
 	.xfrm_state_free_security =	selinux_xfrm_state_free,
+	.xfrm_state_delete_security =	selinux_xfrm_state_delete,
 	.xfrm_policy_lookup = 		selinux_xfrm_policy_lookup,
 #endif
 };
diff -puN security/selinux/include/xfrm.h~lsm-secpeer-fix security/selinux/include/xfrm.h
--- linux-2.6.17-rc4-mm3/security/selinux/include/xfrm.h~lsm-secpeer-fix	2006-05-31 00:02:19.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/security/selinux/include/xfrm.h	2006-05-31 00:04:22.000000000 -0400
@@ -9,8 +9,10 @@
 int selinux_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
 int selinux_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new);
 void selinux_xfrm_policy_free(struct xfrm_policy *xp);
+int selinux_xfrm_policy_delete(struct xfrm_policy *xp);
 int selinux_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
 void selinux_xfrm_state_free(struct xfrm_state *x);
+int selinux_xfrm_state_delete(struct xfrm_state *x);
 int selinux_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir);
 
 /*
diff -puN security/selinux/xfrm.c~lsm-secpeer-fix security/selinux/xfrm.c
--- linux-2.6.17-rc4-mm3/security/selinux/xfrm.c~lsm-secpeer-fix	2006-05-31 00:02:28.000000000 -0400
+++ linux-2.6.17-rc4-mm3-cxzhang/security/selinux/xfrm.c	2006-05-31 00:43:38.000000000 -0400
@@ -132,10 +132,7 @@ static int selinux_xfrm_sec_ctx_alloc(st
 		goto out;
 
 	/*
-	 * Does the subject have permission to set security or permission to
-	 * do the relabel?
-	 * Must be permitted to relabel from default socket type (process type)
-	 * to specified context
+	 * Does the subject have permission to set security context?
 	 */
 	rc = avc_has_perm(tsec->sid, ctx->ctx_sid,
 			  SECCLASS_ASSOCIATION,
@@ -201,6 +198,24 @@ void selinux_xfrm_policy_free(struct xfr
 }
 
 /*
+ * LSM hook implementation that authorizes deletion of labeled policies.
+ */
+int selinux_xfrm_policy_delete(struct xfrm_policy *xp)
+{
+	struct task_security_struct *tsec = current->security;
+	struct xfrm_sec_ctx *ctx = xp->security;
+	int rc = 0;
+
+	if (ctx) {
+		rc = avc_has_perm(tsec->sid, ctx->ctx_sid,
+		SECCLASS_ASSOCIATION,
+		ASSOCIATION__SETCONTEXT, NULL);
+	}
+
+	return rc;
+}
+
+/*
  * LSM hook implementation that allocs and transfers sec_ctx spec to
  * xfrm_state.
  */
@@ -292,6 +307,24 @@ u32 selinux_socket_getpeer_dgram(struct 
 	return SECSID_NULL;
 }
 
+ /*
+  * LSM hook implementation that authorizes deletion of labeled SAs.
+  */
+int selinux_xfrm_state_delete(struct xfrm_state *x)
+{
+	struct task_security_struct *tsec = current->security;
+	struct xfrm_sec_ctx *ctx = x->security;
+	int rc = 0;
+
+	if (ctx) {
+		rc = avc_has_perm(tsec->sid, ctx->ctx_sid,
+			SECCLASS_ASSOCIATION,
+			ASSOCIATION__SETCONTEXT, NULL);
+	}
+
+	return rc;
+}
+
 /*
  * LSM hook that controls access to unlabelled packets.  If
  * a xfrm_state is authorizable (defined by macro) then it was
_

^ permalink raw reply

* [PATCH] TCP: removal of unused label
From: Francois Romieu @ 2006-06-05 19:55 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, netdev
In-Reply-To: <20060605110331.0f058738@dxpl.pdx.osdl.net>


Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>

diff --git a/net/ipv4/tcp_compound.c b/net/ipv4/tcp_compound.c
index bc54f7e..a3c36c0 100644
--- a/net/ipv4/tcp_compound.c
+++ b/net/ipv4/tcp_compound.c
@@ -401,6 +401,7 @@ static void tcp_compound_cong_avoid(stru
 static void tcp_compound_get_info(struct sock *sk, u32 ext, struct sk_buff *skb)
 {
 	const struct compound *ca = inet_csk_ca(sk);
+
 	if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
 		struct tcpvegas_info *info;
 
@@ -411,7 +412,6 @@ static void tcp_compound_get_info(struct
 		info->tcpv_rttcnt = ca->cntRTT;
 		info->tcpv_rtt = ca->baseRTT;
 		info->tcpv_minrtt = ca->minRTT;
-	rtattr_failure:;
 	}
 }
 

^ permalink raw reply related

* Re: [PATCH,RFT] bcm43xx: use softmac-suggested TX rate
From: John W. Linville @ 2006-06-05 20:00 UTC (permalink / raw)
  To: Daniel Drake; +Cc: Michael Buesch, netdev
In-Reply-To: <44848A97.8040801@gentoo.org>

On Mon, Jun 05, 2006 at 08:48:39PM +0100, Daniel Drake wrote:
> Michael Buesch wrote:
> >On Monday 05 June 2006 21:17, John W. Linville wrote:
> >>OK, I will now 'officially' forget about this patch, and wait for you
> >>to endorse it by re-sending it to me. :-)
> >
> >Ok, but it depends on this patch, which does not seem to be in your tree, 
> >yet.
> >http://marc.theaimsgroup.com/?l=linux-netdev&m=114651996213569&q=raw
> >
> >I am not sure where it went, though... .
> 
> It's in the master branch.

There too... :-)

-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* [PATCH 0/3 #3] avoid pci_find_device
From: Jiri Slaby @ 2006-06-05 20:16 UTC (permalink / raw)
  To: Greg KH
  Cc: Linux Kernel Mailing List, linux-pci, jgarzik, netdev, khali,
	lm-sensors, stevel, source, mb, st3, linville

Hello,

there are some patches to avoid pci_find_device in drivers.
I will make a bcm43xx patch against wireless git too.

Take #3.

It's against 2.6.17-rc5-mm3 tree.

01-i2c-scx200-acb-avoid-pci-find-device.patch
02-bcm43xx-avoid-pci-find-device.patch
03-gt96100eth-avoid-pci-find-device.patch

 i2c/busses/scx200_acb.c             |    9 ++++++---
 net/gt96100eth.c                    |   23 ++++++++++++++++++-----
 net/wireless/bcm43xx/bcm43xx_main.c |   21 ++++++++++++++++-----
 3 files changed, 40 insertions(+), 13 deletions(-)

Thanks.

^ permalink raw reply

* Re: [PATCH 2/3] pci: bcm43xx avoid pci_find_device
From: Michael Buesch @ 2006-06-05 20:35 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Greg KH, Linux Kernel Mailing List, linux-pci, jgarzik, netdev,
	mb, st3, linville
In-Reply-To: <20060605201818.1239938CE036@bu3sch.de>

On Monday 05 June 2006 22:18, Jiri Slaby wrote:
> bcm43xx avoid pci_find_device
> 
> Change pci_find_device to safer pci_get_device with support for more
> devices.

I am wondering about the reference count.
>From docbook:

256  * pci_get_device - begin or continue searching for a PCI device by vendor/device id
257  * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
258  * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
259  * @from: Previous PCI device found in search, or %NULL for new search.
260  *
261  * Iterates through the list of known PCI devices.  If a PCI device is
262  * found with a matching @vendor and @device, the reference count to the
                                                      ^^^^^^^^^^^^^^^^^^^^^^
263  * device is incremented and a pointer to its device structure is returned.
       ^^^^^^^^^^^^^^^^^^^^^
264  * Otherwise, %NULL is returned.  A new search is initiated by passing %NULL
265  * to the @from argument.  Otherwise if @from is not %NULL, searches continue
266  * from next device on the global list.  The reference count for @from is
267  * always decremented if it is not %NULL.

Who is going to decrement it, once the device is not used anymore.
"not used anymore" is ifconfig down in the case of bcm43xx.
You will call pci_get_device on each ifconfig up.

> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> 
> ---
> commit 4b73c16f5411d97360d5f26f292ffddeb670ff75
> tree 6e43c8bd02498eb1ceec6bdc64277fa8408da9e2
> parent d59f9ea8489749f59cd0c7333a4784cab964daa8
> author Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
> committer Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
> 
>  drivers/net/wireless/bcm43xx/bcm43xx_main.c |   21 ++++++++++++++++-----
>  1 files changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> index 22b8fa6..d1a9975 100644
> --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> @@ -2133,6 +2133,13 @@ out:
>  	return err;
>  }
>  
> +#ifdef CONFIG_BCM947XX
> +static struct pci_device_id bcm43xx_47xx_ids[] = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
> +	{ 0 }
> +};
> +#endif
> +
>  static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
>  {
>  	int res;
> @@ -2142,11 +2149,15 @@ static int bcm43xx_initialize_irq(struct
>  	bcm->irq = bcm->pci_dev->irq;
>  #ifdef CONFIG_BCM947XX
>  	if (bcm->pci_dev->bus->number == 0) {
> -		struct pci_dev *d = NULL;
> -		/* FIXME: we will probably need more device IDs here... */
> -		d = pci_find_device(PCI_VENDOR_ID_BROADCOM, 0x4324, NULL);
> -		if (d != NULL) {
> -			bcm->irq = d->irq;
> +		struct pci_dev *d;
> +		struct pci_device_id *id;
> +		for (id = bcm43xx_47xx_ids; id->vendor; id++) {
> +			d = pci_get_device(id->vendor, id->device, NULL);
> +			if (d != NULL) {
> +				bcm->irq = d->irq;
> +				pci_dev_put(d);
> +				break;
> +			}
>  		}
>  	}
>  #endif
> 

-- 
Greetings Michael.

^ permalink raw reply

* Re: [PATCH 2/3] pci: bcm43xx avoid pci_find_device
From: Jiri Slaby @ 2006-06-05 20:46 UTC (permalink / raw)
  To: Michael Buesch
  Cc: Greg KH, Linux Kernel Mailing List, linux-pci, jgarzik, netdev,
	st3, linville
In-Reply-To: <200606052235.28687.mb@bu3sch.de>

Michael Buesch napsal(a):
> On Monday 05 June 2006 22:18, Jiri Slaby wrote:
>> bcm43xx avoid pci_find_device
>>
>> Change pci_find_device to safer pci_get_device with support for more
>> devices.
> 
> I am wondering about the reference count.
> From docbook:
> 
> 256  * pci_get_device - begin or continue searching for a PCI device by vendor/device id
> 257  * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids
> 258  * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids
> 259  * @from: Previous PCI device found in search, or %NULL for new search.
> 260  *
> 261  * Iterates through the list of known PCI devices.  If a PCI device is
> 262  * found with a matching @vendor and @device, the reference count to the
>                                                       ^^^^^^^^^^^^^^^^^^^^^^
> 263  * device is incremented and a pointer to its device structure is returned.
>        ^^^^^^^^^^^^^^^^^^^^^
> 264  * Otherwise, %NULL is returned.  A new search is initiated by passing %NULL
> 265  * to the @from argument.  Otherwise if @from is not %NULL, searches continue
> 266  * from next device on the global list.  The reference count for @from is
> 267  * always decremented if it is not %NULL.
> 
> Who is going to decrement it, once the device is not used anymore.
> "not used anymore" is ifconfig down in the case of bcm43xx.
> You will call pci_get_device on each ifconfig up.
> 
>> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
>>
>> ---
>> commit 4b73c16f5411d97360d5f26f292ffddeb670ff75
>> tree 6e43c8bd02498eb1ceec6bdc64277fa8408da9e2
>> parent d59f9ea8489749f59cd0c7333a4784cab964daa8
>> author Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
>> committer Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
>>
>>  drivers/net/wireless/bcm43xx/bcm43xx_main.c |   21 ++++++++++++++++-----
>>  1 files changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
>> index 22b8fa6..d1a9975 100644
>> --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
>> +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
>> @@ -2133,6 +2133,13 @@ out:
>>  	return err;
>>  }
>>  
>> +#ifdef CONFIG_BCM947XX
>> +static struct pci_device_id bcm43xx_47xx_ids[] = {
>> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
>> +	{ 0 }
>> +};
>> +#endif
>> +
>>  static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
>>  {
>>  	int res;
>> @@ -2142,11 +2149,15 @@ static int bcm43xx_initialize_irq(struct
>>  	bcm->irq = bcm->pci_dev->irq;
>>  #ifdef CONFIG_BCM947XX
>>  	if (bcm->pci_dev->bus->number == 0) {
>> -		struct pci_dev *d = NULL;
>> -		/* FIXME: we will probably need more device IDs here... */
>> -		d = pci_find_device(PCI_VENDOR_ID_BROADCOM, 0x4324, NULL);
>> -		if (d != NULL) {
>> -			bcm->irq = d->irq;
>> +		struct pci_dev *d;
>> +		struct pci_device_id *id;
>> +		for (id = bcm43xx_47xx_ids; id->vendor; id++) {
>> +			d = pci_get_device(id->vendor, id->device, NULL);
>> +			if (d != NULL) {
>> +				bcm->irq = d->irq;
>> +				pci_dev_put(d);
here?
>> +				break;
>> +			}
>>  		}
>>  	}
>>  #endif
>>
> 

regards,
-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
\_.-^-._   jirislaby@gmail.com   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E

^ permalink raw reply

* Re: [PATCH 2/3] pci: bcm43xx avoid pci_find_device
From: Greg KH @ 2006-06-05 20:53 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Greg KH, Linux Kernel Mailing List, linux-pci, jgarzik, netdev,
	mb, st3, linville
In-Reply-To: <20060605202007.B464FC7B73@atrey.karlin.mff.cuni.cz>

On Mon, Jun 05, 2006 at 10:20:07PM +0200, Jiri Slaby wrote:
> bcm43xx avoid pci_find_device
> 
> Change pci_find_device to safer pci_get_device with support for more
> devices.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> 
> ---
> commit 4b73c16f5411d97360d5f26f292ffddeb670ff75
> tree 6e43c8bd02498eb1ceec6bdc64277fa8408da9e2
> parent d59f9ea8489749f59cd0c7333a4784cab964daa8
> author Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
> committer Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
> 
>  drivers/net/wireless/bcm43xx/bcm43xx_main.c |   21 ++++++++++++++++-----
>  1 files changed, 16 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> index 22b8fa6..d1a9975 100644
> --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
> @@ -2133,6 +2133,13 @@ out:
>  	return err;
>  }
>  
> +#ifdef CONFIG_BCM947XX
> +static struct pci_device_id bcm43xx_47xx_ids[] = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
> +	{ 0 }
> +};
> +#endif
> +
>  static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
>  {
>  	int res;
> @@ -2142,11 +2149,15 @@ static int bcm43xx_initialize_irq(struct
>  	bcm->irq = bcm->pci_dev->irq;
>  #ifdef CONFIG_BCM947XX
>  	if (bcm->pci_dev->bus->number == 0) {
> -		struct pci_dev *d = NULL;
> -		/* FIXME: we will probably need more device IDs here... */
> -		d = pci_find_device(PCI_VENDOR_ID_BROADCOM, 0x4324, NULL);
> -		if (d != NULL) {
> -			bcm->irq = d->irq;
> +		struct pci_dev *d;
> +		struct pci_device_id *id;
> +		for (id = bcm43xx_47xx_ids; id->vendor; id++) {
> +			d = pci_get_device(id->vendor, id->device, NULL);
> +			if (d != NULL) {
> +				bcm->irq = d->irq;
> +				pci_dev_put(d);
> +				break;
> +			}

This will not work if you have more than one of the same devices in the
system.

Well, the original code will not either :(

Why not just use the proper pci interface?  Why poke around in another
pci device to steal an irq, when that irq might not even be valid?
(irqs are not valid until pci_enable_device() is called on them...)

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 3/3] pci: gt96100eth avoid pci_find_device
From: Jiri Slaby @ 2006-06-05 20:57 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Greg KH, Linux Kernel Mailing List, linux-pci, jgarzik, netdev,
	stevel, source
In-Reply-To: <448491ab.7fb59b32.690f.01c1SMTPIN_ADDED@mx.gmail.com>

Jiri Slaby napsal(a):
> gt96100eth avoid pci_find_device
> 
> Change pci_find_device to safer pci_get_device with support for more
> bridges.
> 
> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
> 
> ---
> commit fd863b81ac491faf783ff7f2dcf6032177c5ab7f
> tree d7eb59f897505230023754f19ad7227eec39e676
> parent 4b73c16f5411d97360d5f26f292ffddeb670ff75
> author Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:20 +0159
> committer Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:20 +0159
> 
>  drivers/net/gt96100eth.c |   23 ++++++++++++++++++-----
>  1 files changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/gt96100eth.c b/drivers/net/gt96100eth.c
> index 2d24354..3066c86 100644
> --- a/drivers/net/gt96100eth.c
> +++ b/drivers/net/gt96100eth.c
> @@ -600,6 +600,11 @@ disable_ether_irq(struct net_device *dev
>  	GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, 0);
>  }
>  
> +static struct pci_device_id gt96100_ids[] = {
> +	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT96100) },
> +	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT96100A) },
> +	{ 0 }
> +};
>  
>  /*
>   * Init GT96100 ethernet controller driver
> @@ -607,16 +612,20 @@ disable_ether_irq(struct net_device *dev
>  static int gt96100_init_module(void)
>  {
>  	struct pci_dev *pci;
> +	struct pci_device_id *id;
>  	int i, retval=0;
>  	u32 cpuConfig;
>  
>  	/*
>  	 * Stupid probe because this really isn't a PCI device
>  	 */
> -	if (!(pci = pci_find_device(PCI_VENDOR_ID_MARVELL,
> -	                            PCI_DEVICE_ID_MARVELL_GT96100, NULL)) &&
> -	    !(pci = pci_find_device(PCI_VENDOR_ID_MARVELL,
> -		                    PCI_DEVICE_ID_MARVELL_GT96100A, NULL))) {
> +	for (id = gt96100_ids; id->vendor; id++) {
> +		pci = pci_get_device(id->vendor, id->device, NULL);
> +		if (pci != NULL)
> +			break;
> +	}
I wonder if this is even better:
while ((pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci)) != NULL)
    if (pci_match_id(gt96100_ids, pci) != NULL)
         break;
What do you think?
> +
> +	if (!id->vendor) {
>  		printk(KERN_ERR __FILE__ ": GT96100 not found!\n");
>  		return -ENODEV;
>  	}
> @@ -625,12 +634,16 @@ static int gt96100_init_module(void)
>  	if (cpuConfig & (1<<12)) {
>  		printk(KERN_ERR __FILE__
>  		       ": must be in Big Endian mode!\n");
> -		return -ENODEV;
> +		retval = -ENODEV;
> +		goto err_pput;
>  	}
>  
>  	for (i=0; i < NUM_INTERFACES; i++)
>  		retval |= gt96100_probe1(pci, i);
>  
> +err_pput:
> +	pci_dev_put(pci);
> +
>  	return retval;
>  }
>  
> 


-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
\_.-^-._   jirislaby@gmail.com   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E

^ permalink raw reply

* Re: [PATCH 2/3] pci: bcm43xx avoid pci_find_device
From: Jiri Slaby @ 2006-06-05 21:09 UTC (permalink / raw)
  To: Greg KH
  Cc: Greg KH, Linux Kernel Mailing List, linux-pci, jgarzik, netdev,
	mb, st3, linville
In-Reply-To: <20060605205309.GA31061@kroah.com>

Greg KH napsal(a):
> On Mon, Jun 05, 2006 at 10:20:07PM +0200, Jiri Slaby wrote:
>> bcm43xx avoid pci_find_device
>>
>> Change pci_find_device to safer pci_get_device with support for more
>> devices.
>>
>> Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
>>
>> ---
>> commit 4b73c16f5411d97360d5f26f292ffddeb670ff75
>> tree 6e43c8bd02498eb1ceec6bdc64277fa8408da9e2
>> parent d59f9ea8489749f59cd0c7333a4784cab964daa8
>> author Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
>> committer Jiri Slaby <ku@bellona.localdomain> Mon, 05 Jun 2006 22:01:03 +0159
>>
>>  drivers/net/wireless/bcm43xx/bcm43xx_main.c |   21 ++++++++++++++++-----
>>  1 files changed, 16 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
>> index 22b8fa6..d1a9975 100644
>> --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c
>> +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c
>> @@ -2133,6 +2133,13 @@ out:
>>  	return err;
>>  }
>>  
>> +#ifdef CONFIG_BCM947XX
>> +static struct pci_device_id bcm43xx_47xx_ids[] = {
>> +	{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
>> +	{ 0 }
>> +};
>> +#endif
>> +
>>  static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
>>  {
>>  	int res;
>> @@ -2142,11 +2149,15 @@ static int bcm43xx_initialize_irq(struct
>>  	bcm->irq = bcm->pci_dev->irq;
>>  #ifdef CONFIG_BCM947XX
>>  	if (bcm->pci_dev->bus->number == 0) {
>> -		struct pci_dev *d = NULL;
>> -		/* FIXME: we will probably need more device IDs here... */
>> -		d = pci_find_device(PCI_VENDOR_ID_BROADCOM, 0x4324, NULL);
>> -		if (d != NULL) {
>> -			bcm->irq = d->irq;
>> +		struct pci_dev *d;
>> +		struct pci_device_id *id;
>> +		for (id = bcm43xx_47xx_ids; id->vendor; id++) {
>> +			d = pci_get_device(id->vendor, id->device, NULL);
>> +			if (d != NULL) {
>> +				bcm->irq = d->irq;
>> +				pci_dev_put(d);
>> +				break;
>> +			}
> 
> This will not work if you have more than one of the same devices in the
> system.
> 
> Well, the original code will not either :(
> 
> Why not just use the proper pci interface?  Why poke around in another
> pci device to steal an irq, when that irq might not even be valid?
> (irqs are not valid until pci_enable_device() is called on them...)
Ok, this is some bus or something, not "real" device, so no pci probing or
anything else could be done. There is only one in the system, if any, since
CONFIG_BCM947XX is set for some sort of embedded systems, but this would be
uttered by somebody more responsible.

Should I call pci_enable_device anyway, I am confused now :/? And then, should I
hold the reference all time until ifdown for this "some kind of parent"?

thanks,
-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
\_.-^-._   jirislaby@gmail.com   _.-^-._/
B67499670407CE62ACC8 22A032CC55C339D47A7E

^ permalink raw reply

* Re: [PATCH] Changes to ieee80211.h for user space regulatory daemon
From: Larry Finger @ 2006-06-05 21:10 UTC (permalink / raw)
  To: John Linville, netdev
In-Reply-To: <20060605185905.GH6068@tuxdriver.com>

John W. Linville wrote:
>> @@ -968,6 +968,7 @@ #define IEEE80211_52GHZ_CHANNELS (IEEE80
>>
>>  enum {
>> 	IEEE80211_CH_PASSIVE_ONLY = (1 << 0),
>> +	IEEE80211_CH_80211H_RULES = (1 << 1),
>> 	IEEE80211_CH_B_ONLY = (1 << 2),
>> 	IEEE80211_CH_NO_IBSS = (1 << 3),
>> 	IEEE80211_CH_UNIFORM_SPREADING = (1 << 4),
> 
> Any idea why this "hole" was here to begin with?  Was there something
> else defined as (1 << 1) previously?  Is it safe to reuse this value?
> 
> John

The hole has been there as long as I have been reading the ieee80211 code. If you are not 
comfortable with plugging the hole, then we can use (1 << 5).

Larry


^ permalink raw reply

* [PATCH 2.6.18 1/3] tg3: Remove unnecessary tx_lock
From: Michael Chan @ 2006-06-05 19:47 UTC (permalink / raw)
  To: davem; +Cc: herbert, jgarzik, netdev

Remove tx_lock where it is unnecessary. tg3 runs lockless and so it
requires interrupts to be disabled and sync'ed, netif_queue and NAPI
poll to be stopped before the device can be reconfigured. After
stopping everything, it is no longer necessary to get the tx_lock.

Signed-off-by: Michael Chan <mchan@broadcom.com>


diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f2382aa..4cda2af 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -2984,9 +2984,7 @@ static void tg3_tx_recover(struct tg3 *t
 	       "and include system chipset information.\n", tp->dev->name);
 
 	spin_lock(&tp->lock);
-	spin_lock(&tp->tx_lock);
 	tp->tg3_flags |= TG3_FLAG_TX_RECOVERY_PENDING;
-	spin_unlock(&tp->tx_lock);
 	spin_unlock(&tp->lock);
 }
 
@@ -3429,12 +3427,10 @@ static inline void tg3_full_lock(struct 
 	if (irq_sync)
 		tg3_irq_quiesce(tp);
 	spin_lock_bh(&tp->lock);
-	spin_lock(&tp->tx_lock);
 }
 
 static inline void tg3_full_unlock(struct tg3 *tp)
 {
-	spin_unlock(&tp->tx_lock);
 	spin_unlock_bh(&tp->lock);
 }
 



^ permalink raw reply related


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