* Re: [PATCH/RFC] net: Add __napi_sycnhronize() to sync with napi poll
From: Benjamin Herrenschmidt @ 2007-10-16 21:14 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev, David S. Miller, Roland Dreier, linuxppc-dev list
In-Reply-To: <20071016115318.0fc36af3@freepuppy.rosehill>
> So this is really just like synchronize_irq()? Using msleep is bogus
> because you want to spin, you are only waiting for a softirq on the other
> cpu to finish. If you wait for a whole millisecond and sleep that
> is far longer than the napi routine should take.
>
> You could even optimize it like synchronize_irq() for the non-SMP case.
It's just like synchronize_irq() indeed. I used the mlseep() just like
napi_disable() mostly because I use it in a very similar context, for
disabling my sub-channels on things like link change etc... where I need
to reconfigure parts of the chip.
I prefer sleeping in my case but I agree that if somebody else was going
to use for something else more performance critical, it might be an
issue. On the other hand, spinning will not be nice for my usage
scenario :-)
I agree about the SMP optimisation though again, in my usage pattern,
it's very unimportant (similar code path as napi_disable)
I'll respin later today though.
Cheers,
Ben.
^ permalink raw reply
* [patch 1/4] forcedeth: power down phy when interface is down
From: akpm @ 2007-10-16 21:24 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, eswierk, aabdulla
From: "Ed Swierk" <eswierk@arastra.com>
Bring the physical link down when the interface is down by placing the PHY
in power-down state, unless WOL is enabled. This mirrors the behavior of
other drivers including e1000 and tg3.
Signed-off-by: Ed Swierk <eswierk@arastra.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/forcedeth.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff -puN drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1313,9 +1313,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
- /* restart auto negotiation */
+ /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
- mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+ mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4791,6 +4791,10 @@ static int nv_open(struct net_device *de
dprintk(KERN_DEBUG "nv_open: begin\n");
+ /* power up phy */
+ mii_rw(dev, np->phyaddr, MII_BMCR,
+ mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4973,6 +4977,10 @@ static int nv_close(struct net_device *d
if (np->wolenabled) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
nv_start_rx(dev);
+ } else {
+ /* power down phy */
+ mii_rw(dev, np->phyaddr, MII_BMCR,
+ mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
}
/* FIXME: power down nic */
_
^ permalink raw reply
* [patch 3/4] WOL bugfix for 3c59x.c
From: akpm @ 2007-10-16 21:24 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, klassert, hcoin
From: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Some NICs (3c905B) can not generate PME in power state PCI_D0, while others
like 3c905C can. Call pci_enable_wake() with PCI_D3hot should give proper
WOL for 3c905B.
Signed-off-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Tested-by: Harry Coin <hcoin@n4comm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/3c59x.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff -puN drivers/net/3c59x.c~wol-bugfix-for-3c59xc drivers/net/3c59x.c
--- a/drivers/net/3c59x.c~wol-bugfix-for-3c59xc
+++ a/drivers/net/3c59x.c
@@ -3118,7 +3118,13 @@ static void acpi_set_WOL(struct net_devi
iowrite16(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
iowrite16(RxEnable, ioaddr + EL3_CMD);
- pci_enable_wake(VORTEX_PCI(vp), 0, 1);
+ if (pci_enable_wake(VORTEX_PCI(vp), PCI_D3hot, 1)) {
+ printk(KERN_INFO "%s: WOL not supported.\n",
+ pci_name(VORTEX_PCI(vp)));
+
+ vp->enable_wol = 0;
+ return;
+ }
/* Change the power state to D3; RxEnable doesn't take effect. */
pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
_
^ permalink raw reply
* [patch 2/4] tokenring/3c359.c: fixed array index problem
From: akpm @ 2007-10-16 21:24 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, meissner, penberg
From: Marcus Meissner <meissner@suse.de>
The xl_laa array is just 6 bytes long, so we should substract 10 from the
index, like is also done some lines above already.
Signed-off-by: Marcus Meissner <meissner@suse.de>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/tokenring/3c359.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/net/tokenring/3c359.c~tokenring-3c359c-fixed-array-index-problem drivers/net/tokenring/3c359.c
--- a/drivers/net/tokenring/3c359.c~tokenring-3c359c-fixed-array-index-problem
+++ a/drivers/net/tokenring/3c359.c
@@ -760,7 +760,7 @@ static int xl_open_hw(struct net_device
if (xl_priv->xl_laa[0]) { /* If using a LAA address */
for (i=10;i<16;i++) {
writel( (MEM_BYTE_WRITE | 0xD0000 | xl_priv->srb) + i, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- writeb(xl_priv->xl_laa[i],xl_mmio + MMIO_MACDATA) ;
+ writeb(xl_priv->xl_laa[i-10], xl_mmio + MMIO_MACDATA);
}
memcpy(dev->dev_addr,xl_priv->xl_laa,dev->addr_len) ;
} else { /* Regular hardware address */
_
^ permalink raw reply
* [patch 4/4] ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
From: akpm @ 2007-10-16 21:24 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, Emilian.Medve, davem, galak, leoli, paulus
From: Andrew Morton <akpm@linux-foundation.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Emil Medve <Emilian.Medve@Freescale.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/ucc_geth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -puN drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes drivers/net/ucc_geth.c
--- a/drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
+++ a/drivers/net/ucc_geth.c
@@ -3454,7 +3454,7 @@ static int ucc_geth_rx(struct ucc_geth_p
u16 length, howmany = 0;
u32 bd_status;
u8 *bdBuffer;
- struct net_device * dev;
+ struct net_device *dev;
ugeth_vdbg("%s: IN", __FUNCTION__);
_
^ permalink raw reply
* Re: atm: panic when loading clip 2nd time
From: Nish Aravamudan @ 2007-10-16 21:33 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-kernel, NetDev, chas
In-Reply-To: <47152758.5000900@oracle.com>
On 10/16/07, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> 2.6.23-git7, using SLAB (not SLUB) [config attached]:
>
> # modprobe clip
> # rmmod clip
> # modprobe clip
>
> results in panic:
>
> kmem_cache_create: duplicate cache clip_arp_cache
>
> Call Trace:
> [<ffffffff8028c682>] kmem_cache_create+0x3bf/0x3fd
> [<ffffffff8046ba1d>] neigh_table_init_no_netlink+0x6c/0x242
> [<ffffffff8800a010>] :clip:atm_clip_init+0x10/0x8a
> [<ffffffff80258ba4>] sys_init_module+0x146c/0x15cd
> [<ffffffff8046be0a>] neigh_lookup+0x0/0xd5
> [<ffffffff8020ef44>] syscall_trace_enter+0x95/0x99
> [<ffffffff8020beec>] tracesys+0xdc/0xe1
>
> Kernel panic - not syncing: kmem_cache_create(): failed to create slab `clip_arp_cache'
>From a quick read through the code, looks like
net/core/neighbour.c:neigh_table_clear() needs a kmem_cache_destroy()?
I only see three callers of neight_table_clear() and they all seem to
be in exit routines, so that should be safe?
-Nish
^ permalink raw reply
* [PATCH] br2684: get rid of broken header code.
From: Stephen Hemminger @ 2007-10-16 21:38 UTC (permalink / raw)
To: chas, David S. Miller; +Cc: linux-atm-general, netdev
Recent header_ops change would break the following dead
code in br2684. Maintaining conditonal code in mainline is wrong.
"Do, or do not. There is no 'try.'"
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/net/atm/br2684.c 2007-10-11 13:16:27.000000000 -0700
+++ b/net/atm/br2684.c 2007-10-12 11:20:32.000000000 -0700
@@ -24,16 +24,6 @@ Author: Marcell GAL, 2000, XDSL Ltd, Hun
#include "common.h"
-/*
- * Define this to use a version of the code which interacts with the higher
- * layers in a more intellegent way, by always reserving enough space for
- * our header at the begining of the packet. However, there may still be
- * some problems with programs like tcpdump. In 2.5 we'll sort out what
- * we need to do to get this perfect. For now we just will copy the packet
- * if we need space for the header
- */
-/* #define FASTER_VERSION */
-
#ifdef SKB_DEBUG
static void skb_debug(const struct sk_buff *skb)
{
@@ -69,9 +59,7 @@ struct br2684_vcc {
#ifdef CONFIG_ATM_BR2684_IPFILTER
struct br2684_filter filter;
#endif /* CONFIG_ATM_BR2684_IPFILTER */
-#ifndef FASTER_VERSION
unsigned copies_needed, copies_failed;
-#endif /* FASTER_VERSION */
};
struct br2684_dev {
@@ -147,13 +135,6 @@ static int br2684_xmit_vcc(struct sk_buf
struct br2684_vcc *brvcc)
{
struct atm_vcc *atmvcc;
-#ifdef FASTER_VERSION
- if (brvcc->encaps == e_llc)
- memcpy(skb_push(skb, 8), llc_oui_pid_pad, 8);
- /* last 2 bytes of llc_oui_pid_pad are managed by header routines;
- yes, you got it: 8 + 2 = sizeof(llc_oui_pid_pad)
- */
-#else
int minheadroom = (brvcc->encaps == e_llc) ? 10 : 2;
if (skb_headroom(skb) < minheadroom) {
struct sk_buff *skb2 = skb_realloc_headroom(skb, minheadroom);
@@ -170,7 +151,6 @@ static int br2684_xmit_vcc(struct sk_buf
skb_copy_to_linear_data(skb, llc_oui_pid_pad, 10);
else
memset(skb->data, 0, 2);
-#endif /* FASTER_VERSION */
skb_debug(skb);
ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
@@ -237,87 +217,6 @@ static struct net_device_stats *br2684_g
return &BRPRIV(dev)->stats;
}
-#ifdef FASTER_VERSION
-/*
- * These mirror eth_header and eth_header_cache. They are not usually
- * exported for use in modules, so we grab them from net_device
- * after ether_setup() is done with it. Bit of a hack.
- */
-static int (*my_eth_header)(struct sk_buff *, struct net_device *,
- unsigned short, void *, void *, unsigned);
-static int (*my_eth_header_cache)(struct neighbour *, struct hh_cache *);
-
-static int
-br2684_header(struct sk_buff *skb, struct net_device *dev,
- unsigned short type, void *daddr, void *saddr, unsigned len)
-{
- u16 *pad_before_eth;
- int t = my_eth_header(skb, dev, type, daddr, saddr, len);
- if (t > 0) {
- pad_before_eth = (u16 *) skb_push(skb, 2);
- *pad_before_eth = 0;
- return dev->hard_header_len; /* or return 16; ? */
- } else
- return t;
-}
-
-static int
-br2684_header_cache(struct neighbour *neigh, struct hh_cache *hh)
-{
-/* hh_data is 16 bytes long. if encaps is ether-llc we need 24, so
-xmit will add the additional header part in that case */
- u16 *pad_before_eth = (u16 *)(hh->hh_data);
- int t = my_eth_header_cache(neigh, hh);
- DPRINTK("br2684_header_cache, neigh=%p, hh_cache=%p\n", neigh, hh);
- if (t < 0)
- return t;
- else {
- *pad_before_eth = 0;
- hh->hh_len = PADLEN + ETH_HLEN;
- }
- return 0;
-}
-
-/*
- * This is similar to eth_type_trans, which cannot be used because of
- * our dev->hard_header_len
- */
-static inline __be16 br_type_trans(struct sk_buff *skb, struct net_device *dev)
-{
- struct ethhdr *eth;
- unsigned char *rawp;
- eth = eth_hdr(skb);
-
- if (is_multicast_ether_addr(eth->h_dest)) {
- if (!compare_ether_addr(eth->h_dest, dev->broadcast))
- skb->pkt_type = PACKET_BROADCAST;
- else
- skb->pkt_type = PACKET_MULTICAST;
- }
-
- else if (compare_ether_addr(eth->h_dest, dev->dev_addr))
- skb->pkt_type = PACKET_OTHERHOST;
-
- if (ntohs(eth->h_proto) >= 1536)
- return eth->h_proto;
-
- rawp = skb->data;
-
- /*
- * This is a magic hack to spot IPX packets. Older Novell breaks
- * the protocol design and runs IPX over 802.3 without an 802.2 LLC
- * layer. We look for FFFF which isn't a used 802.2 SSAP/DSAP. This
- * won't work for fault tolerant netware but does for the rest.
- */
- if (*(unsigned short *) rawp == 0xFFFF)
- return htons(ETH_P_802_3);
-
- /*
- * Real 802.2 LLC
- */
- return htons(ETH_P_802_2);
-}
-#endif /* FASTER_VERSION */
/*
* We remember when the MAC gets set, so we don't override it later with
@@ -448,17 +347,8 @@ static void br2684_push(struct atm_vcc *
return;
}
-#ifdef FASTER_VERSION
- /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
- than should be. What else should I set? */
- skb_pull(skb, plen);
- skb_set_mac_header(skb, -ETH_HLEN);
- skb->pkt_type = PACKET_HOST;
- skb->protocol = br_type_trans(skb, net_dev);
-#else
skb_pull(skb, plen - ETH_HLEN);
skb->protocol = eth_type_trans(skb, net_dev);
-#endif /* FASTER_VERSION */
#ifdef CONFIG_ATM_BR2684_IPFILTER
if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) {
brdev->stats.rx_dropped++;
@@ -584,13 +474,6 @@ static void br2684_setup(struct net_devi
ether_setup(netdev);
brdev->net_dev = netdev;
-#ifdef FASTER_VERSION
- my_eth_header = netdev->hard_header;
- netdev->hard_header = br2684_header;
- my_eth_header_cache = netdev->hard_header_cache;
- netdev->hard_header_cache = br2684_header_cache;
- netdev->hard_header_len = sizeof(llc_oui_pid_pad) + ETH_HLEN; /* 10 + 14 */
-#endif
my_eth_mac_addr = netdev->set_mac_address;
netdev->set_mac_address = br2684_mac_addr;
netdev->hard_start_xmit = br2684_start_xmit;
@@ -719,16 +602,12 @@ static int br2684_seq_show(struct seq_fi
list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
seq_printf(seq, " vcc %d.%d.%d: encaps=%s"
-#ifndef FASTER_VERSION
", failed copies %u/%u"
-#endif /* FASTER_VERSION */
"\n", brvcc->atmvcc->dev->number,
brvcc->atmvcc->vpi, brvcc->atmvcc->vci,
(brvcc->encaps == e_llc) ? "LLC" : "VC"
-#ifndef FASTER_VERSION
, brvcc->copies_failed
, brvcc->copies_needed
-#endif /* FASTER_VERSION */
);
#ifdef CONFIG_ATM_BR2684_IPFILTER
#define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte]
^ permalink raw reply
* [PATCH/RFA] sch_generic: fix carrier-on bug?
From: Jeff Garzik @ 2007-10-16 21:55 UTC (permalink / raw)
To: David Miller; +Cc: netdev, LKML
While looking at a net driver with the following construct,
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
it stuck me that the netif_carrier_ok() check was redundant, since
netif_carrier_on() checks bit __LINK_STATE_NOCARRIER anyway. This is
the same reason why netif_queue_stopped() need not be called prior to
netif_wake_queue().
This is true, but there is however an unwanted side effect from assuming
that netif_carrier_on() can be called multiple times: it touches the
watchdog, regardless of pre-existing carrier state.
The fix: move watchdog-up inside the bit-cleared code path.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
This looks like an obvious bug fix to me, but I found it by reading code
rather than hitting it in the field. Review appreciated.
net/sched/sch_generic.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 95ae119..e01d576 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -249,10 +249,11 @@ static void dev_watchdog_down(struct net_device *dev)
*/
void netif_carrier_on(struct net_device *dev)
{
- if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state))
+ if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
linkwatch_fire_event(dev);
- if (netif_running(dev))
- __netdev_watchdog_up(dev);
+ if (netif_running(dev))
+ __netdev_watchdog_up(dev);
+ }
}
/**
^ permalink raw reply related
* Re: [PATCH,RFC] Marvell Orion SoC ethernet driver
From: Maxime Bizon @ 2007-10-16 21:31 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: netdev, tzachi, nico
In-Reply-To: <20071016192806.GD19618@xi.wantstofly.org>
On Tue, 2007-10-16 at 21:28 +0200, Lennert Buytenhek wrote:
Hello,
> +#define PORT_CONF 0x400
> +#define PORT_CONF_EXT 0x404
> +#define PORT_MAC_LO 0x414
> +#define PORT_MAC_HI 0x418
> +#define PORT_SDMA 0x41c
> +#define PORT_SERIAL 0x43c
> +#define PORT_STAT 0x444
> +#define PORT_TXQ_CMD 0x448
> +#define PORT_MTU 0x458
> +#define PORT_CAUSE 0x460
> +#define PORT_CAUSE_EXT 0x464
> +#define PORT_MASK 0x468
> +#define PORT_MASK_EXT 0x46c
> +#define PORT_TX_THRESH 0x474
This driver seems to support the same hardware as mv643xx_eth, any
chance you could use it to avoid code duplication ?
Regards,
--
Maxime
^ permalink raw reply
* Re: [PATCH] Disable polling in rtl8169_suspend() to prevent race with rtl8169_interrupt()
From: Karsten Wiese @ 2007-10-16 22:10 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev
In-Reply-To: <20071016210412.GB8049@electric-eye.fr.zoreil.com>
Am Dienstag, 16. Oktober 2007 schrieb Francois Romieu:
> Karsten Wiese <fzu@wemgehoertderstaat.de> :
> [...]
> > Forgot to say: patch is against 2.6.23. Stable material, if it gets an ACK.
> > The BUG happens since months here, if not since I hibernate this pc.
>
> Can you give the patch below a try too ?
I don't know how to reliably make the bug happen, it occured once a week
"normally". Before I try please look through this stuff:
with an unpatched r8169 after bug happened today morning i gathered some
diagnostics:
[root@a64 ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
this ^..........^ looked funny to me
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: no
unexpected too ^^
then i did:
[root@a64 ~]# ethtool -s eth0 port mii
[root@a64 ~]# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
back to normal ^.........^
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes
expected value here too^.^ and eth0 worked again.
Can your patch cause the same effect as the "ethtool -s eth0 port mii" in
the bug case?
Do you agree that rtl8169_interrupt() should not be called after
rtl8169_asic_down() when in rtl8169_suspend() and before rtl8169_resume()?
If yes, how should that be achieved?
Karsten
^ permalink raw reply
* Re: netif_napi_add vs. multiple netdev's
From: David Miller @ 2007-10-16 22:16 UTC (permalink / raw)
To: shemminger; +Cc: benh, netdev
In-Reply-To: <20071016091035.5fcd6d2e@freepuppy.rosehill>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Tue, 16 Oct 2007 09:10:35 -0700
> On Tue, 16 Oct 2007 15:47:13 +1000
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> > The way it's currently implemented, there's a list of NAPI's attached to
> > the netdev, so obviously, that won't work for my usage scenario.
>
> sky2 driver has potentially 2 ports for 1 NAPI instance.
And it's unfortunately buggy.
For example, the sky2_suspend() code iterates over the ports
and calls sky2_down() on each one that is up.
That will call napi_disable() on the same NAPI instance if
multiple ports are up, and thus hang the machine.
This is why, Stephen, for the second time, I'm telling you
that perhaps you should put the NAPI instance into the
sky2_port struct.
^ permalink raw reply
* Re: [PATCH] Disable polling in rtl8169_suspend() to prevent race with rtl8169_interrupt()
From: Karsten Wiese @ 2007-10-16 22:21 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev
In-Reply-To: <200710170010.36329.fzu@wemgehoertderstaat.de>
Am Mittwoch, 17. Oktober 2007 schrieb Karsten Wiese:
to nonsense comments, please ignore:
> this ^..........^ looked funny to me
and
> back to normal ^.........^
^ permalink raw reply
* Re: netif_napi_add vs. multiple netdev's
From: Benjamin Herrenschmidt @ 2007-10-16 22:24 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20071016.151616.70218795.davem@davemloft.net>
On Tue, 2007-10-16 at 15:16 -0700, David Miller wrote:
> And it's unfortunately buggy.
>
> For example, the sky2_suspend() code iterates over the ports
> and calls sky2_down() on each one that is up.
>
> That will call napi_disable() on the same NAPI instance if
> multiple ports are up, and thus hang the machine.
>
> This is why, Stephen, for the second time, I'm telling you
> that perhaps you should put the NAPI instance into the
> sky2_port struct.
Can sky2 send/mask interrupts separately per port ? The reason why I
can't do that with EMAC is why I'm doing multiple ports per NAPI
instance...
If sky2 sticks to doing like EMAC, then it probably also needs to do
like EMAC which is to have it's own port_disable/enable that use local
per-port disable bits. (It may do a real napi_disable when all ports are
disabled, I suppose, though I don't currently do it in EMAC).
Ben.
^ permalink raw reply
* BNX2X driver: kernel panic when running netperf
From: Max Asbock @ 2007-10-16 23:34 UTC (permalink / raw)
To: netdev@vger.kernel.org
I tested the bnx2x driver (0001-BNX2X-0.40.10a-net-2.6.24.patch) with
netdev-2.6.24 git tree and found that I can reproducibly panic the
system when running netperf with the TCP_STREAM test.
I copied the following information from the panic message:
RIP: 0xc02fff32
net_rx_action +0x142/0x190
...
do_softirq
...
Kernel panic - not syncing
Fatal exception in interrupt.
Please let me what additional information is useful.
Max
^ permalink raw reply
* Re: netif_napi_add vs. multiple netdev's
From: Stephen Hemminger @ 2007-10-16 23:37 UTC (permalink / raw)
To: David Miller; +Cc: benh, netdev
In-Reply-To: <20071016.151616.70218795.davem@davemloft.net>
On Tue, 16 Oct 2007 15:16:16 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Tue, 16 Oct 2007 09:10:35 -0700
>
> > On Tue, 16 Oct 2007 15:47:13 +1000
> > Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> >
> > > The way it's currently implemented, there's a list of NAPI's attached to
> > > the netdev, so obviously, that won't work for my usage scenario.
> >
> > sky2 driver has potentially 2 ports for 1 NAPI instance.
>
> And it's unfortunately buggy.
>
> For example, the sky2_suspend() code iterates over the ports
> and calls sky2_down() on each one that is up.
>
> That will call napi_disable() on the same NAPI instance if
> multiple ports are up, and thus hang the machine.
>
> This is why, Stephen, for the second time, I'm telling you
> that perhaps you should put the NAPI instance into the
> sky2_port struct.
It isn't possible, there is only one hardware IRQ, and one
common status buffer. I'll fix the suspend code, it has other
problems as well.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply
* [ANNOUNCE] iproute2-2.6.23
From: Stephen Hemminger @ 2007-10-16 23:44 UTC (permalink / raw)
To: netdev
Now that 2.6.23 is out, and the patch storm has settled
here is a new version of iproute2
http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.23.bz2
Changes since last version (v2.6.19)
Alexander Wirt (1):
Drop bogus reference to tc-filters and add lartc.org link to manpage.
Andreas Barth (1):
Remove bogus reference to tc-filters(8) from tc(8) manpage.
Andreas Henriksson (4):
Add new rtacct/nstat manpages and additional symlinks.
Fix overflow in time2tick / tick2time.
Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well.
Also do tc_core_time2big argument (long->unsigned).
David Lamparter (1):
iproute2: Format IPv6 tunnels endpoints nicely.
Eric Dumazet (1):
lnstat : force a flush before sleep
Johannes Berg (1):
show multicast groups
Lionel Elie Mamane (1):
Fix ematch cmp and nbyte syntax help text.
Masahide NAKAMURA (3):
ip: xfrm: Clean-up for internal mask to filter.
ip: xfrm: Fix policy and state flags.
ip: xfrm: Fix flush message.
Mike Frysinger (2):
do not ignore build failures in subdirs of iproute2
ip/routef lifesaver
Noriaki TAKAMIYA (1):
enabled to manipulate the flags of IFA_F_HOMEADDRESS or IFA_F_NODAD from ip.
PJ Waskiewicz (1):
iproute2: sch_rr support in tc
Patrick McHardy (17):
tbf: fix latency printing
Use tc_calc_xmittime() where appropriate
Introduce tc_calc_xmitsize and use where appropriate
Introduce TIME_UNITS_PER_SEC to represent internal clock resolution
Replace "usec" by "time" in function names
Add sprint_ticks() function and use in CBQ
Handle different kernel clock resolutions
Increase internal clock resolution to nsec
[Fwd: Re: more iproute2 issues (not critical)]
TC action parsing bug fix
Bug fix tc action drop
IPROUTE2: RTNETLINK nested attributes
Use FRA_* attributes for routing rules
iplink: use netlink for link configuration
Fix meta ematch usage of 0 values
vlan support
Prevent renaming interfaces to empty string.
Pavel Emelianov (2):
Make ip utility veth driver aware
Module for ip utility to support veth device (v.2.1)
Pavel Roskin (1):
ip: add support for displaying link types 802 and 803
Rick Jones (1):
rto support for ip command
Sridhar Samudrala (1):
Fix bug in display of ipv6 cloned/cached routes
Stephen Hemminger (33):
netem parameters to change command
fix tc-pfifo and tc-bfifo man pages
iptables library fix
TC bfifo man page
Use kernel headers from 2.6.20.y
Iproute2 v2.6.20-070313
Revert "Increase internal clock resolution to nsec"
Add xt_tcpudp.h
incorrect initialization
headers update to 2.6.22
fix last change
fix build warnings
netem: static
Add TC_LIB_DIR environment variable.
Snapshot update for 2.6.22
ss: fix issues with signed inodes
v2.6.22-070710
Fix ss to handle partial records.
sanitized headers update to 2.6.23-rc3
Fix m_ipt build
Revert "Make ip utility veth driver aware"
Fix modes of test files
Update kernel headers to 2.6.23-rc5
2.6.23 kernel headers
Merge 192.168.0.5:src/iproute2
don't make veth a shared library
remove outdated netbug script.
remove support for IP multipath
don't allow "" for device name
Revert "Remove bogus reference to tc-filters(8) from tc(8) manpage."
Revert "don't allow "" for device name"
Update snapshot for release
add q_rr to tc Makefile
Thomas Graf (2):
iproute2: support for goto/nop action and detached flag
iproute2: Support IFF_LOWER_UP and IFF_DORMANT
Thomas Hisch (1):
Fixes use of uninitialized string
YOSHIFUJI Hideaki / 吉藤英明 (1):
IPROUTE2: Support IPv4/IPv6 Tunnel
Yasuyuki KOZAKAI (1):
Fix symbolic link to tc-bfifo.8
jamal (5):
update rest to use nl_mgrp
nl_mgrp to crap if base multicast groups exceeded
Old bug on tc
see SAD info
see SPD info
^ permalink raw reply
* Re: BNX2X driver: kernel panic when running netperf
From: David Miller @ 2007-10-16 23:49 UTC (permalink / raw)
To: masbock; +Cc: netdev
In-Reply-To: <1192577680.5730.12.camel@w-amax.beaverton.ibm.com>
From: Max Asbock <masbock@us.ibm.com>
Date: Tue, 16 Oct 2007 16:34:40 -0700
> I tested the bnx2x driver (0001-BNX2X-0.40.10a-net-2.6.24.patch) with
> netdev-2.6.24 git tree and found that I can reproducibly panic the
> system when running netperf with the TCP_STREAM test.
> I copied the following information from the panic message:
> RIP: 0xc02fff32
> net_rx_action +0x142/0x190
The driver is doing netif_rx_complete() yet returning a value from
->poll() which is >= budget, which is illegal.
We had to fix a similar bug in the tg3 and bnx2 drivers, the same
logic probably just propagated itself into bnx2x.
^ permalink raw reply
* Re: netif_napi_add vs. multiple netdev's
From: David Miller @ 2007-10-16 23:50 UTC (permalink / raw)
To: shemminger; +Cc: benh, netdev
In-Reply-To: <20071016163724.28fc1df0@freepuppy.rosehill>
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Tue, 16 Oct 2007 16:37:24 -0700
> It isn't possible, there is only one hardware IRQ, and one
> common status buffer.
Ok, thanks for explaining. Your hardware is very similar to
Ben's, therefore.
> I'll fix the suspend code, it has other problems as well.
Great!
^ permalink raw reply
* Re: Will RFC1146 (tcp alternative checksum options) be implemented in Linux tcp stack ?
From: Andi Kleen @ 2007-10-17 0:29 UTC (permalink / raw)
To: Yanping Du; +Cc: netdev
In-Reply-To: <887901.30138.qm@web55205.mail.re4.yahoo.com>
Yanping Du <ypdu2001@yahoo.com> writes:
> We found the standard 16-bit tcp checksum is not
> strong enough in some cases. Is there any roadmap on
> implementing RFC1146 (tcp alternative checksum
> options) in Linux tcp stack ?
The standard way to solve this problem is to either use
SSL or IPSec. They both use very strong checksums
and are widely supported unlike this obscure old RFC.
-Andi
^ permalink raw reply
* stateless 1:1 NAT
From: Florin Andrei @ 2007-10-17 0:29 UTC (permalink / raw)
To: netdev
I've heard that stateless 1:1 NAT will be possible with the upcoming
2.6.24 kernel.
I'd like to test that feature, but I'm not sure when it will actually be
included. Will it be present in the release candidates for 2.6.24?
I just need a somewhat stable kernel tree to play with.
--
Florin Andrei
http://florin.myip.org/
^ permalink raw reply
* Re: [ANNOUNCE] iproute2-2.6.23
From: Herbert Xu @ 2007-10-17 1:10 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20071016164439.3f8a4f00@freepuppy.rosehill>
Stephen Hemminger <shemminger@linux-foundation.org> wrote:
> Now that 2.6.23 is out, and the patch storm has settled
> here is a new version of iproute2
Hi Stephen:
Any chance you could include the NAT patch for the next release?
[TC]: Add NAT action
This patch adds the parser for the nat action which is used
for stateless NAT.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/tc/Makefile b/tc/Makefile
index 22cd437..cd5a69e 100644
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -26,6 +26,7 @@ TCMODULES += q_htb.o
TCMODULES += m_gact.o
TCMODULES += m_mirred.o
TCMODULES += m_ipt.o
+TCMODULES += m_nat.o
TCMODULES += m_pedit.o
TCMODULES += p_ip.o
TCMODULES += p_icmp.o
diff --git a/tc/m_nat.c b/tc/m_nat.c
new file mode 100644
index 0000000..6e7fd05
--- /dev/null
+++ b/tc/m_nat.c
@@ -0,0 +1,213 @@
+/*
+ * m_nat.c NAT module
+ *
+ * This program is free software; you can distribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * Authors: Herbert Xu <herbert@gondor.apana.org.au>
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <dlfcn.h>
+#include "utils.h"
+#include "tc_util.h"
+#include <linux/tc_act/tc_nat.h>
+
+static void
+explain(void)
+{
+ fprintf(stderr, "Usage: ... nat NAT\n"
+ "NAT := DIRECTION OLD NEW\n"
+ "DIRECTION := { ingress | egress }\n"
+ "OLD := PREFIX\n"
+ "NEW := ADDRESS\n");
+}
+
+static void
+usage(void)
+{
+ explain();
+ exit(-1);
+}
+
+static int
+parse_nat_args(int *argc_p, char ***argv_p,struct tc_nat *sel)
+{
+ int argc = *argc_p;
+ char **argv = *argv_p;
+ inet_prefix addr;
+
+ if (argc <= 0)
+ return -1;
+
+ if (matches(*argv, "egress") == 0)
+ sel->flags |= TCA_NAT_FLAG_EGRESS;
+ else if (matches(*argv, "ingress") != 0)
+ goto bad_val;
+
+ NEXT_ARG();
+
+ if (get_prefix_1(&addr, *argv, AF_INET))
+ goto bad_val;
+
+ sel->old_addr = addr.data[0];
+ sel->mask = htonl(~0u << (32 - addr.bitlen));
+
+ NEXT_ARG();
+
+ if (get_prefix_1(&addr, *argv, AF_INET))
+ goto bad_val;
+
+ sel->new_addr = addr.data[0];
+
+ argc--;
+ argv++;
+
+ *argc_p = argc;
+ *argv_p = argv;
+ return 0;
+
+bad_val:
+ return -1;
+}
+
+static int
+parse_nat(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n)
+{
+ struct tc_nat sel;
+
+ int argc = *argc_p;
+ char **argv = *argv_p;
+ int ok = 0;
+ struct rtattr *tail;
+
+ memset(&sel, 0, sizeof(sel));
+
+ while (argc > 0) {
+ if (matches(*argv, "nat") == 0) {
+ NEXT_ARG();
+ if (parse_nat_args(&argc, &argv, &sel)) {
+ fprintf(stderr, "Illegal nat construct (%s) \n",
+ *argv);
+ explain();
+ return -1;
+ }
+ ok++;
+ continue;
+ } else if (matches(*argv, "help") == 0) {
+ usage();
+ } else {
+ break;
+ }
+
+ }
+
+ if (!ok) {
+ explain();
+ return -1;
+ }
+
+ if (argc) {
+ if (matches(*argv, "reclassify") == 0) {
+ sel.action = TC_ACT_RECLASSIFY;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "pipe") == 0) {
+ sel.action = TC_ACT_PIPE;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "drop") == 0 ||
+ matches(*argv, "shot") == 0) {
+ sel.action = TC_ACT_SHOT;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "continue") == 0) {
+ sel.action = TC_ACT_UNSPEC;
+ argc--;
+ argv++;
+ } else if (matches(*argv, "pass") == 0) {
+ sel.action = TC_ACT_OK;
+ argc--;
+ argv++;
+ }
+ }
+
+ if (argc) {
+ if (matches(*argv, "index") == 0) {
+ NEXT_ARG();
+ if (get_u32(&sel.index, *argv, 10)) {
+ fprintf(stderr, "Pedit: Illegal \"index\"\n");
+ return -1;
+ }
+ argc--;
+ argv++;
+ }
+ }
+
+ tail = NLMSG_TAIL(n);
+ addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+ addattr_l(n, MAX_MSG, TCA_NAT_PARMS, &sel, sizeof(sel));
+ tail->rta_len = (char *)NLMSG_TAIL(n) - (char *)tail;
+
+ *argc_p = argc;
+ *argv_p = argv;
+ return 0;
+}
+
+static int
+print_nat(struct action_util *au,FILE * f, struct rtattr *arg)
+{
+ struct tc_nat *sel;
+ struct rtattr *tb[TCA_NAT_MAX + 1];
+ char buf1[256];
+ char buf2[256];
+ SPRINT_BUF(buf3);
+ int len;
+
+ if (arg == NULL)
+ return -1;
+
+ parse_rtattr_nested(tb, TCA_NAT_MAX, arg);
+
+ if (tb[TCA_NAT_PARMS] == NULL) {
+ fprintf(f, "[NULL nat parameters]");
+ return -1;
+ }
+ sel = RTA_DATA(tb[TCA_NAT_PARMS]);
+
+ len = ffs(sel->mask);
+ len = len ? 33 - len : 0;
+
+ fprintf(f, " nat %s %s/%d %s %s", sel->flags & TCA_NAT_FLAG_EGRESS ?
+ "egress" : "ingress",
+ format_host(AF_INET, 4, &sel->old_addr, buf1, sizeof(buf1)),
+ len,
+ format_host(AF_INET, 4, &sel->new_addr, buf2, sizeof(buf2)),
+ action_n2a(sel->action, buf3, sizeof (buf3)));
+
+ if (show_stats) {
+ if (tb[TCA_NAT_TM]) {
+ struct tcf_t *tm = RTA_DATA(tb[TCA_NAT_TM]);
+ print_tm(f,tm);
+ }
+ }
+
+ return 0;
+}
+
+struct action_util nat_action_util = {
+ .id = "nat",
+ .parse_aopt = parse_nat,
+ .print_aopt = print_nat,
+};
^ permalink raw reply related
* Re: stateless 1:1 NAT
From: Herbert Xu @ 2007-10-17 1:10 UTC (permalink / raw)
To: netdev; +Cc: netdev
In-Reply-To: <47155761.9030404@andrei.myip.org>
Florin Andrei <florin@andrei.myip.org> wrote:
> I've heard that stateless 1:1 NAT will be possible with the upcoming
> 2.6.24 kernel.
> I'd like to test that feature, but I'm not sure when it will actually be
> included. Will it be present in the release candidates for 2.6.24?
> I just need a somewhat stable kernel tree to play with.
Yes it will be.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 2/2] e1000e: fix error checks
From: Jeff Garzik @ 2007-10-17 1:15 UTC (permalink / raw)
To: Auke Kok; +Cc: jeff, netdev, bunk, joe
In-Reply-To: <20071015210221.26666.14629.stgit@localhost.localdomain>
Auke Kok wrote:
> From: Adrian Bunk <bunk@kernel.org>
>
> Spotted by the Coverity checker.
>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>
> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
applied all three patches (1-2, and then the singleton)
^ permalink raw reply
* [ofa-general] Re: [PATCH linux-2.6] bonding: two small fixes for IPoIB support
From: Jeff Garzik @ 2007-10-17 1:15 UTC (permalink / raw)
To: Jay Vosburgh; +Cc: netdev, rdreier, general
In-Reply-To: <9245.1192491867@death>
Jay Vosburgh wrote:
> Two small fixes to IPoIB support for bonding:
>
> 1- copy header_ops from slave to bonding for IPoIB slaves
> 2- move release and destroy logic to UNREGISTER from GOING_DOWN
> notifier to avoid double release
>
> Set bonding to version 3.2.1.
>
> Signed-off-by: Moni Shoua <monis at voltaire.com>
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
>
applied
^ permalink raw reply
* Re: [PATCH] net: Fix new EMAC driver for NAPI changes
From: Jeff Garzik @ 2007-10-17 1:16 UTC (permalink / raw)
To: benh; +Cc: shemminger, netdev, David S. Miller, Roland Dreier,
linuxppc-dev list
In-Reply-To: <1192513250.19073.10.camel@pasglop>
Benjamin Herrenschmidt wrote:
> net: Fix new EMAC driver for NAPI changes
>
> This fixes the new EMAC driver for the NAPI updates. The previous patch
> by Roland Dreier (already applied) to do that doesn't actually work. This
> applies on top of it makes it work on my test Ebony machine.
>
> This patch depends on "net: Add __napi_sycnhronize() to sync with napi poll"
> posted previously.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> The old EMAC driver does things a bit differently (doesn't do useful
> locking :-) and seems to work with Roland patch. So I'm not going to
> touch it unless somebody reports me that it has problems
applied
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox