Re: [PATCH] Optimize cxgb3 xmit path (a bit)

2008-01-29 Thread Krishna Kumar2
I forgot to mention but the patch is only compile tested as I don't have
hardware to test it.

Krishna Kumar2/India/[EMAIL PROTECTED] wrote on 01/30/2008 12:30:16 PM:

> Changes:
>1. Add common code for stopping queue.
>2. No need to call netif_stop_queue followed by netif_wake_queue (and
>   infact a netif_start_queue could have been used instead), instead
>   call stop_queue if required, and remove code under USE_GTS macro.
>3. There is no need to check for netif_queue_stopped, as the network
>   core guarantees that for us (I am sure every driver could remove
>   that check, eg e1000 - I have tested that path a few billion times
>   with about a few hundred thousand qstops but the condition never
>   hit even once).
>
> Thanks,
>
> - KK
>
> Signed-off-by: Krishna Kumar <[EMAIL PROTECTED]>
> ---
>  sge.c |   35 +++
>  1 files changed, 15 insertions(+), 20 deletions(-)
>
> diff -ruNp a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
> --- a/drivers/net/cxgb3/sge.c   2008-01-30 11:42:39.0 +0530
> +++ b/drivers/net/cxgb3/sge.c   2008-01-30 12:15:28.0 +0530
> @@ -1059,6 +1059,14 @@ static void write_tx_pkt_wr(struct adapt
>htonl(V_WR_TID(q->token)));
>  }
>
> +static inline void t3_stop_queue(struct net_device *dev, struct sge_qset
*qs,
> + struct sge_txq *q)
> +{
> +   netif_stop_queue(dev);
> +   set_bit(TXQ_ETH, &qs->txq_stopped);
> +   q->stops++;
> +}
> +
>  /**
>   *   eth_xmit - add a packet to the Ethernet Tx queue
>   *   @skb: the packet
> @@ -1090,31 +1098,18 @@ int t3_eth_xmit(struct sk_buff *skb, str
> ndesc = calc_tx_descs(skb);
>
> if (unlikely(credits < ndesc)) {
> -  if (!netif_queue_stopped(dev)) {
> - netif_stop_queue(dev);
> - set_bit(TXQ_ETH, &qs->txq_stopped);
> - q->stops++;
> - dev_err(&adap->pdev->dev,
> -"%s: Tx ring %u full while queue awake!\n",
> -dev->name, q->cntxt_id & 7);
> -  }
> +  t3_stop_queue(dev, qs, q);
> +  dev_err(&adap->pdev->dev,
> + "%s: Tx ring %u full while queue awake!\n",
> + dev->name, q->cntxt_id & 7);
>spin_unlock(&q->lock);
>return NETDEV_TX_BUSY;
> }
>
> q->in_use += ndesc;
> -   if (unlikely(credits - ndesc < q->stop_thres)) {
> -  q->stops++;
> -  netif_stop_queue(dev);
> -  set_bit(TXQ_ETH, &qs->txq_stopped);
> -#if !USE_GTS
> -  if (should_restart_tx(q) &&
> -  test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
> - q->restarts++;
> - netif_wake_queue(dev);
> -  }
> -#endif
> -   }
> +   if (unlikely(credits - ndesc < q->stop_thres))
> +  if (USE_GTS || !should_restart_tx(q))
> + t3_stop_queue(dev, qs, q);
>
> gen = q->gen;
> q->unacked += ndesc;

--
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] Optimize cxgb3 xmit path (a bit)

2008-01-29 Thread Krishna Kumar
Changes:
1. Add common code for stopping queue.
2. No need to call netif_stop_queue followed by netif_wake_queue (and
   infact a netif_start_queue could have been used instead), instead
   call stop_queue if required, and remove code under USE_GTS macro.
3. There is no need to check for netif_queue_stopped, as the network
   core guarantees that for us (I am sure every driver could remove
   that check, eg e1000 - I have tested that path a few billion times
   with about a few hundred thousand qstops but the condition never
   hit even once).

Thanks,

- KK

Signed-off-by: Krishna Kumar <[EMAIL PROTECTED]>
---
 sge.c |   35 +++
 1 files changed, 15 insertions(+), 20 deletions(-)

diff -ruNp a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
--- a/drivers/net/cxgb3/sge.c   2008-01-30 11:42:39.0 +0530
+++ b/drivers/net/cxgb3/sge.c   2008-01-30 12:15:28.0 +0530
@@ -1059,6 +1059,14 @@ static void write_tx_pkt_wr(struct adapt
 htonl(V_WR_TID(q->token)));
 }
 
+static inline void t3_stop_queue(struct net_device *dev, struct sge_qset *qs,
+struct sge_txq *q)
+{
+   netif_stop_queue(dev);
+   set_bit(TXQ_ETH, &qs->txq_stopped);
+   q->stops++;
+}
+
 /**
  * eth_xmit - add a packet to the Ethernet Tx queue
  * @skb: the packet
@@ -1090,31 +1098,18 @@ int t3_eth_xmit(struct sk_buff *skb, str
ndesc = calc_tx_descs(skb);
 
if (unlikely(credits < ndesc)) {
-   if (!netif_queue_stopped(dev)) {
-   netif_stop_queue(dev);
-   set_bit(TXQ_ETH, &qs->txq_stopped);
-   q->stops++;
-   dev_err(&adap->pdev->dev,
-   "%s: Tx ring %u full while queue awake!\n",
-   dev->name, q->cntxt_id & 7);
-   }
+   t3_stop_queue(dev, qs, q);
+   dev_err(&adap->pdev->dev,
+   "%s: Tx ring %u full while queue awake!\n",
+   dev->name, q->cntxt_id & 7);
spin_unlock(&q->lock);
return NETDEV_TX_BUSY;
}
 
q->in_use += ndesc;
-   if (unlikely(credits - ndesc < q->stop_thres)) {
-   q->stops++;
-   netif_stop_queue(dev);
-   set_bit(TXQ_ETH, &qs->txq_stopped);
-#if !USE_GTS
-   if (should_restart_tx(q) &&
-   test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) {
-   q->restarts++;
-   netif_wake_queue(dev);
-   }
-#endif
-   }
+   if (unlikely(credits - ndesc < q->stop_thres))
+   if (USE_GTS || !should_restart_tx(q))
+   t3_stop_queue(dev, qs, q);
 
gen = q->gen;
q->unacked += ndesc;
--
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: [RFC/PATCH] e100 driver didn't support any MII-less PHYs...

2008-01-29 Thread Andreas Mohr
Hi,

On Tue, Jan 29, 2008 at 03:09:25PM -0800, Kok, Auke wrote:
> Andreas Mohr wrote:
> > Perhaps it's useful to file a bug/patch
> > on http://sourceforge.net/projects/e1000/ ? Perhaps -mm testing?
> 
> I wanted to push this though our testing labs first which has not happened 
> due to
> time constraints - that should quickly at least confirm that the most common 
> nics
> work OK after the change with your patch. I'll try and see if we can get this
> testing done soon.

Oh, full-scale regression testing even? Nice idea...
Would optionally be even better if during hardware tests one could also
dig out some i82503-based card (or additional MII-less cards?)
since I didn't really make any effort yet to try to make them all
recognized/supported by my patch already (would have been out of scope anyway
since I have this single card only).

Thanks a lot,

Andreas Mohr
--
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] Debugfs compile fix.

2008-01-29 Thread Denis V. Lunev
Debugfs is not compiled without CONFIG_SYSFS in net-2.6 tree. Move
kobject_create_and_add under appropriate ifdef. The fix looks correct
from a first glance, but may be the dependency should be added into
the Kconfig.

Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]>
---
 fs/debugfs/inode.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index d26e282..61cc937 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -432,9 +432,11 @@ static int __init debugfs_init(void)
 {
int retval;
 
+#ifdef CONFIG_SYSFS
debug_kobj = kobject_create_and_add("debug", kernel_kobj);
if (!debug_kobj)
return -EINVAL;
+#endif
 
retval = register_filesystem(&debug_fs_type);
if (retval)
-- 
1.5.3.rc5

--
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: NEWEMAC: Remove "rgmii-interface" from rgmii matching table

2008-01-29 Thread Stefan Roese
On Wednesday 16 January 2008, Josh Boyer wrote:
> On Wed, 16 Jan 2008 20:53:59 +1100
>
> Benjamin Herrenschmidt <[EMAIL PROTECTED]> wrote:
> > On Wed, 2008-01-16 at 10:37 +0100, Stefan Roese wrote:
> > > With the removal the the "rgmii-interface" device_type property from
> > > the dts files, the newemac driver needs an update to only rely on
> > > compatible property.
> > >
> > > Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
> >
> > I need to test if it works on CAB, can't change the DT on those. I'll
> > let you know tomorrow.
>
> This should be fine on CAB.  The rgmii node has:
>
> compatible = "ibm,rgmii-axon", "ibm,rgmii"
>
> so the match should still catch on the latter.

How about this patch? Ben, if you think this is ok then we should make sure 
that it goes in in this merge-window, since the other dts patch relies on it.

Thanks.

Best regards,
Stefan
--
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 7/7][BNX2]: Update version to 1.7.3.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:20:37 -0800

> [BNX2]: Update version to 1.7.3.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

Also applied, thanks Michael.
--
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 6/7][BNX2]: Update firmware.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:20:20 -0800

> [BNX2]: Update firmware.
> 
> Update firmware to support programmable flow control.
>  
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

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: [PATCH 5/7][BNX2]: Fine-tune flow control on 5709.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:20:00 -0800

> [BNX2]: Fine-tune flow control on 5709.
> 
> Make use of the programmable high/low water marks in 5709 for
> 802.3 flow control.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

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: [PATCH 4/7][BNX2]: Remove CTX_WR macro.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:19:47 -0800

> [BNX2]: Remove CTX_WR macro.
> 
> The CTX_WR macro is unnecessary and obfuscates the code. 
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

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: [BUILD FAILURE]2.6.24-git6 build failure on sis190 ethernet driver

2008-01-29 Thread Sam Ravnborg
On Wed, Jan 30, 2008 at 09:11:36AM +0530, Kamalesh Babulal wrote:
> Hi,
> 
> The 2.6.24-git6 kernel build fails on various x86_64 machines with the build 
> failure
> 
> drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
> make[2]: *** [drivers/net/sis190.o] Error 1
> 
> # gcc --version (machine1)
> gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
> 
> # gcc --version (machine2)
> gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)

Hi Kamalesh

I know another patch is circulating, but please try the following.
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..0a5e024 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1556,7 +1556,7 @@ static int __devinit 
sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
   struct net_device *dev)
 {
-   static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
+   static const u16 __devinitconst ids[] = { 0x0965, 0x0966, 0x0968 };
struct sis190_private *tp = netdev_priv(dev);
struct pci_dev *isa_bridge;
u8 reg, tmp8;

It is the better fix if you can confirm it working.
The section conflict issued by gcc happens because we try to
mix const and non-const data in the same section.

Sam
--
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 3/7][BNX2]: Remove REG_WR_IND/REG_RD_IND macros.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:19:33 -0800

> [BNX2]: Remove REG_WR_IND/REG_RD_IND macros.
> 
> The REG_WR_IND/REG_RD_IND macros are unnecessary and obfuscate the
> code.  Many callers to these macros read and write shared memory from
> the bp->shmem_base, so we add 2 similar functions that automatically
> add the shared memory base.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

Nice cleanup, 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: [PATCH 2/7][BNX2]: Refine tx coalescing setup.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:19:09 -0800

> [BNX2]: Refine tx coalescing setup. 
> 
> Make the tx coalescing setup code independent of the MSIX vector.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

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: [PATCH 1/7][BNX2]: Fix 5706 serdes link down bug.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:18:45 -0800

> [BNX2]: Fix 5706 serdes link down bug.
> 
> 1. Correct the MII expansion serdes control register definition.
> 2. Check an additional RUDI_INVALID bit when determining 5706S link.
> 
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

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: pull request: wireless-2.6 'rndis' 2008-01-29

2008-01-29 Thread David Miller
From: "John W. Linville" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:28:13 -0500

> Dave,
> 
> RNDIS is a de facto standard from Microsoft for USB networking devices.
> We already have support for ethernet devices, but wireless devices exist
> as well.  This series applies some fixes to the current ethernet RNDIS
> stuff to co-exist with wireless and adds a wireless RNDIS driver.  I
> would like to see it in 2.6.25.

Pulled and pushed out to net-2.6, thanks John.

I'm going to review these bits a little bit (as well as the
other merge you just made) before pushing it all out to
Linus.

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 0/6] PS3: gelic: gelic updates for 2.6.25

2008-01-29 Thread Masakazu Mokuno
Hi Jeff,

The patch set I posted on Dec 13 2007 (except v2 of #6) have been
reviewed on the ML and seems to have no more outstanding
comments/requests.
http://marc.info/?l=linux-netdev&m=119754603814092


Is it OK to apply for 2.6.25?  If OK, I'll ask Paul to merge this set
into the powerpc tree with my wireless patch because the dependent patch
set will go into the tree.

best regards

-- 
Masakazu MOKUNO

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


net-2.6.25 is no more...

2008-01-29 Thread David Miller

Now that the bulk has been merged over and we are
actively working alongside Linus's tree I have moved
all current patch applying to net-2.6 instead of net-2.6.25,
so the current tree to use is:

kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git

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: pull request: wireless-2.6 'upstream' 2008-01-29

2008-01-29 Thread David Miller
From: "John W. Linville" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 16:27:03 -0500

> Here are some stragglers for 2.6.25.  Most of them are fixes for the
> new stuff anyway -- I don't think there is anything convroversial.
> 
> Please let me know if there are problems!

Pulled and pushed back out to net-2.6, 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


Re: [PATCH 6/7][BNX2]: Update firmware.

2008-01-29 Thread David Miller
From: "Michael Chan" <[EMAIL PROTECTED]>
Date: Tue, 29 Jan 2008 18:29:56 -0800

> Didn't we beat this topic to death last time?

Yes we did.

> Once again, the driver is tightly coupled with the firmware.  We don't
> want things to break when users upgrade or downgrade the kernel.  Coding
> the driver to deal with different firmware versions will add a lot of
> complexity.

I absolutely agree with Michael here.
--
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 retry] bluetooth : add conn add/del workqueues to avoid connection fail

2008-01-29 Thread David Miller
From: Dave Young <[EMAIL PROTECTED]>
Date: Wed, 30 Jan 2008 10:23:54 +0800

> 
> The bluetooth hci_conn sysfs add/del executed in the default workqueue.
> If the del_conn is executed after the new add_conn with same target,
> add_conn will failed with warning of "same kobject name".
> 
> Here add btaddconn & btdelconn workqueues,
> flush the btdelconn workqueue in the add_conn function to avoid the issue.
> 
> Signed-off-by: Dave Young <[EMAIL PROTECTED]> 

This looks good, applied, thanks Dave.

I've queued this up for 2.6.25 merging, if you want me to
schedule it for -stable, just let me know.

Thanks again.
--
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: ipcomp regression in 2.6.24

2008-01-29 Thread David Miller
From: Herbert Xu <[EMAIL PROTECTED]>
Date: Wed, 30 Jan 2008 14:15:33 +1100

> Marco Berizzi <[EMAIL PROTECTED]> wrote:
> >
> >> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data
> >> > flows in both directions, but no data comes out of the tunnel.
> >> > Needed to disable ipcomp.
> > 
> > Same problem here: linux 2.6.24 driven by openswan 2.4.11
> > on Slackware 11.0
> 
> My bad.  This patch should fix it.
> 
> [IPCOMP]: Fetch nexthdr before ipch is destroyed
> 
> When I moved the nexthdr setting out of IPComp I accidently moved
> the reading of ipch->nexthdr after the decompression.  Unfortunately
> this means that we'd be reading from a stale ipch pointer which
> doesn't work very well.
> 
> This patch moves the reading up so that we get the correct nexthdr
> value.
> 
> Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>

Applied, and queued for -stable, 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: [BUILD FAILURE]2.6.24-git6 build failure on sis190 ethernet driver

2008-01-29 Thread Gabriel C
Kamalesh Babulal wrote:
> Hi,
> 
> The 2.6.24-git6 kernel build fails on various x86_64 machines with the build 
> failure
> 
> drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
> make[2]: *** [drivers/net/sis190.o] Error 1
> 
> # gcc --version (machine1)
> gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
> 
> # gcc --version (machine2)
> gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
> 

Heh :) vger.kernel.org does not like emails directly from gmail , it seems =)

( sorry for sending this 3 time now )

The following patch should fix the build failure.

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..e48e4ad 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static const struct pci_device_id sis190_pci_tbl[] __devinitdata = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
{ 0, },


Gabriel
--
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


[BUILD FAILURE]2.6.24-git6 build failure on sis190 ethernet driver

2008-01-29 Thread Kamalesh Babulal
Hi,

The 2.6.24-git6 kernel build fails on various x86_64 machines with the build 
failure

drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
make[2]: *** [drivers/net/sis190.o] Error 1

# gcc --version (machine1)
gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)

# gcc --version (machine2)
gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)

-- 
Thanks & Regards,
Kamalesh Babulal,
Linux Technology Center,
IBM, ISTL.
--
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: sis190 build breakage

2008-01-29 Thread Sam Ravnborg
On Tue, Jan 29, 2008 at 11:03:10PM +0100, Francois Romieu wrote:
> maximilian attems <[EMAIL PROTECTED]> :
> >   CC [M]  drivers/net/sis190.o
> >   drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type 
> > conflict
> >   make[5]: *** [drivers/net/sis190.o] Error 1
> > 
> > gcc --version
> > gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Looks like a bug where __initdata has been used
for const data.
Searching:
static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
  struct net_device *dev)
{
static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
struct sis190_private *tp = netdev_priv(dev);
struct pci_dev *isa_bridge;
u8 reg, tmp8;

Try to change this is __initconst and it should be fixed.

Sam
--
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: ipcomp regression in 2.6.24

2008-01-29 Thread Herbert Xu
Marco Berizzi <[EMAIL PROTECTED]> wrote:
>
>> > With 2.6.24 IPSEC/ESP tunnels to older kernels establish fine, data
>> > flows in both directions, but no data comes out of the tunnel.
>> > Needed to disable ipcomp.
> 
> Same problem here: linux 2.6.24 driven by openswan 2.4.11
> on Slackware 11.0

My bad.  This patch should fix it.

[IPCOMP]: Fetch nexthdr before ipch is destroyed

When I moved the nexthdr setting out of IPComp I accidently moved
the reading of ipch->nexthdr after the decompression.  Unfortunately
this means that we'd be reading from a stale ipch pointer which
doesn't work very well.

This patch moves the reading up so that we get the correct nexthdr
value.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
index f4af99a..b79cdbe 100644
--- a/net/ipv4/ipcomp.c
+++ b/net/ipv4/ipcomp.c
@@ -74,6 +74,7 @@ out:
 
 static int ipcomp_input(struct xfrm_state *x, struct sk_buff *skb)
 {
+   int nexthdr;
int err = -ENOMEM;
struct ip_comp_hdr *ipch;
 
@@ -84,13 +85,15 @@ static int ipcomp_input(struct xfrm_state *x, struct 
sk_buff *skb)
 
/* Remove ipcomp header and decompress original payload */
ipch = (void *)skb->data;
+   nexthdr = ipch->nexthdr;
+
skb->transport_header = skb->network_header + sizeof(*ipch);
__skb_pull(skb, sizeof(*ipch));
err = ipcomp_decompress(x, skb);
if (err)
goto out;
 
-   err = ipch->nexthdr;
+   err = nexthdr;
 
 out:
return err;
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index b276d04..710325e 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -64,6 +64,7 @@ static LIST_HEAD(ipcomp6_tfms_list);
 
 static int ipcomp6_input(struct xfrm_state *x, struct sk_buff *skb)
 {
+   int nexthdr;
int err = -ENOMEM;
struct ip_comp_hdr *ipch;
int plen, dlen;
@@ -79,6 +80,8 @@ static int ipcomp6_input(struct xfrm_state *x, struct sk_buff 
*skb)
 
/* Remove ipcomp header and decompress original payload */
ipch = (void *)skb->data;
+   nexthdr = ipch->nexthdr;
+
skb->transport_header = skb->network_header + sizeof(*ipch);
__skb_pull(skb, sizeof(*ipch));
 
@@ -108,7 +111,7 @@ static int ipcomp6_input(struct xfrm_state *x, struct 
sk_buff *skb)
skb->truesize += dlen - plen;
__skb_put(skb, dlen - plen);
skb_copy_to_linear_data(skb, scratch, dlen);
-   err = ipch->nexthdr;
+   err = nexthdr;
 
 out_put_cpu:
put_cpu();
--
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 9825] New: GPF in kernel when /sbin/ss used for display DCCP sockets.

2008-01-29 Thread Herbert Xu
Andrew Morton <[EMAIL PROTECTED]> wrote:
>
>> Jan 26 23:38:03 host general protection fault:  [#1] PREEMPT
>> Jan 26 23:38:03 host Modules linked in: iptable_mangle iptable_nat nf_nat
>> ipt_REJECT xt_tcpudp nf_conntrack_ipv4 xt_state ipt_ULOG iptable_filter
>> ip_tables x_
>> Jan 26 23:38:03 host
>> Jan 26 23:38:03 host Pid: 5573, comm: ss Not tainted (2.6.24 #1)
>> Jan 26 23:38:03 host EIP: 0060:[] EFLAGS: 00010282 CPU: 0
>> Jan 26 23:38:03 host EIP is at inet_diag_dump+0x2a/0x88b

This should be fixed by

[PATCH][INET_DIAG]: Fix inet_diag_lock_handler error path
[EMAIL PROTECTED]

that Arnaldo posted recently.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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 retry] bluetooth : add conn add/del workqueues to avoid connection fail

2008-01-29 Thread Dave Young

The bluetooth hci_conn sysfs add/del executed in the default workqueue.
If the del_conn is executed after the new add_conn with same target,
add_conn will failed with warning of "same kobject name".

Here add btaddconn & btdelconn workqueues,
flush the btdelconn workqueue in the add_conn function to avoid the issue.

Signed-off-by: Dave Young <[EMAIL PROTECTED]> 

---
diff -upr a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
--- a/net/bluetooth/hci_sysfs.c 2008-01-30 10:14:27.0 +0800
+++ b/net/bluetooth/hci_sysfs.c 2008-01-30 10:14:14.0 +0800
@@ -12,6 +12,8 @@
 #undef  BT_DBG
 #define BT_DBG(D...)
 #endif
+static struct workqueue_struct *btaddconn;
+static struct workqueue_struct *btdelconn;
 
 static inline char *typetostr(int type)
 {
@@ -279,6 +281,7 @@ static void add_conn(struct work_struct 
struct hci_conn *conn = container_of(work, struct hci_conn, work);
int i;
 
+   flush_workqueue(btdelconn);
if (device_add(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
return;
@@ -313,6 +316,7 @@ void hci_conn_add_sysfs(struct hci_conn 
 
INIT_WORK(&conn->work, add_conn);
 
+   queue_work(btaddconn, &conn->work);
schedule_work(&conn->work);
 }
 
@@ -349,6 +353,7 @@ void hci_conn_del_sysfs(struct hci_conn 
 
INIT_WORK(&conn->work, del_conn);
 
+   queue_work(btdelconn, &conn->work);
schedule_work(&conn->work);
 }
 
@@ -398,31 +403,52 @@ int __init bt_sysfs_init(void)
 {
int err;
 
+   btaddconn = create_singlethread_workqueue("btaddconn");
+   if (!btaddconn) {
+   err = -ENOMEM;
+   goto out;
+   }
+   btdelconn = create_singlethread_workqueue("btdelconn");
+   if (!btdelconn) {
+   err = -ENOMEM;
+   goto out_del;
+   }
+
bt_platform = platform_device_register_simple("bluetooth", -1, NULL, 0);
-   if (IS_ERR(bt_platform))
-   return PTR_ERR(bt_platform);
+   if (IS_ERR(bt_platform)) {
+   err = PTR_ERR(bt_platform);
+   goto out_platform;
+   }
 
err = bus_register(&bt_bus);
-   if (err < 0) {
-   platform_device_unregister(bt_platform);
-   return err;
-   }
+   if (err < 0)
+   goto out_bus;
 
bt_class = class_create(THIS_MODULE, "bluetooth");
if (IS_ERR(bt_class)) {
-   bus_unregister(&bt_bus);
-   platform_device_unregister(bt_platform);
-   return PTR_ERR(bt_class);
+   err = PTR_ERR(bt_class);
+   goto out_class;
}
 
return 0;
+
+out_class:
+   bus_unregister(&bt_bus);
+out_bus:
+   platform_device_unregister(bt_platform);
+out_platform:
+   destroy_workqueue(btdelconn);
+out_del:
+   destroy_workqueue(btaddconn);
+out:
+   return err;
 }
 
 void bt_sysfs_cleanup(void)
 {
+   destroy_workqueue(btaddconn);
+   destroy_workqueue(btdelconn);
class_destroy(bt_class);
-
bus_unregister(&bt_bus);
-
platform_device_unregister(bt_platform);
 }
--
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 6/7] bonding: update version

2008-01-29 Thread Jay Vosburgh
Update bonding to version 3.2.4.

Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bonding.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 6d83be4..67ccad6 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -22,8 +22,8 @@
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#define DRV_VERSION"3.2.3"
-#define DRV_RELDATE"December 6, 2007"
+#define DRV_VERSION"3.2.4"
+#define DRV_RELDATE"January 28, 2008"
 #define DRV_NAME   "bonding"
 #define DRV_DESCRIPTION"Ethernet Channel Bonding Driver"
 
-- 
1.5.3.4.206.g58ba4-dirty

--
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 7/7] bonding: update MAINTAINERS

2008-01-29 Thread Jay Vosburgh
Remove Chad Tindel; he hasn't been involved for a number
of years.

Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 MAINTAINERS |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2340cfb..4b7fa32 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -930,8 +930,6 @@ M:  [EMAIL PROTECTED]
 S: Maintained
 
 BONDING DRIVER
-P: Chad Tindel
-M: [EMAIL PROTECTED]
 P: Jay Vosburgh
 M: [EMAIL PROTECTED]
 L: [EMAIL PROTECTED]
-- 
1.5.3.4.206.g58ba4-dirty

--
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 5/7] bonding: do not acquire rtnl in ARP monitor

2008-01-29 Thread Jay Vosburgh
The ARP monitor functions currently acquire RTNL when performing
failover operations, but do so incorrectly (out of order).  This causes
various warnings from might_sleep.

The ARP monitor isn't supported for any of the bonding modes
that actually require RTNL, so it is safe to not hold RTNL when
failing over in the ARP monitor.

Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |   12 
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0cc853e..b532125 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2801,14 +2801,11 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
}
 
if (do_failover) {
-   rtnl_lock();
write_lock_bh(&bond->curr_slave_lock);
 
bond_select_active_slave(bond);
 
write_unlock_bh(&bond->curr_slave_lock);
-   rtnl_unlock();
-
}
 
 re_arm:
@@ -2865,8 +2862,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
 
slave->link = BOND_LINK_UP;
 
-   rtnl_lock();
-
write_lock_bh(&bond->curr_slave_lock);
 
if ((!bond->curr_active_slave) &&
@@ -2902,7 +2897,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
}
 
write_unlock_bh(&bond->curr_slave_lock);
-   rtnl_unlock();
}
} else {
read_lock(&bond->curr_slave_lock);
@@ -2972,7 +2966,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
   bond->dev->name,
   slave->dev->name);
 
-   rtnl_lock();
write_lock_bh(&bond->curr_slave_lock);
 
bond_select_active_slave(bond);
@@ -2980,8 +2973,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
 
write_unlock_bh(&bond->curr_slave_lock);
 
-   rtnl_unlock();
-
bond->current_arp_slave = slave;
 
if (slave) {
@@ -2999,13 +2990,10 @@ void bond_activebackup_arp_mon(struct work_struct *work)
   bond->primary_slave->dev->name);
 
/* primary is up so switch to it */
-   rtnl_lock();
write_lock_bh(&bond->curr_slave_lock);
bond_change_active_slave(bond, bond->primary_slave);
write_unlock_bh(&bond->curr_slave_lock);
 
-   rtnl_unlock();
-
slave = bond->primary_slave;
slave->jiffies = jiffies;
} else {
-- 
1.5.3.4.206.g58ba4-dirty

--
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/7] bonding: fix race that causes invalid statistics

2008-01-29 Thread Jay Vosburgh
From: Andy Gospodarek <[EMAIL PROTECTED]>

I've seen reports of invalid stats in /proc/net/dev for bonding
interfaces, and found it's a pretty easy problem to reproduce.  Since
the current code zeros the bonding stats when a read is requested and a
pointer to that data is returned to the caller we cannot guarantee that
the caller has completely accessed the data before a successive call to
request the stats zeroes the stats again.

This patch creates a new stack variable to keep track of the updated
stats and copies the data from that variable into the bonding stats
structure.  This ensures that the value for any of the bonding stats
should not incorrectly return zero for any of the bonding statistics.
This does use more stack space and require an extra memcpy, but it seems
like a fair trade-off for consistently correct bonding statistics.

Signed-off-by: Andy Gospodarek <[EMAIL PROTECTED]>
Signed-off-by: Chris Snook <[EMAIL PROTECTED]>
Acked-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |   57 --
 1 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 63866da..0cc853e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3775,41 +3775,44 @@ static struct net_device_stats *bond_get_stats(struct 
net_device *bond_dev)
 {
struct bonding *bond = bond_dev->priv;
struct net_device_stats *stats = &(bond->stats), *sstats;
+   struct net_device_stats local_stats;
struct slave *slave;
int i;
 
-   memset(stats, 0, sizeof(struct net_device_stats));
+   memset(&local_stats, 0, sizeof(struct net_device_stats));
 
read_lock_bh(&bond->lock);
 
bond_for_each_slave(bond, slave, i) {
sstats = slave->dev->get_stats(slave->dev);
-   stats->rx_packets += sstats->rx_packets;
-   stats->rx_bytes += sstats->rx_bytes;
-   stats->rx_errors += sstats->rx_errors;
-   stats->rx_dropped += sstats->rx_dropped;
-
-   stats->tx_packets += sstats->tx_packets;
-   stats->tx_bytes += sstats->tx_bytes;
-   stats->tx_errors += sstats->tx_errors;
-   stats->tx_dropped += sstats->tx_dropped;
-
-   stats->multicast += sstats->multicast;
-   stats->collisions += sstats->collisions;
-
-   stats->rx_length_errors += sstats->rx_length_errors;
-   stats->rx_over_errors += sstats->rx_over_errors;
-   stats->rx_crc_errors += sstats->rx_crc_errors;
-   stats->rx_frame_errors += sstats->rx_frame_errors;
-   stats->rx_fifo_errors += sstats->rx_fifo_errors;
-   stats->rx_missed_errors += sstats->rx_missed_errors;
-
-   stats->tx_aborted_errors += sstats->tx_aborted_errors;
-   stats->tx_carrier_errors += sstats->tx_carrier_errors;
-   stats->tx_fifo_errors += sstats->tx_fifo_errors;
-   stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
-   stats->tx_window_errors += sstats->tx_window_errors;
-   }
+   local_stats.rx_packets += sstats->rx_packets;
+   local_stats.rx_bytes += sstats->rx_bytes;
+   local_stats.rx_errors += sstats->rx_errors;
+   local_stats.rx_dropped += sstats->rx_dropped;
+
+   local_stats.tx_packets += sstats->tx_packets;
+   local_stats.tx_bytes += sstats->tx_bytes;
+   local_stats.tx_errors += sstats->tx_errors;
+   local_stats.tx_dropped += sstats->tx_dropped;
+
+   local_stats.multicast += sstats->multicast;
+   local_stats.collisions += sstats->collisions;
+
+   local_stats.rx_length_errors += sstats->rx_length_errors;
+   local_stats.rx_over_errors += sstats->rx_over_errors;
+   local_stats.rx_crc_errors += sstats->rx_crc_errors;
+   local_stats.rx_frame_errors += sstats->rx_frame_errors;
+   local_stats.rx_fifo_errors += sstats->rx_fifo_errors;
+   local_stats.rx_missed_errors += sstats->rx_missed_errors;
+
+   local_stats.tx_aborted_errors += sstats->tx_aborted_errors;
+   local_stats.tx_carrier_errors += sstats->tx_carrier_errors;
+   local_stats.tx_fifo_errors += sstats->tx_fifo_errors;
+   local_stats.tx_heartbeat_errors += sstats->tx_heartbeat_errors;
+   local_stats.tx_window_errors += sstats->tx_window_errors;
+   }
+
+   memcpy(stats, &local_stats, sizeof(struct net_device_stats));
 
read_unlock_bh(&bond->lock);
 
-- 
1.5.3.4.206.g58ba4-dirty

--
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/7] bonding: fix set_multicast_list locking

2008-01-29 Thread Jay Vosburgh
This patch eliminates a problem (reported by lockdep) in the
bond_set_multicast_list function.  It first reduces the locking on
bond->lock to a simple read_lock, and second, adds netif_tx locking
around the bonding mc_list manipulations that occur outside of the
set_multicast_list function.

The original problem was related to IPv6 addrconf activity.

Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |   14 +++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index f3b1e02..591b8b4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1464,10 +1464,12 @@ int bond_enslave(struct net_device *bond_dev, struct 
net_device *slave_dev)
dev_set_allmulti(slave_dev, 1);
}
 
+   netif_tx_lock_bh(bond_dev);
/* upload master's mc_list to new slave */
for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 
0);
}
+   netif_tx_unlock_bh(bond_dev);
}
 
if (bond->params.mode == BOND_MODE_8023AD) {
@@ -1821,7 +1823,9 @@ int bond_release(struct net_device *bond_dev, struct 
net_device *slave_dev)
}
 
/* flush master's mc_list from slave */
+   netif_tx_lock_bh(bond_dev);
bond_mc_list_flush(bond_dev, slave_dev);
+   netif_tx_unlock_bh(bond_dev);
}
 
netdev_set_master(slave_dev, NULL);
@@ -1942,7 +1946,9 @@ static int bond_release_all(struct net_device *bond_dev)
}
 
/* flush master's mc_list from slave */
+   netif_tx_lock_bh(bond_dev);
bond_mc_list_flush(bond_dev, slave_dev);
+   netif_tx_unlock_bh(bond_dev);
}
 
netdev_set_master(slave_dev, NULL);
@@ -3937,8 +3943,6 @@ static void bond_set_multicast_list(struct net_device 
*bond_dev)
struct bonding *bond = bond_dev->priv;
struct dev_mc_list *dmi;
 
-   write_lock_bh(&bond->lock);
-
/*
 * Do promisc before checking multicast_mode
 */
@@ -3959,6 +3963,8 @@ static void bond_set_multicast_list(struct net_device 
*bond_dev)
bond_set_allmulti(bond, -1);
}
 
+   read_lock(&bond->lock);
+
bond->flags = bond_dev->flags;
 
/* looking for addresses to add to slaves' mc list */
@@ -3979,7 +3985,7 @@ static void bond_set_multicast_list(struct net_device 
*bond_dev)
bond_mc_list_destroy(bond);
bond_mc_list_copy(bond_dev->mc_list, bond, GFP_ATOMIC);
 
-   write_unlock_bh(&bond->lock);
+   read_unlock(&bond->lock);
 }
 
 /*
@@ -4526,7 +4532,9 @@ static void bond_free_all(void)
struct net_device *bond_dev = bond->dev;
 
bond_work_cancel_all(bond);
+   netif_tx_lock_bh(bond_dev);
bond_mc_list_destroy(bond);
+   netif_tx_unlock_bh(bond_dev);
/* Release the bonded slaves */
bond_release_all(bond_dev);
bond_deinit(bond_dev);
-- 
1.5.3.4.206.g58ba4-dirty

--
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/7] bonding: fix NULL pointer deref in startup processing

2008-01-29 Thread Jay Vosburgh
Fix the "are we creating a duplicate" check to not compare
the name if the name is NULL (meaning that the system should select
a name).  Bug reported by Benny Amorsen <[EMAIL PROTECTED]>.

Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 591b8b4..63866da 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4896,14 +4896,16 @@ int bond_create(char *name, struct bond_params *params, 
struct bonding **newbond
down_write(&bonding_rwsem);
 
/* Check to see if the bond already exists. */
-   list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
-   if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
-   printk(KERN_ERR DRV_NAME
+   if (name) {
+   list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
+   if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
+   printk(KERN_ERR DRV_NAME
   ": cannot add bond %s; it already exists\n",
-  name);
-   res = -EPERM;
-   goto out_rtnl;
-   }
+  name);
+   res = -EPERM;
+   goto out_rtnl;
+   }
+   }
 
bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
ether_setup);
-- 
1.5.3.4.206.g58ba4-dirty

--
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 1/7] bonding: fix parameter parsing

2008-01-29 Thread Jay Vosburgh
My last fix (commit ece95f7fefe3afae19e641e1b3f5e64b00d5b948)
didn't handle one case correctly.  This resolves that, and it will now
correctly parse parameters with arbitrary white space, and either text
names or mode values.

Signed-off-by: Jay Vosburgh <[EMAIL PROTECTED]>
---
 drivers/net/bonding/bond_main.c |   17 +++--
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 49a1982..f3b1e02 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4549,14 +4549,19 @@ static void bond_free_all(void)
 int bond_parse_parm(const char *buf, struct bond_parm_tbl *tbl)
 {
int mode = -1, i, rv;
-   char modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };
+   char *p, modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };
 
-   rv = sscanf(buf, "%d", &mode);
-   if (!rv) {
+   for (p = (char *)buf; *p; p++)
+   if (!(isdigit(*p) || isspace(*p)))
+   break;
+
+   if (*p)
rv = sscanf(buf, "%20s", modestr);
-   if (!rv)
-   return -1;
-   }
+   else
+   rv = sscanf(buf, "%d", &mode);
+
+   if (!rv)
+   return -1;
 
for (i = 0; tbl[i].modename; i++) {
if (mode == tbl[i].mode)
-- 
1.5.3.4.206.g58ba4-dirty

--
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 0/7] bonding: miscellaneous fixes

2008-01-29 Thread Jay Vosburgh
Following are 7 bonding related patches:

patch 1: Revamp parameter parsing again to handle all cases (missed
an edge case last time).

patch 2: fix set_multicast_list locking issues

patch 3: Fix possible NULL pointer deref at module init time

patch 4: Fix race that causes invalid statistics

patch 5: Don't acquire rtnl in ARP monitor; it's not needed

patch 6: update version

patch 7: update MAINTAINERS

Patches are against the current netdev-2.6#upstream branch.

Please apply.

-J

---
-Jay Vosburgh, IBM Linux Technology Center, [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 6/7][BNX2]: Update firmware.

2008-01-29 Thread Michael Chan
On Wed, 2008-01-30 at 00:46 +0100, maximilian attems wrote:

> happily omitted diffstat:
>  drivers/net/bnx2_fw.h  | 1499 +++
>  drivers/net/bnx2_fw2.h |  464 ++--
>  2 files changed, 982 insertions(+), 981 deletions(-)
> 
> 
> when can bnx2 grow up to proper request_firmware() usage?
> 

Didn't we beat this topic to death last time?

Once again, the driver is tightly coupled with the firmware.  We don't
want things to break when users upgrade or downgrade the kernel.  Coding
the driver to deal with different firmware versions will add a lot of
complexity.

--
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: sis190 build breakage

2008-01-29 Thread Randy Dunlap
On Wed, 30 Jan 2008 00:12:23 +0100 maximilian attems wrote:

> On Tue, Jan 29, 2008 at 11:27:48PM +0100, Francois Romieu wrote:
> > maximilian attems <[EMAIL PROTECTED]> :
> > [...]
> > > probably i should to get interesting info.
> > 
> > Don't bother.
> > 
> > $ less +/devinitdata Documentation/pci.txt
> > [...]
> > Tips on when/where to use the above attributes:
> > o The module_init()/module_exit() functions (and all
> >   initialization functions called _only_ from these)
> >   should be marked __init/__exit.
> > 
> > o Do not mark the struct pci_driver.
> > 
> > o The ID table array should be marked __devinitdata.
> >
> > Could our documentation be wrong ?
> 
> yep that was what i had in mind, so i was a bit baffled..
> 
> randy any insight?

Hi,

I can't reproduce the problem... :(

I tend to expect something with Sam's new section mismatch detection.
Maybe it's a lot better and found a real issue, but AFAIK this table
can still be marked as __devinitdata.

Sam cc-ed.


> > 
> > diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
> > index b570402..2e9e88b 100644
> > --- a/drivers/net/sis190.c
> > +++ b/drivers/net/sis190.c
> > @@ -326,7 +326,7 @@ static const struct {
> > { "SiS 191 PCI Gigabit Ethernet adapter" },
> >  };
> >  
> > -static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
> > +static struct pci_device_id sis190_pci_tbl[] = {
> > { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
> > { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
> > { 0, },
> 
> thanks for quick fix.

---
~Randy
--
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: Udev coldplugging loads 8139too driver instead of 8139cp

2008-01-29 Thread Jon Masters

On Tue, 2008-01-29 at 03:46 +0300, Michael Tokarev wrote:

> Udev in fact loads both - 8139cp and 8139too.  The difference is the ORDER
> in which it loads them - if for "cp-handled" hardware it first loads "too",
> too will complain as above and will NOT claim the device.  The same is
> true for the opposite.

Actually, it's the order in which the probe functions run, which is
typically related to the order in which they are loaded. You can
blacklist one driver and get the other instead.

> I don't know what happened in 2.6.24, but my guess is that since 8139too-based
> hw is now alot more common, the two drivers are listed in the opposite
> order.

Nah. Random build ordering as it always has been - two different builds
would end up with modules in a different order on disk, hence depmod
would generate a different ordering. This will be fixed shortly with the
Modules.order bits, but you will still need to blacklist one of the
drivers (unless you're lucky and 8139too comes first), until there is
proper support for dynamic rebinding and udev rules to do that.

> In short: NotABug, or ComplainToRealtec (but that's wy too late and
> will not help anyway) ;)

Nah. It's a "bug" insomuch as we don't handle multiple matching aliases
very well, and it's becoming more common, so we probably should :)

Jon.


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


2.6.24-git6 net build failure when SYSFS=n, PROC_FS=n

2008-01-29 Thread Randy Dunlap
linux-2.6.24-git6/net/ipv4/fib_frontend.c: In function 'fib_net_init':
linux-2.6.24-git6/net/ipv4/fib_frontend.c:1024: error: implicit declaration of 
function 'fib_proc_init'
linux-2.6.24-git6/net/ipv4/fib_frontend.c: In function 'fib_net_exit':
linux-2.6.24-git6/net/ipv4/fib_frontend.c:1039: error: implicit declaration of 
function 'fib_proc_exit'

linux-2.6.24-git6/net/ipv6/sysctl_net_ipv6.c: In function 
'ipv6_sysctl_net_init':
linux-2.6.24-git6/net/ipv6/sysctl_net_ipv6.c:71: error: implicit declaration of 
function 'ipv6_route_sysctl_init'
linux-2.6.24-git6/net/ipv6/sysctl_net_ipv6.c:71: warning: assignment makes 
pointer from integer without a cast
linux-2.6.24-git6/net/ipv6/sysctl_net_ipv6.c:75: error: implicit declaration of 
function 'ipv6_icmp_sysctl_init'
linux-2.6.24-git6/net/ipv6/sysctl_net_ipv6.c:75: warning: assignment makes 
pointer from integer without a cast


config attached.

---
~Randy


net-sysctl-nosysproc.config
Description: application/config


Re: [PATCH 6/7][BNX2]: Update firmware.

2008-01-29 Thread maximilian attems
On Tue, 29 Jan 2008, Michael Chan wrote:

> [BNX2]: Update firmware.
> 
> Update firmware to support programmable flow control.
>  
> Signed-off-by: Michael Chan <[EMAIL PROTECTED]>
> 
> diff --git a/drivers/net/bnx2_fw.h b/drivers/net/bnx2_fw.h
> index c1ad4dd..3b839d4 100644

happily omitted diffstat:
 drivers/net/bnx2_fw.h  | 1499 +++
 drivers/net/bnx2_fw2.h |  464 ++--
 2 files changed, 982 insertions(+), 981 deletions(-)


when can bnx2 grow up to proper request_firmware() usage?
--
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/7][BNX2]: Refine tx coalescing setup.

2008-01-29 Thread Michael Chan
[BNX2]: Refine tx coalescing setup. 

Make the tx coalescing setup code independent of the MSIX vector.

Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 353c73f..8d0022d 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4438,18 +4438,21 @@ bnx2_init_chip(struct bnx2 *bp)
}
 
if (bp->flags & BNX2_FLAG_USING_MSIX) {
+   u32 base = ((BNX2_TX_VEC - 1) * BNX2_HC_SB_CONFIG_SIZE) +
+  BNX2_HC_SB_CONFIG_1;
+
REG_WR(bp, BNX2_HC_MSIX_BIT_VECTOR,
   BNX2_HC_MSIX_BIT_VECTOR_VAL);
 
-   REG_WR(bp, BNX2_HC_SB_CONFIG_1,
+   REG_WR(bp, base,
BNX2_HC_SB_CONFIG_1_TX_TMR_MODE |
BNX2_HC_SB_CONFIG_1_ONE_SHOT);
 
-   REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP_1,
+   REG_WR(bp, base + BNX2_HC_TX_QUICK_CONS_TRIP_OFF,
(bp->tx_quick_cons_trip_int << 16) |
 bp->tx_quick_cons_trip);
 
-   REG_WR(bp, BNX2_HC_TX_TICKS_1,
+   REG_WR(bp, base + BNX2_HC_TX_TICKS_OFF,
(bp->tx_ticks_int << 16) | bp->tx_ticks);
 
val |= BNX2_HC_CONFIG_SB_ADDR_INC_128B;
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 059e115..7a1eff4 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -5510,6 +5510,15 @@ struct l2_fhdr {
 #define BNX2_HC_PERIODIC_TICKS_8_HC_PERIODIC_TICKS  (0xL<<0)
 #define BNX2_HC_PERIODIC_TICKS_8_HC_INT_PERIODIC_TICKS  (0xL<<16)
 
+#define BNX2_HC_SB_CONFIG_SIZE (BNX2_HC_SB_CONFIG_2 - BNX2_HC_SB_CONFIG_1)
+#define BNX2_HC_COMP_PROD_TRIP_OFF (BNX2_HC_COMP_PROD_TRIP_1 - \
+BNX2_HC_SB_CONFIG_1)
+#define BNX2_HC_COM_TICKS_OFF  (BNX2_HC_COM_TICKS_1 - BNX2_HC_SB_CONFIG_1)
+#define BNX2_HC_CMD_TICKS_OFF  (BNX2_HC_CMD_TICKS_1 - BNX2_HC_SB_CONFIG_1)
+#define BNX2_HC_TX_QUICK_CONS_TRIP_OFF (BNX2_HC_TX_QUICK_CONS_TRIP_1 - \
+BNX2_HC_SB_CONFIG_1)
+#define BNX2_HC_TX_TICKS_OFF   (BNX2_HC_TX_TICKS_1 - BNX2_HC_SB_CONFIG_1)
+
 
 /*
  *  txp_reg definition


--
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 7/7][BNX2]: Update version to 1.7.3.

2008-01-29 Thread Michael Chan
[BNX2]: Update version to 1.7.3.

Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 7a2a71d..f8bc72e 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -56,8 +56,8 @@
 
 #define DRV_MODULE_NAME"bnx2"
 #define PFX DRV_MODULE_NAME": "
-#define DRV_MODULE_VERSION "1.7.2"
-#define DRV_MODULE_RELDATE "January 21, 2008"
+#define DRV_MODULE_VERSION "1.7.3"
+#define DRV_MODULE_RELDATE "January 29, 2008"
 
 #define RUN_AT(x) (jiffies + (x))
 


--
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 5/7][BNX2]: Fine-tune flow control on 5709.

2008-01-29 Thread Michael Chan
[BNX2]: Fine-tune flow control on 5709.

Make use of the programmable high/low water marks in 5709 for
802.3 flow control.

Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8af63b4..e41c723 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -992,6 +992,42 @@ bnx2_copper_linkup(struct bnx2 *bp)
return 0;
 }
 
+static void
+bnx2_init_rx_context0(struct bnx2 *bp)
+{
+   u32 val, rx_cid_addr = GET_CID_ADDR(RX_CID);
+
+   val = BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE;
+   val |= BNX2_L2CTX_CTX_TYPE_SIZE_L2;
+   val |= 0x02 << 8;
+
+   if (CHIP_NUM(bp) == CHIP_NUM_5709) {
+   u32 lo_water, hi_water;
+
+   if (bp->flow_ctrl & FLOW_CTRL_TX)
+   lo_water = BNX2_L2CTX_LO_WATER_MARK_DEFAULT;
+   else
+   lo_water = BNX2_L2CTX_LO_WATER_MARK_DIS;
+   if (lo_water >= bp->rx_ring_size)
+   lo_water = 0;
+
+   hi_water = bp->rx_ring_size / 4;
+
+   if (hi_water <= lo_water)
+   lo_water = 0;
+   
+   hi_water /= BNX2_L2CTX_HI_WATER_MARK_SCALE;
+   lo_water /= BNX2_L2CTX_LO_WATER_MARK_SCALE;
+
+   if (hi_water > 0xf)
+   hi_water = 0xf;
+   else if (hi_water == 0)
+   lo_water = 0;
+   val |= lo_water | (hi_water << BNX2_L2CTX_HI_WATER_MARK_SHIFT);
+   }
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_CTX_TYPE, val);
+}
+
 static int
 bnx2_set_mac_link(struct bnx2 *bp)
 {
@@ -1056,6 +1092,9 @@ bnx2_set_mac_link(struct bnx2 *bp)
/* Acknowledge the interrupt. */
REG_WR(bp, BNX2_EMAC_STATUS, BNX2_EMAC_STATUS_LINK_CHANGE);
 
+   if (CHIP_NUM(bp) == CHIP_NUM_5709)
+   bnx2_init_rx_context0(bp);
+
return 0;
 }
 
@@ -4616,6 +4655,13 @@ bnx2_init_rx_ring(struct bnx2 *bp)
bnx2_init_rxbd_rings(bp->rx_desc_ring, bp->rx_desc_mapping,
 bp->rx_buf_use_size, bp->rx_max_ring);
 
+   bnx2_init_rx_context0(bp);
+
+   if (CHIP_NUM(bp) == CHIP_NUM_5709) {
+   val = REG_RD(bp, BNX2_MQ_MAP_L2_5);
+   REG_WR(bp, BNX2_MQ_MAP_L2_5, val | BNX2_MQ_MAP_L2_5_ARM);
+   }
+
bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, 0);
if (bp->rx_pg_ring_size) {
bnx2_init_rxbd_rings(bp->rx_pg_desc_ring,
@@ -4636,11 +4682,6 @@ bnx2_init_rx_ring(struct bnx2 *bp)
REG_WR(bp, BNX2_MQ_MAP_L2_3, BNX2_MQ_MAP_L2_3_DEFAULT);
}
 
-   val = BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE;
-   val |= BNX2_L2CTX_CTX_TYPE_SIZE_L2;
-   val |= 0x02 << 8;
-   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_CTX_TYPE, val);
-
val = (u64) bp->rx_desc_mapping[0] >> 32;
bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_BDHADDR_HI, val);
 
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index c5fe340..3aa0364 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -348,6 +348,12 @@ struct l2_fhdr {
 #define BNX2_L2CTX_BD_PRE_READ 0x
 #define BNX2_L2CTX_CTX_SIZE0x
 #define BNX2_L2CTX_CTX_TYPE0x
+#define BNX2_L2CTX_LO_WATER_MARK_DEFAULT32
+#define BNX2_L2CTX_LO_WATER_MARK_SCALE  4
+#define BNX2_L2CTX_LO_WATER_MARK_DIS0
+#define BNX2_L2CTX_HI_WATER_MARK_SHIFT  4
+#define BNX2_L2CTX_HI_WATER_MARK_SCALE  16
+#define BNX2_L2CTX_WATER_MARKS_MSK  0x00ff
 #define BNX2_L2CTX_CTX_TYPE_SIZE_L2 ((0x20/20)<<16)
 #define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE (0xf<<28)
 #define BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_UNDEFINED   (0<<28)
@@ -4494,6 +4500,9 @@ struct l2_fhdr {
 #define BNX2_MQ_MAP_L2_3_ENA(0x1L<<31)
 #define BNX2_MQ_MAP_L2_3_DEFAULT0x82004646
 
+#define BNX2_MQ_MAP_L2_5   0x3d34
+#define BNX2_MQ_MAP_L2_5_ARM(0x3L<<26)
+
 /*
  *  tsch_reg definition
  *  offset: 0x4c00
@@ -6405,7 +6414,7 @@ struct l2_fhdr {
 
 #define RX_COPY_THRESH 128
 
-#define BNX2_MISC_ENABLE_DEFAULT   0x7ff
+#define BNX2_MISC_ENABLE_DEFAULT   0x17ff
 
 #define DMA_READ_CHANS 5
 #define DMA_WRITE_CHANS3


--
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/7][BNX2]: Remove CTX_WR macro.

2008-01-29 Thread Michael Chan
[BNX2]: Remove CTX_WR macro.

The CTX_WR macro is unnecessary and obfuscates the code. 

Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8e9fe48..8af63b4 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -2237,7 +2237,7 @@ bnx2_init_context(struct bnx2 *bp)
 
/* Zero out the context. */
for (offset = 0; offset < PHY_CTX_SIZE; offset += 4)
-   CTX_WR(bp, vcid_addr, offset, 0);
+   bnx2_ctx_wr(bp, vcid_addr, offset, 0);
}
}
 }
@@ -4523,6 +4523,7 @@ static void
 bnx2_init_tx_context(struct bnx2 *bp, u32 cid)
 {
u32 val, offset0, offset1, offset2, offset3;
+   u32 cid_addr = GET_CID_ADDR(cid);
 
if (CHIP_NUM(bp) == CHIP_NUM_5709) {
offset0 = BNX2_L2CTX_TYPE_XI;
@@ -4536,16 +4537,16 @@ bnx2_init_tx_context(struct bnx2 *bp, u32 cid)
offset3 = BNX2_L2CTX_TBDR_BHADDR_LO;
}
val = BNX2_L2CTX_TYPE_TYPE_L2 | BNX2_L2CTX_TYPE_SIZE_L2;
-   CTX_WR(bp, GET_CID_ADDR(cid), offset0, val);
+   bnx2_ctx_wr(bp, cid_addr, offset0, val);
 
val = BNX2_L2CTX_CMD_TYPE_TYPE_L2 | (8 << 16);
-   CTX_WR(bp, GET_CID_ADDR(cid), offset1, val);
+   bnx2_ctx_wr(bp, cid_addr, offset1, val);
 
val = (u64) bp->tx_desc_mapping >> 32;
-   CTX_WR(bp, GET_CID_ADDR(cid), offset2, val);
+   bnx2_ctx_wr(bp, cid_addr, offset2, val);
 
val = (u64) bp->tx_desc_mapping & 0x;
-   CTX_WR(bp, GET_CID_ADDR(cid), offset3, val);
+   bnx2_ctx_wr(bp, cid_addr, offset3, val);
 }
 
 static void
@@ -4615,21 +4616,21 @@ bnx2_init_rx_ring(struct bnx2 *bp)
bnx2_init_rxbd_rings(bp->rx_desc_ring, bp->rx_desc_mapping,
 bp->rx_buf_use_size, bp->rx_max_ring);
 
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, 0);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, 0);
if (bp->rx_pg_ring_size) {
bnx2_init_rxbd_rings(bp->rx_pg_desc_ring,
 bp->rx_pg_desc_mapping,
 PAGE_SIZE, bp->rx_max_pg_ring);
val = (bp->rx_buf_use_size << 16) | PAGE_SIZE;
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, val);
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_RBDC_KEY,
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, val);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_RBDC_KEY,
   BNX2_L2CTX_RBDC_JUMBO_KEY);
 
val = (u64) bp->rx_pg_desc_mapping[0] >> 32;
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_HI, val);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_HI, val);
 
val = (u64) bp->rx_pg_desc_mapping[0] & 0x;
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_LO, val);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_LO, val);
 
if (CHIP_NUM(bp) == CHIP_NUM_5709)
REG_WR(bp, BNX2_MQ_MAP_L2_3, BNX2_MQ_MAP_L2_3_DEFAULT);
@@ -4638,13 +4639,13 @@ bnx2_init_rx_ring(struct bnx2 *bp)
val = BNX2_L2CTX_CTX_TYPE_CTX_BD_CHN_TYPE_VALUE;
val |= BNX2_L2CTX_CTX_TYPE_SIZE_L2;
val |= 0x02 << 8;
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_CTX_TYPE, val);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_CTX_TYPE, val);
 
val = (u64) bp->rx_desc_mapping[0] >> 32;
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_NX_BDHADDR_HI, val);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_BDHADDR_HI, val);
 
val = (u64) bp->rx_desc_mapping[0] & 0x;
-   CTX_WR(bp, rx_cid_addr, BNX2_L2CTX_NX_BDHADDR_LO, val);
+   bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_BDHADDR_LO, val);
 
ring_prod = prod = bnapi->rx_pg_prod;
for (i = 0; i < bp->rx_pg_ring_size; i++) {
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index fb3c019..c5fe340 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6814,13 +6814,6 @@ struct bnx2 {
 #define REG_WR16(bp, offset, val)  \
writew(val, bp->regview + offset)
 
-/* Indirect context access.  Unlike the MBQ_WR, these macros will not
- * trigger a chip event. */
-static void bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val);
-
-#define CTX_WR(bp, cid_addr, offset, val)  \
-   bnx2_ctx_wr(bp, cid_addr, offset, val)
-
 struct cpu_reg {
u32 mode;
u32 mode_value_halt;


--
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/7][BNX2]: Remove REG_WR_IND/REG_RD_IND macros.

2008-01-29 Thread Michael Chan
[BNX2]: Remove REG_WR_IND/REG_RD_IND macros.

The REG_WR_IND/REG_RD_IND macros are unnecessary and obfuscate the
code.  Many callers to these macros read and write shared memory from
the bp->shmem_base, so we add 2 similar functions that automatically
add the shared memory base.

Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 8d0022d..8e9fe48 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -266,6 +266,18 @@ bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val)
 }
 
 static void
+bnx2_shmem_wr(struct bnx2 *bp, u32 offset, u32 val)
+{
+   bnx2_reg_wr_ind(bp, bp->shmem_base + offset, val);
+}
+
+static u32
+bnx2_shmem_rd(struct bnx2 *bp, u32 offset)
+{
+   return (bnx2_reg_rd_ind(bp, bp->shmem_base + offset));
+}
+
+static void
 bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val)
 {
offset += cid_addr;
@@ -685,7 +697,7 @@ bnx2_report_fw_link(struct bnx2 *bp)
else
fw_link_status = BNX2_LINK_STATUS_LINK_DOWN;
 
-   REG_WR_IND(bp, bp->shmem_base + BNX2_LINK_STATUS, fw_link_status);
+   bnx2_shmem_wr(bp, BNX2_LINK_STATUS, fw_link_status);
 }
 
 static char *
@@ -1385,7 +1397,7 @@ bnx2_setup_remote_phy(struct bnx2 *bp, u8 port)
speed_arg |= BNX2_NETLINK_SET_LINK_PHY_APP_REMOTE |
 BNX2_NETLINK_SET_LINK_ETH_AT_WIRESPEED;
 
-   REG_WR_IND(bp, bp->shmem_base + BNX2_DRV_MB_ARG0, speed_arg);
+   bnx2_shmem_wr(bp, BNX2_DRV_MB_ARG0, speed_arg);
 
spin_unlock_bh(&bp->phy_lock);
bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_CMD_SET_LINK, 0);
@@ -1530,9 +1542,9 @@ bnx2_set_default_remote_link(struct bnx2 *bp)
u32 link;
 
if (bp->phy_port == PORT_TP)
-   link = REG_RD_IND(bp, bp->shmem_base + BNX2_RPHY_COPPER_LINK);
+   link = bnx2_shmem_rd(bp, BNX2_RPHY_COPPER_LINK);
else
-   link = REG_RD_IND(bp, bp->shmem_base + BNX2_RPHY_SERDES_LINK);
+   link = bnx2_shmem_rd(bp, BNX2_RPHY_SERDES_LINK);
 
if (link & BNX2_NETLINK_SET_LINK_ENABLE_AUTONEG) {
bp->req_line_speed = 0;
@@ -1584,7 +1596,7 @@ bnx2_set_default_link(struct bnx2 *bp)
 
bp->advertising = ETHTOOL_ALL_FIBRE_SPEED | ADVERTISED_Autoneg;
 
-   reg = REG_RD_IND(bp, bp->shmem_base + BNX2_PORT_HW_CFG_CONFIG);
+   reg = bnx2_shmem_rd(bp, BNX2_PORT_HW_CFG_CONFIG);
reg &= BNX2_PORT_HW_CFG_CFG_DFLT_LINK_MASK;
if (reg == BNX2_PORT_HW_CFG_CFG_DFLT_LINK_1G) {
bp->autoneg = 0;
@@ -1616,7 +1628,7 @@ bnx2_remote_phy_event(struct bnx2 *bp)
u8 link_up = bp->link_up;
u8 old_port;
 
-   msg = REG_RD_IND(bp, bp->shmem_base + BNX2_LINK_STATUS);
+   msg = bnx2_shmem_rd(bp, BNX2_LINK_STATUS);
 
if (msg & BNX2_LINK_STATUS_HEART_BEAT_EXPIRED)
bnx2_send_heart_beat(bp);
@@ -1693,7 +1705,7 @@ bnx2_set_remote_link(struct bnx2 *bp)
 {
u32 evt_code;
 
-   evt_code = REG_RD_IND(bp, bp->shmem_base + BNX2_FW_EVT_CODE_MB);
+   evt_code = bnx2_shmem_rd(bp, BNX2_FW_EVT_CODE_MB);
switch (evt_code) {
case BNX2_FW_EVT_CODE_LINK_EVENT:
bnx2_remote_phy_event(bp);
@@ -1905,14 +1917,13 @@ bnx2_init_5708s_phy(struct bnx2 *bp)
bnx2_write_phy(bp, BCM5708S_BLK_ADDR, BCM5708S_BLK_ADDR_DIG);
}
 
-   val = REG_RD_IND(bp, bp->shmem_base + BNX2_PORT_HW_CFG_CONFIG) &
+   val = bnx2_shmem_rd(bp, BNX2_PORT_HW_CFG_CONFIG) &
  BNX2_PORT_HW_CFG_CFG_TXCTL3_MASK;
 
if (val) {
u32 is_backplane;
 
-   is_backplane = REG_RD_IND(bp, bp->shmem_base +
- BNX2_SHARED_HW_CFG_CONFIG);
+   is_backplane = bnx2_shmem_rd(bp, BNX2_SHARED_HW_CFG_CONFIG);
if (is_backplane & BNX2_SHARED_HW_CFG_PHY_BACKPLANE) {
bnx2_write_phy(bp, BCM5708S_BLK_ADDR,
   BCM5708S_BLK_ADDR_TX_MISC);
@@ -2111,13 +2122,13 @@ bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int silent)
bp->fw_wr_seq++;
msg_data |= bp->fw_wr_seq;
 
-   REG_WR_IND(bp, bp->shmem_base + BNX2_DRV_MB, msg_data);
+   bnx2_shmem_wr(bp, BNX2_DRV_MB, msg_data);
 
/* wait for an acknowledgement. */
for (i = 0; i < (FW_ACK_TIME_OUT_MS / 10); i++) {
msleep(10);
 
-   val = REG_RD_IND(bp, bp->shmem_base + BNX2_FW_MB);
+   val = bnx2_shmem_rd(bp, BNX2_FW_MB);
 
if ((val & BNX2_FW_MSG_ACK) == (msg_data & BNX2_DRV_MSG_SEQ))
break;
@@ -2134,7 +2145,7 @@ bnx2_fw_sync(struct bnx2 *bp, u32 msg_data, int silent)
msg_data &= ~BNX2_DRV_MSG_CODE;
msg_data |= BNX2_DRV_MSG_CODE_FW_TIMEOUT;
 
-   REG_WR_IND(bp, bp->shmem_base + BNX2_DRV_MB, msg_data);
+   bnx2_

[PATCH 1/7][BNX2]: Fix 5706 serdes link down bug.

2008-01-29 Thread Michael Chan
[BNX2]: Fix 5706 serdes link down bug.

1. Correct the MII expansion serdes control register definition.
2. Check an additional RUDI_INVALID bit when determining 5706S link.

Signed-off-by: Michael Chan <[EMAIL PROTECTED]>

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 34aebc6..353c73f 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -5315,7 +5315,7 @@ bnx2_5706_serdes_has_link(struct bnx2 *bp)
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);
bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);
 
-   if (an_dbg & MISC_SHDW_AN_DBG_NOSYNC)
+   if (an_dbg & (MISC_SHDW_AN_DBG_NOSYNC | MISC_SHDW_AN_DBG_RUDI_INVALID))
return 0;
 
bnx2_write_phy(bp, MII_BNX2_DSP_ADDRESS, MII_EXPAND_REG1);
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index d8e0347..059e115 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6346,11 +6346,12 @@ struct l2_fhdr {
 #define MII_BNX2_DSP_EXPAND_REG 0x0f00
 #define MII_EXPAND_REG1  
(MII_BNX2_DSP_EXPAND_REG | 1)
 #define MII_EXPAND_REG1_RUDI_C0x20
-#define MII_EXPAND_SERDES_CTL(MII_BNX2_DSP_EXPAND_REG | 2)
+#define MII_EXPAND_SERDES_CTL(MII_BNX2_DSP_EXPAND_REG | 3)
 
 #define MII_BNX2_MISC_SHADOW   0x1c
 #define MISC_SHDW_AN_DBG0x6800
 #define MISC_SHDW_AN_DBG_NOSYNC  0x0002
+#define MISC_SHDW_AN_DBG_RUDI_INVALID0x0100
 #define MISC_SHDW_MODE_CTL  0x7c00
 #define MISC_SHDW_MODE_CTL_SIG_DET   0x0010
 


--
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: Udev coldplugging loads 8139too driver instead of 8139cp

2008-01-29 Thread Jan Engelhardt

On Jan 29 2008 18:34, Jon Masters wrote:
>On Tue, 2008-01-29 at 03:46 +0300, Michael Tokarev wrote:
>
>> Udev in fact loads both - 8139cp and 8139too.  The difference is the ORDER
>> in which it loads them - if for "cp-handled" hardware it first loads "too",
>> too will complain as above and will NOT claim the device.  The same is
>> true for the opposite.
>[...]
>> In short: NotABug, or ComplainToRealtec (but that's wy too late and
>> will not help anyway) ;)
>
>Nah. It's a "bug" insomuch as we don't handle multiple matching aliases
>very well, and it's becoming more common, so we probably should :)

Why not combine 8139cp.c and 8139too.c?
--
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: sis190 build breakage

2008-01-29 Thread maximilian attems
On Tue, Jan 29, 2008 at 11:27:48PM +0100, Francois Romieu wrote:
> maximilian attems <[EMAIL PROTECTED]> :
> [...]
> > probably i should to get interesting info.
> 
> Don't bother.
> 
> $ less +/devinitdata Documentation/pci.txt
> [...]
> Tips on when/where to use the above attributes:
> o The module_init()/module_exit() functions (and all
>   initialization functions called _only_ from these)
>   should be marked __init/__exit.
> 
> o Do not mark the struct pci_driver.
> 
> o The ID table array should be marked __devinitdata.
>
> Could our documentation be wrong ?

yep that was what i had in mind, so i was a bit baffled..

randy any insight?
 
> 
> diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
> index b570402..2e9e88b 100644
> --- a/drivers/net/sis190.c
> +++ b/drivers/net/sis190.c
> @@ -326,7 +326,7 @@ static const struct {
>   { "SiS 191 PCI Gigabit Ethernet adapter" },
>  };
>  
> -static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
> +static struct pci_device_id sis190_pci_tbl[] = {
>   { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
>   { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
>   { 0, },

thanks for quick fix.
--
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: Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread Waskiewicz Jr, Peter P
> Peter, I suspect that driver is just buggy in some other way 
> as opposed to being re-entered; couldnt tell by inspection. 
> It is possible it may be too eager to open up before it 
> really has space.
> It will be easy to check your theory by having the driver 
> just check if it is netif_stopped just before it returns 
> NETDEV_TX_BUSY.

Ahh, very good point.

Thanks,
-PJ
--
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: [RFC/PATCH] e100 driver didn't support any MII-less PHYs...

2008-01-29 Thread Kok, Auke
Andreas Mohr wrote:
> Hi,
> 
> On Tue, Jan 01, 2008 at 09:09:08PM +0100, Andreas Mohr wrote:
>> Thanks for your quick reply!
>>
>> OK, here's part 1, the MII-less support stuff.
>> (preliminary posting, for review only)
>>
>> Note that these diffs apply to 2.6.24-rc6-mm1 without much trouble,
>> thus might want to do -mm testing soon.
> 
> Any verdict on this one?
> 
> I happen to be asking now since silly me just ""upgraded"" a mere mortal's
> sorta-production machine to 2.6.24 proper without remembering
> that the previous -rc6 had contained a minor but effective change
> to make those wires do their thing. Or, to tell it as it was,
> "Mom wasn't impressed ;)".
> 
> Perhaps it's useful to file a bug/patch
> on http://sourceforge.net/projects/e1000/ ? Perhaps -mm testing?

I wanted to push this though our testing labs first which has not happened due 
to
time constraints - that should quickly at least confirm that the most common 
nics
work OK after the change with your patch. I'll try and see if we can get this
testing done soon.

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: Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread jamal
On Tue, 2008-29-01 at 22:45 +0100, Erik Mouw wrote:

> > The driver seems buggy. Make it return NETDEV_TX_BUSY instead of -EIO
> > in xircom_start_xmit() and the messages will go away.
> 
> Like this?
> 

Indeed. 

Peter, I suspect that driver is just buggy in some other way as opposed
to being re-entered; couldnt tell by inspection. It is possible it may
be too eager to open up before it really has space.
It will be easy to check your theory by having the driver just check if
it is netif_stopped just before it returns NETDEV_TX_BUSY.

cheers,
jamal


--
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: [RFC/PATCH] e100 driver didn't support any MII-less PHYs...

2008-01-29 Thread Andreas Mohr
Hi,

On Tue, Jan 01, 2008 at 09:09:08PM +0100, Andreas Mohr wrote:
> Thanks for your quick reply!
> 
> OK, here's part 1, the MII-less support stuff.
> (preliminary posting, for review only)
> 
> Note that these diffs apply to 2.6.24-rc6-mm1 without much trouble,
> thus might want to do -mm testing soon.

Any verdict on this one?

I happen to be asking now since silly me just ""upgraded"" a mere mortal's
sorta-production machine to 2.6.24 proper without remembering
that the previous -rc6 had contained a minor but effective change
to make those wires do their thing. Or, to tell it as it was,
"Mom wasn't impressed ;)".

Perhaps it's useful to file a bug/patch
on http://sourceforge.net/projects/e1000/ ? Perhaps -mm testing?

Thanks,

Andreas Mohr
--
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 1/1] sis190: silence section type conflict

2008-01-29 Thread Francois Romieu
  CC [M]  drivers/net/sis190.o
  drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
  make[5]: *** [drivers/net/sis190.o] Error 1

Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>
Reported-by: Maximilian Attems <[EMAIL PROTECTED]>

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..2e9e88b 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static struct pci_device_id sis190_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
{ 0, },
--
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] cxgb3: Remove incorrect __devinit annotations

2008-01-29 Thread Roland Dreier
When PCI error recovery was added to cxgb3, a function t3_io_slot_reset()
was added.  This function can call back into t3_prep_adapter() at any
time, so t3_prep_adapter() can no longer be marked __devinit.
This patch removes the __devinit annotation from t3_prep_adapter() and
all the functions that it calls, which fixes

WARNING: drivers/net/cxgb3/built-in.o(.text+0x2427): Section mismatch in 
reference from the function t3_io_slot_reset() to the function 
.devinit.text:t3_prep_adapter()

Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/net/cxgb3/mc5.c   |2 +-
 drivers/net/cxgb3/sge.c   |2 +-
 drivers/net/cxgb3/t3_hw.c |   22 ++
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/net/cxgb3/mc5.c b/drivers/net/cxgb3/mc5.c
index 84c1ffa..4c4d6e8 100644
--- a/drivers/net/cxgb3/mc5.c
+++ b/drivers/net/cxgb3/mc5.c
@@ -452,7 +452,7 @@ void t3_mc5_intr_handler(struct mc5 *mc5)
t3_write_reg(adap, A_MC5_DB_INT_CAUSE, cause);
 }
 
-void __devinit t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode)
+void t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode)
 {
 #define K * 1024
 
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index cb684d3..9ca8c66 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -2836,7 +2836,7 @@ void t3_sge_init(struct adapter *adap, struct sge_params 
*p)
  * defaults for the assorted SGE parameters, which admins can change until
  * they are used to initialize the SGE.
  */
-void __devinit t3_sge_prep(struct adapter *adap, struct sge_params *p)
+void t3_sge_prep(struct adapter *adap, struct sge_params *p)
 {
int i;
 
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 7469935..a99496a 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -2675,7 +2675,7 @@ void t3_tp_set_max_rxsize(struct adapter *adap, unsigned 
int size)
 V_PMMAXXFERLEN0(size) | V_PMMAXXFERLEN1(size));
 }
 
-static void __devinit init_mtus(unsigned short mtus[])
+static void init_mtus(unsigned short mtus[])
 {
/*
 * See draft-mathis-plpmtud-00.txt for the values.  The min is 88 so
@@ -2703,7 +2703,7 @@ static void __devinit init_mtus(unsigned short mtus[])
 /*
  * Initial congestion control parameters.
  */
-static void __devinit init_cong_ctrl(unsigned short *a, unsigned short *b)
+static void init_cong_ctrl(unsigned short *a, unsigned short *b)
 {
a[0] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = 1;
a[9] = 2;
@@ -3354,8 +3354,7 @@ out_err:
  * Determines a card's PCI mode and associated parameters, such as speed
  * and width.
  */
-static void __devinit get_pci_mode(struct adapter *adapter,
-  struct pci_params *p)
+static void get_pci_mode(struct adapter *adapter, struct pci_params *p)
 {
static unsigned short speed_map[] = { 33, 66, 100, 133 };
u32 pci_mode, pcie_cap;
@@ -3395,8 +3394,7 @@ static void __devinit get_pci_mode(struct adapter 
*adapter,
  * capabilities and default speed/duplex/flow-control/autonegotiation
  * settings.
  */
-static void __devinit init_link_config(struct link_config *lc,
-  unsigned int caps)
+static void init_link_config(struct link_config *lc, unsigned int caps)
 {
lc->supported = caps;
lc->requested_speed = lc->speed = SPEED_INVALID;
@@ -3419,7 +3417,7 @@ static void __devinit init_link_config(struct link_config 
*lc,
  * Calculates the size of an MC7 memory in bytes from the value of its
  * configuration register.
  */
-static unsigned int __devinit mc7_calc_size(u32 cfg)
+static unsigned int mc7_calc_size(u32 cfg)
 {
unsigned int width = G_WIDTH(cfg);
unsigned int banks = !!(cfg & F_BKS) + 1;
@@ -3430,8 +3428,8 @@ static unsigned int __devinit mc7_calc_size(u32 cfg)
return MBs << 20;
 }
 
-static void __devinit mc7_prep(struct adapter *adapter, struct mc7 *mc7,
-  unsigned int base_addr, const char *name)
+static void mc7_prep(struct adapter *adapter, struct mc7 *mc7,
+unsigned int base_addr, const char *name)
 {
u32 cfg;
 
@@ -3517,7 +3515,7 @@ static int t3_reset_adapter(struct adapter *adapter)
return 0;
 }
 
-static int __devinit init_parity(struct adapter *adap)
+static int init_parity(struct adapter *adap)
 {
int i, err, addr;
 
@@ -3552,8 +3550,8 @@ static int __devinit init_parity(struct adapter *adap)
  * for some adapter tunables, take PHYs out of reset, and initialize the MDIO
  * interface.
  */
-int __devinit t3_prep_adapter(struct adapter *adapter,
- const struct adapter_info *ai, int reset)
+int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
+   int reset)
 {
int ret;
unsigned int i, j = 0;
--
To unsubscribe from 

Re: sis190 build breakage

2008-01-29 Thread Francois Romieu
maximilian attems <[EMAIL PROTECTED]> :
[...]
> probably i should to get interesting info.

Don't bother.

$ less +/devinitdata Documentation/pci.txt
[...]
Tips on when/where to use the above attributes:
o The module_init()/module_exit() functions (and all
  initialization functions called _only_ from these)
  should be marked __init/__exit.

o Do not mark the struct pci_driver.

o The ID table array should be marked __devinitdata.

Could our documentation be wrong ?

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index b570402..2e9e88b 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -326,7 +326,7 @@ static const struct {
{ "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static struct pci_device_id sis190_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
{ PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
{ 0, },
--
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: sis190 build breakage

2008-01-29 Thread maximilian attems
On Tue, Jan 29, 2008 at 11:03:10PM +0100, Francois Romieu wrote:
> maximilian attems <[EMAIL PROTECTED]> :
> >   CC [M]  drivers/net/sis190.o
> >   drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type 
> > conflict
> >   make[5]: *** [drivers/net/sis190.o] Error 1
> > 
> > gcc --version
> > gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
> 
> Are you building latest git with DEBUG_SECTION_MISMATCH enabled by any
> misfortune ?

yep latest git, but nope
# CONFIG_DEBUG_SECTION_MISMATCH is not set

probably i should to get interesting info.
--
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: sis190 build breakage

2008-01-29 Thread Francois Romieu
maximilian attems <[EMAIL PROTECTED]> :
>   CC [M]  drivers/net/sis190.o
>   drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type 
> conflict
>   make[5]: *** [drivers/net/sis190.o] Error 1
> 
> gcc --version
> gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Are you building latest git with DEBUG_SECTION_MISMATCH enabled by any
misfortune ?

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


[REPOST] [PATCH] enable SMC911X for ARCH_MX3

2008-01-29 Thread Daniel Mack
Hi,

this patch enables SMX911X support for Freescale's MX3 platforms.

Signed-off-by: Daniel Mack <[EMAIL PROTECTED]>


diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 6cde4ed..1011735 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -926,7 +926,7 @@ config SMC911X
tristate "SMSC LAN911[5678] support"
select CRC32
select MII
-   depends on ARCH_PXA || SH_MAGIC_PANEL_R2
+   depends on ARCH_PXA || ARCH_MX3 || SH_MAGIC_PANEL_R2
help
  This is a driver for SMSC's LAN911x series of Ethernet chipsets
  including the new LAN9115, LAN9116, LAN9117, and LAN9118.
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h
index d04e4fa..2278408 100644
--- a/drivers/net/smc911x.h
+++ b/drivers/net/smc911x.h
@@ -37,6 +37,11 @@
   #define SMC_USE_16BIT0
   #define SMC_USE_32BIT1
   #define SMC_IRQ_SENSEIRQF_TRIGGER_FALLING
+#elif defined(CONFIG_ARCH_MX3)
+  #define SMC_USE_PXA_DMA  0
+  #define SMC_USE_16BIT0
+  #define SMC_USE_32BIT1
+  #define SMC_IRQ_SENSEIRQF_TRIGGER_FALLING
 #elif defined(CONFIG_SH_MAGIC_PANEL_R2)
   #define SMC_USE_SH_DMA   0
   #define SMC_USE_16BIT0

--
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: netdev->priv and netdev_priv(dev)

2008-01-29 Thread Krzysztof Halasa
Stephen Hemminger <[EMAIL PROTECTED]> writes:

> Those drivers were making a incorrect assumption and should be fixed.
> The in-tree drivers were fixed when this was done. If you have an out
> of tree driver, then too bad for you.

I have few out-of-tree drivers (IOW not yet merged) but they aren't
affected. These in the tree are (actually I was contacted by driver's
author and am considering the best way to fix this).

> The additional overhead of the address calculation would slow down the
> well behaved drivers.

There is always dev->priv.

> There was discussion of alternative layouts of
> the network device allocation or limiting the number of subqueue's so
> that netdev_priv could be a simple addition again, but nothing came of
> it.

This isn't about an addition, netdev_priv() is still there. The
semantics silently changed, that's it.

I'm fine with its removal, is it ok? The trivial "return dev->priv"
isn't worth it anyway.
-- 
Krzysztof Halasa
--
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


sis190 build breakage

2008-01-29 Thread maximilian attems
  CC [M]  drivers/net/sis190.o
  drivers/net/sis190.c:329: error: sis190_pci_tbl causes a section type conflict
  make[5]: *** [drivers/net/sis190.o] Error 1

gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
--
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: Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread Waskiewicz Jr, Peter P

> > Are you using any specific qdisc, or just the default pfifo_fast?  
> > Have you done any specific tuning on your qdisc as well?  
> The default 
> > qlen seems to have been changed.
> 
> The driver seems buggy. Make it return NETDEV_TX_BUSY instead 
> of -EIO in xircom_start_xmit() and the messages will go away.

Totally agree.  However, the driver is still getting entries when it
shouldn't (netif_queue_stopped() is true), hence it's returning a non-OK
value.  We can either re-add the check for netif_queue_stopped() to
qdisc_restart(), or update the drivers to use the newer API.  I'd rather
do the latter, which I can work on.

Thanks Jamal!

-PJ
--
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: Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread Erik Mouw
On Tue, Jan 29, 2008 at 03:57:23PM -0500, jamal wrote:
> On Tue, 2008-29-01 at 11:57 -0800, Waskiewicz Jr, Peter P wrote:
> > > I've just started to use 2.6.24 on my home firewall (before 
> > > it was running 2.6.24-rc2 for about 65 days) and I noticed a 
> > > couple of error messages I've never seen before:
> > > 
> > > Jan 29 07:50:54 gateway kernel: BUG eth1 code -5 qlen 0 Jan 
> > > 29 08:28:30 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 08:57:30 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 09:44:04 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 10:01:35 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 10:01:35 gateway last message repeated 2 times Jan 29 
> > > 10:16:48 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 10:16:48 gateway last message repeated 2 times Jan 29 
> > > 10:45:48 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 10:45:48 gateway last message repeated 2 times Jan 29 
> > > 11:10:01 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > > 11:10:02 gateway last message repeated 9 times
> > > 
> > > The message seems to be coming from the qdisc_restart() in 
> > > net/sched/sch_generic.c which was changed with commit 
> > > 5f1a485d5905aa641f33009019b369907a4c .
> > > 
> > > The NIC is an IBM EtherJet cardbus card using the xircom_cb driver:
> > 
> > Are you using any specific qdisc, or just the default pfifo_fast?  Have
> > you done any specific tuning on your qdisc as well?  The default qlen
> > seems to have been changed.
> 
> The driver seems buggy. Make it return NETDEV_TX_BUSY instead of -EIO
> in xircom_start_xmit() and the messages will go away.

Like this?

diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index 8fc7274..6b93d01 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -441,7 +441,7 @@ static int xircom_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
spin_unlock_irqrestore(&card->lock,flags);
trigger_transmit(card);
 
-   return -EIO;
+   return NETDEV_TX_BUSY;
 }
 
 

It compiles without errors. I'm sorry I can't test it right now, I'm
100 km away from the machine and the same driver is used for both NICs
so if I goof up I won't be able to fix the it. I'll test it this friday
and let you know.


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery


signature.asc
Description: Digital signature


pull request: wireless-2.6 'rndis' 2008-01-29

2008-01-29 Thread John W. Linville
Dave,

RNDIS is a de facto standard from Microsoft for USB networking devices.
We already have support for ethernet devices, but wireless devices exist
as well.  This series applies some fixes to the current ethernet RNDIS
stuff to co-exist with wireless and adds a wireless RNDIS driver.  I
would like to see it in 2.6.25.

Thanks!

John

---

Individual patches are available here:


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

---

The following changes since commit 85040bcb4643cba578839e953f25e2d1965d83d0:
  YOSHIFUJI Hideaki (1):
[IPV6] ADDRLABEL: Fix double free on label deletion.

are available in the git repository at:

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

Bjorge Dijkstra (2):
  rndis_host: Fix sparse warning
  cdc_ether: Hardwire CDC descriptors when missing

Jussi Kivilinna (12):
  rndis_host: Use 1KB buffer in rndis_unbind
  rndis_host: Halt device if rndis_bind fails.
  rndis_host: Fix rndis packet filter flags.
  usbnet: Use wlan device name for RNDIS wireless devices
  rndis_host: Split up rndis_host.c
  rndis_host: export functions
  usbnet: add driver_priv pointer to 'struct usbnet'
  rndis_host: Add early_init function pointer to 'struct rndis_data'.
  rndis_host: Add link_change function pointer to 'struct rndis_data'.
  rndis_host: Add RNDIS physical medium checking into generic_rndis_bind()
  Move usbnet.h and rndis_host.h to include/linux/usb
  Add new driver 'rndis_wlan' for wireless RNDIS devices.

 MAINTAINERS |6 +
 drivers/net/usb/asix.c  |3 +-
 drivers/net/usb/cdc_ether.c |   13 +-
 drivers/net/usb/cdc_subset.c|3 +-
 drivers/net/usb/dm9601.c|3 +-
 drivers/net/usb/gl620a.c|3 +-
 drivers/net/usb/mcs7830.c   |3 +-
 drivers/net/usb/net1080.c   |3 +-
 drivers/net/usb/plusb.c |3 +-
 drivers/net/usb/rndis_host.c|  303 +---
 drivers/net/usb/usbnet.c|6 +-
 drivers/net/usb/zaurus.c|3 +-
 drivers/net/wireless/Kconfig|   28 +
 drivers/net/wireless/Makefile   |2 +
 drivers/net/wireless/rndis_wlan.c   | 2757 +++
 include/linux/usb/rndis_host.h  |  274 +++
 {drivers/net => include/linux}/usb/usbnet.h |   12 +
 17 files changed, 3180 insertions(+), 245 deletions(-)
 create mode 100644 drivers/net/wireless/rndis_wlan.c
 create mode 100644 include/linux/usb/rndis_host.h
 rename {drivers/net => include/linux}/usb/usbnet.h (93%)

Omnibus patch attached as rndis.patch.bz2
-- 
John W. Linville
[EMAIL PROTECTED]


rndis.patch.bz2
Description: BZip2 compressed data


[PATCH 1/3] Kernel support for flexible wakeup filters

2008-01-29 Thread Mitch Williams
Add ethtool infrastructure support for Wake-on-Lan flexible filters.

Signed-off-by: Mitch Williams <[EMAIL PROTECTED]>

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 71d4ada..70b86da 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -56,6 +56,16 @@ struct ethtool_wolinfo {
__u8sopass[SOPASS_MAX]; /* SecureOn(tm) password */
 };
 
+#define WOL_FILTER_MAX_LEN 256
+#define WOL_FILTER_IGNORE_OCTET 0x100
+/* wake-on-lan flexible filters */
+struct ethtool_wol_filter {
+   __u32   cmd;
+   __u32   index;
+   __u32   len;
+   __u16   mask_val[0];
+};
+
 /* for passing single values */
 struct ethtool_value {
__u32   cmd;
@@ -326,6 +336,8 @@ int ethtool_op_set_flags(struct net_device *dev, u32 data);
  * get_stats: Return statistics about the device
  * get_flags: get 32-bit flags bitmap
  * set_flags: set 32-bit flags bitmap
+ * get_wol_filter: get user-defined Wake-on-Lan filter
+ * set_wol_filter: set user-defined Wake-on-Lan filter
  * 
  * Description:
  *
@@ -391,6 +403,8 @@ struct ethtool_ops {
u32 (*get_priv_flags)(struct net_device *);
int (*set_priv_flags)(struct net_device *, u32);
int (*get_sset_count)(struct net_device *, int);
+   int (*get_wol_filter)(struct net_device *, struct 
ethtool_wol_filter *, u16 *);
+   int (*set_wol_filter)(struct net_device *, struct 
ethtool_wol_filter *, u16 *);
 
/* the following hooks are obsolete */
int (*self_test_count)(struct net_device *);/* use get_sset_count */
@@ -440,6 +454,9 @@ struct ethtool_ops {
 #define ETHTOOL_SFLAGS 0x0026 /* Set flags bitmap(ethtool_value) */
 #define ETHTOOL_GPFLAGS0x0027 /* Get driver-private flags 
bitmap */
 #define ETHTOOL_SPFLAGS0x0028 /* Set driver-private flags 
bitmap */
+#define ETHTOOL_GNUMWOLFILT0x0029 /* Get number of WOL filters. */
+#define ETHTOOL_GWOLFILTER 0x002a /* Get WOL filter */
+#define ETHTOOL_SWOLFILTER 0x002b /* Set WOL filter */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET ETHTOOL_GSET
@@ -526,5 +543,6 @@ struct ethtool_ops {
 #define WAKE_ARP   (1 << 4)
 #define WAKE_MAGIC (1 << 5)
 #define WAKE_MAGICSECURE   (1 << 6) /* only meaningful if WAKE_MAGIC */
+#define WAKE_FILTER(1 << 7)
 
 #endif /* _LINUX_ETHTOOL_H */
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 1163eb2..9ba9eb5 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -272,6 +272,64 @@ static int ethtool_set_wol(struct net_device *dev, char 
__user *useraddr)
return dev->ethtool_ops->set_wol(dev, &wol);
 }
 
+static int ethtool_get_wol_filter(struct net_device *dev, char __user 
*useraddr)
+{
+   struct ethtool_wol_filter wolfilt = { ETHTOOL_GWOLFILTER };
+   u16 *data;
+
+   if (!dev->ethtool_ops->get_wol_filter)
+   return -EOPNOTSUPP;
+
+   data = kmalloc(WOL_FILTER_MAX_LEN * 2, GFP_KERNEL);
+   if (!data)
+   return -ENOMEM;
+
+   if (copy_from_user(&wolfilt, useraddr, sizeof(wolfilt)))
+   return -EFAULT;
+
+   dev->ethtool_ops->get_wol_filter(dev, &wolfilt, data);
+
+   if (copy_to_user(useraddr, &wolfilt, sizeof(wolfilt)))
+   return -EFAULT;
+   if (copy_to_user(useraddr + sizeof(wolfilt), data, wolfilt.len * 2))
+   return -EFAULT;
+
+   kfree(data);
+   return 0;
+}
+
+static int ethtool_set_wol_filter(struct net_device *dev, char __user 
*useraddr)
+{
+   struct ethtool_wol_filter wolfilt;
+   u16 *data = NULL;
+   int ret;
+
+   if (!dev->ethtool_ops->get_wol_filter)
+   return -EOPNOTSUPP;
+
+   if (copy_from_user(&wolfilt, useraddr, sizeof(wolfilt)))
+   return -EFAULT;
+
+   if (wolfilt.len > WOL_FILTER_MAX_LEN)
+   return -EOPNOTSUPP;
+   
+   if (wolfilt.len) {
+   data = kmalloc(wolfilt.len * 2, GFP_KERNEL);
+   if (!data)
+   return -ENOMEM;
+   }
+
+   ret = -EFAULT;
+   if (copy_from_user(data, useraddr + sizeof(wolfilt), wolfilt.len * 2))
+   goto out;
+
+   ret = dev->ethtool_ops->set_wol_filter(dev, &wolfilt, data);
+out:
+   kfree(data);
+   return ret;
+   
+}
+
 static int ethtool_nway_reset(struct net_device *dev)
 {
if (!dev->ethtool_ops->nway_reset)
@@ -964,6 +1022,13 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
rc = ethtool_set_value(dev, useraddr,
   dev->ethtool_ops->set_priv_flags);
break;
+   case ETHTOOL_GNUMWOLFILT:
+   case ETHTOOL_GWOLFILTER:
+   rc = ethtool_get_wol_filter(dev, useraddr);
+   break;
+   case ETHTOOL_SWOLFILTER:
+   rc = ethtool_set_wol_filter(dev, useraddr);
+   b

[PATCH 3/3] Add flexible wake filter support to ethtool-6

2008-01-29 Thread Mitch Williams
Add support for Wake-on-Lan flexible filters to ethtool.To set a filter:

$ ethtool -F ethx  
  where  is a string of hex digits (or xx for ignore)
describing bytes from the beginning of the expected packet.
For example:  $ ethtool -F eth0 0 00a055667788449976xx32

To show a filter:
$ ethtool -f ethx 

Signed-off-by: Mitch Williams <[EMAIL PROTECTED]>

diff --git a/ethtool-copy.h b/ethtool-copy.h
index 3a63224..dbad8dc 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -55,6 +55,16 @@ struct ethtool_wolinfo {
__u8sopass[SOPASS_MAX]; /* SecureOn(tm) password */
 };
 
+#define WOL_FILTER_MAX_LEN 256
+#define WOL_FILTER_IGNORE_OCTET 0x100
+/* wake-on-lan flexible filters */
+struct ethtool_wol_filter {
+   u32 cmd;
+   u32 index;
+   u32 len;
+   u16 mask_val[0];
+};
+
 /* for passing single values */
 struct ethtool_value {
__u32   cmd;
@@ -414,6 +424,9 @@ struct ethtool_ops {
 #define ETHTOOL_SUFO   0x0022 /* Set UFO enable (ethtool_value) */
 #define ETHTOOL_GGSO   0x0023 /* Get GSO enable (ethtool_value) */
 #define ETHTOOL_SGSO   0x0024 /* Set GSO enable (ethtool_value) */
+#define ETHTOOL_GNUMWOLFILT0x0029
+#define ETHTOOL_GWOLFILTER 0x002a /* Get WOL flex filter */
+#define ETHTOOL_SWOLFILTER 0x002b /* Set WOL flex filter */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET ETHTOOL_GSET
@@ -500,5 +513,6 @@ struct ethtool_ops {
 #define WAKE_ARP   (1 << 4)
 #define WAKE_MAGIC (1 << 5)
 #define WAKE_MAGICSECURE   (1 << 6) /* only meaningful if WAKE_MAGIC */
+#define WAKE_FILTER(1 << 7)
 
 #endif /* _LINUX_ETHTOOL_H */
diff --git a/ethtool.c b/ethtool.c
index a668b49..febd7e6 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -69,6 +69,9 @@ static int do_scoalesce(int fd, struct ifreq *ifr);
 static int do_goffload(int fd, struct ifreq *ifr);
 static int do_soffload(int fd, struct ifreq *ifr);
 static int do_gstats(int fd, struct ifreq *ifr);
+static int do_gwolfilter(int fd, struct ifreq *ifr);
+static int do_swolfilter(int fd, struct ifreq *ifr);
+static void parse_filter(char *cmdline);
 
 static enum {
MODE_HELP = -1,
@@ -90,6 +93,8 @@ static enum {
MODE_GOFFLOAD,
MODE_SOFFLOAD,
MODE_GSTATS,
+   MODE_GFILTER,
+   MODE_SFILTER,
 } mode = MODE_GSET;
 
 static struct option {
@@ -170,6 +175,8 @@ static struct option {
 { "-t", "--test", MODE_TEST, "Execute adapter self test",
 "   [ online | offline ]\n" },
 { "-S", "--statistics", MODE_GSTATS, "Show adapter statistics" },
+{ "-f", "--show-filter", MODE_GFILTER, "Show WOL filter N\n"},
+{ "-F", "--change-filter", MODE_SFILTER, "Set WOL filter N\n"},
 { "-h", "--help", MODE_HELP, "Show this help" },
 {}
 };
@@ -266,6 +273,10 @@ static int seeprom_changed = 0;
 static int seeprom_magic = 0;
 static int seeprom_offset = -1;
 static int seeprom_value = 0;
+static int gfilter_num = 0;
+static int sfilter_num = 0;
+static u16 filter[WOL_FILTER_MAX_LEN];
+static int filter_len = 0;
 static enum {
ONLINE=0,
OFFLINE,
@@ -430,6 +441,8 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_GOFFLOAD) ||
(mode == MODE_SOFFLOAD) ||
(mode == MODE_GSTATS) ||
+   (mode == MODE_GFILTER) ||
+   (mode == MODE_SFILTER) ||
(mode == MODE_PHYS_ID)) {
devname = argp[i];
break;
@@ -509,6 +522,26 @@ static void parse_cmdline(int argc, char **argp)
i = argc;
break;
}
+   if (mode == MODE_GFILTER) {
+   long v;
+   v = strtol(argp[i], NULL, 0);
+   if (v < 0)
+   show_usage(1);
+   gfilter_num = (int) v;
+   break;
+   }
+   if (mode == MODE_SFILTER) {
+   long v;
+   v = strtol(argp[i], NULL, 0);
+   if (v < 0)
+   show_usage(1);
+   sfilter_num = (int) v;
+   i += 1;
+   if (i >= argc)
+   show_usage(1);
+   parse_filter(argp[i]);
+   break;
+   }
if (mode != MODE_SSET)
show_usage(1);
if (!strcmp(argp[i], "speed")) {
@@ -942,6 +975,9 @@ static int parse_wolopts(char *optst

[PATCH 2/3] Add flexible wake filter support to e1000e

2008-01-29 Thread Mitch Williams
Add support to e1000e for Wake-on-Lan flexible filters.  This feature is
supported by all hardware that the driver supports.

Signed-off-by: Mitch Williams <[EMAIL PROTECTED]>

diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
index 6232c3e..3c18a09 100644
--- a/drivers/net/e1000e/defines.h
+++ b/drivers/net/e1000e/defines.h
@@ -65,6 +65,15 @@
 #define E1000_WUFC_BC   0x0010 /* Broadcast Wakeup Enable */
 #define E1000_WUFC_ARP  0x0020 /* ARP Request Packet Wakeup Enable */
 
+/* Four Flexible Filters are supported */
+#define E1000_FLEXIBLE_FILTER_COUNT_MAX 4
+#define E1000_WUFC_ALL_FILTERS  0x000F00FF /* Mask for all wakeup filters */
+#define E1000_WUFC_FLX_OFFSET   16 /* Offset to the Flexible Filters bits */
+#define E1000_WUFC_FLX_FILTERS  0x000F /* Mask for the 4 flexible filters 
*/
+
+/* Each Flexible Filter is at most 128 (0x80) bytes in length */
+#define E1000_FLEXIBLE_FILTER_SIZE_MAX  128
+
 /* Extended Device Control */
 #define E1000_CTRL_EXT_SDP7_DATA 0x0080 /* Value of SW Defineable Pin 7 */
 #define E1000_CTRL_EXT_EE_RST0x2000 /* Reinitialize from EEPROM */
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 8b88c22..da0538a 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -267,6 +267,7 @@ struct e1000_adapter {
unsigned long led_status;
 
unsigned int flags;
+   u32 wol_filters;
 };
 
 struct e1000_info {
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 9fab444..25b7b4f 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1633,7 +1633,8 @@ static void e1000_get_wol(struct net_device *netdev,
 
wol->supported = WAKE_UCAST | WAKE_MCAST |
 WAKE_BCAST | WAKE_MAGIC |
-WAKE_PHY | WAKE_ARP;
+WAKE_PHY | WAKE_ARP |
+WAKE_FILTER;
 
/* apply any specific unsupported masks here */
if (adapter->flags & FLAG_NO_WAKE_UCAST) {
@@ -1656,6 +1657,8 @@ static void e1000_get_wol(struct net_device *netdev,
wol->wolopts |= WAKE_PHY;
if (adapter->wol & E1000_WUFC_ARP)
wol->wolopts |= WAKE_ARP;
+   if (adapter->wol & E1000_WUFC_FLX_FILTERS)
+   wol->wolopts |= WAKE_FILTER;
 }
 
 static int e1000_set_wol(struct net_device *netdev,
@@ -1684,6 +1687,95 @@ static int e1000_set_wol(struct net_device *netdev,
adapter->wol |= E1000_WUFC_LNKC;
if (wol->wolopts & WAKE_ARP)
adapter->wol |= E1000_WUFC_ARP;
+   if (wol->wolopts & WAKE_FILTER)
+   adapter->wol |= adapter->wol_filters;
+
+   return 0;
+}
+
+static int e1000_get_wol_filter(struct net_device *netdev,
+   struct ethtool_wol_filter *wolfilt,
+   u16 *mask_val)
+{
+   struct e1000_adapter *adapter = netdev_priv(netdev);
+   struct e1000_hw *hw = &adapter->hw;
+   u32 mask, mt_val, vt_val, fflt, shift;
+   int i;
+
+   if (wolfilt->cmd == ETHTOOL_GNUMWOLFILT) {
+   wolfilt->index = E1000_FLEXIBLE_FILTER_COUNT_MAX;
+   wolfilt->len = 0;
+   return 0;
+   }
+
+   if (wolfilt->index > E1000_FLEXIBLE_FILTER_COUNT_MAX)
+   return -EOPNOTSUPP;
+   
+   mask = 1 << wolfilt->index;
+   shift = wolfilt->index * 8;
+
+   fflt = E1000_READ_REG_ARRAY(hw, E1000_FFLT, wolfilt->index*2);
+   wolfilt->len = fflt & 0xff;
+   for (i = 0; i < wolfilt->len; i++) {
+   mt_val = E1000_READ_REG_ARRAY(hw, E1000_FFMT, i*2);
+   vt_val = E1000_READ_REG_ARRAY(hw, E1000_FFVT, i*2);
+   mt_val &= mask;
+   vt_val = (vt_val >> shift) & 0xff;
+   if (!mt_val)
+   mask_val[i] = WOL_FILTER_IGNORE_OCTET | vt_val;
+   else
+   mask_val[i] = vt_val;
+   }
+
+   return 0;
+}
+
+static int e1000_set_wol_filter(struct net_device *netdev,
+   struct ethtool_wol_filter *wolfilt,
+   u16 *mask_val)
+{
+   struct e1000_adapter *adapter = netdev_priv(netdev);
+   struct e1000_hw *hw = &adapter->hw;
+   int i, shift;
+   u32 mask, wufc, mt_val, vt_val, fflt;
+
+   if ((wolfilt->index > E1000_FLEXIBLE_FILTER_COUNT_MAX) ||
+   (wolfilt->len > E1000_FLEXIBLE_FILTER_SIZE_MAX))
+   return -EOPNOTSUPP;
+   
+   wufc = er32(WUFC);
+   mask = 1 << wolfilt->index;
+   if (wolfilt->len) {
+   shift = wolfilt->index * 8;
+   /* first, disable all filters */
+   ew32(WUFC, (wufc & ~E1000_WUFC_FLX_FILTERS));
+   for (i = 0; i < wolfilt->len; i++) {
+   mt_val = E1000_READ_REG_ARRAY(hw, E1000_FFMT, i*2);
+   vt_val = E1000_READ_REG_ARRAY(hw, E1000_FFVT,

[PATCH 0/3] Add flexible wake filter support

2008-01-29 Thread Mitch Williams
This patchset adds support for Wake-on-Lan flexible filters to ethtool
and to e1000e.  Since this hardware feature is required for
certification on Another Operating System(TM), it's likely that most
current hardware supports it in one form or another.

To set a filter:
$ ethtool -F ethx  
  where  is a string of hex digits (or xx for ignore)
describing bytes from the beginning of the expected packet.
For example:  $ ethtool -F eth0 0 00a055667788449976xx32

To show a filter:
$ ethtool -f ethx 

This feature gives more wakeup flexibility for people who need it.

Signed-off-by: Mitch Williams <[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-2.6.25] [IPV6] ADDRLABEL: Fix double free on label deletion.

2008-01-29 Thread Paul E. McKenney
On Mon, Jan 28, 2008 at 09:02:22PM +0900, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> If an entry is being deleted because it has only one reference, 
> we immediately delete it and blindly register the rcu handler for it,
> This results in oops by double freeing that object.
> 
> This patch fixes it by consolidating the code paths for the deletion;
> let its rcu handler delete the object if it has no more reference.
> 
> Bug was found by Mitsuru Chinen <[EMAIL PROTECTED]>

Good catch!!!

Acked-by: Paul E. McKenney <[EMAIL PROTECTED]>

> Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
> ---
> 
> diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
> index 6f1ca60..7a706c4 100644
> --- a/net/ipv6/addrlabel.c
> +++ b/net/ipv6/addrlabel.c
> @@ -106,6 +106,11 @@ static inline void ip6addrlbl_free(struct 
> ip6addrlbl_entry *p)
>   kfree(p);
>  }
> 
> +static void ip6addrlbl_free_rcu(struct rcu_head *h)
> +{
> + ip6addrlbl_free(container_of(h, struct ip6addrlbl_entry, rcu));
> +}
> +
>  static inline int ip6addrlbl_hold(struct ip6addrlbl_entry *p)
>  {
>   return atomic_inc_not_zero(&p->refcnt);
> @@ -114,12 +119,7 @@ static inline int ip6addrlbl_hold(struct 
> ip6addrlbl_entry *p)
>  static inline void ip6addrlbl_put(struct ip6addrlbl_entry *p)
>  {
>   if (atomic_dec_and_test(&p->refcnt))
> - ip6addrlbl_free(p);
> -}
> -
> -static void ip6addrlbl_free_rcu(struct rcu_head *h)
> -{
> - ip6addrlbl_free(container_of(h, struct ip6addrlbl_entry, rcu));
> + call_rcu(&p->rcu, ip6addrlbl_free_rcu);
>  }
> 
>  /* Find label */
> @@ -240,7 +240,6 @@ int __ip6addrlbl_add(struct ip6addrlbl_entry *newp, int 
> replace)
>   }
>   hlist_replace_rcu(&p->list, &newp->list);
>   ip6addrlbl_put(p);
> - call_rcu(&p->rcu, ip6addrlbl_free_rcu);
>   goto out;
>   } else if ((p->prefixlen == newp->prefixlen && 
> !p->ifindex) ||
>  (p->prefixlen < newp->prefixlen)) {
> @@ -300,7 +299,6 @@ int __ip6addrlbl_del(const struct in6_addr *prefix, int 
> prefixlen,
>   ipv6_addr_equal(&p->prefix, prefix)) {
>   hlist_del_rcu(&p->list);
>   ip6addrlbl_put(p);
> - call_rcu(&p->rcu, ip6addrlbl_free_rcu);
>   ret = 0;
>   break;
>   }
> 
> -- 
> YOSHIFUJI Hideaki @ USAGI Project  <[EMAIL PROTECTED]>
> GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
> --
> 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
--
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.6.24] e1000e: add new wakeup cababilities

2008-01-29 Thread Mitch Williams
Ethtool supports wake-on-ARP and wake-on-link, and so does the hardware
supported by e1000e.  This patch just introduces the two.

Signed-off-by: Mitch Williams <[EMAIL PROTECTED]>

diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
index f2175ea..6232c3e 100644
--- a/drivers/net/e1000e/defines.h
+++ b/drivers/net/e1000e/defines.h
@@ -63,6 +63,7 @@
 #define E1000_WUFC_EX   0x0004 /* Directed Exact Wakeup Enable */
 #define E1000_WUFC_MC   0x0008 /* Directed Multicast Wakeup Enable */
 #define E1000_WUFC_BC   0x0010 /* Broadcast Wakeup Enable */
+#define E1000_WUFC_ARP  0x0020 /* ARP Request Packet Wakeup Enable */
 
 /* Extended Device Control */
 #define E1000_CTRL_EXT_SDP7_DATA 0x0080 /* Value of SW Defineable Pin 7 */
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 6d9c27f..9fab444 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -1632,7 +1632,8 @@ static void e1000_get_wol(struct net_device *netdev,
return;
 
wol->supported = WAKE_UCAST | WAKE_MCAST |
-WAKE_BCAST | WAKE_MAGIC;
+WAKE_BCAST | WAKE_MAGIC |
+WAKE_PHY | WAKE_ARP;
 
/* apply any specific unsupported masks here */
if (adapter->flags & FLAG_NO_WAKE_UCAST) {
@@ -1651,6 +1652,10 @@ static void e1000_get_wol(struct net_device *netdev,
wol->wolopts |= WAKE_BCAST;
if (adapter->wol & E1000_WUFC_MAG)
wol->wolopts |= WAKE_MAGIC;
+   if (adapter->wol & E1000_WUFC_LNKC)
+   wol->wolopts |= WAKE_PHY;
+   if (adapter->wol & E1000_WUFC_ARP)
+   wol->wolopts |= WAKE_ARP;
 }
 
 static int e1000_set_wol(struct net_device *netdev,
@@ -1658,7 +1663,7 @@ static int e1000_set_wol(struct net_device *netdev,
 {
struct e1000_adapter *adapter = netdev_priv(netdev);
 
-   if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
+   if (wol->wolopts & WAKE_MAGICSECURE)
return -EOPNOTSUPP;
 
if (!(adapter->flags & FLAG_HAS_WOL))
@@ -1675,6 +1680,10 @@ static int e1000_set_wol(struct net_device *netdev,
adapter->wol |= E1000_WUFC_BC;
if (wol->wolopts & WAKE_MAGIC)
adapter->wol |= E1000_WUFC_MAG;
+   if (wol->wolopts & WAKE_PHY)
+   adapter->wol |= E1000_WUFC_LNKC;
+   if (wol->wolopts & WAKE_ARP)
+   adapter->wol |= E1000_WUFC_ARP;
 
return 0;
 }


--
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: Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread jamal
On Tue, 2008-29-01 at 11:57 -0800, Waskiewicz Jr, Peter P wrote:
> > I've just started to use 2.6.24 on my home firewall (before 
> > it was running 2.6.24-rc2 for about 65 days) and I noticed a 
> > couple of error messages I've never seen before:
> > 
> > Jan 29 07:50:54 gateway kernel: BUG eth1 code -5 qlen 0 Jan 
> > 29 08:28:30 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 08:57:30 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 09:44:04 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 10:01:35 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 10:01:35 gateway last message repeated 2 times Jan 29 
> > 10:16:48 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 10:16:48 gateway last message repeated 2 times Jan 29 
> > 10:45:48 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 10:45:48 gateway last message repeated 2 times Jan 29 
> > 11:10:01 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> > 11:10:02 gateway last message repeated 9 times
> > 
> > The message seems to be coming from the qdisc_restart() in 
> > net/sched/sch_generic.c which was changed with commit 
> > 5f1a485d5905aa641f33009019b369907a4c .
> > 
> > The NIC is an IBM EtherJet cardbus card using the xircom_cb driver:
> 
> Are you using any specific qdisc, or just the default pfifo_fast?  Have
> you done any specific tuning on your qdisc as well?  The default qlen
> seems to have been changed.

The driver seems buggy. Make it return NETDEV_TX_BUSY instead of -EIO
in xircom_start_xmit() and the messages will go away.

cheers,
jamal



--
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: [NET_SCHED]: sch_ingress: remove netfilter support

2008-01-29 Thread jamal

About time - Thanks Patrick.

Acked-by: Jamal Hadi Salim <[EMAIL PROTECTED]>

 
cheers,
jamal

--
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: netdev->priv and netdev_priv(dev)

2008-01-29 Thread Stephen Hemminger
On Tue, 29 Jan 2008 21:10:00 +0100
Krzysztof Halasa <[EMAIL PROTECTED]> wrote:

> A commit few months ago introduced a change:
> 
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
>  
>  static inline void *netdev_priv(const struct net_device *dev)
>  {
> -   return (char *)dev + ((sizeof(struct net_device)
> -   + NETDEV_ALIGN_CONST)
> -   & ~NETDEV_ALIGN_CONST);
> +   return dev->priv;
>  }
>  
> This change caused some problems for drivers which used
> netdev_priv(dev) and dev->priv for different purposes.
> 

Those drivers were making a incorrect assumption and should be fixed.
The in-tree drivers were fixed when this was done. If you have an out
of tree driver, then too bad for you.

> 
> The following patch restores previous behaviour.
> 
> Signed-off-by: Krzysztof Halasa <[EMAIL PROTECTED]>
> 
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -584,7 +584,10 @@ struct net_device
>  
>  static inline void *netdev_priv(const struct net_device *dev)
>  {
> - return dev->priv;
> + return (char *)dev + ((sizeof(struct net_device) +
> +sizeof(struct net_device_subqueue) *
> +(dev->egress_subqueue_count - 1) +
> +NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
>  }
>  
>  #define SET_MODULE_OWNER(dev) do { } while (0)
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3693,13 +3693,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, 
> const char *name,
>   (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
>   dev->padded = (char *)dev - (char *)p;
>  
> - if (sizeof_priv) {
> - dev->priv = ((char *)dev +
> -  ((sizeof(struct net_device) +
> -(sizeof(struct net_device_subqueue) *
> - (queue_count - 1)) + NETDEV_ALIGN_CONST)
> -   & ~NETDEV_ALIGN_CONST));
> - }
> + if (sizeof_priv)
> + dev->priv = netdev_priv(dev);
>  
>   dev->egress_subqueue_count = queue_count;
>  

The additional overhead of the address calculation would slow down the
well behaved drivers.  There was discussion of alternative layouts of
the network device allocation or limiting the number of subqueue's so
that netdev_priv could be a simple addition again, but nothing came of
it.



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


PATCH[1/1]: Add ctr-aes support to ipsec

2008-01-29 Thread Joy Latten
The below patch allows IPsec to use CTR mode with
AES encryption algorithm. Tested this using setkey
in ipsec-tools.

regards,
Joy

diff -urpN net-2.6.25/include/linux/pfkeyv2.h 
net-2.6.25.patch/include/linux/pfkeyv2.h
--- net-2.6.25/include/linux/pfkeyv2.h  2008-01-29 11:48:00.0 -0600
+++ net-2.6.25.patch/include/linux/pfkeyv2.h2008-01-29 13:43:59.0 
-0600
@@ -298,6 +298,7 @@ struct sadb_x_sec_ctx {
 #define SADB_X_EALG_BLOWFISHCBC7
 #define SADB_EALG_NULL 11
 #define SADB_X_EALG_AESCBC 12
+#define SADB_X_EALG_AESCTR 13
 #define SADB_X_EALG_CAMELLIACBC22
 #define SADB_EALG_MAX   253 /* last EALG */
 /* private allocations should use 249-255 (RFC2407) */
diff -urpN net-2.6.25/net/xfrm/xfrm_algo.c net-2.6.25.patch/net/xfrm/xfrm_algo.c
--- net-2.6.25/net/xfrm/xfrm_algo.c 2008-01-29 11:48:03.0 -0600
+++ net-2.6.25.patch/net/xfrm/xfrm_algo.c   2008-01-29 13:42:43.0 
-0600
@@ -300,6 +300,23 @@ static struct xfrm_algo_desc ealg_list[]
.sadb_alg_maxbits = 256
}
 },
+{
+   .name = "rfc3686(ctr(aes))",
+
+   .uinfo = {
+   .encr = {
+   .blockbits = 128,
+   .defkeybits = 160, /* 128-bit key + 32-bit nonce */
+   }
+   },
+
+   .desc = {
+   .sadb_alg_id = SADB_X_EALG_AESCTR,
+   .sadb_alg_ivlen = 8,
+   .sadb_alg_minbits = 128,
+   .sadb_alg_maxbits = 256
+   }
+},
 };
 
 static struct xfrm_algo_desc calg_list[] = {
--
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] netdev->priv and netdev_priv(dev)

2008-01-29 Thread Krzysztof Halasa
[This version shouldn't confuse git/patch]

A commit few months ago introduced a change:

- a/include/linux/netdevice.h
+ b/include/linux/netdevice.h
 
 static inline void *netdev_priv(const struct net_device *dev)
 {
-   return (char *)dev + ((sizeof(struct net_device)
-   + NETDEV_ALIGN_CONST)
-   & ~NETDEV_ALIGN_CONST);
+   return dev->priv;
 }
 
This change caused some problems for drivers which used
netdev_priv(dev) and dev->priv for different purposes.


The following patch restores previous behaviour.

Signed-off-by: Krzysztof Halasa <[EMAIL PROTECTED]>

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -584,7 +584,10 @@ struct net_device
 
 static inline void *netdev_priv(const struct net_device *dev)
 {
-   return dev->priv;
+   return (char *)dev + ((sizeof(struct net_device) +
+  sizeof(struct net_device_subqueue) *
+  (dev->egress_subqueue_count - 1) +
+  NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
 }
 
 #define SET_MODULE_OWNER(dev) do { } while (0)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3693,13 +3693,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, 
const char *name,
(((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
dev->padded = (char *)dev - (char *)p;
 
-   if (sizeof_priv) {
-   dev->priv = ((char *)dev +
-((sizeof(struct net_device) +
-  (sizeof(struct net_device_subqueue) *
-   (queue_count - 1)) + NETDEV_ALIGN_CONST)
- & ~NETDEV_ALIGN_CONST));
-   }
+   if (sizeof_priv)
+   dev->priv = netdev_priv(dev);
 
dev->egress_subqueue_count = queue_count;
 
--
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 1/1 resend][arm/at91_ether.c] logical/bitand typo in function reset_phy() (inactive), drivers/net/arm/at91_ether.c

2008-01-29 Thread Roel Kluin
include/linux/mii.h:48:#define BMCR_RESET 0x8000

The function reset_phy() is in "#if 0" inactivated code
--
Replace logical "&&" by bit "&" before BMCR_RESET

Signed-off-by: Roel Kluin <[EMAIL PROTECTED]>
---
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 25b114a..0ae0d83 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -384,7 +384,7 @@ static void reset_phy(struct net_device *dev)
/* Wait until PHY reset is complete */
do {
read_phy(lp->phy_address, MII_BMCR, &bmcr);
-   } while (!(bmcr && BMCR_RESET));
+   } while (!(bmcr & BMCR_RESET));
 
disable_mdi();
spin_unlock_irq(&lp->lock);

--
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] PHYLIB: Locking fixes for PHY I/O potentially sleeping

2008-01-29 Thread Haavard Skinnemoen
On Tue, 29 Jan 2008 10:05:09 -0600
Nate Case <[EMAIL PROTECTED]> wrote:

> +/* PHY timer which schedules the state machine work */
> +static void phy_timer(unsigned long data)
> +{
> + struct phy_device *phydev = (struct phy_device *)data;
> +
> + /*
> +  * PHY I/O operations can potentially sleep so we ensure that
> +  * it's done from a process context
> +  */
> + schedule_work(&phydev->state_queue);
> +}

If you use schedule_delayed_work() instead, you can get rid of the
timer.

Haavard
--
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


netdev->priv and netdev_priv(dev)

2008-01-29 Thread Krzysztof Halasa
A commit few months ago introduced a change:

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
 
 static inline void *netdev_priv(const struct net_device *dev)
 {
-   return (char *)dev + ((sizeof(struct net_device)
-   + NETDEV_ALIGN_CONST)
-   & ~NETDEV_ALIGN_CONST);
+   return dev->priv;
 }
 
This change caused some problems for drivers which used
netdev_priv(dev) and dev->priv for different purposes.


The following patch restores previous behaviour.

Signed-off-by: Krzysztof Halasa <[EMAIL PROTECTED]>

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -584,7 +584,10 @@ struct net_device
 
 static inline void *netdev_priv(const struct net_device *dev)
 {
-   return dev->priv;
+   return (char *)dev + ((sizeof(struct net_device) +
+  sizeof(struct net_device_subqueue) *
+  (dev->egress_subqueue_count - 1) +
+  NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
 }
 
 #define SET_MODULE_OWNER(dev) do { } while (0)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3693,13 +3693,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, 
const char *name,
(((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
dev->padded = (char *)dev - (char *)p;
 
-   if (sizeof_priv) {
-   dev->priv = ((char *)dev +
-((sizeof(struct net_device) +
-  (sizeof(struct net_device_subqueue) *
-   (queue_count - 1)) + NETDEV_ALIGN_CONST)
- & ~NETDEV_ALIGN_CONST));
-   }
+   if (sizeof_priv)
+   dev->priv = netdev_priv(dev);
 
dev->egress_subqueue_count = queue_count;
 
--
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: Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread Waskiewicz Jr, Peter P
> I've just started to use 2.6.24 on my home firewall (before 
> it was running 2.6.24-rc2 for about 65 days) and I noticed a 
> couple of error messages I've never seen before:
> 
> Jan 29 07:50:54 gateway kernel: BUG eth1 code -5 qlen 0 Jan 
> 29 08:28:30 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 08:57:30 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 09:44:04 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 10:01:35 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 10:01:35 gateway last message repeated 2 times Jan 29 
> 10:16:48 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 10:16:48 gateway last message repeated 2 times Jan 29 
> 10:45:48 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 10:45:48 gateway last message repeated 2 times Jan 29 
> 11:10:01 gateway kernel: BUG eth1 code -5 qlen 0 Jan 29 
> 11:10:02 gateway last message repeated 9 times
> 
> The message seems to be coming from the qdisc_restart() in 
> net/sched/sch_generic.c which was changed with commit 
> 5f1a485d5905aa641f33009019b369907a4c .
> 
> The NIC is an IBM EtherJet cardbus card using the xircom_cb driver:

Are you using any specific qdisc, or just the default pfifo_fast?  Have
you done any specific tuning on your qdisc as well?  The default qlen
seems to have been changed.

Basically your queue is being overrun, and with the current checks in
the kernel in the stack, it's allowing the skb into the driver.  I've
known about this issue, and I'm hesitant to push a patch to re-add the
netif_queue_stopped() check into qdisc_restart().  I'd rather push a
one-time patch to the drivers that interacts with
netif_stop_subqueue(netdev, 0), so we can completely decouple the single
queue from the netdev.

I'd say you can somewhat ignore the messages for now.  But there is work
to be done here, and it's obvious I need to do this sooner than later.
Please let me know about the qdisc parameters though when you get a
chance.

Thanks,

-PJ Waskiewicz
<[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] bfin_mac: Fix MDIO clock frequency

2008-01-29 Thread Kalle Pokki
On Wed, 30 Jan 2008, Bryan Wu wrote:

> 
> On Tue, 2008-01-29 at 20:27 +0800, Kalle Pokki wrote:
> > The clock divisor is set to all ones at reset. 
> > --- 
> >  drivers/net/bfin_mac.c |2 +- 
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c 
> > index eb97175..c199633 100644 
> > --- a/drivers/net/bfin_mac.c 
> > +++ b/drivers/net/bfin_mac.c 
> > @@ -425,7 +425,7 @@ static int mii_probe(struct net_device *dev) 
> >   
> > /* MDC  = 2.5 MHz */ 
> > sysctl = bfin_read_EMAC_SYSCTL(); 
> > -   sysctl |= SET_MDCDIV(24); 
> > +   sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(24); 
> 
> Good catch, I will apply this. 
> Actually, another patch will modified this operation, you patch can not
> be applied cleanly:
> 
> >From e347fc2fdb8d8ecd8fa563929fcfa51759d5ac1c Mon Sep 17 00:00:00 2001
> From: Bryan Wu <[EMAIL PROTECTED]>
> Date: Fri, 11 Jan 2008 15:17:03 +0800
> Subject: [PATCH] [Blackfin] EMAC driver: define MDC_CLK=2.5MHz and caculate 
> mdc_div according to SCLK.
> 
> Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
> ---
>  drivers/net/bfin_mac.c |   16 
>  1 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
> index 4006a5d..ee39819 100644
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -412,20 +412,26 @@ static void bf537_adjust_link(struct net_device *dev)
>   spin_unlock_irqrestore(&lp->lock, flags);
>  }
>  
> +/* MDC  = 2.5 MHz */
> +#define MDC_CLK 250
> +
>  static int mii_probe(struct net_device *dev)
>  {
>   struct bf537mac_local *lp = netdev_priv(dev);
>   struct phy_device *phydev = NULL;
>   unsigned short sysctl;
>   int i;
> + u32 sclk, mdc_div;
>  
>   /* Enable PHY output early */
>   if (!(bfin_read_VR_CTL() & PHYCLKOE))
>   bfin_write_VR_CTL(bfin_read_VR_CTL() | PHYCLKOE);
>  
> - /* MDC  = 2.5 MHz */
> + sclk = get_sclk();
> + mdc_div = ((sclk / MDC_CLK) / 2) - 1;
> +
>   sysctl = bfin_read_EMAC_SYSCTL();
> - sysctl |= SET_MDCDIV(24);
> + sysctl |= SET_MDCDIV(mdc_div);
>   bfin_write_EMAC_SYSCTL(sysctl);
>  
>   /* search for connect PHY device */
> @@ -477,8 +483,10 @@ static int mii_probe(struct net_device *dev)
>   lp->phydev = phydev;
>  
>   printk(KERN_INFO "%s: attached PHY driver [%s] "
> -"(mii_bus:phy_addr=%s, irq=%d)\n",
> -DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq);
> +"(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)"
> +"@sclk=%dMHz)\n",
> +DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq,
> +MDC_CLK, mdc_div, sclk/100);
>  
>   return 0;
>  }
> -- 
> 1.5.3.4
> 
> Do you mind I modified you patch to against this one and send out as a patch 
> set to upstream?

No, I don't mind.
--
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


Lots of "BUG eth1 code -5 qlen 0" messages in 2.6.24

2008-01-29 Thread Erik Mouw
Hi,

I've just started to use 2.6.24 on my home firewall (before it was
running 2.6.24-rc2 for about 65 days) and I noticed a couple of error
messages I've never seen before:

Jan 29 07:50:54 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 08:28:30 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 08:57:30 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 09:44:04 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 10:01:35 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 10:01:35 gateway last message repeated 2 times
Jan 29 10:16:48 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 10:16:48 gateway last message repeated 2 times
Jan 29 10:45:48 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 10:45:48 gateway last message repeated 2 times
Jan 29 11:10:01 gateway kernel: BUG eth1 code -5 qlen 0
Jan 29 11:10:02 gateway last message repeated 9 times

The message seems to be coming from the qdisc_restart() in
net/sched/sch_generic.c which was changed with commit
5f1a485d5905aa641f33009019b369907a4c .

The NIC is an IBM EtherJet cardbus card using the xircom_cb driver:

05:00.0 Ethernet controller: Xircom Cardbus Ethernet 10/100 (rev 03)
Subsystem: IBM 10/100 EtherJet Cardbus Adapter
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- SERR-  0003)
ACPI: PCI Interrupt :05:00.0[A] -> Link [LNKB] -> GSI 11 (level, low) -> 
IRQ 11
PCI: Setting latency timer of device :05:00.0 to 64
eth1: Xircom cardbus revision 3 at irq 11

Question is: do I need to worry about these messages or are they
harmless?


Erik

-- 
They're all fools. Don't worry. Darwin may be slow, but he'll
eventually get them. -- Matthew Lammers in alt.sysadmin.recovery


signature.asc
Description: Digital signature


Re: [PATCH] bfin_mac: Fix MDIO clock frequency

2008-01-29 Thread Bryan Wu

On Tue, 2008-01-29 at 20:27 +0800, Kalle Pokki wrote:
> The clock divisor is set to all ones at reset. 
> --- 
>  drivers/net/bfin_mac.c |2 +- 
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c 
> index eb97175..c199633 100644 
> --- a/drivers/net/bfin_mac.c 
> +++ b/drivers/net/bfin_mac.c 
> @@ -425,7 +425,7 @@ static int mii_probe(struct net_device *dev) 
>   
> /* MDC  = 2.5 MHz */ 
> sysctl = bfin_read_EMAC_SYSCTL(); 
> -   sysctl |= SET_MDCDIV(24); 
> +   sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(24); 

Good catch, I will apply this. 
Actually, another patch will modified this operation, you patch can not
be applied cleanly:

>From e347fc2fdb8d8ecd8fa563929fcfa51759d5ac1c Mon Sep 17 00:00:00 2001
From: Bryan Wu <[EMAIL PROTECTED]>
Date: Fri, 11 Jan 2008 15:17:03 +0800
Subject: [PATCH] [Blackfin] EMAC driver: define MDC_CLK=2.5MHz and caculate 
mdc_div according to SCLK.

Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 drivers/net/bfin_mac.c |   16 
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 4006a5d..ee39819 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -412,20 +412,26 @@ static void bf537_adjust_link(struct net_device *dev)
spin_unlock_irqrestore(&lp->lock, flags);
 }
 
+/* MDC  = 2.5 MHz */
+#define MDC_CLK 250
+
 static int mii_probe(struct net_device *dev)
 {
struct bf537mac_local *lp = netdev_priv(dev);
struct phy_device *phydev = NULL;
unsigned short sysctl;
int i;
+   u32 sclk, mdc_div;
 
/* Enable PHY output early */
if (!(bfin_read_VR_CTL() & PHYCLKOE))
bfin_write_VR_CTL(bfin_read_VR_CTL() | PHYCLKOE);
 
-   /* MDC  = 2.5 MHz */
+   sclk = get_sclk();
+   mdc_div = ((sclk / MDC_CLK) / 2) - 1;
+
sysctl = bfin_read_EMAC_SYSCTL();
-   sysctl |= SET_MDCDIV(24);
+   sysctl |= SET_MDCDIV(mdc_div);
bfin_write_EMAC_SYSCTL(sysctl);
 
/* search for connect PHY device */
@@ -477,8 +483,10 @@ static int mii_probe(struct net_device *dev)
lp->phydev = phydev;
 
printk(KERN_INFO "%s: attached PHY driver [%s] "
-  "(mii_bus:phy_addr=%s, irq=%d)\n",
-  DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq);
+  "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)"
+  "@sclk=%dMHz)\n",
+  DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq,
+  MDC_CLK, mdc_div, sclk/100);
 
return 0;
 }
-- 
1.5.3.4

Do you mind I modified you patch to against this one and send out as a patch 
set to upstream?

Regards,
-Bryan
--
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] bfin_mac: Make the MDIO polling faster

2008-01-29 Thread Bryan Wu

On Tue, 2008-01-29 at 20:28 +0800, Kalle Pokki wrote:
> The poll routine always got 10 ms penalty when called immediately 
> after starting the transfer. The MDIO transfer takes 25.6 us at the 
> noinal 2.5 MHz, so MAX_TIMEOUT_CNT being 500 is still big enough. 

Exactly, but we got a same fixing already.
It will be sent out soon.

Thanks a lot
-Bryan

> --- 
>  drivers/net/bfin_mac.c |2 +- 
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c 
> index c199633..d2e6813 100644 
> --- a/drivers/net/bfin_mac.c 
> +++ b/drivers/net/bfin_mac.c 
> @@ -296,7 +296,7 @@ static void mdio_poll(void) 
>   
> /* poll the STABUSY bit */ 
> while ((bfin_read_EMAC_STAADD()) & STABUSY) { 
> -   mdelay(10); 
> +   udelay(1); 
> if (timeout_cnt-- < 0) { 
> printk(KERN_ERR DRV_NAME 
> ": wait MDC/MDIO transaction to complete
> timeout\n"); 
> -- 
> 1.4.4.2
> 
--
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: Still oopsing in nf_nat_move_storage()

2008-01-29 Thread Patrick McHardy

Chuck Ebbert wrote:

nf_nat_move_storage():
/usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
  87:   f7 47 64 80 01 00 00testl  $0x180,0x64(%edi)
  8e:   74 39   je c9 

line 612:
if (!(ct->status & IPS_NAT_DONE_MASK))
return;

ct is NULL


The current kernel (and 2.6.23-stable) have:

if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
return;

so it seems you're using an old version.
--
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] SELinux: Fix double free in selinux_netlbl_sock_setsid()

2008-01-29 Thread Paul Moore
On Monday 28 January 2008 10:51:24 pm David Miller wrote:
> From: Paul Moore <[EMAIL PROTECTED]>
> Date: Mon, 28 Jan 2008 21:20:26 -0500
>
> > As pointed out by Adrian Bunk, commit
> > 45c950e0f839fded922ebc0bfd59b1081cc71b70 caused a double-free when
> > security_netlbl_sid_to_secattr() fails.  This patch fixes this by
> > removing the netlbl_secattr_destroy() call from that function since we
> > are already releasing the secattr memory in
> > selinux_netlbl_sock_setsid().
> >
> > Signed-off-by: Paul Moore <[EMAIL PROTECTED]>
>
> Applied, and I'll queue this up for -stable too.

Thanks.  Sorry for not catching this in the first place.

> Please, when mentioning specific commits please also provide
> the changelog headline along with the SHA1 hash.
>
> The reason is that when this fix is moved over to another
> tree where the SHA1 of the causing change is different people
> studying your fix won't be able to find it without more stable
> contextual information.

Noted, I'll make sure to include the patch description in the future.  I 
wasn't aware that the hash took into account anything other than the 
individual commit it represented.  However, now that I think about it, since 
order is so critical it only makes sense to have the hash take into account 
at least the previous commit.

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


Still oopsing in nf_nat_move_storage()

2008-01-29 Thread Chuck Ebbert
nf_nat_move_storage():
/usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
  87:   f7 47 64 80 01 00 00testl  $0x180,0x64(%edi)
  8e:   74 39   je c9 

line 612:
if (!(ct->status & IPS_NAT_DONE_MASK))
return;

ct is NULL



To reproduce, this is the Fedora iptables config file:

*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to :21
COMMIT

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p icmp --icmp-type any -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
--
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: forcedeth oops

2008-01-29 Thread Ayaz Abdulla



Jeff Garzik wrote:

Andrew Brooks wrote:
 > Hello
 >
 > I'm getting an oops in forcedeth whenever I shutdown, details below.
 >
 > I've tried kernel 2.6.16.59 and the latest forcedeth.c from nvidia.com
 > which is package-1.23 version-0.62 date-2007/04/27.
 >
 > How can I download the latest forcedeth.c (including 2008-01-13 
patches) ?

 > It's not in the latest snapshot linux-2.6.24-rc8.
 >
 > Also, why is the version on nvidia.com not just older than the one in
 > the kernel, but it appears to have forked back in May 2006.  Has there
 > been independent development on each version?  They should be the same!

We don't run nvidia.com here :)


 > Here's the diff:
 > <  *0.56: 22 Mar 2006: Additional ethtool and moduleparam support.
 > <  *0.57: 14 May 2006: Moved mac address writes to nv_probe and 
nv_remove.

 > <  *0.58: 20 May 2006: Optimized rx and tx data paths.
 > <  *0.59: 31 May 2006: Added support for sideband management unit.
 > <  *0.60: 31 May 2006: Added support for recoverable error.
 > <  *0.61: 18 Jul 2006: Added support for suspend/resume.
 > <  *0.62: 16 Jan 2007: Fixed statistics, mgmt communication, and 
low phy speed on S5.

 > ---
 >>  *0.56: 22 Mar 2006: Additional ethtool config and moduleparam 
support.
 >>  *0.57: 14 May 2006: Mac address set in probe/remove and order 
corrections.

 >>  *0.58: 30 Oct 2006: Added support for sideband management unit.
 >>  *0.59: 30 Oct 2006: Added support for recoverable error.
 >>  *0.60: 20 Jan 2007: Code optimizations for rings, rx & tx data 
paths, and stats.

 >
 >
 > Here's the details of the oops:
 > md: md0 switched to read-only mode.
 > Unable to handle kernel NULL pointer dereference at virtual address 


 > printing eip:
 > f8ccdd55
 > *pde = 36c6a001
 > Oops:  [#1]
 > SMP
 > Modules linked in: nvidia ... forcedeth ... sata_nv
 > CPU: 1
 > EIP:
 > EFLAGS: 00010286 (2.6.16.59 #1)
 > EIP is at nv_suspend+0x85/0x350 [forcedeth]
 > eax:
 > esi:
 > ds:
 > Process reboot
 > Stack:
 > Call Trace:
 > show_stack_log
 > show_registers
 > die
 > do_page_fault
 > error_code
 > nv_reboot_handler
 > notifier_call_chain
 > kernel_restart_prepare
 > kernel_restart
 > sys_reboot
 > sysenter_past_esp
 > Code: 8b 8c 3a 98 01 00 00 01 c8 8b ...
 > INIT: no more processes left in this runlevel

Please reproduce this problem on a modern kernel (2.6.24-rc) without any
closed source modules or drivers loaded.  Thanks.


Andrew,

The driver from the nvidia.com site was forked because we needed to 
create a backport driver package for older kernels. At some point, we 
need to converge the two branches again.


Let us know if you still have an issue with the latest kernel as Jeff 
mentioned.


Regards,
Ayaz




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



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
--
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] forcedeth: mac address mcp77/79

2008-01-29 Thread Ayaz Abdulla
This patch is a critical fix for MCP77 and MCP79 devices. The feature 
flags were missing the define for correct mac address 
(DEV_HAS_CORRECT_MACADDR).


Signed-off-by: Ayaz Abdulla <[EMAIL PROTECTED]>

--- old/drivers/net/forcedeth.c 2008-01-28 10:15:28.0 -0500
+++ new/drivers/net/forcedeth.c 2008-01-28 10:17:38.0 -0500
@@ -5603,35 +5603,35 @@
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_32),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_33),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_34),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_35),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_36),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_37),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_38),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{   /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_39),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   .driver_data = 

Re: Udev coldplugging loads 8139too driver instead of 8139cp

2008-01-29 Thread Ondrej Zary
On Tuesday 29 January 2008 11:43:53 Michael Tokarev wrote:
> Stephen Hemminger wrote:
> > On Tue, 29 Jan 2008 03:46:08 +0300
> > Michael Tokarev <[EMAIL PROTECTED]> wrote:
>
> []
>
> >> There are 2 drivers for 8139-based NICs.  For really different two kinds
> >> of hardware, which both uses the same PCI identifiers.  Both drivers
> >> "claims" to work with all NICs with those PCI ids, because "externally"
> >> (by means of udev for example) it's impossible to distinguish the two
> >> kinds of hardware, it becomes clean only when the driver (either of the
> >> two) loads and actually checks which hardware we have here.
> >
> > Is there any chance of using subdevice or subversion to tell them apart?
> > That worked for other vendors like DLINK who slapped same ID on different
> > cards.
>
> If it were that simple... ;)
>
> No.  The difference is in PCI revision number (byte #8 in PCI config
> space). If it's >= 0x40 - it's 8139too, < 0x40 - 8139cp.  Or 0x20 - I
> forgot.

Perhaps a module could be created that will claim this device ID and then use 
the correct driver.

> Here's a code snippet from a shell script I used ages ago to automatically
> load modules (similar to what udev does nowadays):
>
>   # special hack for 8139{too,cp} stuff
>   case "$modalias" in
>   *v10ECd8139*)
> rev="$(dd if="$1/config" bs=1 skip=8 count=1 2>/dev/null)"
> if [ -n "$rev" ]; then
>   list=
>   for module in $modlist; do
> case "$module" in
> 8139cp)
>   if [ ".$rev" \< ". " ]; then
> $vecho1 "$TAG: not loading $module for this device"
> continue
>   fi
>   ;;
> 8139too)
>   if [ ".$rev" \> ". " ]; then
> $vecho1 "$TAG: not loading $module for this device"
> continue
>   fi
>   ;;
> esac
> list="$list $module"
>   done
>   modlist="$list"
> fi
> ;;
>   esac
>
> /mjt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [EMAIL PROTECTED]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
Ondrej Zary
--
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


status inquiry#2 (RE: [PATCH 01/03] ISATAP V2 (header file changes))

2008-01-29 Thread Templin, Fred L
Would appreciate a status update on this submission, posted 1/15/08.

Thanks - Fred
[EMAIL PROTECTED] 

> -Original Message-
> From: Templin, Fred L 
> Sent: Tuesday, January 15, 2008 11:57 AM
> To: netdev@vger.kernel.org
> Cc: YOSHIFUJI Hideaki / 吉藤英明
> Subject: [PATCH 01/03] ISATAP V2 (header file changes)
> 
> This patch updates the Linux the Intra-Site Automatic Tunnel 
> Addressing
> Protocol (ISATAP) implementation. It places the ISATAP 
> potential router
> list (PRL) in the kernel and adds three new private ioctls for PRL
> management. The diffs are specific to the netdev net-2.6.25 
> development
> tree taken by "git pull" on 1/14/08.
> 
> Signed-off-by: Fred L. Templin <[EMAIL PROTECTED]>
> 
> --- net-2.6.25/include/linux/skbuff.h.orig2008-01-14 
> 15:33:36.0 -0800
> +++ net-2.6.25/include/linux/skbuff.h 2008-01-14 
> 15:43:06.0 -0800
> @@ -311,7 +311,8 @@ struct sk_buff {
>   __u16   tc_verd;/* traffic 
> control verdict */
>  #endif
>  #endif
> - /* 2 byte hole */
> + __u8rtr_type;
> + /* 1 byte hole */
>  
>  #ifdef CONFIG_NET_DMA
>   dma_cookie_tdma_cookie;
> --- net-2.6.25/include/linux/if_tunnel.h.orig 2008-01-14 
> 15:33:36.0 -0800
> +++ net-2.6.25/include/linux/if_tunnel.h  2008-01-14 
> 15:42:14.0 -0800
> @@ -7,6 +7,9 @@
>  #define SIOCADDTUNNEL   (SIOCDEVPRIVATE + 1)
>  #define SIOCDELTUNNEL   (SIOCDEVPRIVATE + 2)
>  #define SIOCCHGTUNNEL   (SIOCDEVPRIVATE + 3)
> +#define SIOCADDPRL  (SIOCDEVPRIVATE + 4)
> +#define SIOCDELPRL  (SIOCDEVPRIVATE + 5)
> +#define SIOCCHGPRL  (SIOCDEVPRIVATE + 6)
>  
>  #define GRE_CSUM __constant_htons(0x8000)
>  #define GRE_ROUTING  __constant_htons(0x4000)
> @@ -17,9 +20,6 @@
>  #define GRE_FLAGS__constant_htons(0x00F8)
>  #define GRE_VERSION  __constant_htons(0x0007)
>  
> -/* i_flags values for SIT mode */
> -#define  SIT_ISATAP  0x0001
> -
>  struct ip_tunnel_parm
>  {
>   charname[IFNAMSIZ];
> @@ -30,5 +30,15 @@ struct ip_tunnel_parm
>   __be32  o_key;
>   struct iphdriph;
>  };
> +/* SIT-mode i_flags */
> +#define  SIT_ISATAP  0x0001
> +
> +struct ip_tunnel_prladdr {
> + __be32  addr;
> + __be16  flags;
> + __be16  rsvd;
> +};
> +/* PRL flags */
> +#define  PRL_BORDER  0x0001
>  
>  #endif /* _IF_TUNNEL_H_ */
> --- net-2.6.25/include/net/ipip.h.orig2008-01-14 
> 15:33:36.0 -0800
> +++ net-2.6.25/include/net/ipip.h 2008-01-14 
> 15:41:21.0 -0800
> @@ -24,6 +24,13 @@ struct ip_tunnel
>   int mlink;
>  
>   struct ip_tunnel_parm   parms;
> + struct ip_tunnel_prlent *prl;   /* potential 
> router list */
> +};
> +
> +struct ip_tunnel_prlent
> +{
> + struct ip_tunnel_prlent *next;
> + struct ip_tunnel_prladdr ent;
>  };
>  
>  #define IPTUNNEL_XMIT() do { 
>   \
> --- net-2.6.25/include/net/ndisc.h.orig   2008-01-14 
> 15:40:28.0 -0800
> +++ net-2.6.25/include/net/ndisc.h2008-01-15 
> 08:43:21.0 -0800
> @@ -12,6 +12,16 @@
>  #define NDISC_REDIRECT   137
>  
>  /*
> + * Router type: cross-layer information from link-layer to
> + * IPv6 layer reported by certain link types (e.g., RFC4214).
> + */
> +
> +#define RTRTYPE_UNSPEC   0 /* 
> unspecified (default) */
> +#define RTRTYPE_HOST 1 /* host or 
> unauthorized router */
> +#define RTRTYPE_INTERIOR 2 /* site-interior router */
> +#define RTRTYPE_BORDER   3 /* site 
> border router */
> +
> +/*
>   *   ndisc options
>   */
> --
> 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
> 
--
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] pktgen: pktgen should not print info that it is spinning

2008-01-29 Thread Jesse Brandeburg
when using pktgen to send delay packets the module prints repeatedly to the
kernel log:
sleeping for X
sleeping for X
...

This is probably just a debugging item left in and should not be enabled for
regular use of the module.

Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
CC: Robert Olsson <[EMAIL PROTECTED]>
---

 net/core/pktgen.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 285ec3e..b1b1aba 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2138,7 +2138,6 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 
spin_until_us)
__u64 now;
 
start = now = getCurUs();
-   printk(KERN_INFO "sleeping for %d\n", (int)(spin_until_us - now));
while (now < spin_until_us) {
/* TODO: optimize sleeping behavior */
if (spin_until_us - now > jiffies_to_usecs(1) + 1)

--
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] New driver "sfc" for Solarstorm SFC4000 controller

2008-01-29 Thread Ben Hutchings
This is a resubmission of a new driver for Solarflare network controllers.

The driver supports several types of PHY (10Gbase-T, XFP, CX4) on six
different 10G and 1G boards.  It is accompanied by an MTD driver that
allows access to the flash/EEPROM.

NICs based on this controller are now available from SMC as part numbers
SMC10GPCIe-XFP and SMC10GPCIe-10BT.

FYI the previous thread was:
  http://marc.info/?l=linux-netdev&m=120067352032298&w=4

Things that have changed since the last patch:

 - Changed ethtool support to use the default ethtool implementations
   where possible
 - Removed unused MDIO functions
 - Combined struct efx_nic and struct efx_nic_port, since the driver
   now only supports 1-port configurations
 - Removed/combined redundant members of struct efx_nic
 - Moved some constant members of struct efx_nic into struct efx_nic_type
 - Moved the two steps of efx_nic::dma_mask initialisation together
 - Eliminated efx_nic::features and efx_nic_type::features; moved all
   feature flag setting into efx_init_netdev()
 - Fixed page-based RX buffer alignment for architectures with strict
   alignment
 - Replaced spinlocks with mutexes where possible
 - Merged efx_{init,fini}_debugfs_nic_symlink into
   efx_{init,fini}_debugfs_netdev
 - Renamed efx_{init,fini}_netdev and corrected comments to
   indicate that they only (un)register the net device
 - Added EFX_FTL - fatal in debug builds otherwise equivalent to EFX_ERR
 - Changed RX FIFO watermarks to more reasonable values
 - Fixed various corner cases in PHY reconfiguration
 - Changed NET_DEV_NAME() to use efx->name, making races with
   (un)registration harmless
 - Fixed repetition of PCI or net device name in log messages
 - Renamed falcon_nic_params structure to falcon_nic_data
 - Fixed spelling, capitalisation, grammar, punctuation, spacing
   in various comments and log messages

We believe this is ready to be merged now and would like to know if
there is anything remaining that we need to fix or improve.

The patch (against netdev-2.6) is at:
  https://support.solarflare.com/netdev/6/netdev-2.6-sfc-2.2.0056.patch

The new files may also be downloaded as a tarball:
  https://support.solarflare.com/netdev/6/netdev-2.6-sfc-2.2.0056.tgz

And for verification there is:
  https://support.solarflare.com/netdev/6/MD5SUMS

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
--
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] PHYLIB: Add BCM5482 PHY support

2008-01-29 Thread Nate Case
This Broadcom PHY is similar to other bcm54xx devices.

Signed-off-by: Nate Case <[EMAIL PROTECTED]>
---
 drivers/net/phy/broadcom.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 29666c8..5b80358 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -141,6 +141,20 @@ static struct phy_driver bcm5461_driver = {
.driver = { .owner = THIS_MODULE },
 };
 
+static struct phy_driver bcm5482_driver = {
+.phy_id= 0x0143bcb0,
+   .phy_id_mask= 0xfff0,
+   .name   = "Broadcom BCM5482",
+   .features   = PHY_GBIT_FEATURES,
+   .flags  = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
+   .config_init= bcm54xx_config_init,
+   .config_aneg= genphy_config_aneg,
+   .read_status= genphy_read_status,
+   .ack_interrupt  = bcm54xx_ack_interrupt,
+   .config_intr= bcm54xx_config_intr,
+   .driver = { .owner = THIS_MODULE },
+};
+
 static int __init broadcom_init(void)
 {
int ret;
@@ -154,8 +168,13 @@ static int __init broadcom_init(void)
ret = phy_driver_register(&bcm5461_driver);
if (ret)
goto out_5461;
+   ret = phy_driver_register(&bcm5482_driver);
+   if (ret)
+   goto out_5482;
return ret;
 
+out_5482:
+   phy_driver_unregister(&bcm5461_driver);
 out_5461:
phy_driver_unregister(&bcm5421_driver);
 out_5421:
@@ -166,6 +185,7 @@ out_5411:
 
 static void __exit broadcom_exit(void)
 {
+   phy_driver_unregister(&bcm5482_driver);
phy_driver_unregister(&bcm5461_driver);
phy_driver_unregister(&bcm5421_driver);
phy_driver_unregister(&bcm5411_driver);
-- 
1.5.3.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


SKBs with shared fragments

2008-01-29 Thread kristrev
Hello,

I am working on a patch to the TCP-code that, among others, share
fragments between skbs, and have encountered a problem that I'm not sure
if I have solved correctly.

To share a fragment, I copy the skb_frag-struct to the correct place in
the other skbs frags-array, increase the page-counter, skb->data_len,
skb->len, skb->end_seq and gso_segs/gso_size, and calculate a new
checksum.

The problem is the skb->truesize-variable. Currently I do not increase it,
leading to a SKB BUG because truesize is less than (skb->len +
sizeof(struct skb)). When I increase/decrease truesize, both the
wmem_queue and sk_forward_alloc is something else than zero and the socket
leaks memory.

The kernel does not halt and all the data is received correctly in both
cases.

The reason that I currently don't increase/decrease truesize is that, at
least if I have understod the code correctly, truesize says something
about how much memory an skb actually consumes. And since I only copy
existing fragments into it, I don't use any more memory.

Is this correct, or should I increase/decrease truesize as well? Also, is
there a better way to share fragments between skbs?

Thanks in advance for any replies,
Kristian

--
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] PHYLIB: Locking fixes for PHY I/O potentially sleeping

2008-01-29 Thread Nate Case
PHY read/write functions can potentially sleep (e.g., a PHY accessed
via I2C).  The following changes were made to account for this:

* Change spin locks to mutex locks
* Add a BUG_ON() to phy_read() phy_write() to warn against
  calling them from an interrupt context.
* Use work queue for PHY state machine handling since
  it can potentially sleep
* Change phydev lock from spinlock to mutex

Signed-off-by: Nate Case <[EMAIL PROTECTED]>
Acked-by: Andy Fleming <[EMAIL PROTECTED]>

---
Note: This is a resend of the patch submitted on January 3rd, 2008

 drivers/net/phy/mdio_bus.c   |2 +-
 drivers/net/phy/phy.c|   68 -
 drivers/net/phy/phy_device.c |   11 +++
 include/linux/phy.h  |5 ++-
 4 files changed, 55 insertions(+), 31 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index c30196d..6e9f619 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -49,7 +49,7 @@ int mdiobus_register(struct mii_bus *bus)
int i;
int err = 0;
 
-   spin_lock_init(&bus->mdio_lock);
+   mutex_init(&bus->mdio_lock);
 
if (NULL == bus || NULL == bus->name ||
NULL == bus->read ||
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 7c9e6e3..12fccb1 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -72,9 +71,11 @@ int phy_read(struct phy_device *phydev, u16 regnum)
int retval;
struct mii_bus *bus = phydev->bus;
 
-   spin_lock_bh(&bus->mdio_lock);
+   BUG_ON(in_interrupt());
+
+   mutex_lock(&bus->mdio_lock);
retval = bus->read(bus, phydev->addr, regnum);
-   spin_unlock_bh(&bus->mdio_lock);
+   mutex_unlock(&bus->mdio_lock);
 
return retval;
 }
@@ -95,9 +96,11 @@ int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
int err;
struct mii_bus *bus = phydev->bus;
 
-   spin_lock_bh(&bus->mdio_lock);
+   BUG_ON(in_interrupt());
+
+   mutex_lock(&bus->mdio_lock);
err = bus->write(bus, phydev->addr, regnum, val);
-   spin_unlock_bh(&bus->mdio_lock);
+   mutex_unlock(&bus->mdio_lock);
 
return err;
 }
@@ -428,7 +431,7 @@ int phy_start_aneg(struct phy_device *phydev)
 {
int err;
 
-   spin_lock_bh(&phydev->lock);
+   mutex_lock(&phydev->lock);
 
if (AUTONEG_DISABLE == phydev->autoneg)
phy_sanitize_settings(phydev);
@@ -449,13 +452,14 @@ int phy_start_aneg(struct phy_device *phydev)
}
 
 out_unlock:
-   spin_unlock_bh(&phydev->lock);
+   mutex_unlock(&phydev->lock);
return err;
 }
 EXPORT_SYMBOL(phy_start_aneg);
 
 
 static void phy_change(struct work_struct *work);
+static void phy_state_machine(struct work_struct *work);
 static void phy_timer(unsigned long data);
 
 /**
@@ -476,6 +480,7 @@ void phy_start_machine(struct phy_device *phydev,
 {
phydev->adjust_state = handler;
 
+   INIT_WORK(&phydev->state_queue, phy_state_machine);
init_timer(&phydev->phy_timer);
phydev->phy_timer.function = &phy_timer;
phydev->phy_timer.data = (unsigned long) phydev;
@@ -493,11 +498,12 @@ void phy_start_machine(struct phy_device *phydev,
 void phy_stop_machine(struct phy_device *phydev)
 {
del_timer_sync(&phydev->phy_timer);
+   cancel_work_sync(&phydev->state_queue);
 
-   spin_lock_bh(&phydev->lock);
+   mutex_lock(&phydev->lock);
if (phydev->state > PHY_UP)
phydev->state = PHY_UP;
-   spin_unlock_bh(&phydev->lock);
+   mutex_unlock(&phydev->lock);
 
phydev->adjust_state = NULL;
 }
@@ -541,9 +547,9 @@ static void phy_force_reduction(struct phy_device *phydev)
  */
 void phy_error(struct phy_device *phydev)
 {
-   spin_lock_bh(&phydev->lock);
+   mutex_lock(&phydev->lock);
phydev->state = PHY_HALTED;
-   spin_unlock_bh(&phydev->lock);
+   mutex_unlock(&phydev->lock);
 }
 
 /**
@@ -705,10 +711,10 @@ static void phy_change(struct work_struct *work)
if (err)
goto phy_err;
 
-   spin_lock_bh(&phydev->lock);
+   mutex_lock(&phydev->lock);
if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state))
phydev->state = PHY_CHANGELINK;
-   spin_unlock_bh(&phydev->lock);
+   mutex_unlock(&phydev->lock);
 
atomic_dec(&phydev->irq_disable);
enable_irq(phydev->irq);
@@ -735,7 +741,7 @@ phy_err:
  */
 void phy_stop(struct phy_device *phydev)
 {
-   spin_lock_bh(&phydev->lock);
+   mutex_lock(&phydev->lock);
 
if (PHY_HALTED == phydev->state)
goto out_unlock;
@@ -751,7 +757,7 @@ void phy_stop(struct phy_device *phydev)
phydev->state = PHY_HALTED;
 
 out_unlock:
-   spin_unlock_bh(&phydev->lock);
+   mutex_unlock(&phydev->lock);

[NET_SCHED]: sch_ingress: remove netfilter support

2008-01-29 Thread Patrick McHardy
 commit 3b27667029825ba16f8509fb119bca1b445a3dc9
Author: Patrick McHardy <[EMAIL PROTECTED]>
Date:   Mon Jan 28 13:57:56 2008 +0100

[NET_SCHED]: sch_ingress: remove netfilter support

Since the old policer code is gone, TC actions are needed for policing.
The ingress qdisc can get packets directly from netif_receive_skb()
in case TC actions are enabled or through netfilter otherwise, but
since without TC actions there is no policer the only thing it actually
does is count packets.

Remove the netfilter support and always require TC actions.

Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 87af7c9..7d4085a 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -198,7 +198,7 @@ config NET_SCH_NETEM
 
 config NET_SCH_INGRESS
 	tristate "Ingress Qdisc"
-	depends on NET_CLS_ACT || NETFILTER
+	depends on NET_CLS_ACT
 	---help---
 	  Say Y here if you want to use classifiers for incoming packets.
 	  If unsure, say Y.
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 3f72d52..274b1dd 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -12,18 +12,10 @@
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
 
 
-/* Thanks to Doron Oz for this hack */
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
-static int nf_registered;
-#endif
-
 struct ingress_qdisc_data {
 	struct tcf_proto	*filter_list;
 };
@@ -84,11 +76,6 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
 	result = tc_classify(skb, p->filter_list, &res);
 
-	/*
-	 * Unlike normal "enqueue" functions, ingress_enqueue returns a
-	 * firewall FW_* code.
-	 */
-#ifdef CONFIG_NET_CLS_ACT
 	sch->bstats.packets++;
 	sch->bstats.bytes += skb->len;
 	switch (result) {
@@ -107,71 +94,10 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		result = TC_ACT_OK;
 		break;
 	}
-#else
-	result = NF_ACCEPT;
-	sch->bstats.packets++;
-	sch->bstats.bytes += skb->len;
-#endif
 
 	return result;
 }
 
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
-static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
-			 const struct net_device *indev,
-			 const struct net_device *outdev,
-			 int (*okfn)(struct sk_buff *))
-{
-
-	struct Qdisc *q;
-	struct net_device *dev = skb->dev;
-	int fwres = NF_ACCEPT;
-
-	if (dev->qdisc_ingress) {
-		spin_lock(&dev->ingress_lock);
-		if ((q = dev->qdisc_ingress) != NULL)
-			fwres = q->enqueue(skb, q);
-		spin_unlock(&dev->ingress_lock);
-	}
-
-	return fwres;
-}
-
-/* after ipt_filter */
-static struct nf_hook_ops ing_ops[] __read_mostly = {
-	{
-		.hook   = ing_hook,
-		.owner		= THIS_MODULE,
-		.pf = PF_INET,
-		.hooknum= NF_INET_PRE_ROUTING,
-		.priority   = NF_IP_PRI_FILTER + 1,
-	},
-	{
-		.hook   = ing_hook,
-		.owner		= THIS_MODULE,
-		.pf = PF_INET6,
-		.hooknum= NF_INET_PRE_ROUTING,
-		.priority   = NF_IP6_PRI_FILTER + 1,
-	},
-};
-#endif
-
-static int ingress_init(struct Qdisc *sch, struct nlattr *opt)
-{
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
-	printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
-
-	if (!nf_registered) {
-		if (nf_register_hooks(ing_ops, ARRAY_SIZE(ing_ops)) < 0) {
-			printk("ingress qdisc registration error \n");
-			return -EINVAL;
-		}
-		nf_registered++;
-	}
-#endif
-	return 0;
-}
-
 /* - */
 
 static void ingress_destroy(struct Qdisc *sch)
@@ -213,7 +139,6 @@ static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
 	.id		=	"ingress",
 	.priv_size	=	sizeof(struct ingress_qdisc_data),
 	.enqueue	=	ingress_enqueue,
-	.init		=	ingress_init,
 	.destroy	=	ingress_destroy,
 	.dump		=	ingress_dump,
 	.owner		=	THIS_MODULE,
@@ -227,10 +152,6 @@ static int __init ingress_module_init(void)
 static void __exit ingress_module_exit(void)
 {
 	unregister_qdisc(&ingress_qdisc_ops);
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
-	if (nf_registered)
-		nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops));
-#endif
 }
 
 module_init(ingress_module_init)


Re: sky2: tx hang on dual-port Yukon XL when rx csum disabled

2008-01-29 Thread Tony Battersby
Tony Battersby wrote:
> "iperf -c 192.168.1.1" never finishes, but "iperf -c 192.168.2.1" does
> finish.  Press Ctrl-C to abort the hung iperf.  Ping 192.168.1.1 does
> not respond.  Ping 192.168.2.1 does respond, but each ping has almost
> exactly 1 second latency (the latency should be < 1 ms).
>
>   

Update: after triggering the problem, the ping latency on the interface
that still responds is the same as the ping interval.  The default ping
interval is 1 second, so in my initial test I was seeing a 1 second ping
latency.  If I do "ping -i 2 192.168.2.1", then each ping takes 2
seconds to receive the response.  If I do "ping -i 5 192.168.2.1", then
each ping takes 5 seconds to receive the response.  This implies that
the network stack doesn't realize that it received the ping reply until
it goes to send another ping.

Hope that helps.

Tony Battersby
Cybernetics

--
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.25] [MACVLAN] Setting macvlan_handle_frame_hook to NULL when rtnl_link_register() fails.

2008-01-29 Thread Patrick McHardy

Rami Rosen wrote:

Hi,
  In drivers/net/macvlan.c, when rtnl_link_register() fails
in macvlan_init_module(), there is no point to set it (second time in this
method) to macvlan_handle_frame; macvlan_init_module() will return a negative
number, so instead this patch sets macvlan_handle_frame_hook to NULL.



Indeed, that seems to be a stupid cut-and-paste error. Thanks for
catching this.

Dave, please apply.
--
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.25] [MACVLAN] Setting macvlan_handle_frame_hook to NULL when rtnl_link_register() fails.

2008-01-29 Thread Rami Rosen
Hi,
  In drivers/net/macvlan.c, when rtnl_link_register() fails
in macvlan_init_module(), there is no point to set it (second time in this
method) to macvlan_handle_frame; macvlan_init_module() will return a negative
number, so instead this patch sets macvlan_handle_frame_hook to NULL.

Regards,
Rami Rosen


Signed-off-by: Rami Rosen <[EMAIL PROTECTED]>
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6ef6b8b..f651a81 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -508,7 +508,7 @@ static int __init macvlan_init_module(void)
goto err1;
return 0;
 err1:
-   macvlan_handle_frame_hook = macvlan_handle_frame;
+   macvlan_handle_frame_hook = NULL;
unregister_netdevice_notifier(&macvlan_notifier_block);
return err;
 }


[VLAN]: set_rx_mode support for unicast address list

2008-01-29 Thread Patrick McHardy
 commit fbf2742ff936c751444ae610ae45c6ef54c14658
Author: Chris Leech <[EMAIL PROTECTED]>
Date:   Thu Jan 24 18:24:53 2008 +0100

[VLAN]: set_rx_mode support for unicast address list

Reuse the existing logic for multicast list synchronization for the unicast
address list. The core of dev_mc_sync/unsync are split out as
__dev_addr_sync/unsync and moved from dev_mcast.c to dev.c.  These are then
used to implement dev_unicast_sync/unsync as well.

I'm working on cleaning up Intel's FCoE stack, which generates new MAC
addresses from the fibre channel device id assigned by the fabric as per the
current draft specification in T11.  When using such a protocol in a VLAN
environment it would be nice to not always be forced into promiscuous mode,
assuming the underlying Ethernet driver supports multiple unicast addresses 
as
well.

Signed-off-by: Chris Leech <[EMAIL PROTECTED]>
Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b0813c3..047d432 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1414,12 +1414,16 @@ extern void dev_set_rx_mode(struct 
net_device *dev);
 extern void__dev_set_rx_mode(struct net_device *dev);
 extern int dev_unicast_delete(struct net_device *dev, void *addr, 
int alen);
 extern int dev_unicast_add(struct net_device *dev, void *addr, int 
alen);
+extern int dev_unicast_sync(struct net_device *to, struct 
net_device *from);
+extern voiddev_unicast_unsync(struct net_device *to, struct 
net_device *from);
 extern int dev_mc_delete(struct net_device *dev, void *addr, int 
alen, int all);
 extern int dev_mc_add(struct net_device *dev, void *addr, int 
alen, int newonly);
 extern int dev_mc_sync(struct net_device *to, struct net_device 
*from);
 extern voiddev_mc_unsync(struct net_device *to, struct net_device 
*from);
 extern int __dev_addr_delete(struct dev_addr_list **list, int 
*count, void *addr, int alen, int all);
 extern int __dev_addr_add(struct dev_addr_list **list, int *count, 
void *addr, int alen, int newonly);
+extern int __dev_addr_sync(struct dev_addr_list **to, int 
*to_count, struct dev_addr_list **from, int *from_count);
+extern void__dev_addr_unsync(struct dev_addr_list **to, int 
*to_count, struct dev_addr_list **from, int *from_count);
 extern voiddev_set_promiscuity(struct net_device *dev, int inc);
 extern voiddev_set_allmulti(struct net_device *dev, int inc);
 extern voidnetdev_state_change(struct net_device *dev);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 8059fa4..77f04e4 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -563,6 +563,7 @@ static int vlan_dev_stop(struct net_device *dev)
struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
 
dev_mc_unsync(real_dev, dev);
+   dev_unicast_unsync(real_dev, dev);
if (dev->flags & IFF_ALLMULTI)
dev_set_allmulti(real_dev, -1);
if (dev->flags & IFF_PROMISC)
@@ -634,9 +635,10 @@ static void vlan_dev_change_rx_flags(struct net_device 
*dev, int change)
dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : 
-1);
 }
 
-static void vlan_dev_set_multicast_list(struct net_device *vlan_dev)
+static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)
 {
dev_mc_sync(vlan_dev_info(vlan_dev)->real_dev, vlan_dev);
+   dev_unicast_sync(vlan_dev_info(vlan_dev)->real_dev, vlan_dev);
 }
 
 /*
@@ -702,7 +704,8 @@ void vlan_setup(struct net_device *dev)
dev->open   = vlan_dev_open;
dev->stop   = vlan_dev_stop;
dev->set_mac_address= vlan_dev_set_mac_address;
-   dev->set_multicast_list = vlan_dev_set_multicast_list;
+   dev->set_rx_mode= vlan_dev_set_rx_mode;
+   dev->set_multicast_list = vlan_dev_set_rx_mode;
dev->change_rx_flags= vlan_dev_change_rx_flags;
dev->do_ioctl   = vlan_dev_ioctl;
dev->destructor = free_netdev;
diff --git a/net/core/dev.c b/net/core/dev.c
index c9c593e..edaff27 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2962,6 +2962,102 @@ int dev_unicast_add(struct net_device *dev, void *addr, 
int alen)
 }
 EXPORT_SYMBOL(dev_unicast_add);
 
+int __dev_addr_sync(struct dev_addr_list **to, int *to_count,
+   struct dev_addr_list **from, int *from_count)
+{
+   struct dev_addr_list *da, *next;
+   int err = 0;
+
+   da = *from;
+   while (da != NULL) {
+   next = da->next;
+   if (!da->da_synced) {
+   err = __dev_addr_add(to, to_count,
+da->da_addr, da->da_addrlen, 0);
+   if (err < 0)
+ 

[GIT PULL] pull request for lblnet-2.6_testing

2008-01-29 Thread Paul Moore
Hi James,

I've just rebased the lblnet-2.6_testing tree against Linus' latest 
which already includes DaveM's net-2.6.25 tree so there shouldn't be 
any collisions with the core networking bits.  Other than minor changes 
needed to merge cleanly with the current linux-2.6 tree there have been 
no changes to the labeled networking patches since they were last 
posted.  The git tree can be found here:

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

In the interest of full disclosure, I was not able to test this tree as 
there are a few compile errors in the drivers area which are preventing 
me from getting a kernel built.  However, all of the relevant areas 
(security/selinux, net/netlabel, net/netfilter, net/xfrm, net/ipv4, 
net/ipv6) compiled without issue.  I will continue to try and get a 
kernel compiled but I thought getting this out in a reasonable 
timeframe to minimize merge issues was a better decision.  Thse patches 
applied to 2.6.24 do compile, boot, and run without any known 
regressions.

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


pppoe, /proc/net/pppoe wrong (extra entries)

2008-01-29 Thread Denys Fedoryshchenko
Hi again

I notice strange thing, with /proc/net/pppoe, not sure if it is bug, but for 
me it looks wrong.

cat /proc/net/pppoe
there is normal entries of users, but at the end i have 

0D00 00:16:D3:0B:F9:34 eth1
4000 00:50:22:00:1C:FC eth1
7E00 00:03:47:BD:34:25 eth1
7E00 00:03:47:BD:34:25 eth1
7E00 00:03:47:BD:34:25 eth1
7E00 00:03:47:BD:34:25 eth1
7E00 00:03:47:BD:34:25 eth1

and last entry duplicates till end.

i have script to get customers interfaces, so i am using it to calculate 
amount of users logged in

defaulthost ~ #cat /proc/net/pppoe |grep -i '00:03:47:BD:34:25'|wc -l
40
defaulthost ~ #cat /proc/net/pppoe |wc -l
113
defaulthost ~ #pppctrl |wc -l
73

It means there is 40 extra entries. 00:03:47:BD:34:25 host have established, 
but only one session. I am seeing similar issue on all remaining pppoe 
servers, extra entries with same mac at the end.

If you need more info or access, please let me know.

--
Denys Fedoryshchenko
Technical Manager
Virtual ISP S.A.L.

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


  1   2   >