* [PATCH 2/2] e1000: fix mismerge skb_put.
From: Kok, Auke @ 2006-04-18 19:40 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke, akpm
In-Reply-To: <20060418193950.16262.10757.stgit@gitlost.site>
Seems there was a bit of a fix needed to due a bad merge in the legacy
receive path. Fixes a panic due to skb_over_panic.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 2b8bced..fb8cef6 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3585,8 +3585,7 @@ e1000_clean_rx_irq(struct e1000_adapter
buffer_info->skb = skb;
goto next_desc;
}
- } else
- skb_put(skb, length);
+ }
/* code added for copybreak, this should improve
* performance for small packets with large amounts
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 1/2] e1000: fix mispatch for media type detect.
From: Kok, Auke @ 2006-04-18 19:40 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke, akpm
In-Reply-To: <20060418193950.16262.10757.stgit@gitlost.site>
Recent patch was mismerged in the miitool path. e1000_media_type_copper
was being compared with the phy type instead of the media type.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 82d443b..2b8bced 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4174,7 +4174,7 @@ e1000_mii_ioctl(struct net_device *netde
spin_unlock_irqrestore(&adapter->stats_lock, flags);
return -EIO;
}
- if (adapter->hw.phy_type == e1000_media_type_copper) {
+ if (adapter->hw.media_type == e1000_media_type_copper) {
switch (data->reg_num) {
case PHY_CTRL:
if (mii_reg & MII_CR_POWER_DOWN)
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply related
* [PATCH 0/2] e1000: fix two mispatches
From: Kok, Auke @ 2006-04-18 19:39 UTC (permalink / raw)
To: Garzik, Jeff, netdev, Miller, David
Cc: Ronciak, John, Brandeburg, Jesse, Kirsher, Jeff, Kok, Auke, akpm
Hi,
This patch series implements two e100 fixes for an old and new patch mishap.
[1] fix mispatch for media type detect.
[2] fix mismerge skb_put.
These changes are available through git.
git://63.64.152.142/~ahkok/git/netdev-2.6 e1000-7.0.38-k2-fixes
these patches are against
netdev-2.6#upstream 8fc65162a8f25929be80c8d6321a3479e92b5aae
Cheers,
Auke
---
drivers/net/e1000/e1000_main.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
--
Auke Kok <auke-jan.h.kok@intel.com>
Intel Pro Ethernet Driver Group
LAN Access Division / Digital Enterprise Group
^ permalink raw reply
* Re: [RFC: 2.6 patch] net/netlink/: possible cleanups
From: Adrian Bunk @ 2006-04-18 19:09 UTC (permalink / raw)
To: Alan Cox; +Cc: Evgeniy Polyakov, netdev, linux-kernel
In-Reply-To: <1145386121.21723.28.camel@localhost.localdomain>
On Tue, Apr 18, 2006 at 07:48:41PM +0100, Alan Cox wrote:
> On Maw, 2006-04-18 at 16:19 +0200, Adrian Bunk wrote:
> > OTOH, we also have to always check whether users are expected soon (and
> > recheck whether there are really users after some time) since every
> > single export makes the kernel larger for nearly everyone.
>
> Of course fixing the amount of memory used by an EXPORT_SYMBOL would be
> far more productive.
Both is productive.
You can decrease the amount of memory used by an EXPORT_SYMBOL, but you
can't get it down to 0.
And in some cases the memory used by an EXPORT_SYMBOL mostly consists of
an otherwise unused function...
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
* Re: [RFC: 2.6 patch] net/netlink/: possible cleanups
From: Alan Cox @ 2006-04-18 18:48 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Evgeniy Polyakov, netdev, linux-kernel
In-Reply-To: <20060418141946.GC11582@stusta.de>
On Maw, 2006-04-18 at 16:19 +0200, Adrian Bunk wrote:
> OTOH, we also have to always check whether users are expected soon (and
> recheck whether there are really users after some time) since every
> single export makes the kernel larger for nearly everyone.
Of course fixing the amount of memory used by an EXPORT_SYMBOL would be
far more productive.
^ permalink raw reply
* Re: [Patch] Dead code in net/sunrpc/auth_gss/auth_gss.c
From: Trond Myklebust @ 2006-04-18 16:34 UTC (permalink / raw)
To: Eric Sesterhenn; +Cc: netdev, dugsong
In-Reply-To: <1145376431.11649.2.camel@localhost>
On Tue, 2006-04-18 at 18:07 +0200, Eric Sesterhenn wrote:
> Hi,
>
> the coverity checker spotted that cred is always NULL
> when we jump to out_err ( there is just one case, when
> we fail to allocate the memory for cred )
> This is Coverity ID #79
>
> Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
>
I'll take it, but please send sunrpc patches to the NFS lists, not
netdev.
Cheers,
Trond
> --- linux-2.6.17-rc1/net/sunrpc/auth_gss/auth_gss.c.orig 2006-04-18 13:23:22.000000000 +0200
> +++ linux-2.6.17-rc1/net/sunrpc/auth_gss/auth_gss.c 2006-04-18 13:24:10.000000000 +0200
> @@ -794,7 +794,6 @@ gss_create_cred(struct rpc_auth *auth, s
>
> out_err:
> dprintk("RPC: gss_create_cred failed with error %d\n", err);
> - if (cred) gss_destroy_cred(&cred->gc_base);
> return ERR_PTR(err);
> }
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [TCP]: Fix truesize underflow
From: Ingo Oeser @ 2006-04-18 16:29 UTC (permalink / raw)
To: Herbert Xu
Cc: Boris B. Zhmurov, Phil Oester, Mark Nipper, David S. Miller,
jesse.brandeburg, jrlundgren, cat, djani22, yoseph.basri, mykleb,
olel, michal, chris, netdev, jesse.brandeburg, Andi Kleen,
Jeff Garzik
In-Reply-To: <20060418123204.GA3962@gondor.apana.org.au>
Hi Herbert,
Herbert Xu wrote:
> I've copied the code you used in tso_fragment which should work here.
I'm happy to see, that this got resolved and this is a nice minimalistic fix
for -stable.
But shouldn't we put this kind of hairy manipulation into some nice functions?
Driver writers were already confused by all that size, len and truesize stuff,
as this bug showed.
Regards
Ingo Oeser
^ permalink raw reply
* [Patch] Dead code in net/sunrpc/auth_gss/auth_gss.c
From: Eric Sesterhenn @ 2006-04-18 16:07 UTC (permalink / raw)
To: netdev; +Cc: dugsong
Hi,
the coverity checker spotted that cred is always NULL
when we jump to out_err ( there is just one case, when
we fail to allocate the memory for cred )
This is Coverity ID #79
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.17-rc1/net/sunrpc/auth_gss/auth_gss.c.orig 2006-04-18 13:23:22.000000000 +0200
+++ linux-2.6.17-rc1/net/sunrpc/auth_gss/auth_gss.c 2006-04-18 13:24:10.000000000 +0200
@@ -794,7 +794,6 @@ gss_create_cred(struct rpc_auth *auth, s
out_err:
dprintk("RPC: gss_create_cred failed with error %d\n", err);
- if (cred) gss_destroy_cred(&cred->gc_base);
return ERR_PTR(err);
}
^ permalink raw reply
* [PATCH 4/4] [IPV6]: Clean up hop-by-hop options handler.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-04-18 15:21 UTC (permalink / raw)
To: davem; +Cc: netdev, yoshfuji
[IPV6]: Clean up hop-by-hop options handler.
- Removed unused argument (nhoff) for ipv6_parse_hopopts().
- Make ipv6_parse_hopopts() to align with other extension header
handlers.
- Removed pointless assignment (hdr), which is not used afterwards.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
include/net/ipv6.h | 2 +-
net/ipv6/exthdrs.c | 4 ++--
net/ipv6/ip6_input.c | 3 +--
3 files changed, 4 insertions(+), 5 deletions(-)
e261b91167cad07c4639dffb72ecabedb4ed9e49
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6d6f063..4abedb8 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -230,7 +230,7 @@ extern int ip6_ra_control(struct sock
void (*destructor)(struct sock *));
-extern int ipv6_parse_hopopts(struct sk_buff *skb, int);
+extern int ipv6_parse_hopopts(struct sk_buff *skb);
extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt);
extern struct ipv6_txoptions * ipv6_renew_options(struct sock *sk, struct ipv6_txoptions *opt,
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index d88cab7..a18d425 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -485,7 +485,7 @@ static struct tlvtype_proc tlvprochopopt
{ -1, }
};
-int ipv6_parse_hopopts(struct sk_buff *skb, int nhoff)
+int ipv6_parse_hopopts(struct sk_buff *skb)
{
struct inet6_skb_parm *opt = IP6CB(skb);
@@ -505,7 +505,7 @@ int ipv6_parse_hopopts(struct sk_buff *s
if (ip6_parse_tlv(tlvprochopopt_lst, skb)) {
skb->h.raw += (skb->h.raw[1]+1)<<3;
opt->nhoff = sizeof(struct ipv6hdr);
- return sizeof(struct ipv6hdr);
+ return 1;
}
return -1;
}
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 29f7359..aceee25 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -114,11 +114,10 @@ int ipv6_rcv(struct sk_buff *skb, struct
}
if (hdr->nexthdr == NEXTHDR_HOP) {
- if (ipv6_parse_hopopts(skb, IP6CB(skb)->nhoff) < 0) {
+ if (ipv6_parse_hopopts(skb) < 0) {
IP6_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS);
return 0;
}
- hdr = skb->nh.ipv6h;
}
return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
--
1.0.8
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply related
* [PATCH 3/4] [IPV6] XFRM: Fix decoding session with preceding extension header(s).
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-04-18 15:21 UTC (permalink / raw)
To: davem; +Cc: netdev, yoshfuji, takamiya, kazunori
[IPV6] XFRM: Fix decoding session with preceding extension header(s).
We did not correctly decode session with preceding extension
header(s). This was because we had already pulled preceding
headers, skb->nh.raw + 40 + 1 - skb->data was minus, and
pskb_may_pull() failed.
We now have IP6CB(skb)->nhoff and skb->h.raw, and we can
start parsing / decoding upper layer protocol from current
position.
Tracked down by Noriaki TAKAMIYA <takamiya@po.ntts.co.jp>
and tested by Kazunori Miyazawa <kazunori@miyazawa.org>.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/xfrm6_policy.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
2556f141ba4ee513141aaf2a984e98e1e06a8c44
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 588922b..88c840f 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -191,10 +191,10 @@ error:
static inline void
_decode_session6(struct sk_buff *skb, struct flowi *fl)
{
- u16 offset = sizeof(struct ipv6hdr);
+ u16 offset = skb->h.raw - skb->nh.raw;
struct ipv6hdr *hdr = skb->nh.ipv6h;
struct ipv6_opt_hdr *exthdr;
- u8 nexthdr = skb->nh.ipv6h->nexthdr;
+ u8 nexthdr = skb->nh.raw[IP6CB(skb)->nhoff];
memset(fl, 0, sizeof(struct flowi));
ipv6_addr_copy(&fl->fl6_dst, &hdr->daddr);
--
1.0.8
^ permalink raw reply related
* [PATCH 2/4] [IPV6] XFRM: Don't use old copy of pointer after pskb_may_pull().
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-04-18 15:21 UTC (permalink / raw)
To: davem; +Cc: netdev, yoshfuji
[IPV6] XFRM: Don't use old copy of pointer after pskb_may_pull().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/xfrm6_policy.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
83e25b9fb69b2c04ebfec2ee2b9fe95e5a7c0584
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 91cce8b..588922b 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -193,7 +193,7 @@ _decode_session6(struct sk_buff *skb, st
{
u16 offset = sizeof(struct ipv6hdr);
struct ipv6hdr *hdr = skb->nh.ipv6h;
- struct ipv6_opt_hdr *exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
+ struct ipv6_opt_hdr *exthdr;
u8 nexthdr = skb->nh.ipv6h->nexthdr;
memset(fl, 0, sizeof(struct flowi));
@@ -201,6 +201,8 @@ _decode_session6(struct sk_buff *skb, st
ipv6_addr_copy(&fl->fl6_src, &hdr->saddr);
while (pskb_may_pull(skb, skb->nh.raw + offset + 1 - skb->data)) {
+ exthdr = (struct ipv6_opt_hdr*)(skb->nh.raw + offset);
+
switch (nexthdr) {
case NEXTHDR_ROUTING:
case NEXTHDR_HOP:
--
1.0.8
^ permalink raw reply related
* [PATCH 1/4] [IPV6]: Ensure to have hop-by-hop options in our header of &sk_buff.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-04-18 15:20 UTC (permalink / raw)
To: davem; +Cc: netdev, yoshfuji
[IPV6]: Ensure to have hop-by-hop options in our header of &sk_buff.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
net/ipv6/exthdrs.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
7bcedcc73a45a5577103422c33e01f1633173984
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 2a1e7e4..d88cab7 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -489,6 +489,18 @@ int ipv6_parse_hopopts(struct sk_buff *s
{
struct inet6_skb_parm *opt = IP6CB(skb);
+ /*
+ * skb->nh.raw is equal to skb->data, and
+ * skb->h.raw - skb->nh.raw is always equal to
+ * sizeof(struct ipv6hdr) by definition of
+ * hop-by-hop options.
+ */
+ if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + 8) ||
+ !pskb_may_pull(skb, sizeof(struct ipv6hdr) + ((skb->h.raw[1] + 1) << 3))) {
+ kfree_skb(skb);
+ return -1;
+ }
+
opt->hop = sizeof(struct ipv6hdr);
if (ip6_parse_tlv(tlvprochopopt_lst, skb)) {
skb->h.raw += (skb->h.raw[1]+1)<<3;
--
1.0.8
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply related
* [PATCH 0/4]: Fix several errors in extension header handling.
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2006-04-18 15:20 UTC (permalink / raw)
To: davem; +Cc: yoshfuji, netdev
Hello.
Following changesets fix several errors in extension header handling.
I'd propose to push them (except 4/4, maybe) to -stable.
[PATCH 1/4] [IPV6]: Ensure to have hop-by-hop options in our header of &sk_buff.
[PATCH 2/4] [IPV6] XFRM: Don't use old copy of pointer after pskb_may_pull().
[PATCH 3/4] [IPV6] XFRM: Fix decoding session with preceding extension header(s).
[PATCH 4/4] [IPV6]: Clean up hop-by-hop options handler.
Regards,
--
YOSHIFUJI Hideaki @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG-FP : 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
^ permalink raw reply
* [PATCH] sync bcm43xx-d80211 to bcm43xx
From: Michael Buesch @ 2006-04-18 14:48 UTC (permalink / raw)
To: John W. Linville; +Cc: bcm43xx-dev, netdev
[-- Attachment #1.1: Type: text/plain, Size: 211 bytes --]
Hi John,
I already sent these three patches for inclusion into
the softmac version of the driver. Here are the devicescape
port versions for inclusion in your wireless-dev tree.
--
Greetings Michael.
[-- Attachment #1.2: bcm43xx-d80211_clean_up_sysfs_stuff.patch --]
[-- Type: text/x-diff, Size: 9476 bytes --]
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx.h
===================================================================
--- wireless-dev-ds.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx.h 2006-04-18 16:33:23.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx.h 2006-04-18 16:38:10.000000000 +0200
@@ -18,7 +18,6 @@
#include "bcm43xx_debugfs.h"
#include "bcm43xx_leds.h"
-#include "bcm43xx_sysfs.h"
#define PFX KBUILD_MODNAME ": "
@@ -628,8 +627,6 @@
};
struct bcm43xx_private {
- struct bcm43xx_sysfs sysfs;
-
struct ieee80211_hw *ieee;
struct ieee80211_low_level_stats ieee_stats;
int iw_mode;
@@ -843,6 +840,20 @@
return phy->_lo_pairs + (radio_attenuation + 14 * (baseband_attenuation / 2));
}
+struct device;
+
+static inline
+struct bcm43xx_private * dev_to_bcm(struct device *dev)
+{
+ struct net_device *net_dev;
+ struct bcm43xx_private *bcm;
+
+ net_dev = dev_get_drvdata(dev);
+ bcm = bcm43xx_priv(net_dev);
+
+ return bcm;
+}
+
static inline
u16 bcm43xx_read16(struct bcm43xx_private *bcm, u16 offset)
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c
===================================================================
--- wireless-dev-ds.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c 2006-04-18 16:33:23.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c 2006-04-18 16:37:48.000000000 +0200
@@ -52,6 +52,7 @@
#include "bcm43xx_sysfs.h"
#include "bcm43xx_ethtool.h"
#include "bcm43xx_xmit.h"
+#include "bcm43xx_sysfs.h"
MODULE_DESCRIPTION("Broadcom BCM43xx wireless driver");
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_sysfs.c
===================================================================
--- wireless-dev-ds.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx_sysfs.c 2006-04-18 16:33:23.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_sysfs.c 2006-04-18 16:37:48.000000000 +0200
@@ -71,14 +71,46 @@
return -EINVAL;
}
+static int sprom2hex(const u16 *sprom, char *buf, size_t buf_len)
+{
+ int i, pos = 0;
+
+ for (i = 0; i < BCM43xx_SPROM_SIZE; i++) {
+ pos += snprintf(buf + pos, buf_len - pos - 1,
+ "%04X", swab16(sprom[i]) & 0xFFFF);
+ }
+ pos += snprintf(buf + pos, buf_len - pos - 1, "\n");
+
+ return pos + 1;
+}
+
+static int hex2sprom(u16 *sprom, const char *dump, size_t len)
+{
+ char tmp[5] = { 0 };
+ int cnt = 0;
+ unsigned long parsed;
+
+ if (len < BCM43xx_SPROM_SIZE * sizeof(u16) * 2)
+ return -EINVAL;
+
+ while (cnt < BCM43xx_SPROM_SIZE) {
+ memcpy(tmp, dump, 4);
+ dump += 4;
+ parsed = simple_strtoul(tmp, NULL, 16);
+ sprom[cnt++] = swab16((u16)parsed);
+ }
+
+ return 0;
+}
+
static ssize_t bcm43xx_attr_sprom_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_sprom);
+ struct bcm43xx_private *bcm = dev_to_bcm(dev);
u16 *sprom;
unsigned long flags;
- int i, err;
+ int err;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
@@ -91,55 +123,53 @@
bcm43xx_lock_mmio(bcm, flags);
assert(bcm->initialized);
err = bcm43xx_sprom_read(bcm, sprom);
- if (!err) {
- for (i = 0; i < BCM43xx_SPROM_SIZE; i++) {
- buf[i * 2] = sprom[i] & 0x00FF;
- buf[i * 2 + 1] = (sprom[i] & 0xFF00) >> 8;
- }
- }
+ if (!err)
+ err = sprom2hex(sprom, buf, PAGE_SIZE);
bcm43xx_unlock_mmio(bcm, flags);
kfree(sprom);
- return err ? err : BCM43xx_SPROM_SIZE * sizeof(u16);
+ return err;
}
static ssize_t bcm43xx_attr_sprom_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
- struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_sprom);
+ struct bcm43xx_private *bcm = dev_to_bcm(dev);
u16 *sprom;
unsigned long flags;
- int i, err;
+ int err;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- if (count != BCM43xx_SPROM_SIZE * sizeof(u16))
- return -EINVAL;
sprom = kmalloc(BCM43xx_SPROM_SIZE * sizeof(*sprom),
GFP_KERNEL);
if (!sprom)
return -ENOMEM;
- for (i = 0; i < BCM43xx_SPROM_SIZE; i++) {
- sprom[i] = buf[i * 2] & 0xFF;
- sprom[i] |= ((u16)(buf[i * 2 + 1] & 0xFF)) << 8;
- }
+ err = hex2sprom(sprom, buf, count);
+ if (err)
+ goto out_kfree;
bcm43xx_lock_mmio(bcm, flags);
assert(bcm->initialized);
err = bcm43xx_sprom_write(bcm, sprom);
bcm43xx_unlock_mmio(bcm, flags);
+out_kfree:
kfree(sprom);
return err ? err : count;
}
+static DEVICE_ATTR(sprom, 0600,
+ bcm43xx_attr_sprom_show,
+ bcm43xx_attr_sprom_store);
+
static ssize_t bcm43xx_attr_interfmode_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_interfmode);
+ struct bcm43xx_private *bcm = dev_to_bcm(dev);
unsigned long flags;
int err;
ssize_t count = 0;
@@ -175,7 +205,7 @@
struct device_attribute *attr,
const char *buf, size_t count)
{
- struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_interfmode);
+ struct bcm43xx_private *bcm = dev_to_bcm(dev);
unsigned long flags;
int err;
int mode;
@@ -215,11 +245,15 @@
return err ? err : count;
}
+static DEVICE_ATTR(interference, 0644,
+ bcm43xx_attr_interfmode_show,
+ bcm43xx_attr_interfmode_store);
+
static ssize_t bcm43xx_attr_preamble_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
- struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_preamble);
+ struct bcm43xx_private *bcm = dev_to_bcm(dev);
unsigned long flags;
int err;
ssize_t count;
@@ -245,7 +279,7 @@
struct device_attribute *attr,
const char *buf, size_t count)
{
- struct bcm43xx_private *bcm = devattr_to_bcm(attr, attr_preamble);
+ struct bcm43xx_private *bcm = dev_to_bcm(dev);
unsigned long flags;
int err;
int value;
@@ -267,56 +301,41 @@
return err ? err : count;
}
+static DEVICE_ATTR(shortpreamble, 0644,
+ bcm43xx_attr_preamble_show,
+ bcm43xx_attr_preamble_store);
+
int bcm43xx_sysfs_register(struct bcm43xx_private *bcm)
{
struct device *dev = &bcm->pci_dev->dev;
- struct bcm43xx_sysfs *sysfs = &bcm->sysfs;
int err;
assert(bcm->initialized);
- sysfs->attr_sprom.attr.name = "sprom";
- sysfs->attr_sprom.attr.owner = THIS_MODULE;
- sysfs->attr_sprom.attr.mode = 0600;
- sysfs->attr_sprom.show = bcm43xx_attr_sprom_show;
- sysfs->attr_sprom.store = bcm43xx_attr_sprom_store;
- err = device_create_file(dev, &sysfs->attr_sprom);
+ err = device_create_file(dev, &dev_attr_sprom);
if (err)
goto out;
-
- sysfs->attr_interfmode.attr.name = "interference";
- sysfs->attr_interfmode.attr.owner = THIS_MODULE;
- sysfs->attr_interfmode.attr.mode = 0600;
- sysfs->attr_interfmode.show = bcm43xx_attr_interfmode_show;
- sysfs->attr_interfmode.store = bcm43xx_attr_interfmode_store;
- err = device_create_file(dev, &sysfs->attr_interfmode);
+ err = device_create_file(dev, &dev_attr_interference);
if (err)
goto err_remove_sprom;
-
- sysfs->attr_preamble.attr.name = "shortpreamble";
- sysfs->attr_preamble.attr.owner = THIS_MODULE;
- sysfs->attr_preamble.attr.mode = 0600;
- sysfs->attr_preamble.show = bcm43xx_attr_preamble_show;
- sysfs->attr_preamble.store = bcm43xx_attr_preamble_store;
- err = device_create_file(dev, &sysfs->attr_preamble);
+ err = device_create_file(dev, &dev_attr_shortpreamble);
if (err)
goto err_remove_interfmode;
out:
return err;
err_remove_interfmode:
- device_remove_file(dev, &sysfs->attr_interfmode);
+ device_remove_file(dev, &dev_attr_interference);
err_remove_sprom:
- device_remove_file(dev, &sysfs->attr_sprom);
+ device_remove_file(dev, &dev_attr_sprom);
goto out;
}
void bcm43xx_sysfs_unregister(struct bcm43xx_private *bcm)
{
struct device *dev = &bcm->pci_dev->dev;
- struct bcm43xx_sysfs *sysfs = &bcm->sysfs;
- device_remove_file(dev, &sysfs->attr_preamble);
- device_remove_file(dev, &sysfs->attr_interfmode);
- device_remove_file(dev, &sysfs->attr_sprom);
+ device_remove_file(dev, &dev_attr_shortpreamble);
+ device_remove_file(dev, &dev_attr_interference);
+ device_remove_file(dev, &dev_attr_sprom);
}
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_sysfs.h
===================================================================
--- wireless-dev-ds.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx_sysfs.h 2006-04-18 16:33:23.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_sysfs.h 2006-04-18 16:37:48.000000000 +0200
@@ -1,22 +1,6 @@
#ifndef BCM43xx_SYSFS_H_
#define BCM43xx_SYSFS_H_
-#include <linux/device.h>
-
-
-struct bcm43xx_sysfs {
- struct device_attribute attr_sprom;
- struct device_attribute attr_interfmode;
- struct device_attribute attr_preamble;
-};
-
-#define devattr_to_bcm(attr, attr_name) ({ \
- struct bcm43xx_sysfs *__s; struct bcm43xx_private *__p; \
- __s = container_of((attr), struct bcm43xx_sysfs, attr_name); \
- __p = container_of(__s, struct bcm43xx_private, sysfs); \
- __p; \
- })
-
struct bcm43xx_private;
int bcm43xx_sysfs_register(struct bcm43xx_private *bcm);
[-- Attachment #1.3: bcm43xx-d80211_pctl_clockfreqlimit_uninit_fix.patch --]
[-- Type: text/x-diff, Size: 4989 bytes --]
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_power.c
===================================================================
--- wireless-dev-ds.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx_power.c 2006-04-18 16:33:23.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_power.c 2006-04-18 16:38:56.000000000 +0200
@@ -35,77 +35,101 @@
#include "bcm43xx_main.h"
+/* Get the Slow Clock Source */
+static int bcm43xx_pctl_get_slowclksrc(struct bcm43xx_private *bcm)
+{
+ u32 tmp;
+ int err;
+
+ assert(bcm->current_core == &bcm->core_chipcommon);
+ if (bcm->current_core->rev < 6) {
+ if (bcm->bustype == BCM43xx_BUSTYPE_PCMCIA ||
+ bcm->bustype == BCM43xx_BUSTYPE_SB)
+ return BCM43xx_PCTL_CLKSRC_XTALOS;
+ if (bcm->bustype == BCM43xx_BUSTYPE_PCI) {
+ err = bcm43xx_pci_read_config32(bcm, BCM43xx_PCTL_OUT, &tmp);
+ assert(!err);
+ if (tmp & 0x10)
+ return BCM43xx_PCTL_CLKSRC_PCI;
+ return BCM43xx_PCTL_CLKSRC_XTALOS;
+ }
+ }
+ if (bcm->current_core->rev < 10) {
+ tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL);
+ tmp &= 0x7;
+ if (tmp == 0)
+ return BCM43xx_PCTL_CLKSRC_LOPWROS;
+ if (tmp == 1)
+ return BCM43xx_PCTL_CLKSRC_XTALOS;
+ if (tmp == 2)
+ return BCM43xx_PCTL_CLKSRC_PCI;
+ }
+
+ return BCM43xx_PCTL_CLKSRC_XTALOS;
+}
+
/* Get max/min slowclock frequency
* as described in http://bcm-specs.sipsolutions.net/PowerControl
*/
static int bcm43xx_pctl_clockfreqlimit(struct bcm43xx_private *bcm,
int get_max)
{
- int limit = 0;
+ int limit;
+ int clocksrc;
int divisor;
- int selection;
- int err;
u32 tmp;
- struct bcm43xx_coreinfo *old_core;
- if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL))
- goto out;
- old_core = bcm->current_core;
- err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon);
- if (err)
- goto out;
+ assert(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL);
+ assert(bcm->current_core == &bcm->core_chipcommon);
+ clocksrc = bcm43xx_pctl_get_slowclksrc(bcm);
if (bcm->current_core->rev < 6) {
- if ((bcm->bustype == BCM43xx_BUSTYPE_PCMCIA) ||
- (bcm->bustype == BCM43xx_BUSTYPE_SB)) {
- selection = 1;
+ switch (clocksrc) {
+ case BCM43xx_PCTL_CLKSRC_PCI:
+ divisor = 64;
+ break;
+ case BCM43xx_PCTL_CLKSRC_XTALOS:
divisor = 32;
- } else {
- err = bcm43xx_pci_read_config32(bcm, BCM43xx_PCTL_OUT, &tmp);
- if (err) {
- printk(KERN_ERR PFX "clockfreqlimit pcicfg read failure\n");
- goto out_switchback;
- }
- if (tmp & 0x10) {
- /* PCI */
- selection = 2;
- divisor = 64;
- } else {
- /* XTAL */
- selection = 1;
- divisor = 32;
- }
+ break;
+ default:
+ assert(0);
+ divisor = 1;
}
} else if (bcm->current_core->rev < 10) {
- selection = (tmp & 0x07);
- if (selection) {
+ switch (clocksrc) {
+ case BCM43xx_PCTL_CLKSRC_LOPWROS:
+ divisor = 1;
+ break;
+ case BCM43xx_PCTL_CLKSRC_XTALOS:
+ case BCM43xx_PCTL_CLKSRC_PCI:
tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SLOWCLKCTL);
- divisor = 4 * (1 + ((tmp & 0xFFFF0000) >> 16));
- } else
+ divisor = ((tmp & 0xFFFF0000) >> 16) + 1;
+ divisor *= 4;
+ break;
+ default:
+ assert(0);
divisor = 1;
+ }
} else {
tmp = bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL);
- divisor = 4 * (1 + ((tmp & 0xFFFF0000) >> 16));
- selection = 1;
+ divisor = ((tmp & 0xFFFF0000) >> 16) + 1;
+ divisor *= 4;
}
-
- switch (selection) {
- case 0:
- /* LPO */
+
+ switch (clocksrc) {
+ case BCM43xx_PCTL_CLKSRC_LOPWROS:
if (get_max)
limit = 43000;
else
limit = 25000;
break;
- case 1:
- /* XTAL */
+ case BCM43xx_PCTL_CLKSRC_XTALOS:
if (get_max)
limit = 20200000;
else
limit = 19800000;
break;
- case 2:
- /* PCI */
+ case BCM43xx_PCTL_CLKSRC_PCI:
if (get_max)
limit = 34000000;
else
@@ -113,17 +137,14 @@
break;
default:
assert(0);
+ limit = 0;
}
limit /= divisor;
-out_switchback:
- err = bcm43xx_switch_core(bcm, old_core);
- assert(err == 0);
-
-out:
return limit;
}
+
/* init power control
* as described in http://bcm-specs.sipsolutions.net/PowerControl
*/
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_power.h
===================================================================
--- wireless-dev-ds.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx_power.h 2006-04-18 16:33:23.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_power.h 2006-04-18 16:38:56.000000000 +0200
@@ -33,6 +33,15 @@
#include <linux/types.h>
+/* Clock sources */
+enum {
+ /* PCI clock */
+ BCM43xx_PCTL_CLKSRC_PCI,
+ /* Crystal slow clock oscillator */
+ BCM43xx_PCTL_CLKSRC_XTALOS,
+ /* Low power oscillator */
+ BCM43xx_PCTL_CLKSRC_LOPWROS,
+};
struct bcm43xx_private;
[-- Attachment #1.4: bcm43xx-d80211_phy_tssi_memleak_fix.patch --]
[-- Type: text/x-diff, Size: 567 bytes --]
Index: wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_phy.c
===================================================================
--- wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_phy.c 2006-04-13 02:21:39.000000000 +0200
+++ wireless-dev-ds/drivers/net/wireless/bcm43xx-d80211/bcm43xx_phy.c 2006-04-13 02:23:31.000000000 +0200
@@ -2151,6 +2151,7 @@
phy->tssi2dbm = NULL;
printk(KERN_ERR PFX "Could not generate "
"tssi2dBm table\n");
+ kfree(dyn_tssi2dbm);
return -ENODEV;
}
phy->tssi2dbm = dyn_tssi2dbm;
[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: [RFC: 2.6 patch] net/netlink/: possible cleanups
From: Adrian Bunk @ 2006-04-18 14:19 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: netdev, linux-kernel
In-Reply-To: <20060414105610.GA18149@2ka.mipt.ru>
On Fri, Apr 14, 2006 at 02:56:12PM +0400, Evgeniy Polyakov wrote:
>...
> Although it is always statically built systems, it is still very
> convenient way of netlink usage for others (future modular systems).
I do understand Dave's "new API, users are expected soon" point.
OTOH, we also have to always check whether users are expected soon (and
recheck whether there are really users after some time) since every
single export makes the kernel larger for nearly everyone.
> Evgeniy Polyakov
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
* [TCP]: Fix truesize underflow
From: Herbert Xu @ 2006-04-18 12:32 UTC (permalink / raw)
To: Boris B. Zhmurov, Phil Oester, Mark Nipper, David S. Miller,
jesse.brandeburg, jrlundgren, cat, djani22, yoseph.basri, mykleb,
olel, michal, chris, netdev, jesse.brandeburg, Andi Kleen,
Jeff Garzik
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
Hi Dave:
You're absolutely right about there being a problem with the TSO packet
trimming code. The cause of this lies in the tcp_fragment() function.
When we allocate a fragment for a completely non-linear packet the
truesize is calculated for a payload length of zero. This means that
truesize could in fact be less than the real payload length.
When that happens the TSO packet trimming can cause truesize to become
negative. This in turn can cause sk_forward_alloc to be -n * PAGE_SIZE
which would trigger the warning.
I've copied the code you used in tso_fragment which should work here.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Everyone who's having the sk_forward_alloc warning problem should give
this patch a go to see if it cures things.
Just in case this still doesn't fix it, could everyone please also verify
whether disabling SMP has any effect on reproducing this?
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: tcp-fragment.patch --]
[-- Type: text/plain, Size: 484 bytes --]
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index b871db6..44df1db 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -551,7 +551,9 @@
buff = sk_stream_alloc_skb(sk, nsize, GFP_ATOMIC);
if (buff == NULL)
return -ENOMEM; /* We'll just try again later. */
- sk_charge_skb(sk, buff);
+
+ buff->truesize = skb->len - len;
+ skb->truesize -= buff->truesize;
/* Correct the sequence numbers. */
TCP_SKB_CB(buff)->seq = TCP_SKB_CB(skb)->seq + len;
^ permalink raw reply related
* Re: fixing sk_stream_rfree()
From: Ingo Oeser @ 2006-04-18 11:49 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20060414.205927.13626300.davem@davemloft.net>
Hi David,
You wrote:
> 2) We can't turn sk_forward_alloc easily into an atomic_t. The
> masking operation in __sk_stream_mem_reclaim() does not translate
> readily into an atomic_t op:
>
> sk->sk_forward_alloc &= SK_STREAM_MEM_QUANTUM - 1;
>
> That line has always driven me nuts, but I know that it is there
> to handle partial page allocations existing when that function
> is called.
>
> I guess for #2 we could change those two lines into:
>
> int n = atomic_read(&sk->sk_forward_alloc) /
> SK_STREAM_MEM_QUANTUM;
>
> atomic_sub(n, sk->sk_prot->memory_allocated);
> sk->sk_forward_alloc -= n * SK_STREAM_MEM_QUANTUM;
>
> in order to make it "atomic_t op" translatable.
It is possible. Just view this as an register with size SK_STREAM_MEM_QUANTUM.
Mask on every read and always after the read.
Always add/subtract the intended value.
Wraparound happens within the modulo/mask value.
This works without problems as long as SK_STREAM_MEM_QUANTUM
is a power of two. If not, just use modulo arithmetics.
The non-atomic wrapround doesn't change the atomic nature of
read, add, sub. Only problem is atomic_dec_and_test() or similiar ops.
Regards
Ingo Oeser
^ permalink raw reply
* Re: [PATCH] ip_route_input panic fix
From: Herbert Xu @ 2006-04-18 6:54 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, netdev
In-Reply-To: <20060417171253.4e988afc@localhost.localdomain>
Stephen Hemminger <shemminger@osdl.org> wrote:
>
> --- linux-2.6.16.6.orig/net/ipv4/route.c
> +++ linux-2.6.16.6/net/ipv4/route.c
> @@ -2750,7 +2750,10 @@ int inet_rtm_getroute(struct sk_buff *in
> /* Reserve room for dummy headers, this skb can pass
> through good chunk of routing engine.
> */
> - skb->mac.raw = skb->data;
> + skb->mac.raw = skb->nh.raw = skb->data;
> +
> + /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
> + skb->nh.iph->protocol = IPPROTO_ICMP;
Looking at this again, the root of this problem is the IGMPv3
patch which started using the skb->nh.iph->protocol as a key.
So what we really should do is make the protocol an explicit parameter
to the ip_route_input function. This will make it clear to all the
users which include some pretty weird cases that the protocol is needed.
In fact I'm unsure as to whether all the other users of ip_route_input
is safe as it is regarding the protocol.
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
* e1000 breakage in git-netdev-all
From: Andrew Morton @ 2006-04-18 6:41 UTC (permalink / raw)
To: John Ronciak, Auke Kok, Jesse Brandeburg; +Cc: netdev, Jeff Garzik
A bunch of e1000 changes just hit Jeff's tree.
I hit this.
skb_over_panic: text:ffffffff803b7dc5 len:3028 put:1514 head:ffff81017f83e870 data:ffff81017f83e882 tail:ffff81017f83f456 end:ffff81017f83ee70 dev:eth0
----------- [cut here ] --------- [please bite here ] ---------
Kernel BUG at net/core/skbuff.c:94
invalid opcode: 0000 [1] PREEMPT SMP
last sysfs file: /class/vc/vcsa5/dev
CPU 3
Modules linked in: pcmcia yenta_socket rsrc_nonstatic pcmcia_core video sony_acpi
Pid: 11697, comm: cc1 Not tainted 2.6.17-rc1-mm3 #66
RIP: 0010:[<ffffffff8043f2d6>] <ffffffff8043f2d6>{skb_over_panic+78}
RSP: 0000:ffff81017fd1be28 EFLAGS: 00010292
RAX: 000000000000009b RBX: 0000000000000000 RCX: 0000000000000213
RDX: ffffffff805ddad8 RSI: 0000000000000213 RDI: 0000000000000001
RBP: ffff81017fd1be48 R08: ffffffff805ddad8 R09: 0000000000000061
R10: 0000000000000061 R11: 0000000000000000 R12: ffff81017fb31500
R13: ffff81017f8e4548 R14: 00000000000005ea R15: 000000000000003b
FS: 00002b7e4f259b00(0000) GS:ffff81017fc74b20(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00002b7e547db000 CR3: 000000016098a000 CR4: 00000000000006e0
Process cc1 (pid: 11697, threadinfo ffff81015c6aa000, task ffff8101791120d0)
Stack: ffff81017f83f456 ffff81017f83ee70 ffff81017fb31000 ffff81017f83f456
ffff81017fd1bed8 ffffffff803b7dd0 23ff81017fd1be68 0000000100000001
ffffc20000010760 ffffc20000010740
Call Trace: <IRQ> <ffffffff803b7dd0>{e1000_clean_rx_irq+836}
<ffffffff803b79be>{e1000_intr+173} <ffffffff8024f26b>{handle_IRQ_event+48}
<ffffffff8024f344>{__do_IRQ+163} <ffffffff8020bcd5>{do_IRQ+50}
<ffffffff80209d84>{ret_from_intr+0} <EOI>
Code: 0f 0b 68 2b 74 52 80 c2 5e 00 c9 c3 55 49 89 d2 48 89 e5 52
RIP <ffffffff8043f2d6>{skb_over_panic+78} RSP <ffff81017fd1be28>
The machine was being used as a distcc server at the time - just basic TCP
stuff.
I'll drop Jeff's tree for now. Please let me know when we have a fix.
^ permalink raw reply
* Re: [1/1] netlink: fix broadcasting to the wrong group.
From: Evgeniy Polyakov @ 2006-04-18 6:09 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netdev
In-Reply-To: <44448079.6030305@trash.net>
On Tue, Apr 18, 2006 at 08:00:25AM +0200, Patrick McHardy (kaber@trash.net) wrote:
> >>Again, bind() takes a bitmask of the groups to subscribe to, not the
> >>numerical value 5. To subscribe to group 5 using bind, you use 1<<(5-1)
> >>as nladdr, which is 0x10000. Check out the difference between
> >>RTMGRP_NOTIFY (backwards compatibility for bind()) and RTNLGRP_NOTIFY
> >>(used internally and for NETLINK_ADD_MEMBERSHIP).
> >
> >
> > I.e. bind nladdr is an optimisation for several calls of
> > NETLINK_ADD_MEMBERSHIP, as long as socket setup in netlink table?
>
> No, its not an optimization, its there for backwards compatibility.
> Otherwise the cleanest solution would have been to remove group
> subscription from bind().
>
> > And thus bind(5) is equal to subscribe(1); subscribe(3).
>
> Yes, except that it will also unsubscribe from all other groups <= 32.
>
> Easiest way to avoid problems is to first call bind() with a group mask
> of 0, then use setsockopt() to subscribe to groups.
Ok, this clarifies things a lot.
Thank you.
--
Evgeniy Polyakov
^ permalink raw reply
* Re: [1/1] netlink: fix broadcasting to the wrong group.
From: Patrick McHardy @ 2006-04-18 6:00 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: David S. Miller, netdev
In-Reply-To: <20060418055351.GB833@2ka.mipt.ru>
Evgeniy Polyakov wrote:
> On Tue, Apr 18, 2006 at 07:36:52AM +0200, Patrick McHardy (kaber@trash.net) wrote:
>
>>Again, bind() takes a bitmask of the groups to subscribe to, not the
>>numerical value 5. To subscribe to group 5 using bind, you use 1<<(5-1)
>>as nladdr, which is 0x10000. Check out the difference between
>>RTMGRP_NOTIFY (backwards compatibility for bind()) and RTNLGRP_NOTIFY
>>(used internally and for NETLINK_ADD_MEMBERSHIP).
>
>
> I.e. bind nladdr is an optimisation for several calls of
> NETLINK_ADD_MEMBERSHIP, as long as socket setup in netlink table?
No, its not an optimization, its there for backwards compatibility.
Otherwise the cleanest solution would have been to remove group
subscription from bind().
> And thus bind(5) is equal to subscribe(1); subscribe(3).
Yes, except that it will also unsubscribe from all other groups <= 32.
Easiest way to avoid problems is to first call bind() with a group mask
of 0, then use setsockopt() to subscribe to groups.
^ permalink raw reply
* Re: [1/1] netlink: fix broadcasting to the wrong group.
From: Evgeniy Polyakov @ 2006-04-18 5:53 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netdev
In-Reply-To: <44447AF4.5060907@trash.net>
On Tue, Apr 18, 2006 at 07:36:52AM +0200, Patrick McHardy (kaber@trash.net) wrote:
> Again, bind() takes a bitmask of the groups to subscribe to, not the
> numerical value 5. To subscribe to group 5 using bind, you use 1<<(5-1)
> as nladdr, which is 0x10000. Check out the difference between
> RTMGRP_NOTIFY (backwards compatibility for bind()) and RTNLGRP_NOTIFY
> (used internally and for NETLINK_ADD_MEMBERSHIP).
I.e. bind nladdr is an optimisation for several calls of
NETLINK_ADD_MEMBERSHIP, as long as socket setup in netlink table?
And thus bind(5) is equal to subscribe(1); subscribe(3).
--
Evgeniy Polyakov
^ permalink raw reply
* Re: [PATCH] ip_route_input panic fix
From: David S. Miller @ 2006-04-18 5:45 UTC (permalink / raw)
To: herbert; +Cc: shemminger, netdev
In-Reply-To: <E1FVfxQ-0008Tf-00@gondolin.me.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 18 Apr 2006 12:28:48 +1000
> Stephen Hemminger <shemminger@osdl.org> wrote:
> > + /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
> > + skb->nh.iph->protocol = IPPROTO_ICMP;
>
> Do we really need this? After all we can get completely bogus values
> coming in through the network too.
ip_mc_check() will return 1 if it happens to be IGMP, that's not
a good default for this netlink lookup case.
^ permalink raw reply
* Re: [1/1] netlink: fix broadcasting to the wrong group.
From: Patrick McHardy @ 2006-04-18 5:36 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: David S. Miller, netdev
In-Reply-To: <20060418051846.GA833@2ka.mipt.ru>
Evgeniy Polyakov wrote:
> On Tue, Apr 18, 2006 at 01:13:35AM +0200, Patrick McHardy (kaber@trash.net) wrote:
>
>>I went over your mails again, but I don't understand the problem you're
>>seeing. Please just make a simple example showing the operation +
>>the arguments you're using to bind to group 5 which would result in
>>bit 0 beeing set or the kernel deciding to send to group 1 for some
>>other reason.
>
>
> Example:
> at bind time group 5 was selected and then socket was subscribed to that
> group. This end up in 0b10101 bitmask, which allows to multicast to
> group 16 which has nothing in common with either group number 5 or
> bitmask 5.
Again, bind() takes a bitmask of the groups to subscribe to, not the
numerical value 5. To subscribe to group 5 using bind, you use 1<<(5-1)
as nladdr, which is 0x10000. Check out the difference between
RTMGRP_NOTIFY (backwards compatibility for bind()) and RTNLGRP_NOTIFY
(used internally and for NETLINK_ADD_MEMBERSHIP).
> I think that if socket uses bitmask at bind time, then it should not be
> allowed to subscribe.
> So for above example at bind time (1<<4) should be used and this is what
> happens with subscription. We discussed already that itmask
> functionality was never used, and current behaviour introduces big
> ambiguity.
> Well, if you forces this to not be changed, I will update documentation
> about this behaviour.
See above. Does this clear things up?
^ permalink raw reply
* Re: [1/1] netlink: fix broadcasting to the wrong group.
From: Evgeniy Polyakov @ 2006-04-18 5:18 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, netdev
In-Reply-To: <4444211F.3030000@trash.net>
On Tue, Apr 18, 2006 at 01:13:35AM +0200, Patrick McHardy (kaber@trash.net) wrote:
> I went over your mails again, but I don't understand the problem you're
> seeing. Please just make a simple example showing the operation +
> the arguments you're using to bind to group 5 which would result in
> bit 0 beeing set or the kernel deciding to send to group 1 for some
> other reason.
Example:
at bind time group 5 was selected and then socket was subscribed to that
group. This end up in 0b10101 bitmask, which allows to multicast to
group 16 which has nothing in common with either group number 5 or
bitmask 5.
I think that if socket uses bitmask at bind time, then it should not be
allowed to subscribe.
So for above example at bind time (1<<4) should be used and this is what
happens with subscription. We discussed already that itmask
functionality was never used, and current behaviour introduces big
ambiguity.
Well, if you forces this to not be changed, I will update documentation
about this behaviour.
--
Evgeniy Polyakov
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox