Re: 2.6.24-rc1 fails with lockup - /sbin/ifconfig / inet_ioctl() / dev_close() / rtl8169_down()

2007-10-25 Thread Ingo Molnar

* Romano Giannetti <[EMAIL PROTECTED]> wrote:

> > Does this help?
> 
> I tried this, but although I have the D-state processes, I cannot see 
> any debug trace now. Results are at:
> 
> http://www.dea.icai.upcomillas.es/romano/linux/info/2624rc1_3/
> 
> Can I try anything more? This is quite a show-stopper for me... and 
> before trying to bisect 11Mbyte of patches...

hm, from your log it appears that lockdep did not find anything, still 
the hang does trigger.

it's /sbin/ifconfig and inet_ioctl() / dev_close() / rtl8169_down() that 
seems to be hanging. I've extracted the relevant backtrace below. I've 
Cc:-ed people who might have a better idea about what's going on.

Ingo

 -->
 ifconfig  S c0476f80 0  7226   7166
cbb67df0 0046 c02f3f97 c0476f80 cbb67dc0 c01489d5 c2b81550 c2b8168c 
c1cf7b80  c30bd250  cbb67dd0 0282 cbb67e00 c0476f80 
cbb67df0 c0132618 4232  0282 cbb67e00 4232 f884e000 
 Call Trace:
  [schedule_timeout+72/192] schedule_timeout+0x48/0xc0
  [schedule_timeout_interruptible+21/32] 
schedule_timeout_interruptible+0x15/0x20
  [msleep_interruptible+39/64] msleep_interruptible+0x27/0x40
  [] rtl8169_down+0xb0/0xd0 [r8169]
  [] rtl8169_close+0x1f/0xb0 [r8169]
  [dev_close+71/96] dev_close+0x47/0x60
  [dev_change_flags+125/384] dev_change_flags+0x7d/0x180
  [devinet_ioctl+1225/1632] devinet_ioctl+0x4c9/0x660
  [inet_ioctl+107/144] inet_ioctl+0x6b/0x90
  [sock_ioctl+208/544] sock_ioctl+0xd0/0x220
  [do_ioctl+40/128] do_ioctl+0x28/0x80
  [vfs_ioctl+87/640] vfs_ioctl+0x57/0x280
  [sys_ioctl+57/96] sys_ioctl+0x39/0x60
  [sysenter_past_esp+95/165] sysenter_past_esp+0x5f/0xa5
  ===
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-2.6.24][trivial] fix inconsistency of terms

2007-10-25 Thread David Miller
From: TAKANO Ryousei <[EMAIL PROTECTED]>
Date: Tue, 09 Oct 2007 15:32:34 +0900 (JST)

> 
> Fix inconsistency of terms:
> 1) D-SACK
> 2) F-RTO
> 
> Signed-off-by: Ryousei Takano <[EMAIL PROTECTED]>

Patch applied, thank you!
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Please pull 'fixes-davem' branch of wireless-2.6 (Use this one!)

2007-10-25 Thread David Miller
From: "John W. Linville" <[EMAIL PROTECTED]>
Date: Fri, 26 Oct 2007 00:34:09 -0400

> Dave,
> 
> (Use this one!)
> 
> A few fixes for 2.6.24...also adds Johannes Berg as a mac80211
> maintainer, since he probably wrote most of the newest bugs
> there... :-)

Pulled, thanks John!
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Please pull 'fixes-davem' branch of wireless-2.6 (Use this one!)

2007-10-25 Thread John W. Linville
Dave,

(Use this one!)

A few fixes for 2.6.24...also adds Johannes Berg as a mac80211
maintainer, since he probably wrote most of the newest bugs
there... :-)

Thanks,

John

---

Individual patches available here:


http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes-davem

---

The following changes since commit c9927c2bf4f45bb85e8b502ab3fb79ad6483c244:
  Linus Torvalds (1):
Linux 2.6.24-rc1

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
fixes-davem

Johannes Berg (2):
  add myself as mac80211 maintainer
  mac80211: fix printk warning on 64-bit

Michael Wu (1):
  mac80211: Fix SSID matching in AP selection

 MAINTAINERS  |8 +---
 net/mac80211/ieee80211_sta.c |5 +++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 76b8571..71badfb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2442,13 +2442,15 @@ W:  http://www.tazenda.demon.co.uk/phil/linux-hp
 S: Maintained
 
 MAC80211
-P: Jiri Benc
-M: [EMAIL PROTECTED]
 P: Michael Wu
 M: [EMAIL PROTECTED]
+P: Johannes Berg
+M: [EMAIL PROTECTED]
+P: Jiri Benc
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 W: http://linuxwireless.org/
-T: git kernel.org:/pub/scm/linux/kernel/git/jbenc/mac80211.git
+T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
 S: Maintained
 
 MACVLAN DRIVER
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index f7ffeec..fda0e06 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1184,7 +1184,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct 
net_device *dev,
printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x "
   "status=%d aid=%d)\n",
   dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa),
-  capab_info, status_code, aid & ~(BIT(15) | BIT(14)));
+  capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14;
 
if (status_code != WLAN_STATUS_SUCCESS) {
printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
@@ -2096,7 +2096,8 @@ static int ieee80211_sta_match_ssid(struct 
ieee80211_if_sta *ifsta,
 {
int tmp, hidden_ssid;
 
-   if (!memcmp(ifsta->ssid, ssid, ssid_len))
+   if (ssid_len == ifsta->ssid_len &&
+   !memcmp(ifsta->ssid, ssid, ssid_len))
return 1;
 
if (ifsta->flags & IEEE80211_STA_AUTO_BSSID_SEL)
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Please pull 'fixes-davem' branch of wireless-2.6

2007-10-25 Thread John W. Linville
On Thu, Oct 25, 2007 at 11:10:33PM -0400, John W. Linville wrote:

> The following changes since commit c9927c2bf4f45bb85e8b502ab3fb79ad6483c244:
>   Linus Torvalds (1):
> Linux 2.6.24-rc1
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
> fixes-davem
> 
> Jeff Garzik (1):
>   mac80211: fix warning created by BIT()

Hmmm...this doesn't actually seem to fix the warning -- oops!

Disregard this request, I'll apply Johannes' fix instead and send
another pull request.

John
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Please pull 'fixes-davem' branch of wireless-2.6

2007-10-25 Thread John W. Linville
Dave,

A few fixes for 2.6.24...also adds Johannes Berg as a mac80211
maintainer, since he probably wrote most of the newest bugs
there... :-)

Thanks,

John

---

Individual patches available here:


http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes-davem

---

The following changes since commit c9927c2bf4f45bb85e8b502ab3fb79ad6483c244:
  Linus Torvalds (1):
Linux 2.6.24-rc1

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
fixes-davem

Jeff Garzik (1):
  mac80211: fix warning created by BIT()

Johannes Berg (1):
  add myself as mac80211 maintainer

Michael Wu (1):
  mac80211: Fix SSID matching in AP selection

 MAINTAINERS  |8 +---
 net/mac80211/ieee80211_sta.c |5 +++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 76b8571..71badfb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2442,13 +2442,15 @@ W:  http://www.tazenda.demon.co.uk/phil/linux-hp
 S: Maintained
 
 MAC80211
-P: Jiri Benc
-M: [EMAIL PROTECTED]
 P: Michael Wu
 M: [EMAIL PROTECTED]
+P: Johannes Berg
+M: [EMAIL PROTECTED]
+P: Jiri Benc
+M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
 W: http://linuxwireless.org/
-T: git kernel.org:/pub/scm/linux/kernel/git/jbenc/mac80211.git
+T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
 S: Maintained
 
 MACVLAN DRIVER
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index f7ffeec..0d996aa 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1182,7 +1182,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct 
net_device *dev,
aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
 
printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x "
-  "status=%d aid=%d)\n",
+  "status=%d aid=%ld)\n",
   dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa),
   capab_info, status_code, aid & ~(BIT(15) | BIT(14)));
 
@@ -2096,7 +2096,8 @@ static int ieee80211_sta_match_ssid(struct 
ieee80211_if_sta *ifsta,
 {
int tmp, hidden_ssid;
 
-   if (!memcmp(ifsta->ssid, ssid, ssid_len))
+   if (ssid_len == ifsta->ssid_len &&
+   !memcmp(ifsta->ssid, ssid, ssid_len))
return 1;
 
if (ifsta->flags & IEEE80211_STA_AUTO_BSSID_SEL)
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Please pull 'fixes-jgarzik' branch of wireless-2.6

2007-10-25 Thread John W. Linville
Jeff,

A few fixes for 2.6.24...

Thanks,

John

---

Individual patches available here:


http://www.kernel.org/pub/linux/kernel/people/linville/wireless-2.6/fixes-jgarzik

---

The following changes since commit c9927c2bf4f45bb85e8b502ab3fb79ad6483c244:
  Linus Torvalds (1):
Linux 2.6.24-rc1

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
fixes-jgarzik

Anton Blanchard (3):
  ipw2100/ipw2200: jiffies_round -> jiffies_round_relative
  rt2x00: jiffies_round -> jiffies_round_relative
  b43/b43legacy: jiffies_round -> jiffies_round_relative

Michael Wu (1):
  rtl8187: Allow multicast frames

Mohamed Abbas (3):
  iwl4965: fix scan problem
  iwl3945: cancel scan on rxon command
  iwl3945: fix direct scan problem

Tomas Winkler (1):
  iwlwifi: fix sending probe request in iwl 4965

mabbas (1):
  iwl4965: fix driver hang related to hardware scan

 drivers/net/wireless/b43/main.c |2 +-
 drivers/net/wireless/b43legacy/main.c   |2 +-
 drivers/net/wireless/ipw2100.c  |   11 +++--
 drivers/net/wireless/ipw2200.c  |6 +-
 drivers/net/wireless/iwlwifi/iwl-4965.c |6 +--
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   56 +++
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   56 +++
 drivers/net/wireless/rt2x00/rt2x00lib.h |2 +-
 drivers/net/wireless/rtl8187_dev.c  |   20 +
 9 files changed, 121 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 9d9ff76..5058e60 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2391,7 +2391,7 @@ out_requeue:
if (b43_debug(dev, B43_DBG_PWORK_FAST))
delay = msecs_to_jiffies(50);
else
-   delay = round_jiffies(HZ * 15);
+   delay = round_jiffies_relative(HZ * 15);
queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay);
 out:
mutex_unlock(&wl->mutex);
diff --git a/drivers/net/wireless/b43legacy/main.c 
b/drivers/net/wireless/b43legacy/main.c
index d09479e..f0e56df 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2260,7 +2260,7 @@ out_requeue:
if (b43legacy_debug(dev, B43legacy_DBG_PWORK_FAST))
delay = msecs_to_jiffies(50);
else
-   delay = round_jiffies(HZ);
+   delay = round_jiffies_relative(HZ);
queue_delayed_work(dev->wl->hw->workqueue,
   &dev->periodic_work, delay);
 out:
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index a6c7904..8d53d08 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1769,7 +1769,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int 
deferred)
if (priv->stop_rf_kill) {
priv->stop_rf_kill = 0;
queue_delayed_work(priv->workqueue, &priv->rf_kill,
-  round_jiffies(HZ));
+  round_jiffies_relative(HZ));
}
 
deferred = 1;
@@ -2086,7 +2086,8 @@ static void isr_indicate_rf_kill(struct ipw2100_priv 
*priv, u32 status)
/* Make sure the RF Kill check timer is running */
priv->stop_rf_kill = 0;
cancel_delayed_work(&priv->rf_kill);
-   queue_delayed_work(priv->workqueue, &priv->rf_kill, round_jiffies(HZ));
+   queue_delayed_work(priv->workqueue, &priv->rf_kill,
+  round_jiffies_relative(HZ));
 }
 
 static void send_scan_event(void *data)
@@ -2123,7 +2124,7 @@ static void isr_scan_complete(struct ipw2100_priv *priv, 
u32 status)
if (!delayed_work_pending(&priv->scan_event_later))
queue_delayed_work(priv->workqueue,
&priv->scan_event_later,
-   round_jiffies(msecs_to_jiffies(4000)));
+   
round_jiffies_relative(msecs_to_jiffies(4000)));
} else {
priv->user_requested_scan = 0;
cancel_delayed_work(&priv->scan_event_later);
@@ -4242,7 +4243,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, 
int disable_radio)
priv->stop_rf_kill = 0;
cancel_delayed_work(&priv->rf_kill);
queue_delayed_work(priv->workqueue, &priv->rf_kill,
-  round_jiffies(HZ));
+  round_jiffies_relative(HZ));
} else
schedule_reset(priv);
}
@@ -5981,7 +5982,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
IPW_DEBUG_RF_KILL("RF Kill active, 

[PATCH] [IPv4] SNMP: Refer correct memory location to display ICMP out-going statistics

2007-10-25 Thread Mitsuru Chinen
While displaying ICMP out-going statistics as Out counters in
/proc/net/snmp, the memory location for ICMP in-coming statistics
was referred by mistake.

Acked-by: David L Stevens <[EMAIL PROTECTED]> 
Signed-off-by: Mitsuru Chinen <[EMAIL PROTECTED]>
---
 net/ipv4/proc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index fd16cb8..b7f7f8a 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -312,7 +312,7 @@ static void icmp_put(struct seq_file *seq)
for (i=0; icmpmibmap[i].name != NULL; i++)
seq_printf(seq, " %lu",
snmp_fold_field((void **) icmpmsg_statistics,
-   icmpmibmap[i].index));
+   icmpmibmap[i].index | 0x100));
 }
 
 /*
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] UDP: Make use of inet_iif() when doing socket lookups.

2007-10-25 Thread David Miller
From: David Stevens <[EMAIL PROTECTED]>
Date: Thu, 25 Oct 2007 14:58:29 -0700

> I don't see any problem with this. If you're using IP_MULTICAST_IF with
> a bound socket, it forces you to use that interface, anyway.
> 
> I'm not sure multicasting works as expected in some other cases with
> bound sockets (looks like there may be some holes to evade the
> binding), but that's in old code. I don't see any problems from this
> patch.
> 
> +-DLS
> 
> Acked-by: David L Stevens <[EMAIL PROTECTED]>

Patch applied, thanks everyone!
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NET: Mark snmp4_icmp_list[] as being unused

2007-10-25 Thread David Miller
From: David Stevens <[EMAIL PROTECTED]>
Date: Thu, 25 Oct 2007 18:27:22 -0700

> [EMAIL PROTECTED] wrote on 10/25/2007 04:05:13 PM:
> 
> > David Stevens <[EMAIL PROTECTED]> wrote:
> > 
> > > What about just removing it, or do you think it's
> > > useful for documentation of the order? Either way,
> > 
> > I don't know whether it's intended to be used for something, perhaps a
> > debugging macro.  Perhaps it should be #if'd out instead.
> 
> It was used for /proc/net/snmp header printing, but
> most of the items in it were moved to a different MIB (by me).
> The new values are printed in a backward-compatible way, but
> maintaining the old order means not using this header map.
> So, long-winded way of saying I believe it should be
> removed, but I missed that when I made it obsolete. :-)

I've checked just such a change into my tree.

Thanks!
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NET: Mark snmp4_icmp_list[] as being unused

2007-10-25 Thread David Stevens
[EMAIL PROTECTED] wrote on 10/25/2007 04:05:13 PM:

> David Stevens <[EMAIL PROTECTED]> wrote:
> 
> > What about just removing it, or do you think it's
> > useful for documentation of the order? Either way,
> 
> I don't know whether it's intended to be used for something, perhaps a
> debugging macro.  Perhaps it should be #if'd out instead.

It was used for /proc/net/snmp header printing, but
most of the items in it were moved to a different MIB (by me).
The new values are printed in a backward-compatible way, but
maintaining the old order means not using this header map.
So, long-winded way of saying I believe it should be
removed, but I missed that when I made it obsolete. :-)

+-DLS

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fried r8169.

2007-10-25 Thread Tom Prince
On Thu, Oct 25, 2007 at 11:36:45PM +0200, Francois Romieu wrote:
> Tom Prince <[EMAIL PROTECTED]> :
> > While testing Linux v2.6.24-rc1, I noticed that my onboard r8169 had
> > disappeared, and the it remained gone when I rebooted to v2.6.23 and 
> > v2.6.22,
> > where it had previously worked.
> 
> [...]
> > I am running x86_64 ASUS Z92T laptop (an OEM version of the A6T).
> > 
> > I have posted dmesg/lspci/config from v2.6.23 (and soon v2.6.24) at 
> >  www.math.uwo.ca/~rprince5/r8169/
> > 
> > Also these appear to be the relevant log messages from when the device was
> > working. Unfortunately, I didn't have the foresight to save dmesg/lspci from
> > before the device disappeared.
> 
> Can you try an older/vendor kernel and power-off the host before restarting ?
> 
> I have experienced something similar. My 8168b returns but the magic spell
> is still not clear.

Thanks.
 
Well, after power cyclic a few times, and reverting to v2.6.23, the card works
again. Unfortunately, I don't have the exact config where the card disappeared
any more, and it now shows up but doesn't work under v2.6.23. I'll spend some
time this weekend, and see if I can track down what causes it to disappear.

One data point: I have a kernel v2.6.23 + patch-2.6.23-rc9-hrt1 and a custom
acpi DSDT that seems to cause the device to disappear.

I have now uploaded dmesg/lspci/config from v2.6.23 from a succesful boot to
www.math.uwo.ca/~rprince5/r8169/

  Tom

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Stephen Hemminger
On Thu, 25 Oct 2007 13:29:08 -0700
"Dale Farnsworth" <[EMAIL PROTECTED]> wrote:

> On Thu, Oct 25, 2007 at 09:41:14PM +0200, Domen Puncer wrote:
> > On 25/10/07 11:57 -0700, Dale Farnsworth wrote:
> > > Domen wrote:
> > > > > use your platform's dma mapping functions, rather than virt_to_phys()
> > > > > 
> > > > > it might be the exact same implementation, inside the platform 
> > > > > internals, but drivers should not be using this directly.
> > > > 
> > > > I've replaced this with dma_map_single(), unmatched with
> > > > dma_unmap_single(), since bestcomm doesn't have a way to do that
> > > > and it's blank on ppc32 anyway.
> > > > 
> > > > Is this OK? PPC guys?
> > > 
> > > Even though dma_unmap_single() may be a no-op, calls to
> > > dma_map_single() must be matched with calls to dma_unmap_single().
> > > 
> > > Perhaps with the additions below:
> > > 
> > > > +static void mpc52xx_fec_free_rx_buffers(struct bcom_task *s)
> > > > +{
> > > > +   struct sk_buff *skb;
> > > > +
> > > > +   while (!bcom_queue_empty(s)) {
> > > > +   skb = bcom_retrieve_buffer(s, NULL, NULL);
> > > 
> > >   dma_unmap_single(&skb->dev->dev, skb-data,
> > >FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
> > 
> > It looks to me like dma_unmap_single takes the mapped address
> > (what dma_map_single returned), and not the address we're mapping
> > (skb->data).
> 
> Yeah.  Sorry.  That won't be so easy.  We'll either need to
> squirrel away the mapped address, or change the interface to
> bcom_retrieve_buffers() so we can get the address.
> 
> IMO, it's still a requirement that we call dma_unmap_single() for
> each call to dma_map_single().
> 

There exist some macro's for pci stuff to handle the nop case well
see: pci_unmap_addr(), pci_unmap_len().

-- 
Stephen Hemminger <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NET: Mark snmp4_icmp_list[] as being unused

2007-10-25 Thread David Howells
David Stevens <[EMAIL PROTECTED]> wrote:

> What about just removing it, or do you think it's
> useful for documentation of the order? Either way,

I don't know whether it's intended to be used for something, perhaps a
debugging macro.  Perhaps it should be #if'd out instead.

David
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Jeff Garzik

Dale Farnsworth wrote:

IMO, it's still a requirement that we call dma_unmap_single() for
each call to dma_map_single().


Yep...


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6.25 patch] the planned eepro100 removal

2007-10-25 Thread Kok, Auke
Jeff Garzik wrote:
> Bill Davidsen wrote:
>> Adrian Bunk wrote:
>>> This patch contains the planned removal of the eepro100 driver.
>>>
>> Are the e100 people satisfied that e100 now handles all known cases? I 
> 
> Nope.  There are still e100 work outstanding that means we cannot kill
> eepro100.

Agreed, there is still a receive unit hang in the last version that I got from
David Acker.

Auke
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6.25 patch] the planned eepro100 removal

2007-10-25 Thread Jeff Garzik

Bill Davidsen wrote:

Adrian Bunk wrote:

This patch contains the planned removal of the eepro100 driver.

Are the e100 people satisfied that e100 now handles all known cases? I 


Nope.  There are still e100 work outstanding that means we cannot kill 
eepro100.


Jeff


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] UDP: Make use of inet_iif() when doing socket lookups.

2007-10-25 Thread David Miller
From: David Stevens <[EMAIL PROTECTED]>
Date: Thu, 25 Oct 2007 14:58:29 -0700

> I don't see any problem with this. If you're using IP_MULTICAST_IF with
> a bound socket, it forces you to use that interface, anyway.
> 
> I'm not sure multicasting works as expected in some other cases with
> bound sockets (looks like there may be some holes to evade the
> binding), but that's in old code. I don't see any problems from this
> patch.
> 
> +-DLS
> 
> Acked-by: David L Stevens <[EMAIL PROTECTED]>

Thanks for reviewing David.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NET: Mark snmp4_icmp_list[] as being unused

2007-10-25 Thread David Stevens
What about just removing it, or do you think it's
useful for documentation of the order? Either way,

Acked-by: David L Stevens <[EMAIL PROTECTED]>

+-DLS

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] UDP: Make use of inet_iif() when doing socket lookups.

2007-10-25 Thread David Stevens
I don't see any problem with this. If you're using IP_MULTICAST_IF with
a bound socket, it forces you to use that interface, anyway.

I'm not sure multicasting works as expected in some other cases with
bound sockets (looks like there may be some holes to evade the
binding), but that's in old code. I don't see any problems from this
patch.

+-DLS

Acked-by: David L Stevens <[EMAIL PROTECTED]>

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fried r8169.

2007-10-25 Thread Francois Romieu
Tom Prince <[EMAIL PROTECTED]> :
> While testing Linux v2.6.24-rc1, I noticed that my onboard r8169 had
> disappeared, and the it remained gone when I rebooted to v2.6.23 and v2.6.22,
> where it had previously worked.

[...]
> I am running x86_64 ASUS Z92T laptop (an OEM version of the A6T).
> 
> I have posted dmesg/lspci/config from v2.6.23 (and soon v2.6.24) at 
>  www.math.uwo.ca/~rprince5/r8169/
> 
> Also these appear to be the relevant log messages from when the device was
> working. Unfortunately, I didn't have the foresight to save dmesg/lspci from
> before the device disappeared.

Can you try an older/vendor kernel and power-off the host before restarting ?

I have experienced something similar. My 8168b returns but the magic spell
is still not clear.

[...]
> kernel: r8169 Gigabit Ethernet driver 2.2LK-NAPI loaded
> kernel: ACPI: PCI Interrupt Link [LNEA] enabled at IRQ 16
> kernel: ACPI: PCI Interrupt :01:00.0[A] -> Link [LNEA] -> GSI 16 (level, 
> low) -> IRQ 16
> kernel: PCI: Setting latency timer of device :01:00.0 to 64
> kernel: eth1: RTL8168b/8111b at 0xc200020e2000, 00:18:f3:87:0b:bb, XID 
> 3800 IRQ 16

8168b as well. Okay...

-- 
Ueimor
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/4] e1000e: Fix jumbo frame receive code.

2007-10-25 Thread Kok, Auke
Auke Kok wrote:
> Fix allocation and freeing of jumbo frames where several bugs
> were recently introduced by cleanups after we forked this code
> from e1000. This moves ps_pages to buffer_info where it really
> belongs and makes it a dynamically allocated array. The penalty
> is not that high since it's allocated outside of the buffer_info
> struct anyway.
> 
> Without this patch all jumbo frames are completely broken and the
> driver panics.


Jeff,

I strongly suggest that you apply patches #1 and #2 (but preferably all) to
#upstream-fixes since these patches fix the -absolutely- broken jumbo frames 
code
in e1000e. On top of that patches #1 and #2 only touch the jumbo frame codepath,
so the impact is zero to the normal way people use these cards.

patch #3 is an optimization, patch #4 is mostly cosmetical.

Cheers,

Auke
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] e1000e: Re-enable SECRC - crc stripping

2007-10-25 Thread Auke Kok
This workaround code performed software stripping instead of the
hardware which can do it much faster. None of the e1000e target
hardware has issues with this feature and should work fine. This
gives us some performance back on receive, and removes some
kludging stripping the 4 bytes.

Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000e/netdev.c |   19 ++-
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index e87ed31..03fcc70 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -494,10 +494,6 @@ static bool e1000_clean_rx_irq(struct e1000_adapter 
*adapter,
goto next_desc;
}
 
-   /* adjust length to remove Ethernet CRC */
-   length -= 4;
-
-   /* probably a little skewed due to removing CRC */
total_rx_bytes += length;
total_rx_packets++;
 
@@ -964,8 +960,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter 
*adapter,
kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
pci_dma_sync_single_for_device(pdev, ps_page->dma,
PAGE_SIZE, PCI_DMA_FROMDEVICE);
-   /* remove the CRC */
-   l1 -= 4;
+
skb_put(skb, l1);
goto copydone;
} /* if */
@@ -987,10 +982,6 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter 
*adapter,
skb->truesize += length;
}
 
-   /* strip the ethernet crc, problem is we're using pages now so
-* this whole operation can get a little cpu intensive */
-   pskb_trim(skb, skb->len - 4);
-
 copydone:
total_rx_bytes += skb->len;
total_rx_packets++;
@@ -2034,9 +2025,11 @@ static void e1000_setup_rctl(struct e1000_adapter 
*adapter)
 
ew32(RFCTL, rfctl);
 
-   /* disable the stripping of CRC because it breaks
-* BMC firmware connected over SMBUS */
-   rctl |= E1000_RCTL_DTYP_PS /* | E1000_RCTL_SECRC */;
+   /* Enable Packet split descriptors */
+   rctl |= E1000_RCTL_DTYP_PS;
+   
+   /* Enable hardware CRC frame stripping */
+   rctl |= E1000_RCTL_SECRC;
 
psrctl |= adapter->rx_ps_bsize0 >>
E1000_PSRCTL_BSIZE0_SHIFT;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] e1000e: Fix PBA calculation for jumbo frame packets

2007-10-25 Thread Auke Kok
Upon inspection the rx FIFO size calculation code was found to have
2 significant flaws: A superfluous minus sign resulting in the
wrong size to be used for jumbo frames on 82573 and ich9, as well
as that this code rewrote the read-only adapter->pba variable
resulting in different values at each run.

Without this patch jumbo's will work but performance will be
awkward since the TX size is not adequate for two whole frames.

Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000e/netdev.c |   22 +-
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 46c5ac6..e87ed31 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2328,8 +2328,11 @@ void e1000e_reset(struct e1000_adapter *adapter)
struct e1000_mac_info *mac = &adapter->hw.mac;
struct e1000_hw *hw = &adapter->hw;
u32 tx_space, min_tx_space, min_rx_space;
+   u32 pba;
u16 hwm;
 
+   ew32(PBA, adapter->pba);
+
if (mac->max_frame_size > ETH_FRAME_LEN + ETH_FCS_LEN ) {
/* To maintain wire speed transmits, the Tx FIFO should be
 * large enough to accommodate two full transmit packets,
@@ -2337,11 +2340,11 @@ void e1000e_reset(struct e1000_adapter *adapter)
 * the Rx FIFO should be large enough to accommodate at least
 * one full receive packet and is similarly rounded up and
 * expressed in KB. */
-   adapter->pba = er32(PBA);
+   pba = er32(PBA);
/* upper 16 bits has Tx packet buffer allocation size in KB */
-   tx_space = adapter->pba >> 16;
+   tx_space = pba >> 16;
/* lower 16 bits has Rx packet buffer allocation size in KB */
-   adapter->pba &= 0x;
+   pba &= 0x;
/* the tx fifo also stores 16 bytes of information about the tx
 * but don't include ethernet FCS because hardware appends it */
min_tx_space = (mac->max_frame_size +
@@ -2357,20 +2360,21 @@ void e1000e_reset(struct e1000_adapter *adapter)
/* If current Tx allocation is less than the min Tx FIFO size,
 * and the min Tx FIFO size is less than the current Rx FIFO
 * allocation, take space away from current Rx allocation */
-   if (tx_space < min_tx_space &&
-   ((min_tx_space - tx_space) < adapter->pba)) {
-   adapter->pba -= - (min_tx_space - tx_space);
+   if ((tx_space < min_tx_space) &&
+   ((min_tx_space - tx_space) < pba)) {
+   pba -= min_tx_space - tx_space;
 
/* if short on rx space, rx wins and must trump tx
 * adjustment or use Early Receive if available */
-   if ((adapter->pba < min_rx_space) &&
+   if ((pba < min_rx_space) &&
(!(adapter->flags & FLAG_HAS_ERT)))
/* ERT enabled in e1000_configure_rx */
-   adapter->pba = min_rx_space;
+   pba = min_rx_space;
}
+
+   ew32(PBA, pba);
}
 
-   ew32(PBA, adapter->pba);
 
/* flow control settings */
/* The high water mark must be low enough to fit one full frame
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] e1000e: Remove legacy jumbo frame receive code

2007-10-25 Thread Auke Kok
The legacy jumbo frame receive code is no longer needed since all
hardware can do packet split and we're no longer offering a bypass
kernel config option to disable packet split. Remove the unused code.

Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000e/e1000.h  |1 
 drivers/net/e1000e/netdev.c |  282 ---
 2 files changed, 1 insertions(+), 282 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 811eada..473f78d 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -122,7 +122,6 @@ struct e1000_buffer {
u16 next_to_watch;
};
/* RX */
-   struct page *page;
/* arrays of page information for packet split */
struct e1000_ps_page *ps_pages;
};
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 03fcc70..4fd2e23 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -333,94 +333,6 @@ no_buffers:
 }
 
 /**
- * e1000_alloc_rx_buffers_jumbo - Replace used jumbo receive buffers
- *
- * @adapter: address of board private structure
- * @cleaned_count: number of buffers to allocate this pass
- **/
-static void e1000_alloc_rx_buffers_jumbo(struct e1000_adapter *adapter,
-int cleaned_count)
-{
-   struct net_device *netdev = adapter->netdev;
-   struct pci_dev *pdev = adapter->pdev;
-   struct e1000_ring *rx_ring = adapter->rx_ring;
-   struct e1000_rx_desc *rx_desc;
-   struct e1000_buffer *buffer_info;
-   struct sk_buff *skb;
-   unsigned int i;
-   unsigned int bufsz = 256 -
-16 /*for skb_reserve */ -
-NET_IP_ALIGN;
-
-   i = rx_ring->next_to_use;
-   buffer_info = &rx_ring->buffer_info[i];
-
-   while (cleaned_count--) {
-   skb = buffer_info->skb;
-   if (skb) {
-   skb_trim(skb, 0);
-   goto check_page;
-   }
-
-   skb = netdev_alloc_skb(netdev, bufsz);
-   if (!skb) {
-   /* Better luck next round */
-   adapter->alloc_rx_buff_failed++;
-   break;
-   }
-
-   /* Make buffer alignment 2 beyond a 16 byte boundary
-* this will result in a 16 byte aligned IP header after
-* the 14 byte MAC header is removed
-*/
-   skb_reserve(skb, NET_IP_ALIGN);
-
-   buffer_info->skb = skb;
-check_page:
-   /* allocate a new page if necessary */
-   if (!buffer_info->page) {
-   buffer_info->page = alloc_page(GFP_ATOMIC);
-   if (!buffer_info->page) {
-   adapter->alloc_rx_buff_failed++;
-   break;
-   }
-   }
-
-   if (!buffer_info->dma)
-   buffer_info->dma = pci_map_page(pdev,
-   buffer_info->page, 0,
-   PAGE_SIZE,
-   PCI_DMA_FROMDEVICE);
-   if (pci_dma_mapping_error(buffer_info->dma)) {
-   dev_err(&adapter->pdev->dev, "RX DMA page map 
failed\n");
-   adapter->rx_dma_failed++;
-   break;
-   }
-
-   rx_desc = E1000_RX_DESC(*rx_ring, i);
-   rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
-
-   i++;
-   if (i == rx_ring->count)
-   i = 0;
-   buffer_info = &rx_ring->buffer_info[i];
-   }
-
-   if (rx_ring->next_to_use != i) {
-   rx_ring->next_to_use = i;
-   if (i-- == 0)
-   i = (rx_ring->count - 1);
-
-   /* Force memory writes to complete before letting h/w
-* know there are new descriptors to fetch.  (Only
-* applicable for weak-ordered memory model archs,
-* such as IA-64). */
-   wmb();
-   writel(i, adapter->hw.hw_addr + rx_ring->tail);
-   }
-}
-
-/**
  * e1000_clean_rx_irq - Send received data up the network stack; legacy
  * @adapter: board private structure
  *
@@ -549,15 +461,6 @@ next_desc:
return cleaned;
 }
 
-static void e1000_consume_page(struct e1000_buffer *bi, struct sk_buff *skb,
-  u16 length)
-{
-   bi->page = NULL;
-   skb->len += length;
-   skb->data_len += length;
-   skb->truesize += length;
-}
-
 static void e1000_put_txbuf(struct e1000_adapter *adapter,
 struct e1000_buffer *buffer_info)
 {
@@ -694,174 +597,6 @@ stat

[PATCH 1/4] e1000e: Fix jumbo frame receive code.

2007-10-25 Thread Auke Kok
Fix allocation and freeing of jumbo frames where several bugs
were recently introduced by cleanups after we forked this code
from e1000. This moves ps_pages to buffer_info where it really
belongs and makes it a dynamically allocated array. The penalty
is not that high since it's allocated outside of the buffer_info
struct anyway.

Without this patch all jumbo frames are completely broken and the
driver panics.

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: Auke Kok <[EMAIL PROTECTED]>
---

 drivers/net/e1000e/e1000.h  |4 +-
 drivers/net/e1000e/netdev.c |  102 ++-
 2 files changed, 54 insertions(+), 52 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index d2499bb..811eada 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -123,6 +123,8 @@ struct e1000_buffer {
};
/* RX */
struct page *page;
+   /* arrays of page information for packet split */
+   struct e1000_ps_page *ps_pages;
};
 
 };
@@ -142,8 +144,6 @@ struct e1000_ring {
/* array of buffer information structs */
struct e1000_buffer *buffer_info;
 
-   /* arrays of page information for packet split */
-   struct e1000_ps_page *ps_pages;
struct sk_buff *rx_skb_top;
 
struct e1000_queue_stats stats;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 033e124..46c5ac6 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -245,37 +245,36 @@ static void e1000_alloc_rx_buffers_ps(struct 
e1000_adapter *adapter,
rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
 
for (j = 0; j < PS_PAGE_BUFFERS; j++) {
-   ps_page = &rx_ring->ps_pages[(i * PS_PAGE_BUFFERS)
-+ j];
-   if (j < adapter->rx_ps_pages) {
+   ps_page = &buffer_info->ps_pages[j];
+   if (j >= adapter->rx_ps_pages) {
+   /* all unused desc entries get hw null ptr */
+   rx_desc->read.buffer_addr[j+1] = ~0;
+   continue;
+   }
+   if (!ps_page->page) {
+   ps_page->page = alloc_page(GFP_ATOMIC);
if (!ps_page->page) {
-   ps_page->page = alloc_page(GFP_ATOMIC);
-   if (!ps_page->page) {
-   adapter->alloc_rx_buff_failed++;
-   goto no_buffers;
-   }
-   ps_page->dma = pci_map_page(pdev,
-  ps_page->page,
-  0, PAGE_SIZE,
-  PCI_DMA_FROMDEVICE);
-   if (pci_dma_mapping_error(
-   ps_page->dma)) {
-   dev_err(&adapter->pdev->dev,
- "RX DMA page map failed\n");
-   adapter->rx_dma_failed++;
-   goto no_buffers;
-   }
+   adapter->alloc_rx_buff_failed++;
+   goto no_buffers;
+   }
+   ps_page->dma = pci_map_page(pdev,
+  ps_page->page,
+  0, PAGE_SIZE,
+  PCI_DMA_FROMDEVICE);
+   if (pci_dma_mapping_error(ps_page->dma)) {
+   dev_err(&adapter->pdev->dev,
+ "RX DMA page map failed\n");
+   adapter->rx_dma_failed++;
+   goto no_buffers;
}
-   /*
-* Refresh the desc even if buffer_addrs
-* didn't change because each write-back
-* erases this info.
-*/
-   rx_desc->read.buffer_addr[j+1] =
-cpu_to_le64(ps_page->dma);
-   } else {
-   rx_desc->read.buffer_addr[j+1] = ~0;
}
+   /*
+* Refresh the desc ev

Re: [2.6.25 patch] the planned eepro100 removal

2007-10-25 Thread Bill Davidsen

Adrian Bunk wrote:

This patch contains the planned removal of the eepro100 driver.

Are the e100 people satisfied that e100 now handles all known cases? I 
remember that there were corner cases e100 didn't handle, have they all 
been fixed?


--
Bill Davidsen <[EMAIL PROTECTED]>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Dale Farnsworth
On Thu, Oct 25, 2007 at 09:41:14PM +0200, Domen Puncer wrote:
> On 25/10/07 11:57 -0700, Dale Farnsworth wrote:
> > Domen wrote:
> > > > use your platform's dma mapping functions, rather than virt_to_phys()
> > > > 
> > > > it might be the exact same implementation, inside the platform 
> > > > internals, but drivers should not be using this directly.
> > > 
> > > I've replaced this with dma_map_single(), unmatched with
> > > dma_unmap_single(), since bestcomm doesn't have a way to do that
> > > and it's blank on ppc32 anyway.
> > > 
> > > Is this OK? PPC guys?
> > 
> > Even though dma_unmap_single() may be a no-op, calls to
> > dma_map_single() must be matched with calls to dma_unmap_single().
> > 
> > Perhaps with the additions below:
> > 
> > > +static void mpc52xx_fec_free_rx_buffers(struct bcom_task *s)
> > > +{
> > > + struct sk_buff *skb;
> > > +
> > > + while (!bcom_queue_empty(s)) {
> > > + skb = bcom_retrieve_buffer(s, NULL, NULL);
> > 
> > dma_unmap_single(&skb->dev->dev, skb-data,
> >  FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
> 
> It looks to me like dma_unmap_single takes the mapped address
> (what dma_map_single returned), and not the address we're mapping
> (skb->data).

Yeah.  Sorry.  That won't be so easy.  We'll either need to
squirrel away the mapped address, or change the interface to
bcom_retrieve_buffers() so we can get the address.

IMO, it's still a requirement that we call dma_unmap_single() for
each call to dma_map_single().

-Dale
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Bugme-new] [Bug 9225] New: typhoon : "no descs for cmd, had (needed) 0 (1) cmd, 31 (7) resp"

2007-10-25 Thread Andrew Morton
On Thu, 25 Oct 2007 06:45:42 -0700 (PDT)
[EMAIL PROTECTED] wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9225
> 
>Summary: typhoon : "no descs for cmd, had (needed) 0 (1) cmd, 31
> (7) resp"
>Product: Drivers
>Version: 2.5
>  KernelVersion: 2.6.23.1 SMP PREEMPT
>   Platform: All
> OS/Version: Linux
>   Tree: Mainline
> Status: NEW
>   Severity: high
>   Priority: P1
>  Component: Network
> AssignedTo: [EMAIL PROTECTED]
> ReportedBy: [EMAIL PROTECTED]
> 
> 
> Most recent kernel where this bug did not occur: none
> Distribution: Fedora Core 4
> Hardware Environment: Intel 845 chipset, 3 x 3C990-FX-97 NICs
> Software Environment:
> Problem Description:
>  Our dmesg buffer fill of these messages
> 
> eth1: no descs for cmd, had (needed) 0 (1) cmd, 31 (7) resp
> eth1: error getting stats
> eth1: no descs for cmd, had (needed) 0 (1) cmd, 31 (7) resp
> eth1: error getting stats
> eth1: no descs for cmd, had (needed) 0 (1) cmd, 31 (7) resp
> eth1: error getting stats
> 
> and so one.
> 
>  After for days of working we got kernel panic.
> 
> Steps to reproduce:

(switching to email - please respond via reply-to-all, not via the bugzilla
web interface)

typhoon.c doesn't appear to have a maintainer.  

It oopsed in typhoon_rx - there's a jpg attached to the bugzilla report.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Domen Puncer
On 25/10/07 11:57 -0700, Dale Farnsworth wrote:
> Domen wrote:
> > > use your platform's dma mapping functions, rather than virt_to_phys()
> > > 
> > > it might be the exact same implementation, inside the platform 
> > > internals, but drivers should not be using this directly.
> > 
> > I've replaced this with dma_map_single(), unmatched with
> > dma_unmap_single(), since bestcomm doesn't have a way to do that
> > and it's blank on ppc32 anyway.
> > 
> > Is this OK? PPC guys?
> 
> Even though dma_unmap_single() may be a no-op, calls to
> dma_map_single() must be matched with calls to dma_unmap_single().
> 
> Perhaps with the additions below:
> 
> > +static void mpc52xx_fec_free_rx_buffers(struct bcom_task *s)
> > +{
> > +   struct sk_buff *skb;
> > +
> > +   while (!bcom_queue_empty(s)) {
> > +   skb = bcom_retrieve_buffer(s, NULL, NULL);
> 
>   dma_unmap_single(&skb->dev->dev, skb-data,
>FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);

It looks to me like dma_unmap_single takes the mapped address
(what dma_map_single returned), and not the address we're mapping
(skb->data).


Domen
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Dale Farnsworth
Domen wrote:
> > use your platform's dma mapping functions, rather than virt_to_phys()
> > 
> > it might be the exact same implementation, inside the platform 
> > internals, but drivers should not be using this directly.
> 
> I've replaced this with dma_map_single(), unmatched with
> dma_unmap_single(), since bestcomm doesn't have a way to do that
> and it's blank on ppc32 anyway.
> 
> Is this OK? PPC guys?

Even though dma_unmap_single() may be a no-op, calls to
dma_map_single() must be matched with calls to dma_unmap_single().

Perhaps with the additions below:

> +static void mpc52xx_fec_free_rx_buffers(struct bcom_task *s)
> +{
> + struct sk_buff *skb;
> +
> + while (!bcom_queue_empty(s)) {
> + skb = bcom_retrieve_buffer(s, NULL, NULL);

dma_unmap_single(&skb->dev->dev, skb-data,
 FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);

> + kfree_skb(skb);
> + }
> +}
> +
> +static int mpc52xx_fec_alloc_rx_buffers(struct net_device *dev, struct
> bcom_task *rxtsk)
> +{
> + while (!bcom_queue_full(rxtsk)) {
> + struct sk_buff *skb;
> + struct bcom_fec_bd *bd;
> +
> + skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
> + if (skb == NULL)
> + return -EAGAIN;

skb->dev = dev;

> +
> + /* zero out the initial receive buffers to aid debugging */
> + memset(skb->data, 0, FEC_RX_BUFFER_SIZE);
> +
> + bd = (struct bcom_fec_bd *)bcom_prepare_next_buffer(rxtsk);
> +
> + bd->status = FEC_RX_BUFFER_SIZE;
> + bd->skb_pa = dma_map_single(&dev->dev, skb->data,
> + FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
> +
> + bcom_submit_next_buffer(rxtsk, skb);
> + }
> +
> + return 0;
> +}

[...]

> +static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct
> net_device *dev)
> +{
> + struct mpc52xx_fec_priv *priv = netdev_priv(dev);
> + struct bcom_fec_bd *bd;
> +
> + if (bcom_queue_full(priv->tx_dmatsk)) {
> + if (net_ratelimit())
> + dev_err(&dev->dev, "transmit queue overrun\n");
> + return 1;
> + }
> +
> + spin_lock_irq(&priv->lock);
> + dev->trans_start = jiffies;
> +
> + bd = (struct bcom_fec_bd *)
> + bcom_prepare_next_buffer(priv->tx_dmatsk);
> +
> + bd->status = skb->len | BCOM_FEC_TX_BD_TFD | BCOM_FEC_TX_BD_TC;
> + bd->skb_pa = dma_map_single(&dev->dev, skb->data, skb->len, 
> DMA_TO_DEVICE);
> +
> + bcom_submit_next_buffer(priv->tx_dmatsk, skb);
> +
> + if (bcom_queue_full(priv->tx_dmatsk)) {
> + netif_stop_queue(dev);
> + }
> +
> + spin_unlock_irq(&priv->lock);
> +
> + return 0;
> +}
> +
> +/* This handles BestComm transmit task interrupts
> + */
> +static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
> +{
> + struct net_device *dev = dev_id;
> + struct mpc52xx_fec_priv *priv = netdev_priv(dev);
> +
> + spin_lock(&priv->lock);
> +
> + while (bcom_buffer_done(priv->tx_dmatsk)) {
> + struct sk_buff *skb;
> + skb = bcom_retrieve_buffer(priv->tx_dmatsk, NULL, NULL);
> + /* Here (and in rx routines) would be a good place for
> +  * dma_unmap_single(), but bcom doesn't return bcom_bd of the
> +  * finished transfer, and _unmap is empty on this platfrom.
> +  */

Replace the above comment with:

dma_unmap_single(&dev->dev, skb->data,
 skb->len, DMA_TO_DEVICE);

> +
> + dev_kfree_skb_irq(skb);
> + }
> +
> + netif_wake_queue(dev);
> +
> + spin_unlock(&priv->lock);
> +
> + return IRQ_HANDLED;
> +}
> +
> +static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
> +{
> + struct net_device *dev = dev_id;
> + struct mpc52xx_fec_priv *priv = netdev_priv(dev);
> +
> + while (bcom_buffer_done(priv->rx_dmatsk)) {
> + struct sk_buff *skb;
> + struct sk_buff *rskb;
> + struct bcom_fec_bd *bd;
> + u32 status;
> +
> + rskb = bcom_retrieve_buffer(priv->rx_dmatsk, &status, NULL);

dma_unmap_single(&dev->dev, rskb->data,
 FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);

> +
> + /* Test for errors in received frame */
> + if (status & BCOM_FEC_RX_BD_ERRORS) {
> + /* Drop packet and reuse the buffer */
> + bd = (struct bcom_fec_bd *)
> + bcom_prepare_next_buffer(priv->rx_dmatsk);
> +
> + bd->status = FEC_RX_BUFFER_SIZE;
> + bd->skb_pa = dma_map_single(&dev->dev, rskb->data,
> + FEC_RX_BUFFER_SIZE, DMA_FROM_DEVICE);
> +
> + bcom_submit_next_buffer(priv->rx_dmatsk, rskb);
> +
> +   

Re: BUG in sys_socketpair

2007-10-25 Thread Chuck Ebbert
On 10/25/2007 10:11 AM, Rich Paul wrote:
> In 2.6.23, there seems to be a minor bug in sys_socketpair.  When the
> calls to sock_alloc_fd fail, it aborts the routine, but it returns the
> variable err, which is not set in this case.
> 
> The result is a silent failure if you have too many files open and call
> socketpair.
> 
> Here is a simple UNTESTED patch (not even compiled) which should resolve the
> issue.
> 
> 
> --- net/socket.c.orig   2007-10-25 10:03:56.0 -0400
> +++ net/socket.c2007-10-25 10:04:00.0 -0400
> @@ -1245,11 +1245,14 @@
> goto out_release_both;
> 
> fd1 = sock_alloc_fd(&newfile1);
> -   if (unlikely(fd1 < 0))
> +   if (unlikely(fd1 < 0)) {
> +   err=fd1;
> goto out_release_both;
> +   }
> 
> fd2 = sock_alloc_fd(&newfile2);
> if (unlikely(fd2 < 0)) {
> +   err=fd2;
> put_filp(newfile1);
> put_unused_fd(fd1);
> goto out_release_both;
> 

Should be "err = fd1" (spaces), otherwise looks good.

Original did:

err = sock_map_fd(sock1);
if (err < 0)
goto out_release_both;
fd1 = err;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: on the topic of alternate MAC addresses

2007-10-25 Thread Eric W. Biederman
Rick Jones <[EMAIL PROTECTED]> writes:

> Eric W. Biederman wrote:
>> Duplicate mac addresses across interfaces on the same machine
>> should generally be a don't care.  Although there may some
>> cases we don't mind.
>
> What might the switches think of that?  Outside of the context of a
> link-aggregate I would think that could do some unhappy things when multiple
> interfaces are connected to the same broadcast domain.
>
> That the "all interfaces have one MAC" default behaviour on SPARC systems 
> often
> ran into troubles is probably cautionary here.

Sure we don't want to duplicate mac addresses globally by default.

The case that is always wrong is duplicate mac addresses going
in and out the same interface, and skimming through the code
it looks like we already have the data structures necessary to
prevent duplicate use of unicast mac addresses already.

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Eric W. Biederman
"Denis V. Lunev" <[EMAIL PROTECTED]> writes:

> Eric W. Biederman wrote:
>> Benjamin Thery <[EMAIL PROTECTED]> writes:
>> 
>>> Eric W. Biederman wrote:
 Benjamin Thery <[EMAIL PROTECTED]> writes:

> Denis V. Lunev wrote:
>> The patch attached should help. The idea is simple. The "init" should be
>> called only once without NETNS. Period. No need for any lists.
> This is the kind of idea I had but I didn't think it could be 
> that simple. :) 
> Thanks Denis.
 It isn't.
>
> this will work due to INIT_LIST_HEAD with circles list to itself and a
> del operation will work.

Suppose I have this fragment of code in a module:

> static int __net_init xt_net_init(struct net *net)
> {
> ...
> }
> 
> static void __net_exit xt_net_exit(struct net *net)
> {
> ...
> }
> 
> static struct pernet_operations __net_initdata  xt_net_ops = {
>   .init = xt_net_init,
>   .exit = xt_net_exit,
> };
> 
> static int __init xt_init(void)
> {
>   return register_pernet_subsys(&xt_net_ops);
> }
> 
> static void __exit xt_fini(void)
> {
>   unregister_pernet_subsys(&xt_net_ops);
> }
> 
> module_init(xt_init);
> module_exit(xt_fini);

What happens during module removal when unregister_pernet_subys calls 
xt_net_ops.exit after xt_net_ops has been removed from the kernels
memory?


> By the way, I think that we can in the case of undefined CONFIG_NET_NS
> reduce register to calling ->init method and unregister to calling
> ->exit method.
>
> This is a correct thing at least for now and will be welcomed by the all
> embedded/etc people.

I'm not fundamentally opposed.  Earlier versions of my patchset
did that and more.   However I think the pain is greater then the
gain right now.  Especially since this concept seem to require
having quality inspected into it.

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: on the topic of alternate MAC addresses

2007-10-25 Thread Rick Jones

Eric W. Biederman wrote:

Duplicate mac addresses across interfaces on the same machine
should generally be a don't care.  Although there may some
cases we don't mind.


What might the switches think of that?  Outside of the context of a 
link-aggregate I would think that could do some unhappy things when multiple 
interfaces are connected to the same broadcast domain.


That the "all interfaces have one MAC" default behaviour on SPARC systems often 
ran into troubles is probably cautionary here.


rick jones
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Bugme-new] [Bug 9224] New: Settings to /proc/sys/net/ipv[46]/conf/all are not propagated

2007-10-25 Thread YOSHIFUJI Hideaki / 吉藤英明
In article <[EMAIL PROTECTED]> (at Thu, 25 Oct 2007 09:16:52 -0700), Andrew 
Morton <[EMAIL PROTECTED]> says:

> > Most recent kernel where this bug did not occur: 2.6.22 (not sure)

> Apparently a regression.

I would say it is a bug, but it is not a regression.
I mean, I believe this "bug" lives since 2.2.

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [linux-pm] QUESTION: How to fix race between .suspend routine and watchdog timer

2007-10-25 Thread Alan Stern
On Thu, 25 Oct 2007, Maxim Levitsky wrote:

> Hi,
> 
> Recently, trying to fix saa7134 suspend/resume problems I found that there 
> is a race between IRQ handler and .suspend , and that I cant let driver 
> access the device
> while its in D3 since it can lock up some systems.
> 
> Now I am looking to fix those issues in two drivers that have my 
> .suspend/.resume routines.
> the saa7134 capture chip and dmfe, the davicom network driver.
> 
> Looking through the dmfe code, I noticed yet another possible race.
> A race between the .suspend, and a timer that serves both as a watchdog, and 
> link state detector.
> Again I need to prevent it from running during the suspend/resume, but how?
> 
> I can use del_timer in .suspend, and mod_timer in .resume, but that doesn't 
> protect against
> race with already running timer.
> I can use del_timer_sync, but it states that it is useless if timer 
> re-enables itself, and I agree with that.
> In dmfe case the timer does re-enable itself.

That comment isn't right.  del_timer_sync works perfectly well even if
the timer routine re-enables itself, provided it stops doing so after a
small number of iterations.

> I can put checks in the timer for ->insuspend, and don't re enable it if set,
> but that opens a new can of worms with memory barriers, etc...

You don't have to worry about any of that stuff.  Just check the 
insuspend flag and don't re-enable the timer if it is set.  Even 
without any memory barriers, the timer routine won't iterate more than 
once or twice.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Denis V. Lunev
Eric W. Biederman wrote:
> Benjamin Thery <[EMAIL PROTECTED]> writes:
> 
>> Eric W. Biederman wrote:
>>> Benjamin Thery <[EMAIL PROTECTED]> writes:
>>>
 Denis V. Lunev wrote:
> The patch attached should help. The idea is simple. The "init" should be
> called only once without NETNS. Period. No need for any lists.
 This is the kind of idea I had but I didn't think it could be 
 that simple. :) 
 Thanks Denis.
>>> It isn't.

this will work due to INIT_LIST_HEAD with circles list to itself and a
del operation will work.

By the way, I think that we can in the case of undefined CONFIG_NET_NS
reduce register to calling ->init method and unregister to calling
->exit method.

This is a correct thing at least for now and will be welcomed by the all
embedded/etc people.

Regards,
Den
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Eric W. Biederman
Benjamin Thery <[EMAIL PROTECTED]> writes:

> Eric W. Biederman wrote:
>> Benjamin Thery <[EMAIL PROTECTED]> writes:
>> 
>>> Denis V. Lunev wrote:
 The patch attached should help. The idea is simple. The "init" should be
 called only once without NETNS. Period. No need for any lists.
>>> This is the kind of idea I had but I didn't think it could be 
>>> that simple. :) 
>>> Thanks Denis.
>> 
>> It isn't.
>> 
 I'll resend it to Dave after the ACK.
>>> Tested on x86_64 with CONFIG_NET_NS=n and y. 
>>> It fixes the issue we observed.
>>>
>>> Acked-by: Benjamin Thery <[EMAIL PROTECTED]>
>> 
>> Try rmmod.
>
> rmmod was part of my tests and it does work.
> I did:
>
> $ iptables --list
>
>   modules x_tables, ip_tables & iptable_filter are loaded
>   each calling register_pernet_subsys.
>
> $ rmmod iptable_filter ip_tables x_tables
>
>   No problem here
>
> $ iptables --list
>
>   To be sure I can load the modules again.

You haven't changed those modules to be mark struct
pernet_operations as __net_initdata have you?

If that is the case the symptoms you are seeing make sense.

Not doing the list walks helps when if it is only compiled in
kernel data structures that are removed.  However if it
is potentially modular data structures that are removed
the dereference of exit in unregister_pernet_subsys will also have
problems.

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Bugme-new] [Bug 9224] New: Settings to /proc/sys/net/ipv[46]/conf/all are not propagated

2007-10-25 Thread Andrew Morton
On Thu, 25 Oct 2007 04:44:06 -0700 (PDT) [EMAIL PROTECTED] wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=9224
> 
>Summary: Settings to /proc/sys/net/ipv[46]/conf/all are not
> propagated
>Product: Networking
>Version: 2.5
>  KernelVersion: 2.6.24-rc1
>   Platform: All
> OS/Version: Linux
>   Tree: Mainline
> Status: NEW
>   Severity: normal
>   Priority: P1
>  Component: Other
> AssignedTo: [EMAIL PROTECTED]
> ReportedBy: [EMAIL PROTECTED]
> 
> 
> Most recent kernel where this bug did not occur: 2.6.22 (not sure)
> Distribution: custom
> Hardware Environment: See attached files
> Software Environment: See attached files.
> Problem Description: Changing a setting in /proc/sys/net/ipv[46]/conf/all does
> not propagate the setting to the individual network interfaces, for most
> settings.
> 
> Steps to reproduce:
> # cat /proc/sys/net/ipv6/conf/{all,default,lo,eth0}/autoconf
> 1
> 1
> 1
> 1
> # echo 0 > /proc/sys/net/ipv6/conf/all/autoconf
> # echo 0 > /proc/sys/net/ipv6/conf/default/autoconf
> # cat /proc/sys/net/ipv6/conf/{all,default,lo,eth0}/autoconf
> 0
> 0
> 1
> 1
> 
> The problem occurs for other settings than "autoconf", but not for all.
> "forwarding" is one which does work.
> 
> Changing settings for individual interfaces still works.
> 
> The problem is not specific to ipv6.
> 

Apparently a regression.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: on the topic of alternate MAC addresses

2007-10-25 Thread Eric W. Biederman
David Miller <[EMAIL PROTECTED]> writes:

> From: Jeff Garzik <[EMAIL PROTECTED]>
> Date: Tue, 23 Oct 2007 22:25:05 -0400
>
>> h.  Using ethtool isn't a big deal, but IMO you probably want more 
>> than just an exported list for the usage you described...  it sounds 
>> like some sort of reservation system should be used, to note which MAC 
>> addresses are [not] in use?
>> 
>> Then a virt client -- or anyone who wants multiple unicast addresses for 
>> whatever reason -- can let other clients to avoid MAC addresses 1, 7, or 
>> 13 (random examples).
>
> I see your point.
>
> However, it's not the virt clients that do this, it's the control
> node (aka: domain 0) which has to manage these things.
>
> It has to manage all of the global hardware resources and allocate
> them out to itself and the clients anyways.
>
> And this is why I think it's sufficient to just publish the list of
> MAC addresses from the driver, and leave the allocation and policy
> to the userland virtualizatin daemon running on the control node.
>
> Let me know if you still disagree.

On the per interface level we know the set of used mac addresses in
the uc_list.

At least at a per interface level we should already have this
information, and this is where we care because duplicates at
that could cause problems.

Duplicate mac addresses across interfaces on the same machine
should generally be a don't care.  Although there may some
cases we don't mind.

Currently drivers like macvlan that care today call
random_ether_addr().  I think it would make sense to convenience
kernel function that picked the next available unicast address
for an interface that was not on the uc_list, (called
random_ether_adder if there was not such address) and called
dev_unicast_add to let the driver receive it and to keep other people
from using it.

Exporting that information with ethtool to handle the strange cases
makes sense.  But it looks like there are easy cases that don't
need that help.

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [IFGROUPv4 2/3] Interface group: core (netlink) part

2007-10-25 Thread Patrick McHardy

Laszlo Attila Toth wrote:

Patrick McHardy írta:

Laszlo Attila Toth wrote:

Interface groups let handle different interfaces together
especially in netfilter modules.
Modified net device structure and netlink interface.

@@ -891,6 +895,13 @@ static int do_setlink(struct net_device *dev, 
struct ifinfomsg *ifm,

 }
 }
 
+if (tb[IFLA_IFGROUP]) {

+write_lock_bh(&dev_base_lock);
+dev->ifgroup = nla_get_u32(tb[IFLA_IFGROUP]);
+write_unlock_bh(&dev_base_lock);
+modified = 1;
+}



The locking looks unnecessary, the rtnl should be enough.
I'm not even sure why its used for operstate and linkmode,
AFAICS they are also protected by the rtnl.



Hm, ok. In this case operstate and linkmode can be unprotected as code 
cleanup, am I right? Or leave them unchanged?



There seems to be a single case where operstate is used without
the rtnl (under dev_base_lock), in dev_get_flags() invoked by
dev_ifsioc_locked(). But that looks like a bug, there are many
callers of dev_change_flags() that only take the rtnl. So this
would be more a fix than a cleanup.


And notification is only needed if something was changed.


Yes.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fried r8169.

2007-10-25 Thread Tom Prince
On Wed, Oct 24, 2007 at 10:11:23PM -0600, Tom Prince wrote:
While testing Linux v2.6.24-rc1, I noticed that my onboard r8169 had
disappeared, and the it remained gone when I rebooted to v2.6.23 and v2.6.22,
where it had previously worked.
 
I have no idea where to begin debugging (or even reproducing) this, but am
quite willing to provide whatever additional details are requested.

I am running x86_64 ASUS Z92T laptop (an OEM version of the A6T).

I have posted dmesg/lspci/config from v2.6.23 (and soon v2.6.24) at 
 www.math.uwo.ca/~rprince5/r8169/

Also these appear to be the relevant log messages from when the device was
working. Unfortunately, I didn't have the foresight to save dmesg/lspci from
before the device disappeared.

kernel: r8169 Gigabit Ethernet driver 2.2LK-NAPI loaded
kernel: ACPI: PCI Interrupt Link [LNEA] enabled at IRQ 16
kernel: ACPI: PCI Interrupt :01:00.0[A] -> Link [LNEA] -> GSI 16 (level, 
low) -> IRQ 16
kernel: PCI: Setting latency timer of device :01:00.0 to 64
kernel: eth1: RTL8168b/8111b at 0xc200020e2000, 00:18:f3:87:0b:bb, XID 
3800 IRQ 16

  Tom

[PS Please CC me.]

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: D-Link DFE-580TX and snmpd problems, who's maintainer of sundance.c ?

2007-10-25 Thread Volker Sauer
On Mi, 24 Okt 2007, Francois Romieu <[EMAIL PROTECTED]> wrote:
> > So the questions is: why? What is this good for?
> > And: can I remove it? I can not abandon snmpd and the messages spam my
> > syslog.
> > Or: do I have to patch snmpd?
> 
> Please try the attached patch.
> 

Hi Francois,

the patch solves the problem. Thank you.

Regards
Volker

-- 
  Volker Sauer  *  Poststrasse 1/601   *   64293 Darmstadt  *   Germany
  E-Mail/Jabber: volker(at)volker-sauer.de * http://www.volker-sauer.de
  PGPKey-Fingerprint: DB26 11C7 B12E 0B27 3999 2E4F 7E35 4E4D 5DD5 D0E0
  http://wwwkeys.de.pgp.net/pks/lookup?op=get&search=0x7E354E4D5DD5D0E0 


signature.asc
Description: Digital signature


Re: [IFGROUPv4 2/3] Interface group: core (netlink) part

2007-10-25 Thread Laszlo Attila Toth

Patrick McHardy írta:

Laszlo Attila Toth wrote:

Interface groups let handle different interfaces together
especially in netfilter modules.
Modified net device structure and netlink interface.

@@ -891,6 +895,13 @@ static int do_setlink(struct net_device *dev, 
struct ifinfomsg *ifm,

 }
 }
 
+if (tb[IFLA_IFGROUP]) {

+write_lock_bh(&dev_base_lock);
+dev->ifgroup = nla_get_u32(tb[IFLA_IFGROUP]);
+write_unlock_bh(&dev_base_lock);
+modified = 1;
+}



The locking looks unnecessary, the rtnl should be enough.
I'm not even sure why its used for operstate and linkmode,
AFAICS they are also protected by the rtnl.



Hm, ok. In this case operstate and linkmode can be unprotected as code 
cleanup, am I right? Or leave them unchanged?

And notification is only needed if something was changed.

--
Attila
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [IFGROUPv4 iptables] Interface group match

2007-10-25 Thread Patrick McHardy

Laszlo Attila Toth wrote:

+++ extensions/libxt_ifgroup.c  (revision 0)
@@ -0,0 +1,196 @@
+/* 
+ * Shared library add-on to iptables to match 
+ * packets by the incoming interface group.

+ *
+ * (c) 2006, 2007 Balazs Scheidler <[EMAIL PROTECTED]>,
+ * Laszlo Attila Toth <[EMAIL PROTECTED]>
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void
+ifgroup_help(void)
+{
+   printf(
+"ifgroup v%s options:\n"
+"  --ifgroup-in  [!] group[/mask]  incoming interface group and its mask\n"
+"  --ifgroup-out [!] group[/mask]  outgoing interface group and its mask\n"
+"\n", IPTABLES_VERSION);
+}
+
+static struct option opts[] = {
+   {"ifgroup-in", 1, 0, '1'},
+   {"ifgroup-out", 1, 0, '2'},


The third member is a pointer, please use NULL.


+   { }
+};
+
+#define PARAM_MATCH_IN 0x01
+#define PARAM_MATCH_OUT0x02
+
+static int
+ifgroup_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
+{
+   struct xt_ifgroup_info *info =
+(struct xt_ifgroup_info *) (*match)->data;
+   char *end;
+   
+   switch (c)
+   {


This goes on the same line as the switch statement please.


+   case '1':


And please no extra indentation for the case labels.


+   if (*flags & PARAM_MATCH_IN)
+   exit_error(PARAMETER_PROBLEM,
+   "ifgroup match: Can't specify --ifgroup-in 
twice");
+
+   check_inverse(optarg, &invert, &optind, 0);
+   
+   info->in_group = strtoul(optarg, &end, 0);
+   info->in_mask = 0xUL;


in_mask is not an unsigned long but an unsigned int.


+   
+   if (*end == '/')
+   info->in_mask = strtoul(end+1, &end, 0);
+
+   if (*end != '\0' || end == optarg)
+   exit_error(PARAMETER_PROBLEM,
+ "ifgroup match: Bad ifgroup value 
`%s'",
+  optarg);
+   
+   if (invert)
+   info->flags |= XT_IFGROUP_INVERT_IN;
+
+   *flags |= PARAM_MATCH_IN;
+   info->flags |= XT_IFGROUP_MATCH_IN;  
+   break;
+   case '2':
+   if (*flags & PARAM_MATCH_OUT)
+   exit_error(PARAMETER_PROBLEM,
+ "ifgroup match: Can't specify "
+ "--ifgroup-out twice");
+
+   check_inverse(optarg, &invert, &optind, 0);
+   
+   info->out_group = strtoul(optarg, &end, 0);
+   info->out_mask = 0xUL;
+   
+   if (*end == '/')
+   info->out_mask = strtoul(end+1, &end, 0);
+
+   if (*end != '\0' || end == optarg)
+   exit_error(PARAMETER_PROBLEM,
+ "ifgroup match: Bad ifgroup "
+ "value `%s'",
+  optarg);
+   
+   if (invert)
+   info->flags |= XT_IFGROUP_INVERT_OUT;
+
+   *flags |= PARAM_MATCH_OUT;
+   info->flags |= XT_IFGROUP_MATCH_OUT; 
+   break;
+		default: 
+			return 0;

+   }
+
+   return 1;
+}
+
+static void
+ifgroup_final_check(unsigned int flags)
+{
+   if (!flags)
+   exit_error(PARAMETER_PROBLEM,
+  "You must specify either "
+  "`--ifgroup-in' or `--ifgroup-out'");
+}
+
+static void
+ifgroup_print_value_in(struct xt_ifgroup_info *info)
+{
+   printf("0x%x/0x%x ", info->in_group, info->in_mask);
+}
+
+static void
+ifgroup_print_value_out(struct xt_ifgroup_info *info)
+{
+   printf("0x%x/0x%x ", info->out_group, info->out_mask);
+}


Just a suggestion: not printing the mask when its ~0 would
improve readability.


+
+static void
+ifgroup_print(const void *ip,
+ const struct xt_entry_match *match,
+ int numeric)
+{
+   struct xt_ifgroup_info *info =
+   (struct xt_ifgroup_info *) match->data;
+   
+   printf("ifgroup ");
+   
+   if (info->flags & XT_IFGROUP_MATCH_IN) {
+   printf("in %s",
+  info->flags & XT_IFGROUP_INVERT_IN ? "! " : "");
+   ifgroup_print_value_in(info);
+   }
+   if (info->flags & XT_IFGROUP_MATCH_OUT) {
+   printf("out %s",
+  info

Re: [IFGROUPv4 3/3] Netfilter Interface group match

2007-10-25 Thread Patrick McHardy

Laszlo Attila Toth wrote:

+++ b/net/netfilter/xt_ifgroup.c
+static bool
+ifgroup_match(const struct sk_buff *skb,
+const struct net_device *in,
+const struct net_device *out,
+const struct xt_match *match,
+const void *matchinfo,
+int offset,
+unsigned int protoff,
+bool *hotdrop)
+{
+   const struct xt_ifgroup_info *info = matchinfo;
+   
+   if (info->flags & XT_IFGROUP_MATCH_IN &&  !ifgroup_match_in(in, info))
+   return false;
+   if (info->flags & XT_IFGROUP_MATCH_OUT &&  !ifgroup_match_out(out, 
info))



If you'd remove the extra space it would fit on a 80 character line.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [IFGROUPv4 2/3] Interface group: core (netlink) part

2007-10-25 Thread Patrick McHardy

Laszlo Attila Toth wrote:

Interface groups let handle different interfaces together
especially in netfilter modules.
Modified net device structure and netlink interface.

@@ -891,6 +895,13 @@ static int do_setlink(struct net_device *dev, struct 
ifinfomsg *ifm,
}
}
 
+	if (tb[IFLA_IFGROUP]) {

+   write_lock_bh(&dev_base_lock);
+   dev->ifgroup = nla_get_u32(tb[IFLA_IFGROUP]);
+   write_unlock_bh(&dev_base_lock);
+   modified = 1;
+   }



The locking looks unnecessary, the rtnl should be enough.
I'm not even sure why its used for operstate and linkmode,
AFAICS they are also protected by the rtnl.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Benjamin Thery
Eric W. Biederman wrote:
> Benjamin Thery <[EMAIL PROTECTED]> writes:
> 
>> Denis V. Lunev wrote:
>>> The patch attached should help. The idea is simple. The "init" should be
>>> called only once without NETNS. Period. No need for any lists.
>> This is the kind of idea I had but I didn't think it could be 
>> that simple. :) 
>> Thanks Denis.
> 
> It isn't.
> 
>>> I'll resend it to Dave after the ACK.
>> Tested on x86_64 with CONFIG_NET_NS=n and y. 
>> It fixes the issue we observed.
>>
>> Acked-by: Benjamin Thery <[EMAIL PROTECTED]>
> 
> Try rmmod.

rmmod was part of my tests and it does work.
I did:

$ iptables --list

  modules x_tables, ip_tables & iptable_filter are loaded
  each calling register_pernet_subsys.

$ rmmod iptable_filter ip_tables x_tables

  No problem here

$ iptables --list

  To be sure I can load the modules again.


> 
> Eric
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


-- 
B e n j a m i n   T h e r y  - BULL/DT/Open Software R&D

   http://www.bull.com
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Eric W. Biederman
Benjamin Thery <[EMAIL PROTECTED]> writes:

> Denis V. Lunev wrote:
>> The patch attached should help. The idea is simple. The "init" should be
>> called only once without NETNS. Period. No need for any lists.
>
> This is the kind of idea I had but I didn't think it could be 
> that simple. :) 
> Thanks Denis.

It isn't.

>> I'll resend it to Dave after the ACK.
>
> Tested on x86_64 with CONFIG_NET_NS=n and y. 
> It fixes the issue we observed.
>
> Acked-by: Benjamin Thery <[EMAIL PROTECTED]>

Try rmmod.

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Eric W. Biederman
"Denis V. Lunev" <[EMAIL PROTECTED]> writes:

> The patch attached should help. The idea is simple. The "init" should be
> called only once without NETNS. Period. No need for any lists.
>
> I'll resend it to Dave after the ACK.

First in the case of the code that is currently merged none of 
the __net_init __net_exit or __net_initdata can be modular, so for
2.6.24 there is no fix needed. Yeah.

Second the whole concept of concept pernet_operations being __init
doesn't work when you have modular code that calls unregister_pernet_subsys().
Because unregister calls the exit method from the pernet_operations
structure.  So the patch doesn't even begin to address the real
issue.

Third from my perspective CONFIG_NET_NS is a temporary measure
designed to last only until we have enough implementation experience 
so that we can feel comfortable removing the experimental status of
the network namespace work.  It was not my intention for it to be a
space saving measure.  So I think it is silly to go marking up the
patches in development with __net_initdata etc.

At least so far I think __net_initdata is a totally bogus concept
and I'm not certain about the other two. 

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IFGROUPv4 iptables] Interface group match

2007-10-25 Thread Laszlo Attila Toth
Interface group values can be checked on both input and output interfaces
with optional mask.

Signed-off-by: Laszlo Attila Toth <[EMAIL PROTECTED]>
---
 Makefile |2
 libip6t_ifgroup.man  |   36 +++
 libipt_ifgroup.man   |   36 +++
 libxt_ifgroup.c  |  196 +++
 linux/netfilter/xt_ifgroup.h |   18 +++
 5 files changed, 287 insertions(+), 1 deletion(-)
  
Index: include/linux/netfilter/xt_ifgroup.h
===
--- include/linux/netfilter/xt_ifgroup.h(revision 0)
+++ include/linux/netfilter/xt_ifgroup.h(revision 0)
@@ -0,0 +1,18 @@
+#ifndef _XT_IFGROUP_H
+#define _XT_IFGROUP_H
+
+#define XT_IFGROUP_INVERT_IN   0x01
+#define XT_IFGROUP_INVERT_OUT  0x02
+#define XT_IFGROUP_MATCH_IN0x04
+#define XT_IFGROUP_MATCH_OUT   0x08
+
+struct xt_ifgroup_info {
+   u_int32_t in_group;
+   u_int32_t in_mask;
+   u_int32_t out_group;
+   u_int32_t out_mask;
+   u_int8_t flags;
+};
+
+#endif /*_XT_IFGROUP_H*/
+
Index: extensions/libxt_ifgroup.c
===
--- extensions/libxt_ifgroup.c  (revision 0)
+++ extensions/libxt_ifgroup.c  (revision 0)
@@ -0,0 +1,196 @@
+/* 
+ * Shared library add-on to iptables to match 
+ * packets by the incoming interface group.
+ *
+ * (c) 2006, 2007 Balazs Scheidler <[EMAIL PROTECTED]>,
+ * Laszlo Attila Toth <[EMAIL PROTECTED]>
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void
+ifgroup_help(void)
+{
+   printf(
+"ifgroup v%s options:\n"
+"  --ifgroup-in  [!] group[/mask]  incoming interface group and its mask\n"
+"  --ifgroup-out [!] group[/mask]  outgoing interface group and its mask\n"
+"\n", IPTABLES_VERSION);
+}
+
+static struct option opts[] = {
+   {"ifgroup-in", 1, 0, '1'},
+   {"ifgroup-out", 1, 0, '2'},
+   { }
+};
+
+#define PARAM_MATCH_IN 0x01
+#define PARAM_MATCH_OUT0x02
+
+static int
+ifgroup_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
+{
+   struct xt_ifgroup_info *info =
+(struct xt_ifgroup_info *) (*match)->data;
+   char *end;
+   
+   switch (c)
+   {
+   case '1':
+   if (*flags & PARAM_MATCH_IN)
+   exit_error(PARAMETER_PROBLEM,
+   "ifgroup match: Can't specify 
--ifgroup-in twice");
+
+   check_inverse(optarg, &invert, &optind, 0);
+   
+   info->in_group = strtoul(optarg, &end, 0);
+   info->in_mask = 0xUL;
+   
+   if (*end == '/')
+   info->in_mask = strtoul(end+1, &end, 0);
+
+   if (*end != '\0' || end == optarg)
+   exit_error(PARAMETER_PROBLEM,
+ "ifgroup match: Bad ifgroup value 
`%s'",
+  optarg);
+   
+   if (invert)
+   info->flags |= XT_IFGROUP_INVERT_IN;
+
+   *flags |= PARAM_MATCH_IN;
+   info->flags |= XT_IFGROUP_MATCH_IN; 
+   break;
+   case '2':
+   if (*flags & PARAM_MATCH_OUT)
+   exit_error(PARAMETER_PROBLEM,
+ "ifgroup match: Can't specify "
+ "--ifgroup-out twice");
+
+   check_inverse(optarg, &invert, &optind, 0);
+   
+   info->out_group = strtoul(optarg, &end, 0);
+   info->out_mask = 0xUL;
+   
+   if (*end == '/')
+   info->out_mask = strtoul(end+1, &end, 0);
+
+   if (*end != '\0' || end == optarg)
+   exit_error(PARAMETER_PROBLEM,
+ "ifgroup match: Bad ifgroup "
+ "value `%s'",
+  optarg);
+   
+   if (invert)
+   info->flags |= XT_IFGROUP_INVERT_OUT;
+
+   *flags |= PARAM_MATCH_OUT;
+   info->flags |= XT_IFGROUP_MATCH_OUT;
+   break;
+   default: 
+   return 0;
+   }
+
+   return 1;
+}
+
+static void
+ifgroup_final_check(unsigned int flags)
+{
+   if (!flags)
+   exit_error(PARAMETER_PROBLEM,
+  

[IFGROUPv4 3/3] Netfilter Interface group match

2007-10-25 Thread Laszlo Attila Toth
Interface group values can be checked on both input and output interfaces.

Signed-off-by: Laszlo Attila Toth <[EMAIL PROTECTED]>
---
 include/linux/netfilter/xt_ifgroup.h |   18 +
 net/netfilter/Kconfig|   16 +
 net/netfilter/Makefile   |1 +
 net/netfilter/xt_ifgroup.c   |  121 ++
 4 files changed, 156 insertions(+), 0 deletions(-)

diff --git a/include/linux/netfilter/xt_ifgroup.h 
b/include/linux/netfilter/xt_ifgroup.h
new file mode 100644
index 000..9ac75de
--- /dev/null
+++ b/include/linux/netfilter/xt_ifgroup.h
@@ -0,0 +1,18 @@
+#ifndef _XT_IFGROUP_H
+#define _XT_IFGROUP_H
+
+#define XT_IFGROUP_INVERT_IN   0x01
+#define XT_IFGROUP_INVERT_OUT  0x02
+#define XT_IFGROUP_MATCH_IN0x04
+#define XT_IFGROUP_MATCH_OUT   0x08
+
+struct xt_ifgroup_info {
+   u_int32_t in_group;
+   u_int32_t in_mask;
+   u_int32_t out_group;
+   u_int32_t out_mask;
+   u_int8_t flags;
+};
+
+#endif /*_XT_IFGROUP_H*/
+
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index d7a600a..0e0cd4f 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -597,6 +597,22 @@ config NETFILTER_XT_MATCH_QUOTA
  If you want to compile it as a module, say M here and read
  .  If unsure, say `N'.
 
+config NETFILTER_XT_MATCH_IFGROUP
+   tristate '"ifgroup" interface group match support'
+   depends on NETFILTER_XTABLES
+   help
+ Interface group matching allows you to match a packet by
+ its incoming interface "group", settable using ip link set
+ group
+
+ Typical usage is to assign dynamic interfaces to a group
+ when they come up using "ip link set group" and then match
+ incoming packets with a rule like this:
+
+   iptables -A INPUT -m ifgroup --if-group openvpn-rw1 -j LOG
+
+ To compile it as a module, choose M here.  If unsure, say N.
+
 config NETFILTER_XT_MATCH_REALM
tristate  '"realm" match support'
depends on NETFILTER_XTABLES
diff --git a/net/netfilter/Makefile b/net/netfilter/Makefile
index 93c58f9..29718c1 100644
--- a/net/netfilter/Makefile
+++ b/net/netfilter/Makefile
@@ -78,3 +78,4 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += xt_tcpmss.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_U32) += xt_u32.o
 obj-$(CONFIG_NETFILTER_XT_MATCH_HASHLIMIT) += xt_hashlimit.o
+obj-$(CONFIG_NETFILTER_XT_MATCH_IFGROUP) += xt_ifgroup.o
diff --git a/net/netfilter/xt_ifgroup.c b/net/netfilter/xt_ifgroup.c
new file mode 100644
index 000..2baf772
--- /dev/null
+++ b/net/netfilter/xt_ifgroup.c
@@ -0,0 +1,121 @@
+/*
+ * An x_tables match module to match interface groups
+ *
+ * (C) 2006,2007 Balazs Scheidler <[EMAIL PROTECTED]>,
+ *   Laszlo Attila Toth <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Laszlo Attila Toth <[EMAIL PROTECTED]>");
+MODULE_DESCRIPTION("Xtables interface group matching module");
+MODULE_ALIAS("ipt_ifgroup");
+MODULE_ALIAS("ip6t_ifgroup");
+
+
+static inline bool
+ifgroup_match_in(const struct net_device *in,
+const struct xt_ifgroup_info *info)
+{
+
+   return ((in->ifgroup & info->in_mask) == info->in_group) ^ 
+   ((info->flags & XT_IFGROUP_INVERT_IN) == XT_IFGROUP_INVERT_IN);
+}
+
+static inline bool
+ifgroup_match_out(const struct net_device *out,
+const struct xt_ifgroup_info *info)
+{
+   return ((out->ifgroup & info->out_mask) == info->out_group) ^ 
+   ((info->flags & XT_IFGROUP_INVERT_OUT) == 
XT_IFGROUP_INVERT_OUT);
+}
+
+static bool
+ifgroup_match(const struct sk_buff *skb,
+const struct net_device *in,
+const struct net_device *out,
+const struct xt_match *match,
+const void *matchinfo,
+int offset,
+unsigned int protoff,
+bool *hotdrop)
+{
+   const struct xt_ifgroup_info *info = matchinfo;
+   
+   if (info->flags & XT_IFGROUP_MATCH_IN &&  !ifgroup_match_in(in, info))
+   return false;
+   if (info->flags & XT_IFGROUP_MATCH_OUT &&  !ifgroup_match_out(out, 
info))
+   return false;
+   
+   return true;
+}
+
+static bool ifgroup_checkentry(const char *tablename, const void *ip_void,
+  const struct xt_match *match,
+  void *matchinfo, unsigned int hook_mask)
+{
+   struct xt_ifgroup_info *info = matchinfo;
+
+   if (!(info->flags & (XT_IFGROUP_MATCH_IN|XT_IFGROUP_MATCH_OUT))) {
+   printk(KERN_ERR "xt_ifgroup: neither incoming nor "
+   "outgoing device selected\n");
+  

[IFGROUPv4 iproute 1/2] Added IFLA_NET_NS_PID as in kernel v2.6.24-rc1

2007-10-25 Thread Laszlo Attila Toth
Signed-off-by: Laszlo Attila Toth <[EMAIL PROTECTED]>
---
 include/linux/if_link.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 23b3a8e..c948395 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -78,6 +78,7 @@ enum
IFLA_LINKMODE,
IFLA_LINKINFO,
 #define IFLA_LINKINFO IFLA_LINKINFO
+   IFLA_NET_NS_PID,
__IFLA_MAX
 };
 
-- 
1.5.2.5

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IFGROUPv4 2/3] Interface group: core (netlink) part

2007-10-25 Thread Laszlo Attila Toth
Interface groups let handle different interfaces together
especially in netfilter modules.
Modified net device structure and netlink interface.

Signed-off-by: Laszlo Attila Toth <[EMAIL PROTECTED]>
---
 include/linux/if_link.h   |2 ++
 include/linux/netdevice.h |2 ++
 net/core/rtnetlink.c  |   11 +++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 84c3492..722b25c 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -79,6 +79,8 @@ enum
IFLA_LINKINFO,
 #define IFLA_LINKINFO IFLA_LINKINFO
IFLA_NET_NS_PID,
+   IFLA_IFGROUP,
+#define IFLA_IFGROUP IFLA_IFGROUP
__IFLA_MAX
 };
 
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c4de536..87aa550 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -519,6 +519,8 @@ struct net_device
/* Interface index. Unique device identifier*/
int ifindex;
int iflink;
+   /* interface group this interface belongs to */
+   u_int32_t   ifgroup;
 
 
struct net_device_stats* (*get_stats)(struct net_device *dev);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ecf4dc5..f13883d 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -611,6 +611,7 @@ static inline size_t if_nlmsg_size(const struct net_device 
*dev)
   + nla_total_size(4) /* IFLA_MTU */
   + nla_total_size(4) /* IFLA_LINK */
   + nla_total_size(4) /* IFLA_MASTER */
+  + nla_total_size(4) /* IFLA_IFGROUP */
   + nla_total_size(1) /* IFLA_OPERSTATE */
   + nla_total_size(1) /* IFLA_LINKMODE */
   + rtnl_link_get_size(dev); /* IFLA_LINKINFO */
@@ -648,6 +649,9 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct 
net_device *dev,
if (dev->master)
NLA_PUT_U32(skb, IFLA_MASTER, dev->master->ifindex);
 
+   if (dev->ifgroup)
+   NLA_PUT_U32(skb, IFLA_IFGROUP, dev->ifgroup);
+
if (dev->qdisc_sleeping)
NLA_PUT_STRING(skb, IFLA_QDISC, dev->qdisc_sleeping->ops->id);
 
@@ -891,6 +895,13 @@ static int do_setlink(struct net_device *dev, struct 
ifinfomsg *ifm,
}
}
 
+   if (tb[IFLA_IFGROUP]) {
+   write_lock_bh(&dev_base_lock);
+   dev->ifgroup = nla_get_u32(tb[IFLA_IFGROUP]);
+   write_unlock_bh(&dev_base_lock);
+   modified = 1;
+   }
+
err = 0;
 
 errout:
-- 
1.5.2.5

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IFGROUPv4 iproute 2/2] Interface group as new ip link option

2007-10-25 Thread Laszlo Attila Toth
Interfaces can be grouped and each group has an unique positive integer ID.
It can be set via ip link. Symbolic names can be specified in
/etc/iproute2/rt_ifgroup.

Signed-off-by: Laszlo Attila Toth <[EMAIL PROTECTED]>
---
 include/linux/if_link.h |2 +
 include/rt_names.h  |2 +
 ip/ipaddress.c  |4 +++
 ip/iplink.c |   11 
 lib/rt_names.c  |   62 +++
 man/man8/ip.8   |5 
 6 files changed, 86 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index c948395..5a2d071 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -79,6 +79,8 @@ enum
IFLA_LINKINFO,
 #define IFLA_LINKINFO IFLA_LINKINFO
IFLA_NET_NS_PID,
+   IFLA_IFGROUP,
+#defineIFLA_IFGROUP IFLA_IFGROUP
__IFLA_MAX
 };
 
diff --git a/include/rt_names.h b/include/rt_names.h
index 07a10e0..72c5247 100644
--- a/include/rt_names.h
+++ b/include/rt_names.h
@@ -8,11 +8,13 @@ char* rtnl_rtscope_n2a(int id, char *buf, int len);
 char* rtnl_rttable_n2a(__u32 id, char *buf, int len);
 char* rtnl_rtrealm_n2a(int id, char *buf, int len);
 char* rtnl_dsfield_n2a(int id, char *buf, int len);
+char* rtnl_ifgroup_n2a(int id, char *buf, int len);
 int rtnl_rtprot_a2n(__u32 *id, char *arg);
 int rtnl_rtscope_a2n(__u32 *id, char *arg);
 int rtnl_rttable_a2n(__u32 *id, char *arg);
 int rtnl_rtrealm_a2n(__u32 *id, char *arg);
 int rtnl_dsfield_a2n(__u32 *id, char *arg);
+int rtnl_ifgroup_a2n(__u32 *id, char *arg);
 
 const char *inet_proto_n2a(int proto, char *buf, int len);
 int inet_proto_a2n(char *buf);
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index d1c6620..1ecbe03 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -227,6 +227,10 @@ int print_linkinfo(const struct sockaddr_nl *who,
fprintf(fp, "mtu %u ", *(int*)RTA_DATA(tb[IFLA_MTU]));
if (tb[IFLA_QDISC])
fprintf(fp, "qdisc %s ", (char*)RTA_DATA(tb[IFLA_QDISC]));
+   if (tb[IFLA_IFGROUP]) {
+   SPRINT_BUF(b1);
+   fprintf(fp, "group %s ", 
rtnl_ifgroup_n2a(*(int*)RTA_DATA(tb[IFLA_IFGROUP]), b1, sizeof(b1)));
+   }
 #ifdef IFLA_MASTER
if (tb[IFLA_MASTER]) {
SPRINT_BUF(b1);
diff --git a/ip/iplink.c b/ip/iplink.c
index 8e0ed2a..71bd240 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "rt_names.h"
 #include "utils.h"
@@ -46,6 +47,7 @@ void iplink_usage(void)
fprintf(stderr, "promisc { on | off } |\n");
fprintf(stderr, "trailers { on | off } 
|\n");
fprintf(stderr, "txqueuelen PACKETS |\n");
+   fprintf(stderr, "group GROUP |\n");
fprintf(stderr, "name NEWNAME |\n");
fprintf(stderr, "address LLADDR | broadcast 
LLADDR |\n");
fprintf(stderr, "mtu MTU }\n");
@@ -145,6 +147,7 @@ static int iplink_have_newlink(void)
 static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
 {
int qlen = -1;
+   __u32 group = 0;
int mtu = -1;
int len;
char abuf[32];
@@ -197,6 +200,14 @@ static int iplink_modify(int cmd, unsigned int flags, int 
argc, char **argv)
if (get_integer(&qlen,  *argv, 0))
invarg("Invalid \"txqueuelen\" value\n", *argv);
addattr_l(&req.n, sizeof(req), IFLA_TXQLEN, &qlen, 4);
+   } else if (matches(*argv, "group") == 0) {
+   NEXT_ARG();
+   if (group != 0)
+   duparg("group", *argv);
+
+   if (rtnl_ifgroup_a2n(&group, *argv))
+   invarg("\"group\" value is invalid\n", *argv);
+   addattr_l(&req.n, sizeof(req), IFLA_IFGROUP, &group, 
sizeof(group));
} else if (strcmp(*argv, "mtu") == 0) {
NEXT_ARG();
if (mtu != -1)
diff --git a/lib/rt_names.c b/lib/rt_names.c
index 8d019a0..a067e74 100644
--- a/lib/rt_names.c
+++ b/lib/rt_names.c
@@ -446,3 +446,65 @@ int rtnl_dsfield_a2n(__u32 *id, char *arg)
return 0;
 }
 
+static char * rtnl_rtifgroup_tab[256] = {
+   "0",
+};
+
+static int rtnl_rtifgroup_init;
+
+static void rtnl_rtifgroup_initialize(void)
+{
+   rtnl_rtifgroup_init = 1;
+   rtnl_tab_initialize("/etc/iproute2/rt_ifgroup",
+   rtnl_rtifgroup_tab, 256);
+}
+
+char * rtnl_ifgroup_n2a(int id, char *buf, int len)
+{
+   if (id<0 || id>=256) {
+   snprintf(buf, len, "%d", id);
+   return buf;
+   }
+   if (!rtnl_rtifgroup_tab[id]) {
+   if (!rtnl_rtifgroup_init)
+  

[IFGROUPv4 1/3] rtnetlink: setlink changes atomic with single notification

2007-10-25 Thread Laszlo Attila Toth
In do_setlink the device changes are atomic and notifications will be sent
at the end of the function once if any modification occured and once if
address has been changed.

Signed-off-by: Laszlo Attila Toth <[EMAIL PROTECTED]>
---
 net/core/rtnetlink.c |   34 --
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 4a2640d..ecf4dc5 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -537,7 +537,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct 
dst_entry *dst, u32 id,
 
 EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
 
-static void set_operstate(struct net_device *dev, unsigned char transition)
+static int set_operstate(struct net_device *dev, unsigned char transition)
 {
unsigned char operstate = dev->operstate;
 
@@ -560,8 +560,9 @@ static void set_operstate(struct net_device *dev, unsigned 
char transition)
write_lock_bh(&dev_base_lock);
dev->operstate = operstate;
write_unlock_bh(&dev_base_lock);
-   netdev_state_change(dev);
-   }
+   return 1;
+   } else
+   return 0;
 }
 
 static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
@@ -855,6 +856,7 @@ static int do_setlink(struct net_device *dev, struct 
ifinfomsg *ifm,
if (tb[IFLA_BROADCAST]) {
nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
send_addr_notify = 1;
+   modified = 1;
}
 
if (ifm->ifi_flags || ifm->ifi_change) {
@@ -867,16 +869,26 @@ static int do_setlink(struct net_device *dev, struct 
ifinfomsg *ifm,
dev_change_flags(dev, flags);
}
 
-   if (tb[IFLA_TXQLEN])
-   dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+   if (tb[IFLA_TXQLEN]) {
+   if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) {
+   write_lock_bh(&dev_base_lock);
+   dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
+   write_unlock_bh(&dev_base_lock);
+   modified = 1;
+   }
+   }
 
-   if (tb[IFLA_OPERSTATE])
-   set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+   if (tb[IFLA_OPERSTATE]) {
+   modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
+   }
 
if (tb[IFLA_LINKMODE]) {
-   write_lock_bh(&dev_base_lock);
-   dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
-   write_unlock_bh(&dev_base_lock);
+   if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) {
+   write_lock_bh(&dev_base_lock);
+   dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+   write_unlock_bh(&dev_base_lock);
+   modified = 1;
+   }
}
 
err = 0;
@@ -890,6 +902,8 @@ errout:
 
if (send_addr_notify)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
+   if (modified)
+   netdev_state_change(dev);
return err;
 }
 
-- 
1.5.2.5

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IFGROUPv4 0/3 (+3)] Interface group patches

2007-10-25 Thread Laszlo Attila Toth
Hi Dave,

This is the 4th version of our interface group patches. The only difference
from the previous one is in the first patch (single notification and atomic
changes in rtnetlink) plus in iptables code: parameter in-ifgroup changed to
ifgroup-in (and ifgroup-out).

I had to add IFLA_NET_NS_PID in the iproute2 patches as in kernel v2.6.24-rc1.

Usage as before:
 ip link set eth0 group 4
 iptables -A INPUT -m ifgroup --ifgroup-in 4/0xf -j ACCEPT
 iptables -A FORWARD -m ifgroup --ifgroup-in 4 --ifgroup-out 5 -j DROP

Patches:
 [1/3] rtnetlink: setlink changes atomic with single notification
 [2/3] Interface group: core (netlink) part
 [3/3] Netfilter Interface group match
 [iptables] Interface group match
 [iproute 1/2] Added IFLA_NET_NS_PID as in kernel v2.6.24-rc1
 [iproute 2/2] Interface group as new ip link option

Please apply,
Attila
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Benjamin Thery
Denis V. Lunev wrote:
> The patch attached should help. The idea is simple. The "init" should be
> called only once without NETNS. Period. No need for any lists.

This is the kind of idea I had but I didn't think it could be 
that simple. :) 
Thanks Denis.

> I'll resend it to Dave after the ACK.

Tested on x86_64 with CONFIG_NET_NS=n and y. 
It fixes the issue we observed.

Acked-by: Benjamin Thery <[EMAIL PROTECTED]>


> Regards,
>   Den
> 
> Benjamin Thery wrote:
>> Hello Pavel,
>>
>> I've found a problem with one of your patch related to netns:
>>
>> * [NETNS] Move some code into __init section when CONFIG_NET_NS=n (v2)
>>http://www.spinics.net/lists/netdev/msg43310.html
>>
>> This patch introduces the __net_init/__net_exit/__net_initdata
>> defines to save some memory when CONFIG_NET_NS is not set.
>>
>> Cedric Le Goater reported he had a *non-fatal* oops when booting
>> a 2.6.23-mm1-lxc1 kernel with CONFIG_NET_NS=n. (2.6.23-mm1-lxc1 
>> contains the NETNS49 patchset). The oops occured when modules 
>> related to iptables were loaded after the boot completes.
>>
>> The problem is the following:
>>
>> - Your patch adds the __net_initdata attribute to pernet_operations 
>>   structures.
>>
>> - pernet_operations are registered via register_pernet_subsys() and 
>>   linked in the pernet_list during boot.
>>
>> - At the end of boot, pernet_operations are freed (because of the
>>   __net_initdata attribute), and the pernet_list (or first_device list) 
>>   points to freed memory.
>>
>> - After boot, network modules which are netns-aware try to register
>>   themselves with register_pernet_subsys() and ...KABOOM... page
>>   fault when accessing pernet_list (or first_device list).
>>   (I reproduce Cedric's oops with the command: iptables --list)
>>
>> This is not a problem right now in 2.6.23-mm1 or net-2.6 because 
>> there are very few netns-aware network subsystems merged and they
>> are all initialized during boot. But it will be problematic when 
>> we will merge netns code for subsystems which can be built as 
>> modules (eg. iptables, ...). I'm not sure we can use 
>> __net_init_data for pernet_operations then. 
>> Maybe we can add some checks in register_pernet_operations
>> when CONFIG_NET_NS=n.
>>
>> I haven't found a fix yet.
>>
>> Regards,
>> Benjamin
>>
> 


-- 
B e n j a m i n   T h e r y  - BULL/DT/Open Software R&D

   http://www.bull.com
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


BUG in sys_socketpair

2007-10-25 Thread Rich Paul
In 2.6.23, there seems to be a minor bug in sys_socketpair.  When the
calls to sock_alloc_fd fail, it aborts the routine, but it returns the
variable err, which is not set in this case.

The result is a silent failure if you have too many files open and call
socketpair.

Here is a simple UNTESTED patch (not even compiled) which should resolve the
issue.

Regards,
Rich

--- net/socket.c.orig   2007-10-25 10:03:56.0 -0400
+++ net/socket.c2007-10-25 10:04:00.0 -0400
@@ -1245,11 +1245,14 @@
goto out_release_both;

fd1 = sock_alloc_fd(&newfile1);
-   if (unlikely(fd1 < 0))
+   if (unlikely(fd1 < 0)) {
+   err=fd1;
goto out_release_both;
+   }

fd2 = sock_alloc_fd(&newfile2);
if (unlikely(fd2 < 0)) {
+   err=fd2;
put_filp(newfile1);
put_unused_fd(fd1);
goto out_release_both;

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Devel] Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n (resend, was wrong patch)

2007-10-25 Thread Denis V. Lunev
Denis V. Lunev wrote:
> The patch attached should help. The idea is simple. The "init" should be
> called only once without NETNS. Period. No need for any lists.
> 
> I'll resend it to Dave after the ACK.
> 
> Regards,
>   Den
> 
> Benjamin Thery wrote:
>> Hello Pavel,
>>
>> I've found a problem with one of your patch related to netns:
>>
>> * [NETNS] Move some code into __init section when CONFIG_NET_NS=n (v2)
>>http://www.spinics.net/lists/netdev/msg43310.html
>>
>> This patch introduces the __net_init/__net_exit/__net_initdata
>> defines to save some memory when CONFIG_NET_NS is not set.
>>
>> Cedric Le Goater reported he had a *non-fatal* oops when booting
>> a 2.6.23-mm1-lxc1 kernel with CONFIG_NET_NS=n. (2.6.23-mm1-lxc1 
>> contains the NETNS49 patchset). The oops occured when modules 
>> related to iptables were loaded after the boot completes.
>>
>> The problem is the following:
>>
>> - Your patch adds the __net_initdata attribute to pernet_operations 
>>   structures.
>>
>> - pernet_operations are registered via register_pernet_subsys() and 
>>   linked in the pernet_list during boot.
>>
>> - At the end of boot, pernet_operations are freed (because of the
>>   __net_initdata attribute), and the pernet_list (or first_device list) 
>>   points to freed memory.
>>
>> - After boot, network modules which are netns-aware try to register
>>   themselves with register_pernet_subsys() and ...KABOOM... page
>>   fault when accessing pernet_list (or first_device list).
>>   (I reproduce Cedric's oops with the command: iptables --list)
>>
>> This is not a problem right now in 2.6.23-mm1 or net-2.6 because 
>> there are very few netns-aware network subsystems merged and they
>> are all initialized during boot. But it will be problematic when 
>> we will merge netns code for subsystems which can be built as 
>> modules (eg. iptables, ...). I'm not sure we can use 
>> __net_init_data for pernet_operations then. 
>> Maybe we can add some checks in register_pernet_operations
>> when CONFIG_NET_NS=n.
>>
>> I haven't found a fix yet.
>>
>> Regards,
>> Benjamin

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 6f71db8..cc306dc 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -186,7 +186,11 @@ static int register_pernet_operations(struct list_head 
*list,
int error;
 
error = 0;
+#ifdef CONFIG_NET_NS
list_add_tail(&ops->list, list);
+#else
+   INIT_LIST_HEAD(&ops->list);
+#endif
for_each_net(net) {
if (ops->init) {
error = ops->init(net);


Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Domen Puncer
On 25/10/07 05:29 -0400, Jeff Garzik wrote:
> Domen Puncer wrote:
> >+static int mpc52xx_fec_alloc_rx_buffers(struct bcom_task *rxtsk)
> >+{
> >+while (!bcom_queue_full(rxtsk)) {
> >+struct sk_buff *skb;
> >+struct bcom_fec_bd *bd;
> >+
> >+skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
> >+if (skb == NULL)
> >+return -EAGAIN;
> >+
> >+/* zero out the initial receive buffers to aid debugging */
> >+memset(skb->data, 0, FEC_RX_BUFFER_SIZE);
> >+
> >+bd = (struct bcom_fec_bd *)bcom_prepare_next_buffer(rxtsk);
> >+
> >+bd->status = FEC_RX_BUFFER_SIZE;
> >+bd->skb_pa = virt_to_phys(skb->data);
> >+
> >+bcom_submit_next_buffer(rxtsk, skb);
> 
> use your platform's dma mapping functions, rather than virt_to_phys()
> 
> it might be the exact same implementation, inside the platform 
> internals, but drivers should not be using this directly.

I've replaced this with dma_map_single(), unmatched with
dma_unmap_single(), since bestcomm doesn't have a way to do that
and it's blank on ppc32 anyway.

Is this OK? PPC guys?

> 
> >+{
> >+struct mpc52xx_fec_priv *priv = netdev_priv(dev);
> >+int err = -EBUSY;
> >+
> >+if (request_irq(dev->irq, &mpc52xx_fec_interrupt, IRQF_DISABLED | 
> >IRQF_SHARED,
> 
> why IRQF_DISABLED?  that should not be needed.

Removed all three occurances.

> >+bd->status = skb->len | BCOM_FEC_TX_BD_TFD | BCOM_FEC_TX_BD_TC;
> >+bd->skb_pa = virt_to_phys(skb->data);
> 
> use dma_xxx

dma_map_single

> 
> >+bcom_submit_next_buffer(priv->tx_dmatsk, skb);
> >+
> >+if (bcom_queue_full(priv->tx_dmatsk)) {
> >+priv->tx_full = 1;
> 
> no need for your own tx_full variable

I'm not sure what I should do here.
It does it internally, so just removing tx_full is OK?


> >+dev_kfree_skb_irq(skb);
> >+}
> >+
> >+if (netif_queue_stopped(dev) && !priv->tx_full)
> 
> no need to test netif_queue_stopped(), netif_wake_queue() does that anyway
> 
> no need for tx_full

OK.

> >+static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id)
> >+{
> >+struct net_device *dev = dev_id;
> >+struct mpc52xx_fec_priv *priv = netdev_priv(dev);
> >+struct mpc52xx_fec __iomem *fec = priv->fec;
> >+u32 ievent;
> >+
> >+ievent = in_be32(&fec->ievent);
> 
> generally wise to check for 0x, which often indicates hardware 
> fault / device not there / scrogged

It's on the CPU, so it has to be there :-)
dev_warn and fec_reset would catch that anyway.

> 
> 
> >+ievent &= ~FEC_IEVENT_MII;  /* mii is handled separately */
> >+if (!ievent)
> 
> 
> 
> >+return IRQ_NONE;
> >+
> >+out_be32(&fec->ievent, ievent); /* clear pending events */
> >+
> >+if (ievent & ~(FEC_IEVENT_RFIFO_ERROR | FEC_IEVENT_XFIFO_ERROR)) {
> >+if (ievent & ~FEC_IEVENT_TFINT)
> >+dev_dbg(&dev->dev, "ievent: %08x\n", ievent);
> >+return IRQ_HANDLED;
> >+}
> >+
> >+if (net_ratelimit() && (ievent & FEC_IEVENT_RFIFO_ERROR))
> >+dev_warn(&dev->dev, "FEC_IEVENT_RFIFO_ERROR\n");
> >+if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR))
> >+dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n");
> >+
> >+mpc52xx_fec_reset(dev);
> >+
> >+netif_wake_queue(dev);
> >+return IRQ_HANDLED;
> >+}
> >+


> >+
> >+memset(&priv->stats, 0, sizeof(priv->stats));
> 
> don't use your own copy of net_device_stats, it's in net_device now

Nice. OK.

> 
> 
> >+/*
> >+ * Set or clear the multicast filter for this adaptor.
> >+ */
> >+static void mpc52xx_fec_set_multicast_list(struct net_device *dev)
> >+{
> >+struct mpc52xx_fec_priv *priv = netdev_priv(dev);
> >+struct mpc52xx_fec __iomem *fec = priv->fec;
> >+u32 rx_control;
> >+
> >+rx_control = in_be32(&fec->r_cntrl);
> >+
> >+if (dev->flags & IFF_PROMISC) {
> >+rx_control |= FEC_RCNTRL_PROM;
> >+out_be32(&fec->r_cntrl, rx_control);
> >+} else {
> >+rx_control &= ~FEC_RCNTRL_PROM;
> >+out_be32(&fec->r_cntrl, rx_control);
> >+
> >+if (dev->flags & IFF_ALLMULTI) {
> >+out_be32(&fec->gaddr1, 0x);
> >+out_be32(&fec->gaddr2, 0x);
> >+} else {
> >+u32 crc;
> >+int i;
> >+struct dev_mc_list *dmi;
> >+u32 gaddr1 = 0x;
> >+u32 gaddr2 = 0x;
> >+
> >+dmi = dev->mc_list;
> >+for (i=0; imc_count; i++) {
> >+crc = ether_crc_le(6, dmi->dmi_addr) >> 26;
> >+if (crc >= 32)
> >+gaddr1 |= 1 << (crc-32);
> >+else
> >+gaddr2 |= 1 << crc;
> >+   

Re: [NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Denis V. Lunev
The patch attached should help. The idea is simple. The "init" should be
called only once without NETNS. Period. No need for any lists.

I'll resend it to Dave after the ACK.

Regards,
Den

Benjamin Thery wrote:
> Hello Pavel,
> 
> I've found a problem with one of your patch related to netns:
> 
> * [NETNS] Move some code into __init section when CONFIG_NET_NS=n (v2)
>http://www.spinics.net/lists/netdev/msg43310.html
> 
> This patch introduces the __net_init/__net_exit/__net_initdata
> defines to save some memory when CONFIG_NET_NS is not set.
> 
> Cedric Le Goater reported he had a *non-fatal* oops when booting
> a 2.6.23-mm1-lxc1 kernel with CONFIG_NET_NS=n. (2.6.23-mm1-lxc1 
> contains the NETNS49 patchset). The oops occured when modules 
> related to iptables were loaded after the boot completes.
> 
> The problem is the following:
> 
> - Your patch adds the __net_initdata attribute to pernet_operations 
>   structures.
> 
> - pernet_operations are registered via register_pernet_subsys() and 
>   linked in the pernet_list during boot.
> 
> - At the end of boot, pernet_operations are freed (because of the
>   __net_initdata attribute), and the pernet_list (or first_device list) 
>   points to freed memory.
> 
> - After boot, network modules which are netns-aware try to register
>   themselves with register_pernet_subsys() and ...KABOOM... page
>   fault when accessing pernet_list (or first_device list).
>   (I reproduce Cedric's oops with the command: iptables --list)
> 
> This is not a problem right now in 2.6.23-mm1 or net-2.6 because 
> there are very few netns-aware network subsystems merged and they
> are all initialized during boot. But it will be problematic when 
> we will merge netns code for subsystems which can be built as 
> modules (eg. iptables, ...). I'm not sure we can use 
> __net_init_data for pernet_operations then. 
> Maybe we can add some checks in register_pernet_operations
> when CONFIG_NET_NS=n.
> 
> I haven't found a fix yet.
> 
> Regards,
> Benjamin
> 

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 6f71db8..9ba4809 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -186,7 +186,11 @@ static int register_pernet_operations(struct list_head 
*list,
int error;
 
error = 0;
+#ifdef CONFIG_NET_NS
list_add_tail(&ops->list, list);
+#endif
+   INIT_LIST_HEAD(&ops->list);
+#endif
for_each_net(net) {
if (ops->init) {
error = ops->init(net);


[PATCH] NetLabel: correct usage of RCU locking

2007-10-25 Thread Paul Moore
This fixes some awkward, and perhaps even problematic, RCU lock usage in the
NetLabel code as well as some other related trivial cleanups found when
looking through the RCU locking.  Most of the changes involve removing the
redundant RCU read locks wrapping spinlocks in the case of a RCU writer.

Signed-off-by: Paul Moore <[EMAIL PROTECTED]>
---

 net/ipv4/cipso_ipv4.c  |   39 +---
 net/netlabel/netlabel_domainhash.c |   37 ++
 net/netlabel/netlabel_mgmt.c   |4 
 net/netlabel/netlabel_unlabeled.c  |4 +---
 4 files changed, 22 insertions(+), 62 deletions(-)

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 805a78e..f18e88b 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -504,22 +504,16 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def)
INIT_RCU_HEAD(&doi_def->rcu);
INIT_LIST_HEAD(&doi_def->dom_list);
 
-   rcu_read_lock();
-   if (cipso_v4_doi_search(doi_def->doi) != NULL)
-   goto doi_add_failure_rlock;
spin_lock(&cipso_v4_doi_list_lock);
if (cipso_v4_doi_search(doi_def->doi) != NULL)
-   goto doi_add_failure_slock;
+   goto doi_add_failure;
list_add_tail_rcu(&doi_def->list, &cipso_v4_doi_list);
spin_unlock(&cipso_v4_doi_list_lock);
-   rcu_read_unlock();
 
return 0;
 
-doi_add_failure_slock:
+doi_add_failure:
spin_unlock(&cipso_v4_doi_list_lock);
-doi_add_failure_rlock:
-   rcu_read_unlock();
return -EEXIST;
 }
 
@@ -543,29 +537,23 @@ int cipso_v4_doi_remove(u32 doi,
struct cipso_v4_doi *doi_def;
struct cipso_v4_domhsh_entry *dom_iter;
 
-   rcu_read_lock();
-   if (cipso_v4_doi_search(doi) != NULL) {
-   spin_lock(&cipso_v4_doi_list_lock);
-   doi_def = cipso_v4_doi_search(doi);
-   if (doi_def == NULL) {
-   spin_unlock(&cipso_v4_doi_list_lock);
-   rcu_read_unlock();
-   return -ENOENT;
-   }
+   spin_lock(&cipso_v4_doi_list_lock);
+   doi_def = cipso_v4_doi_search(doi);
+   if (doi_def != NULL) {
doi_def->valid = 0;
list_del_rcu(&doi_def->list);
spin_unlock(&cipso_v4_doi_list_lock);
+   rcu_read_lock();
list_for_each_entry_rcu(dom_iter, &doi_def->dom_list, list)
if (dom_iter->valid)
netlbl_domhsh_remove(dom_iter->domain,
 audit_info);
-   cipso_v4_cache_invalidate();
rcu_read_unlock();
-
+   cipso_v4_cache_invalidate();
call_rcu(&doi_def->rcu, callback);
return 0;
}
-   rcu_read_unlock();
+   spin_unlock(&cipso_v4_doi_list_lock);
 
return -ENOENT;
 }
@@ -653,22 +641,19 @@ int cipso_v4_doi_domhsh_add(struct cipso_v4_doi *doi_def, 
const char *domain)
new_dom->valid = 1;
INIT_RCU_HEAD(&new_dom->rcu);
 
-   rcu_read_lock();
spin_lock(&cipso_v4_doi_list_lock);
-   list_for_each_entry_rcu(iter, &doi_def->dom_list, list)
+   list_for_each_entry(iter, &doi_def->dom_list, list)
if (iter->valid &&
((domain != NULL && iter->domain != NULL &&
  strcmp(iter->domain, domain) == 0) ||
 (domain == NULL && iter->domain == NULL))) {
spin_unlock(&cipso_v4_doi_list_lock);
-   rcu_read_unlock();
kfree(new_dom->domain);
kfree(new_dom);
return -EEXIST;
}
list_add_tail_rcu(&new_dom->list, &doi_def->dom_list);
spin_unlock(&cipso_v4_doi_list_lock);
-   rcu_read_unlock();
 
return 0;
 }
@@ -689,9 +674,8 @@ int cipso_v4_doi_domhsh_remove(struct cipso_v4_doi *doi_def,
 {
struct cipso_v4_domhsh_entry *iter;
 
-   rcu_read_lock();
spin_lock(&cipso_v4_doi_list_lock);
-   list_for_each_entry_rcu(iter, &doi_def->dom_list, list)
+   list_for_each_entry(iter, &doi_def->dom_list, list)
if (iter->valid &&
((domain != NULL && iter->domain != NULL &&
  strcmp(iter->domain, domain) == 0) ||
@@ -699,13 +683,10 @@ int cipso_v4_doi_domhsh_remove(struct cipso_v4_doi 
*doi_def,
iter->valid = 0;
list_del_rcu(&iter->list);
spin_unlock(&cipso_v4_doi_list_lock);
-   rcu_read_unlock();
call_rcu(&iter->rcu, cipso_v4_doi_domhsh_free);
-
return 0;
}
spin_unlock(&cipso_v4_doi_list_lock);
-   rcu_read_unlock();
 
return -ENOENT;
 }
diff --git a/net/netlabel/netlabel_dom

[PATCH] NetLabel fixes against 2.6.24-rc1

2007-10-25 Thread Paul Moore
There have been some good discussions on the list about RCU lately that made
me realize NetLabel was doing some rather stupid things in regards to how it
makes use of RCU.  This is a small patch again against 2.6.24-rc1 which should
fix the RCU problems.  You can grab the patch from email or from here:

 * git://git.infradead.org/users/pcmoore/lblnet-2.6

I tested last patch last week using some stress tests for a few days and
didn't nothing anything out of the oridinary.  Please consider for 2.6.24.

Thanks.

-- 
paul moore
linux security @ hp

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] NET: Mark snmp4_icmp_list[] as being unused

2007-10-25 Thread David Howells
Mark snmp4_icmp_list[] as being unused to avoid the warning it would otherwise
incur.

Signed-off-by: David Howells <[EMAIL PROTECTED]>
---

 net/ipv4/proc.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index fd16cb8..1c0854d 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -121,7 +121,8 @@ static const struct snmp_mib snmp4_ipextstats_list[] = {
SNMP_MIB_SENTINEL
 };
 
-static const struct snmp_mib snmp4_icmp_list[] = {
+static __attribute__((unused))
+const struct snmp_mib snmp4_icmp_list[] = {
SNMP_MIB_ITEM("InMsgs", ICMP_MIB_INMSGS),
SNMP_MIB_ITEM("InErrors", ICMP_MIB_INERRORS),
SNMP_MIB_ITEM("OutMsgs", ICMP_MIB_OUTMSGS),

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[NETNS] Oops in register_pernet_operations() with CONFIG_NET_NS=n

2007-10-25 Thread Benjamin Thery
Hello Pavel,

I've found a problem with one of your patch related to netns:

* [NETNS] Move some code into __init section when CONFIG_NET_NS=n (v2)
   http://www.spinics.net/lists/netdev/msg43310.html

This patch introduces the __net_init/__net_exit/__net_initdata
defines to save some memory when CONFIG_NET_NS is not set.

Cedric Le Goater reported he had a *non-fatal* oops when booting
a 2.6.23-mm1-lxc1 kernel with CONFIG_NET_NS=n. (2.6.23-mm1-lxc1 
contains the NETNS49 patchset). The oops occured when modules 
related to iptables were loaded after the boot completes.

The problem is the following:

- Your patch adds the __net_initdata attribute to pernet_operations 
  structures.

- pernet_operations are registered via register_pernet_subsys() and 
  linked in the pernet_list during boot.

- At the end of boot, pernet_operations are freed (because of the
  __net_initdata attribute), and the pernet_list (or first_device list) 
  points to freed memory.

- After boot, network modules which are netns-aware try to register
  themselves with register_pernet_subsys() and ...KABOOM... page
  fault when accessing pernet_list (or first_device list).
  (I reproduce Cedric's oops with the command: iptables --list)

This is not a problem right now in 2.6.23-mm1 or net-2.6 because 
there are very few netns-aware network subsystems merged and they
are all initialized during boot. But it will be problematic when 
we will merge netns code for subsystems which can be built as 
modules (eg. iptables, ...). I'm not sure we can use 
__net_init_data for pernet_operations then. 
Maybe we can add some checks in register_pernet_operations
when CONFIG_NET_NS=n.

I haven't found a fix yet.

Regards,
Benjamin

-- 
B e n j a m i n   T h e r y  - BULL/DT/Open Software R&D

   http://www.bull.com
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH,RFC] Marvell Orion SoC ethernet driver

2007-10-25 Thread Lennert Buytenhek
On Thu, Oct 25, 2007 at 05:12:04AM -0400, Jeff Garzik wrote:

> >+struct rx_desc {
> >+u32 cmd_sts;
> >+u16 size;
> >+u16 count;
> >+u32 buf;
> >+u32 next;
> >+};
> >+
> >+struct tx_desc {
> >+u32 cmd_sts;
> >+u16 l4i_chk;
> >+u16 count;
> >+u32 buf;
> >+u32 next;
> >+};
> 
> should use sparse type (__le32, etc.) and make sure this driver passes 
> sparse checks
> 
> ditto for checkpatch (except for the excessively anal stuff)

Sorry if it wasn't clear from the thread -- the mainline mv643xx_eth
driver turns out to support the same silicon block (but as part of a
different chip), so we've dropped orion_eth and submitted patches to
make mv643xx_eth work on both the Discovery (what it was originally
written for) and the Orion, and these patches are in -rc1 already.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v1.2.8] wan: new driver retina

2007-10-25 Thread Jeff Garzik

Matti Linnanvuori wrote:

From: Matti Linnanvuori <[EMAIL PROTECTED]>

Adding Retina G.703 and G.SHDSL driver.

Signed-off-by: Matti Linnanvuori <[EMAIL PROTECTED]>


Overall comment:  very nice and clean, well done.




diff -Napur linux-2.6.23/drivers/net/wan/Kconfig 
linux-2.6.24/drivers/net/wan/Kconfig
--- linux-2.6.23/drivers/net/wan/Kconfig2007-10-09 23:31:38.0 
+0300
+++ linux-2.6.24/drivers/net/wan/Kconfig2007-10-25 09:23:19.933170522 
+0300
@@ -494,4 +494,15 @@ config SBNI_MULTILINE
 
 	  If unsure, say N.
 
+config RETINA

+   tristate "Retina support"
+   depends on PCI
+   help
+ Driver for Retina C5400 and E2200 network PCI cards, which
+ support G.703, G.SHDSL with Ethernet encapsulation or
+ character device stream.
+
+ To compile this driver as a module, choose M here: the
+ module will be called retina.
+
 endif # WAN
diff -Napur linux-2.6.23/drivers/net/wan/Makefile 
linux-2.6.24/drivers/net/wan/Makefile
--- linux-2.6.23/drivers/net/wan/Makefile   2007-10-09 23:31:38.0 
+0300
+++ linux-2.6.24/drivers/net/wan/Makefile   2007-10-23 12:31:17.598640178 
+0300
@@ -42,6 +42,7 @@ obj-$(CONFIG_C101)+= c101.o
 obj-$(CONFIG_WANXL)+= wanxl.o
 obj-$(CONFIG_PCI200SYN)+= pci200syn.o
 obj-$(CONFIG_PC300TOO) += pc300too.o
+obj-$(CONFIG_RETINA)   += retina.o
 
 clean-files := wanxlfw.inc

 $(obj)/wanxl.o:$(obj)/wanxlfw.inc
diff -Napur linux-2.6.23/drivers/net/wan/retina.c 
linux-2.6.24/drivers/net/wan/retina.c
--- linux-2.6.23/drivers/net/wan/retina.c   1970-01-01 02:00:00.0 
+0200
+++ linux-2.6.24/drivers/net/wan/retina.c   2007-10-25 13:10:05.004606703 
+0300
@@ -0,0 +1,3708 @@
+/* retina.c: */
+
+/*
+   This driver is based on:
+
+   /drivers/net/fepci.c
+   FEPCI (Frame Engine for PCI) driver for Linux operating system
+
+   Copyright (C) 2002-2003 Jouni Kujala, Flexibilis Oy.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License
+   as published by the Free Software Foundation; either version 2
+   of the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   All the drivers derived from or based on this code fall under the
+   GPL and must retain the copyright and license notice.
+*/
+
+#define DRV_NAME   "retina"
+#define DRV_VERSION"1.2.8"
+
+/* Keep this if you want to have point-to-point links.
+ * Only interfaces listed in retina_ptp_interfaces will be created in PtP mode.
+ * See retina_ptp_interfaces. */
+#define FEPCI_POINT_TO_POINT
+
+/* need to update MODULE_PARM also */
+#define MAX_DEVICES 32u
+
+#define MAX_TX_UNITS  256u
+#define MAX_RX_UNITS  256u
+
+#define MAX_UNIT_SZ_ORDER  10u
+
+#define TX_RING_SIZE   8u
+#define RX_RING_SIZE   8u
+
+/* need to update MODULE_PARM also */
+#define CHANNELS4u
+
+#define RX_FIFO_THRESHOLD_PACKET_MODE 0x4
+#define TX_FIFO_THRESHOLD_PACKET_MODE 0x4
+#define TX_DESC_THRESHOLD_PACKET_MODE 0x4
+
+#define RX_FIFO_THRESHOLD_STREAM_MODE 0x4
+#define TX_FIFO_THRESHOLD_STREAM_MODE 0x7
+#define TX_DESC_THRESHOLD_STREAM_MODE 0x1
+
+/* need to update MODULE_PARM also */
+#define MAX_INTERFACES (CHANNELS*MAX_DEVICES)
+
+static const char fepci_name[] = "retina";
+static const char fepci_alarm_manager_name[] = "retina alarm manager";
+static const char fepci_NAME[] = "RETINA";
+static const char fepci_netdev_name[] = "dcpxx";
+static const char fepci_proc_entry_name[] = "driver/retina";
+
+static unsigned int find_cnt;
+
+#ifdef FEPCI_POINT_TO_POINT
+static char *retina_ptp_interfaces[MAX_INTERFACES];
+static int retina_noarp_with_ptp = 1;
+#endif /* FEPCI_POINT_TO_POINT */
+
+#define fepci_features_proc_entry_name "driver/retina/%02x:%02x.%02x/features"
+#define fepci_settings_proc_entry_name "driver/retina/%02x:%02x.%02x/settings"
+#define fepci_status_proc_entry_name "driver/retina/%02x:%02x.%02x/status"
+
+/* Time in jiffies before concluding that the transmitter is hung */
+#define TX_TIMEOUT  (5 * HZ)
+
+#include "retina.h"
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+MODULE_VERSION(DRV_VERSION);
+
+/* PCI I/O space extent */
+#define FEPCI_SIZE 0x2


consider making an enum like your other constants



+#define PCI_IOTYPE (PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY)


delete, never used



+static struct pci_device_id fepci_pci_tbl[] __devinitdata = {
+   {0x

Re: [PATCH v4] FEC - fast ethernet controller for mpc52xx

2007-10-25 Thread Jeff Garzik

Domen Puncer wrote:

+static int mpc52xx_fec_alloc_rx_buffers(struct bcom_task *rxtsk)
+{
+   while (!bcom_queue_full(rxtsk)) {
+   struct sk_buff *skb;
+   struct bcom_fec_bd *bd;
+
+   skb = dev_alloc_skb(FEC_RX_BUFFER_SIZE);
+   if (skb == NULL)
+   return -EAGAIN;
+
+   /* zero out the initial receive buffers to aid debugging */
+   memset(skb->data, 0, FEC_RX_BUFFER_SIZE);
+
+   bd = (struct bcom_fec_bd *)bcom_prepare_next_buffer(rxtsk);
+
+   bd->status = FEC_RX_BUFFER_SIZE;
+   bd->skb_pa = virt_to_phys(skb->data);
+
+   bcom_submit_next_buffer(rxtsk, skb);


use your platform's dma mapping functions, rather than virt_to_phys()

it might be the exact same implementation, inside the platform 
internals, but drivers should not be using this directly.




+/* based on generic_adjust_link from fs_enet-main.c */
+static void mpc52xx_fec_adjust_link(struct net_device *dev)
+{
+   struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+   struct phy_device *phydev = priv->phydev;
+   int new_state = 0;
+
+   if (phydev->link != PHY_DOWN) {
+   if (phydev->duplex != priv->duplex) {
+   struct mpc52xx_fec __iomem *fec = priv->fec;
+   u32 rcntrl;
+   u32 tcntrl;
+
+   new_state = 1;
+   priv->duplex = phydev->duplex;
+
+   rcntrl = in_be32(&fec->r_cntrl);
+   tcntrl = in_be32(&fec->x_cntrl);
+
+   rcntrl &= ~FEC_RCNTRL_DRT;
+   tcntrl &= ~FEC_TCNTRL_FDEN;
+   if (phydev->duplex == DUPLEX_FULL)
+   tcntrl |= FEC_TCNTRL_FDEN;  /* FD enable */
+   else
+   rcntrl |= FEC_RCNTRL_DRT;   /* disable Rx 
on Tx (HD) */
+
+   out_be32(&fec->r_cntrl, rcntrl);
+   out_be32(&fec->x_cntrl, tcntrl);
+   }
+
+   if (phydev->speed != priv->speed) {
+   new_state = 1;
+   priv->speed = phydev->speed;
+   }
+
+   if (priv->link == PHY_DOWN) {
+   new_state = 1;
+   priv->link = phydev->link;
+   netif_schedule(dev);
+   netif_carrier_on(dev);
+   netif_start_queue(dev);
+   }
+
+   } else if (priv->link) {
+   new_state = 1;
+   priv->link = PHY_DOWN;
+   priv->speed = 0;
+   priv->duplex = -1;
+   netif_stop_queue(dev);
+   netif_carrier_off(dev);
+   }
+
+   if (new_state && netif_msg_link(priv))
+   phy_print_status(phydev);
+}
+
+static int mpc52xx_fec_init_phy(struct net_device *dev)
+{
+   struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+   struct phy_device *phydev;
+   char phy_id[BUS_ID_SIZE];
+
+   snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT,
+   (unsigned int)dev->base_addr, priv->phy_addr);
+
+   priv->link = PHY_DOWN;
+   priv->speed = 0;
+   priv->duplex = -1;
+
+   phydev = phy_connect(dev, phy_id, &mpc52xx_fec_adjust_link, 0, 
PHY_INTERFACE_MODE_MII);
+   if (IS_ERR(phydev)) {
+   dev_err(&dev->dev, "phy_connect failed\n");
+   return PTR_ERR(phydev);
+   }
+   dev_info(&dev->dev, "attached phy %i to driver %s\n",
+   phydev->addr, phydev->drv->name);
+
+   priv->phydev = phydev;
+
+   return 0;
+}
+
+static int mpc52xx_fec_phy_start(struct net_device *dev)
+{
+   struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+   int err;
+
+   if (!priv->has_phy)
+   return 0;
+
+   err = mpc52xx_fec_init_phy(dev);
+   if (err) {
+   dev_err(&dev->dev, "mpc52xx_fec_init_phy failed\n");
+   return err;
+   }
+
+   /* reset phy - this also wakes it from PDOWN */
+   phy_write(priv->phydev, MII_BMCR, BMCR_RESET);
+   phy_start(priv->phydev);
+
+   return 0;
+}
+
+static void mpc52xx_fec_phy_stop(struct net_device *dev)
+{
+   struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+   if (!priv->has_phy)
+   return;
+
+   phy_disconnect(priv->phydev);
+   /* power down phy */
+   phy_stop(priv->phydev);
+   phy_write(priv->phydev, MII_BMCR, BMCR_PDOWN);
+}
+
+static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv,
+   struct mii_ioctl_data *mii_data, int cmd)
+{
+   if (!priv->has_phy)
+   return -ENOTSUPP;
+
+   return phy_mii_ioctl(priv->phydev, mii_data, cmd);
+}
+
+static void mpc52xx_fec_phy_hw_init(struct mpc52xx_fec_priv *priv)
+{
+   struct mpc52xx_fec __iomem *fec = priv->fec;
+

Re: [PATCH] wan: new driver retina

2007-10-25 Thread Jeff Garzik


Not sure what's going on, but your patch looks scrambled, as scripts 
look at it:



From: Matti Linnanvuori <[EMAIL PROTECTED]>=0A=0AAdding Retina G.7=
03 and G.SHDSL driver.=0A=0ASigned-off-by: Matti Linnanvuori =0A---=0A=0AFixing bugs and style according to netdev mailing=
 list comments.=0A=0Adiff -Napur linux-2.6.23/drivers/net/wan/Kconfig linux=
-2.6.24/drivers/net/wan/Kconfig=0A--- linux-2.6.23/drivers/net/wan/Kconfig=
=092007-10-09 23:31:38.0 +0300=0A+++ linux-2.6.24/drivers/net/wan/K=
config=092007-10-25 09:23:19.933170522 +0300=0A@@ -494,4 +494,15 @@ config =
SBNI_MULTILINE=0A =0A =09  If unsure, say N.=0A =0A+config RETINA=0A+=09tri=
state "Retina support"=0A+=09depends on PCI=0A+=09help=0A+=09  Driver for R=


Its been mangled into "Content-Transfer-Encoding: quoted-printable" by 
your mailer.


Also, when you revise a patch, please note somehow that this is an 
updated version.  One convention is changing the subject line:


[PATCH v3] wan: new driver retina

Otherwise I have an mbox full of seemingly-similar patches, all with the 
subject "wan: new driver retina"


Jeff


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH,RFC] Marvell Orion SoC ethernet driver

2007-10-25 Thread Jeff Garzik

Lennert Buytenhek wrote:

+struct rx_desc {
+   u32 cmd_sts;
+   u16 size;
+   u16 count;
+   u32 buf;
+   u32 next;
+};
+
+struct tx_desc {
+   u32 cmd_sts;
+   u16 l4i_chk;
+   u16 count;
+   u32 buf;
+   u32 next;
+};


should use sparse type (__le32, etc.) and make sure this driver passes 
sparse checks


ditto for checkpatch (except for the excessively anal stuff)



+struct orion_priv {
+   unsigned long base_addr;
+
+   /*
+* RX stuff
+*/
+   u32 rxd_used;
+   u32 rxd_curr;
+   u32 rxd_count;
+   u32 rxd_max_pending;
+   struct sk_buff *rx_skb[RX_DESC_NR];
+   struct rx_desc *rxd_base;
+   dma_addr_t rxd_base_dma;
+   spinlock_t rx_lock;
+   struct timer_list rx_fill_timer;
+
+   /*
+* TX stuff
+*/
+   u32 txd_used;
+   u32 txd_curr;
+   u32 txd_count;
+   u32 txd_max_pending;
+   struct sk_buff *tx_skb[TX_DESC_NR];
+   struct tx_desc *txd_base;
+   dma_addr_t txd_base_dma;
+   spinlock_t tx_lock;
+
+   /*
+* PHY stuff
+*/
+   struct mii_if_info mii;
+   spinlock_t mii_lock;
+
+   /*
+* Statistics counters
+*/
+   struct net_device_stats stats;
+};
+
+/*
+ * PHY access
+ /
+static int orion_mii_read(struct net_device *dev, int phy_id, int reg)
+{
+   struct orion_priv *op = netdev_priv(dev);
+   int val, i;
+
+   spin_lock(&op->mii_lock);
+
+   /*
+* Poll until not busy
+*/
+   for (i = 1; i && (rdl(op, ETH_SMI) & SMI_BUSY); i--)
+   rmb();
+
+   if (i == 0) {
+   printk("orion-eth mii read busy timeout\n");
+   val = -1;
+   goto out;
+   }
+
+   /*
+* Issue read command
+*/
+   wrl(op, ETH_SMI, (phy_id << SMI_DEV_OFFS) |
+(reg << SMI_REG_OFFS) | SMI_READ);
+
+   /*
+* Poll until data is ready
+*/
+   for (i = 1; i && !(rdl(op, ETH_SMI) & SMI_READ_VALID); i--)
+   rmb();
+
+   if (i == 0) {
+   printk("orion-eth mii read busy timeout\n");
+   val = -1;
+   goto out;
+   }
+
+   /*
+* Read data
+*/
+   val = rdl(op, ETH_SMI) & 0x;
+
+out:
+   spin_unlock(&op->mii_lock);
+   return val;
+}
+
+static void orion_mii_write(struct net_device *dev, int phy_id, int reg, int 
data)
+{
+   struct orion_priv *op = netdev_priv(dev);
+   int i;
+
+   spin_lock(&op->mii_lock);
+
+   /*
+* Poll until not busy
+*/
+   for (i = 1; i && (rdl(op, ETH_SMI) & SMI_BUSY); i--)
+   rmb();
+
+   if (i == 0) {
+   printk("orion-eth mii write busy timeout\n");
+   goto out;
+   }
+
+   /*
+* Issue write command
+*/
+   wrl(op, ETH_SMI, (phy_id << 16) | (reg << 21) | data);
+
+out:
+   spin_unlock(&op->mii_lock);
+}
+
+/*
+ * Called from orion_irq in interrupt context.
+ * Not going out to read PHY status, using Orion registers instead.
+ */
+static inline void orion_phy_link_change(struct net_device *dev)
+{
+   struct orion_priv *op = netdev_priv(dev);
+   u32 stat = rdl(op, PORT_STAT);
+
+   if (!(stat & STAT_LINK_UP)) {
+   netif_carrier_off(dev);
+   netif_stop_queue(dev);
+   printk(KERN_NOTICE "%s: link down.\n", dev->name);
+   } else {
+   netif_carrier_on(dev);
+   netif_wake_queue(dev);
+   netif_poll_enable(dev);
+   printk(KERN_NOTICE "%s: link up, ", dev->name);
+   if (stat & STAT_FULL_DUPLEX)
+   printk("full duplex, ");
+   else
+   printk("half duplex, ");
+   if (stat & STAT_SPEED_1000)
+   printk("1000Mbps.\n");
+   else if (stat & STAT_SPEED_100)
+   printk("100Mbps\n");
+   else
+   printk("10Mbps\n");
+   }
+}
+
+/*
+ * MAC address filtering
+ /
+static void orion_set_unicast(struct orion_priv *op, u8 *addr)
+{
+   int i;
+
+   /*
+* Clear unicast table
+*/
+   for (i = 0; i < PORT_UCAST_SIZE; i += 4)
+   wrl(op, PORT_UCAST_BASE + i, 0);
+
+   /*
+* Setup MAC addr registers
+*/
+   wrl(op, PORT_MAC_HI, (addr[0] << 24) | (addr[1] << 16) |
+(addr[2] << 8) | addr[3]);
+   wrl(op, PORT_MAC_LO, (addr[4] << 8) | addr[5]);
+
+   /*
+* Enable our entry in unicat table
+*

Re: [RFC][PATCH 0/3][XFRM]: Support packet processing error statistics.

2007-10-25 Thread Masahide NAKAMURA
Wednesday 24 October 2007 21:18, jamal wrote:
> On Wed, 2007-24-10 at 12:30 +0900, Masahide NAKAMURA wrote:
> 
> > At IPsec point of view, actually "SPI mismatch" caused by user configuration
> > cannot be identified easily since identify of SAD is consist of SPI, 
> > address and
> > protocol(ESP/AH...) and linux SAD uses hash database. It is database 
> > identify
> > mismatch. Then, SPI mismatch goes "NoStates" at my patch.
> > OTOH Key mismatch goes "ProtoError" since esp[46]_input returns error.
> 
> Would be useful to just document what you said above so that user doesnt
> have to intepret it.

OK, I write it to commit-log then. If anybody have another place
where such information should be written, tell me.

[snip]
> > > In any case, it seems to me to be more accurate to not call them MIB
> > > stats if they are not. This doesnt qualify using the macros, utilities
> > > etc used for MIBs.
> > 
> 
> BTW, I meant "doesnt disqualify them" above;-> 

OK ;-)

Jamal, thanks for many comments.

-- 
Masahide NAKAMURA
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Regression in current git - Network Manager fails (bisected)

2007-10-25 Thread Thomas Graf
* Dan Williams <[EMAIL PROTECTED]> 2007-10-23 10:10
> Should I make NM disable ACKs for now until it gets fixed?

The reason libnl enables ACKs by default is to give the
application using it clear synchronisation points. For
change requests that means the interface function won't
return until the change has been commited as it will
call nl_wait_for_ack(). So if you disable it in NM and
run it on "old" kernels still using async netlink you
won't be sure when the change is actually being done so
this might break things if you rely on it.

I think providing a invalid message handler which returns
NL_OK if nlmsg_type is NLMSG_DONE or NLMSG_ERROR && err == 0
would be better if you need some kind of workaround. As
those messages are always last this should never cause
real troubles.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-2.6] [TCP]: fix D-SACK cwnd handling

2007-10-25 Thread Ryousei Takano
In the current net-2.6 kernel, handling FLAG_DSACKING_ACK is broken.
The flag is cleared to 1 just after FLAG_DSACKING_ACK is set.

if (found_dup_sack)
flag |= FLAG_DSACKING_ACK;
:
flag = 1;

To fix it, this patch introduces a part of the tcp_sacktag_state patch:
http://marc.info/?l=linux-netdev&m=119210560431519&w=2

Do you plan to apply the tcp_sacktag_state patch?
Or please apply this patch.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: Ryousei Takano <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   12 +---
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3dbbb44..59e3c9a 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1248,6 +1248,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
int cached_fack_count;
int i;
int first_sack_index;
+   int force_one_sack;
 
if (!tp->sacked_out) {
if (WARN_ON(tp->fackets_out))
@@ -1272,18 +1273,18 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
 * if the only SACK change is the increase of the end_seq of
 * the first block then only apply that SACK block
 * and use retrans queue hinting otherwise slowpath */
-   flag = 1;
+   force_one_sack = 1;
for (i = 0; i < num_sacks; i++) {
__be32 start_seq = sp[i].start_seq;
__be32 end_seq = sp[i].end_seq;
 
if (i == 0) {
if (tp->recv_sack_cache[i].start_seq != start_seq)
-   flag = 0;
+   force_one_sack = 0;
} else {
if ((tp->recv_sack_cache[i].start_seq != start_seq) ||
(tp->recv_sack_cache[i].end_seq != end_seq))
-   flag = 0;
+   force_one_sack = 0;
}
tp->recv_sack_cache[i].start_seq = start_seq;
tp->recv_sack_cache[i].end_seq = end_seq;
@@ -1295,7 +1296,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
}
 
first_sack_index = 0;
-   if (flag)
+   if (force_one_sack)
num_sacks = 1;
else {
int j;
@@ -1321,9 +1322,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
}
}
 
-   /* clear flag as used for different purpose in following code */
-   flag = 0;
-
/* Use SACK fastpath hint if valid */
cached_skb = tp->fastpath_skb_hint;
cached_fack_count = tp->fastpath_cnt_hint;
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-2.6] [TCP]: fix D-SACK cwnd handling

2007-10-25 Thread Ilpo Järvinen
On Thu, 25 Oct 2007, Ryousei Takano wrote:

> In the current net-2.6 kernel, handling FLAG_DSACKING_ACK is broken.
> The flag is cleared to 1 just after FLAG_DSACKING_ACK is set.
> 
> if (found_dup_sack)
> flag |= FLAG_DSACKING_ACK;
>   :
>   flag = 1;
> 
> To fix it, this patch introduces a part of the tcp_sacktag_state patch:
>   http://marc.info/?l=linux-netdev&m=119210560431519&w=2
> 
> Do you plan to apply the tcp_sacktag_state patch?
> Or please apply this patch.

Thanks for noticing this, it seems I've been playing too much already with 
the safer code where the possibility of this kind of annoying trap is 
already removed and wasn't therefore careful enough anymore. Luckily, it 
doesn't have huge impact.

...I'd say that this is better for now (it could have been a separate one
right from the beginning, conforms better to just-one-thing-per-patch). 
State patch and other things that depend on it are not targetted, at 
earliest, to 2.6.25 AFAICT, so no big hurry to have it fully.

Acked-by: Ilpo Järvinen <[EMAIL PROTECTED]>

-- 
 i.

> Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
> Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
> Signed-off-by: Ryousei Takano <[EMAIL PROTECTED]>
> ---
>  net/ipv4/tcp_input.c |   12 +---
>  1 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 3dbbb44..59e3c9a 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -1248,6 +1248,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
> *ack_skb, u32 prior_snd_
>   int cached_fack_count;
>   int i;
>   int first_sack_index;
> + int force_one_sack;
>  
>   if (!tp->sacked_out) {
>   if (WARN_ON(tp->fackets_out))
> @@ -1272,18 +1273,18 @@ tcp_sacktag_write_queue(struct sock *sk, struct 
> sk_buff *ack_skb, u32 prior_snd_
>* if the only SACK change is the increase of the end_seq of
>* the first block then only apply that SACK block
>* and use retrans queue hinting otherwise slowpath */
> - flag = 1;
> + force_one_sack = 1;
>   for (i = 0; i < num_sacks; i++) {
>   __be32 start_seq = sp[i].start_seq;
>   __be32 end_seq = sp[i].end_seq;
>  
>   if (i == 0) {
>   if (tp->recv_sack_cache[i].start_seq != start_seq)
> - flag = 0;
> + force_one_sack = 0;
>   } else {
>   if ((tp->recv_sack_cache[i].start_seq != start_seq) ||
>   (tp->recv_sack_cache[i].end_seq != end_seq))
> - flag = 0;
> + force_one_sack = 0;
>   }
>   tp->recv_sack_cache[i].start_seq = start_seq;
>   tp->recv_sack_cache[i].end_seq = end_seq;
> @@ -1295,7 +1296,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
> *ack_skb, u32 prior_snd_
>   }
>  
>   first_sack_index = 0;
> - if (flag)
> + if (force_one_sack)
>   num_sacks = 1;
>   else {
>   int j;
> @@ -1321,9 +1322,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
> *ack_skb, u32 prior_snd_
>   }
>   }
>  
> - /* clear flag as used for different purpose in following code */
> - flag = 0;
> -
>   /* Use SACK fastpath hint if valid */
>   cached_skb = tp->fastpath_skb_hint;
>   cached_fack_count = tp->fastpath_cnt_hint;
> 

[git patches] net driver updates

2007-10-25 Thread Jeff Garzik

Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git 
upstream-linus

to receive the following updates:

 Documentation/networking/00-INDEX|2 -
 Documentation/networking/net-modules.txt |  315 --
 drivers/net/bonding/bond_main.c  |5 +-
 drivers/net/bonding/bonding.h|1 -
 drivers/net/cpmac.c  |  145 --
 drivers/net/ehea/ehea.h  |2 +-
 drivers/net/ehea/ehea_main.c |7 +-
 drivers/net/forcedeth.c  |   16 ++
 drivers/net/ipg.c|   22 ++-
 drivers/net/ipg.h|   20 --
 drivers/net/natsemi.c|1 +
 drivers/net/usb/rndis_host.c |   18 ++-
 include/linux/pci_ids.h  |4 +
 13 files changed, 149 insertions(+), 409 deletions(-)
 delete mode 100644 Documentation/networking/net-modules.txt

Adrian Bunk (4):
  remove Documentation/networking/net-modules.txt
  drivers/net/ipg.c: cleanups
  make bonding/bond_main.c:bond_deinit() static
  bonding/bond_main.c: fix cut'n'paste error

Ayaz Abdulla (1):
  [netdrvr] forcedeth: add MCP77 device IDs

Eugene Konev (3):
  cpmac: use print_mac() instead of MAC_FMT
  cpmac: convert to napi_struct interface
  cpmac: update to new fixed phy driver interface

Ingo Molnar (1):
  natsemi: fix oops, link back netdevice from private-struct

Jan-Bernd Themann (1):
  ehea: fix port_napi_disable/enable

Thomas Sailer (1):
  rndis_host: reduce MTU instead of refusing to talk to devices with low 
max packet size

diff --git a/Documentation/networking/00-INDEX 
b/Documentation/networking/00-INDEX
index 153d84d..f5a5e6d 100644
--- a/Documentation/networking/00-INDEX
+++ b/Documentation/networking/00-INDEX
@@ -80,8 +80,6 @@ multicast.txt
- Behaviour of cards under Multicast
 ncsa-telnet
- notes on how NCSA telnet (DOS) breaks with MTU discovery enabled.
-net-modules.txt
-   - info and "insmod" parameters for all network driver modules.
 netdevices.txt
- info on network device driver functions exported to the kernel.
 olympic.txt
diff --git a/Documentation/networking/net-modules.txt 
b/Documentation/networking/net-modules.txt
deleted file mode 100644
index 98c4392..000
--- a/Documentation/networking/net-modules.txt
+++ /dev/null
@@ -1,315 +0,0 @@
-Wed 2-Aug-95  <[EMAIL PROTECTED]>
-
-   Linux network driver modules
-
-   Do not mistake this for "README.modules" at the top-level
-   directory!  That document tells about modules in general, while
-   this one tells only about network device driver modules.
-
-   This is a potpourri of INSMOD-time(*) configuration options
-   (if such exists) and their default values of various modules
-   in the Linux network drivers collection.
-
-   Some modules have also hidden (= non-documented) tunable values.
-   The choice of not documenting them is based on general belief, that
-   the less the user needs to know, the better.  (There are things that
-   driver developers can use, others should not confuse themselves.)
-
-   In many cases it is highly preferred that insmod:ing is done
-   ONLY with defining an explicit address for the card, AND BY
-   NOT USING AUTO-PROBING!
-
-   Now most cards have some explicitly defined base address that they
-   are compiled with (to avoid auto-probing, among other things).
-   If that compiled value does not match your actual configuration,
-   do use the "io=0xXXX" -parameter for the insmod, and give there
-   a value matching your environment.
-
-   If you are adventurous, you can ask the driver to autoprobe
-   by using the "io=0" parameter, however it is a potentially dangerous
-   thing to do in a live system.  (If you don't know where the
-   card is located, you can try autoprobing, and after possible
-   crash recovery, insmod with proper IO-address..)
-
-   --
-   (*) "INSMOD-time" means when you load module with
-   /sbin/insmod  you can feed it optional parameters.
-   See "man insmod".
-   --
-
-
-   8390 based Network Modules  (Paul Gortmaker, Nov 12, 1995)
-   --
-
-(Includes: smc-ultra, ne, wd, 3c503, hp, hp-plus, e2100 and ac3200)
-
-The 8390 series of network drivers now support multiple card systems without 
-reloading the same module multiple times (memory efficient!) This is done by 
-specifying multiple comma separated values, such as:
-
-   insmod 3c503.o io=0x280,0x300,0x330,0x350  xcvr=0,1,0,1
-
-The above would have the one module controlling four 3c503 cards, with card 2
-and 4 using external transceivers. The "insmod" manual describes the usage
-of comma separated value lists.
-
-It 

Re: [PATCH 1/3] netdev: use ARRAY_SIZE() instead of sizeof(array) / ETH_GSTRING_LEN

2007-10-25 Thread Jeff Garzik

applied 1-3 to #upstream (2.6.25)


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] forcedeth new device ids

2007-10-25 Thread Jeff Garzik

applied 1-2, after combining into a single patch


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] cpmac: use print_mac() instead of MAC_FMT

2007-10-25 Thread Jeff Garzik

Eugene Konev wrote:

Switch to using DECLARE_MAC_BUF/print_mac() added by commit
0795af5729b18218767fab27c44b1384f72dc9ad [NET]: Introduce and use print_mac()
and DECLARE_MAC_BUF().


Signed-off-by: Eugene Konev <[EMAIL PROTECTED]>


applied 1-3


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6 patch] remove Documentation/networking/net-modules.txt

2007-10-25 Thread Jeff Garzik

Adrian Bunk wrote:

According to git, the only one who touched this file during the last
5 years was me when removing drivers...

modinfo offers less ancient information.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Acked-by: Geert Uytterhoeven <[EMAIL PROTECTED]>
Acked-by: Paul Gortmaker <[EMAIL PROTECTED]>

---

This patch has been sent on:
- 14 Aug 2007
- 23 Jul 2007



applied


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6 patch] drivers/net/ipg.c: cleanups

2007-10-25 Thread Jeff Garzik

Adrian Bunk wrote:

This patch contains the following cleanups:
- make ipg_nic_get_stats() static
- move DefaultPhyParam[] from ipg.h to ipg.c and make it static



applied


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6 patch] make bonding/bond_main.c:bond_deinit() static

2007-10-25 Thread Jeff Garzik

applied both bonding patches

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html