* Re: Linux 2.6.36
From: Mihai Donțu @ 2010-10-21 7:52 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, Gary Zambrano, netdev
In-Reply-To: <AANLkTimdii2F3PsG4SxO5Zym7TB=MSGhtN+TpG=HmbcT@mail.gmail.com>
[-- Attachment #1: Type: Text/Plain, Size: 2050 bytes --]
On Thursday 21 October 2010 00:01:27 Linus Torvalds wrote:
> So it's a week later than I wanted (plus all the days that added up
> from me having a few 8-day weeks during this release window), but it's
> out there now.
>
> The delay means that the merge window that opens now would cover the
> upcoming kernel summit. However, I really hope that everybody sends me
> their patches and pull requests _before_ KS even starts. And if you're
> affected by the kernel summit you probably won't have time during it
> to finalize anything that week anyway, especially for those staying
> for plumbers afterwards, and...
>
> So I'm going to hope that we could perhaps even do the 2.6.37 -rc1
> release and close the merge window the Sunday before KS opens. Since
> 2.6.36 was longer than usual (at least it felt that way), I wouldn't
> mind having a 2.6.37 that is shorter than usual.
>
> But holler if this really screws up any plans. Ten days instead of two
> weeks? Let's see if it's even reasonably realistic.
>
> Anyway, I'm appending the shortlog since -rc8. At least it's
> noticeably shorter than the -rc7 and -rc8 logs were, and most of it
> really is pretty small.
>
> For the bigger picture of changes since 2.6.35, see for example
>
> http://kernelnewbies.org/Linux_2_6_36
>
> but it may be worth pointing out that we ended up disabling the new
> fanotify system calls because people were still unsure about the
> interfaces. Better let the interface discussion cook a bit longer than
> release with a bad interface that we need to redo.
I get a rather big amount of 'b44 ssb1:0: eth0: powering down PHY' messages in
dmesg shortly after booting:
# grep -c 'b44 ssb1:0: eth0: powering down PHY' /var/log/messages
124566
# grep -c 'b44 ssb1:0: eth0: late interrupt' /var/log/messages
1141
The same thing happens when resuming from suspend to RAM. This is accompanied
by kworker/0:3 (?) taking 100% CPU time for 1 min or so. I'm running 2.6.35
now, so I might be wrong about the name of the kernel thread.
Thanks,
--
Mihai Donțu
[-- Attachment #2: syslog-messages.gz --]
[-- Type: application/x-gzip, Size: 299996 bytes --]
[-- Attachment #3: lspci.txt --]
[-- Type: text/plain, Size: 1758 bytes --]
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
02:01.0 CardBus bridge: O2 Micro, Inc. Cardbus bridge (rev 21)
02:01.4 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02)
0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11a/b/g (rev 01)
^ permalink raw reply
* (unknown)
From: David Miller @ 2010-10-21 7:56 UTC (permalink / raw)
To: ddutt; +Cc: netdev, rmody, huangj, amathur
In-Reply-To: <F363E7AC84E1B646A0358B281A46F4AEABA0FFCC62@HQ1-EXCH03.corp.brocade.com>
People are very unlikely to read your posting because you
did not provide a subject line.
^ permalink raw reply
* Re: [RFC PATCH 1/9] ipvs network name space aware
From: Eric Dumazet @ 2010-10-21 8:01 UTC (permalink / raw)
To: Hans Schillstrom
Cc: paulmck@linux.vnet.ibm.com, Daniel Lezcano,
lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, horms@verge.net.au, ja@ssi.bg,
wensong@linux-vs.org
In-Reply-To: <201010210945.55252.hans.schillstrom@ericsson.com>
Le jeudi 21 octobre 2010 à 09:45 +0200, Hans Schillstrom a écrit :
> I do have this (and some debuging)
> __rcu_read_lock()
> => 0xffffffff8108bcf3 <+0>: push %rbp
> 0xffffffff8108bcf4 <+1>: mov %rsp,%rbp
> 0xffffffff8108bcf7 <+4>: nopl 0x0(%rax,%rax,1)
> 0xffffffff8108bcfc <+9>: mov %gs:0xb540,%rax
> 0xffffffff8108bd05 <+18>: mov 0x108(%rax),%edx
> 0xffffffff8108bd0b <+24>: inc %edx
> 0xffffffff8108bd0d <+26>: mov %edx,0x108(%rax)
> 0xffffffff8108bd13 <+32>: leaveq
> 0xffffffff8108bd14 <+33>: retq
>
> which is not that many, actually imprerssing few instructions :-)
nopl 0x0(%rax,%rax,1) is a filler because of extra instrumentation in
your kernel.
Maybe you could find out why your compiler dont use
incl 0x108(%rax)
instead of
mov 0x108(%rax),%edx
inc %edx
mov %edx,0x108(%rax)
So rcu_read_lock() is really _two_ instructions.
I agree with Paul with the "few" qualification... :-)
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH net-next] fib: introduce fib_alias_accessed() helper
From: Eric Dumazet @ 2010-10-21 8:03 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Perf tools session at NFWS 2010 pointed out a false sharing on struct
fib_alias that can be avoided pretty easily, if we set FA_S_ACCESSED bit
only if needed (ie : not already set)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/fib_hash.c | 3 ++-
net/ipv4/fib_lookup.h | 7 +++++++
net/ipv4/fib_semantics.c | 2 +-
net/ipv4/fib_trie.c | 3 ++-
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 4f1aafd..43e1c59 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -335,7 +335,8 @@ void fib_table_select_default(struct fib_table *tb,
if (!next_fi->fib_nh[0].nh_gw ||
next_fi->fib_nh[0].nh_scope != RT_SCOPE_LINK)
continue;
- fa->fa_state |= FA_S_ACCESSED;
+
+ fib_alias_accessed(fa);
if (fi == NULL) {
if (next_fi != res->fi)
diff --git a/net/ipv4/fib_lookup.h b/net/ipv4/fib_lookup.h
index 5072d8e..a29edf2 100644
--- a/net/ipv4/fib_lookup.h
+++ b/net/ipv4/fib_lookup.h
@@ -17,6 +17,13 @@ struct fib_alias {
#define FA_S_ACCESSED 0x01
+/* Dont write on fa_state unless needed, to keep it shared on all cpus */
+static inline void fib_alias_accessed(struct fib_alias *fa)
+{
+ if (!(fa->fa_state & FA_S_ACCESSED))
+ fa->fa_state |= FA_S_ACCESSED;
+}
+
/* Exported by fib_semantics.c */
extern int fib_semantic_match(struct list_head *head,
const struct flowi *flp,
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 6734c9c..3e0da3e 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -901,7 +901,7 @@ int fib_semantic_match(struct list_head *head, const struct flowi *flp,
if (fa->fa_scope < flp->fl4_scope)
continue;
- fa->fa_state |= FA_S_ACCESSED;
+ fib_alias_accessed(fa);
err = fib_props[fa->fa_type].error;
if (err == 0) {
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 31494f3..cd5e13a 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1838,7 +1838,8 @@ void fib_table_select_default(struct fib_table *tb,
if (!next_fi->fib_nh[0].nh_gw ||
next_fi->fib_nh[0].nh_scope != RT_SCOPE_LINK)
continue;
- fa->fa_state |= FA_S_ACCESSED;
+
+ fib_alias_accessed(fa);
if (fi == NULL) {
if (next_fi != res->fi)
^ permalink raw reply related
* Re: [GIT PULL net-2.6] vhost-net: access_ok fix
From: David Miller @ 2010-10-21 8:08 UTC (permalink / raw)
To: mst; +Cc: kvm, virtualization, netdev, linux-kernel
In-Reply-To: <20101019145901.GA16025@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Tue, 19 Oct 2010 16:59:01 +0200
> David,
> Not sure if it's too late for 2.6.36 - in case it's not, the following tree
> includes a last minute bugfix for vhost-net, found by code inspection.
> It is on top of net-2.6.
> Thanks!
>
> The following changes since commit b0057c51db66c5f0f38059f242c57d61c4741d89:
>
> tg3: restore rx_dropped accounting (2010-10-11 16:06:24 -0700)
>
> are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net
Even though it's too late, I've pulled this.
^ permalink raw reply
* Re: [RFC PATCH 3/9] ipvs network name space aware
From: Simon Horman @ 2010-10-21 8:22 UTC (permalink / raw)
To: Hans Schillstrom
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, ja@ssi.bg, wensong@linux-vs.org,
daniel.lezcano@free.fr
In-Reply-To: <201010210951.40914.hans.schillstrom@ericsson.com>
On Thu, Oct 21, 2010 at 09:51:40AM +0200, Hans Schillstrom wrote:
> On Wednesday 20 October 2010 16:03:24 Simon Horman wrote:
> > On Fri, Oct 08, 2010 at 01:16:57PM +0200, Hans Schillstrom wrote:
[ snip ]
> > > @@ -278,35 +271,41 @@ ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
> > > unsigned int proto_off, int inverse)
> > > {
> > > __be16 _ports[2], *pptr;
> > > + struct net *net = dev_net(skb->dev);
> > >
> > > pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
> > > if (pptr == NULL)
> > > return NULL;
> > >
> > > + BUG_ON(!net);
> >
> > Can you explain why BUG_ON is here?
>
> Yes, I forgot to remove it.
> I had them every where to make sure that net ptr was set,
> - don't call me paranoid ;-)
Thanks, I thought it was something like that.
I'll remove them as part of my rebase.
[ strip ]
^ permalink raw reply
* [PATCH 0/8] r8169 patches for net-next v2
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
v1 -> v2
- update to current code and some minor changes/cleanups
- do not return NETDEV_TX_BUSY from start_xmit when mapping fail (patch 1)
- add missing unlikely (patch 1)
- account tx bytes based on skb->len (patch 5)
- new patches: changing mtu clean up, (re)init phy on resume
- add net_ratelimit (patch 8)
All patches in series was tested on RTL8111/8168B
^ permalink raw reply
* [PATCH 1/8] r8169: check dma mapping failures
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Check possible dma mapping errors and do clean up if it happens.
Fix overwrap bug in rtl8169_tx_clear on the way.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 66 +++++++++++++++++++++++++++++++++++++--------------
1 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 1760533..01d96a7 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3992,11 +3992,18 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
if (!data)
return NULL;
}
+
mapping = dma_map_single(&pdev->dev, rtl8169_align(data), rx_buf_sz,
PCI_DMA_FROMDEVICE);
+ if (unlikely(dma_mapping_error(&pdev->dev, mapping)))
+ goto err_out;
rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
return data;
+
+err_out:
+ kfree(data);
+ return NULL;
}
static void rtl8169_rx_clear(struct rtl8169_private *tp)
@@ -4080,12 +4087,13 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
tx_skb->len = 0;
}
-static void rtl8169_tx_clear(struct rtl8169_private *tp)
+static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
+ unsigned int n)
{
unsigned int i;
- for (i = tp->dirty_tx; i < tp->dirty_tx + NUM_TX_DESC; i++) {
- unsigned int entry = i % NUM_TX_DESC;
+ for (i = 0; i < n; i++) {
+ unsigned int entry = (start + i) % NUM_TX_DESC;
struct ring_info *tx_skb = tp->tx_skb + entry;
unsigned int len = tx_skb->len;
@@ -4101,6 +4109,11 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
tp->dev->stats.tx_dropped++;
}
}
+}
+
+static void rtl8169_tx_clear(struct rtl8169_private *tp)
+{
+ rtl8169_tx_clear_range(tp, tp->dirty_tx, NUM_TX_DESC);
tp->cur_tx = tp->dirty_tx = 0;
}
@@ -4219,6 +4232,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
addr = ((void *) page_address(frag->page)) + frag->page_offset;
mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
PCI_DMA_TODEVICE);
+ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ goto err_out;
/* anti gcc 2.95.3 bugware (sic) */
status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
@@ -4235,6 +4250,10 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
}
return cur_frag;
+
+err_out:
+ rtl8169_tx_clear_range(tp, tp->cur_tx + 1, cur_frag);
+ return -EIO;
}
static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev)
@@ -4261,40 +4280,44 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
- unsigned int frags, entry = tp->cur_tx % NUM_TX_DESC;
+ unsigned int entry = tp->cur_tx % NUM_TX_DESC;
struct TxDesc *txd = tp->TxDescArray + entry;
void __iomem *ioaddr = tp->mmio_addr;
dma_addr_t mapping;
u32 status, len;
u32 opts1;
+ int frags;
if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {
netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
- goto err_stop;
+ goto err_stop_0;
}
if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
- goto err_stop;
+ goto err_stop_0;
+
+ len = skb_headlen(skb);
+ mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
+ PCI_DMA_TODEVICE);
+ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ goto err_dma_0;
+
+ tp->tx_skb[entry].len = len;
+ txd->addr = cpu_to_le64(mapping);
+ txd->opts2 = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
opts1 = DescOwn | rtl8169_tso_csum(skb, dev);
frags = rtl8169_xmit_frags(tp, skb, opts1);
- if (frags) {
- len = skb_headlen(skb);
+ if (frags < 0)
+ goto err_dma_1;
+ else if (frags)
opts1 |= FirstFrag;
- } else {
- len = skb->len;
+ else {
opts1 |= FirstFrag | LastFrag;
tp->tx_skb[entry].skb = skb;
}
- mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
- PCI_DMA_TODEVICE);
-
- tp->tx_skb[entry].len = len;
- txd->addr = cpu_to_le64(mapping);
- txd->opts2 = cpu_to_le32(rtl8169_tx_vlan_tag(tp, skb));
-
wmb();
/* anti gcc 2.95.3 bugware (sic) */
@@ -4316,7 +4339,14 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
-err_stop:
+err_dma_1:
+ rtl8169_unmap_tx_skb(tp->pci_dev, tp->tx_skb + entry, txd);
+err_dma_0:
+ dev_kfree_skb(skb);
+ dev->stats.tx_dropped++;
+ return NETDEV_TX_OK;
+
+err_stop_0:
netif_stop_queue(dev);
dev->stats.tx_dropped++;
return NETDEV_TX_BUSY;
--
1.6.5.2
^ permalink raw reply related
* [PATCH 2/8] r8169: init rx ring cleanup
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 52 +++++++++++++++++++++-----------------------------
1 files changed, 22 insertions(+), 30 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 01d96a7..5a87036 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3974,12 +3974,12 @@ static inline void *rtl8169_align(void *data)
return (void *)ALIGN((long)data, 16);
}
-static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
- struct net_device *dev,
- struct RxDesc *desc)
+static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
+ struct RxDesc *desc)
{
void *data;
dma_addr_t mapping;
+ struct net_device *dev = tp->dev;
int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
data = kmalloc_node(rx_buf_sz, GFP_KERNEL, node);
@@ -3993,9 +3993,9 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct pci_dev *pdev,
return NULL;
}
- mapping = dma_map_single(&pdev->dev, rtl8169_align(data), rx_buf_sz,
+ mapping = dma_map_single(&tp->pci_dev->dev, rtl8169_align(data), rx_buf_sz,
PCI_DMA_FROMDEVICE);
- if (unlikely(dma_mapping_error(&pdev->dev, mapping)))
+ if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
goto err_out;
rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
@@ -4018,34 +4018,35 @@ static void rtl8169_rx_clear(struct rtl8169_private *tp)
}
}
-static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
- u32 start, u32 end, gfp_t gfp)
+static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
{
- u32 cur;
+ desc->opts1 |= cpu_to_le32(RingEnd);
+}
- for (cur = start; end - cur != 0; cur++) {
- void *data;
- unsigned int i = cur % NUM_RX_DESC;
+static int rtl8169_rx_fill(struct rtl8169_private *tp)
+{
+ unsigned int i;
- WARN_ON((s32)(end - cur) < 0);
+ for (i = 0; i < NUM_RX_DESC; i++) {
+ void *data;
if (tp->Rx_databuff[i])
continue;
- data = rtl8169_alloc_rx_data(tp->pci_dev, dev,
- tp->RxDescArray + i);
+ data = rtl8169_alloc_rx_data(tp, tp->RxDescArray + i);
if (!data) {
rtl8169_make_unusable_by_asic(tp->RxDescArray + i);
- break;
+ goto err_out;
}
tp->Rx_databuff[i] = data;
}
- return cur - start;
-}
-static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
-{
- desc->opts1 |= cpu_to_le32(RingEnd);
+ rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
+ return 0;
+
+err_out:
+ rtl8169_rx_clear(tp);
+ return -ENOMEM;
}
static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)
@@ -4062,16 +4063,7 @@ static int rtl8169_init_ring(struct net_device *dev)
memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
memset(tp->Rx_databuff, 0x0, NUM_RX_DESC * sizeof(void *));
- if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC, GFP_KERNEL) != NUM_RX_DESC)
- goto err_out;
-
- rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
-
- return 0;
-
-err_out:
- rtl8169_rx_clear(tp);
- return -ENOMEM;
+ return rtl8169_rx_fill(tp);
}
static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
--
1.6.5.2
^ permalink raw reply related
* [PATCH 3/8] r8169: replace PCI_DMA_{TO,FROM}DEVICE to DMA_{TO,FROM}_DEVICE
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5a87036..7ad119f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3948,7 +3948,7 @@ static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
struct pci_dev *pdev = tp->pci_dev;
dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
kfree(*data_buff);
*data_buff = NULL;
rtl8169_make_unusable_by_asic(desc);
@@ -3994,7 +3994,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
}
mapping = dma_map_single(&tp->pci_dev->dev, rtl8169_align(data), rx_buf_sz,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
goto err_out;
@@ -4072,7 +4072,7 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
unsigned int len = tx_skb->len;
dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
desc->opts1 = 0x00;
desc->opts2 = 0x00;
desc->addr = 0x00;
@@ -4223,7 +4223,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
len = frag->size;
addr = ((void *) page_address(frag->page)) + frag->page_offset;
mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
goto err_out;
@@ -4290,7 +4290,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
len = skb_headlen(skb);
mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
- PCI_DMA_TODEVICE);
+ DMA_TO_DEVICE);
if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
goto err_dma_0;
@@ -4469,13 +4469,13 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
data = rtl8169_align(data);
dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
prefetch(data);
skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
if (skb)
memcpy(skb->data, data, pkt_size);
dma_sync_single_for_device(&tp->pci_dev->dev, addr, pkt_size,
- PCI_DMA_FROMDEVICE);
+ DMA_FROM_DEVICE);
return skb;
}
--
1.6.5.2
^ permalink raw reply related
* [PATCH 4/8] r8169: use pointer to struct device as local variable
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 51 +++++++++++++++++++++++++--------------------------
1 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 7ad119f..0a797d0 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1200,6 +1200,7 @@ static void rtl8169_update_counters(struct net_device *dev)
dma_addr_t paddr;
u32 cmd;
int wait = 1000;
+ struct device *d = &tp->pci_dev->dev;
/*
* Some chips are unable to dump tally counters when the receiver
@@ -1208,8 +1209,7 @@ static void rtl8169_update_counters(struct net_device *dev)
if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
return;
- counters = dma_alloc_coherent(&tp->pci_dev->dev, sizeof(*counters),
- &paddr, GFP_KERNEL);
+ counters = dma_alloc_coherent(d, sizeof(*counters), &paddr, GFP_KERNEL);
if (!counters)
return;
@@ -1230,8 +1230,7 @@ static void rtl8169_update_counters(struct net_device *dev)
RTL_W32(CounterAddrLow, 0);
RTL_W32(CounterAddrHigh, 0);
- dma_free_coherent(&tp->pci_dev->dev, sizeof(*counters), counters,
- paddr);
+ dma_free_coherent(d, sizeof(*counters), counters, paddr);
}
static void rtl8169_get_ethtool_stats(struct net_device *dev,
@@ -3945,10 +3944,9 @@ static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
void **data_buff, struct RxDesc *desc)
{
- struct pci_dev *pdev = tp->pci_dev;
-
- dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
+ dma_unmap_single(&tp->pci_dev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
DMA_FROM_DEVICE);
+
kfree(*data_buff);
*data_buff = NULL;
rtl8169_make_unusable_by_asic(desc);
@@ -3979,6 +3977,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
{
void *data;
dma_addr_t mapping;
+ struct device *d = &tp->pci_dev->dev;
struct net_device *dev = tp->dev;
int node = dev->dev.parent ? dev_to_node(dev->dev.parent) : -1;
@@ -3993,9 +3992,9 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
return NULL;
}
- mapping = dma_map_single(&tp->pci_dev->dev, rtl8169_align(data), rx_buf_sz,
+ mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz,
DMA_FROM_DEVICE);
- if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ if (unlikely(dma_mapping_error(d, mapping)))
goto err_out;
rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
@@ -4066,13 +4065,13 @@ static int rtl8169_init_ring(struct net_device *dev)
return rtl8169_rx_fill(tp);
}
-static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
+static void rtl8169_unmap_tx_skb(struct device *d, struct ring_info *tx_skb,
struct TxDesc *desc)
{
unsigned int len = tx_skb->len;
- dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
- DMA_TO_DEVICE);
+ dma_unmap_single(d, le64_to_cpu(desc->addr), len, DMA_TO_DEVICE);
+
desc->opts1 = 0x00;
desc->opts2 = 0x00;
desc->addr = 0x00;
@@ -4092,7 +4091,7 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
if (len) {
struct sk_buff *skb = tx_skb->skb;
- rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb,
+ rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
tp->TxDescArray + entry);
if (skb) {
dev_kfree_skb(skb);
@@ -4209,6 +4208,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
struct skb_shared_info *info = skb_shinfo(skb);
unsigned int cur_frag, entry;
struct TxDesc * uninitialized_var(txd);
+ struct device *d = &tp->pci_dev->dev;
entry = tp->cur_tx;
for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {
@@ -4222,9 +4222,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
txd = tp->TxDescArray + entry;
len = frag->size;
addr = ((void *) page_address(frag->page)) + frag->page_offset;
- mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
- DMA_TO_DEVICE);
- if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(d, mapping)))
goto err_out;
/* anti gcc 2.95.3 bugware (sic) */
@@ -4275,6 +4274,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
unsigned int entry = tp->cur_tx % NUM_TX_DESC;
struct TxDesc *txd = tp->TxDescArray + entry;
void __iomem *ioaddr = tp->mmio_addr;
+ struct device *d = &tp->pci_dev->dev;
dma_addr_t mapping;
u32 status, len;
u32 opts1;
@@ -4289,9 +4289,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
goto err_stop_0;
len = skb_headlen(skb);
- mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
- DMA_TO_DEVICE);
- if (unlikely(dma_mapping_error(&tp->pci_dev->dev, mapping)))
+ mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(d, mapping)))
goto err_dma_0;
tp->tx_skb[entry].len = len;
@@ -4332,7 +4331,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
err_dma_1:
- rtl8169_unmap_tx_skb(tp->pci_dev, tp->tx_skb + entry, txd);
+ rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd);
err_dma_0:
dev_kfree_skb(skb);
dev->stats.tx_dropped++;
@@ -4414,8 +4413,8 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
dev->stats.tx_bytes += len;
dev->stats.tx_packets++;
- rtl8169_unmap_tx_skb(tp->pci_dev, tx_skb, tp->TxDescArray + entry);
-
+ rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
+ tp->TxDescArray + entry);
if (status & LastFrag) {
dev_kfree_skb(tx_skb->skb);
tx_skb->skb = NULL;
@@ -4466,16 +4465,16 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
dma_addr_t addr)
{
struct sk_buff *skb;
+ struct device *d = &tp->pci_dev->dev;
data = rtl8169_align(data);
- dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
- DMA_FROM_DEVICE);
+ dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
prefetch(data);
skb = netdev_alloc_skb_ip_align(tp->dev, pkt_size);
if (skb)
memcpy(skb->data, data, pkt_size);
- dma_sync_single_for_device(&tp->pci_dev->dev, addr, pkt_size,
- DMA_FROM_DEVICE);
+ dma_sync_single_for_device(d, addr, pkt_size, DMA_FROM_DEVICE);
+
return skb;
}
--
1.6.5.2
^ permalink raw reply related
* [PATCH 5/8] r8169: do not account fragments as packets
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Only increase tx_{packets,dropped} statistics when transmit or drop
full skb, not just fragment.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
--
drivers/net/r8169.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 0a797d0..ef304c5 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4094,10 +4094,10 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
tp->TxDescArray + entry);
if (skb) {
+ tp->dev->stats.tx_dropped++;
dev_kfree_skb(skb);
tx_skb->skb = NULL;
}
- tp->dev->stats.tx_dropped++;
}
}
}
@@ -4402,7 +4402,6 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
while (tx_left > 0) {
unsigned int entry = dirty_tx % NUM_TX_DESC;
struct ring_info *tx_skb = tp->tx_skb + entry;
- u32 len = tx_skb->len;
u32 status;
rmb();
@@ -4410,12 +4409,11 @@ static void rtl8169_tx_interrupt(struct net_device *dev,
if (status & DescOwn)
break;
- dev->stats.tx_bytes += len;
- dev->stats.tx_packets++;
-
rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
tp->TxDescArray + entry);
if (status & LastFrag) {
+ dev->stats.tx_packets++;
+ dev->stats.tx_bytes += tx_skb->skb->len;
dev_kfree_skb(tx_skb->skb);
tx_skb->skb = NULL;
}
--
1.6.5.2
^ permalink raw reply related
* [PATCH 6/8] r8169: changing mtu clean up
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Since we do not change rx buffer size any longer, we can
clean up rtl8169_change_mtu and in consequence rtl8169_down.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 47 ++++++-----------------------------------------
1 files changed, 6 insertions(+), 41 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index ef304c5..ad3f37a 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3908,31 +3908,11 @@ static void rtl_hw_start_8101(struct net_device *dev)
static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
{
- struct rtl8169_private *tp = netdev_priv(dev);
- int ret = 0;
-
if (new_mtu < ETH_ZLEN || new_mtu > SafeMtu)
return -EINVAL;
dev->mtu = new_mtu;
-
- if (!netif_running(dev))
- goto out;
-
- rtl8169_down(dev);
-
- ret = rtl8169_init_ring(dev);
- if (ret < 0)
- goto out;
-
- napi_enable(&tp->napi);
-
- rtl_hw_start(dev);
-
- rtl8169_request_timer(dev);
-
-out:
- return ret;
+ return 0;
}
static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
@@ -4684,7 +4664,6 @@ static void rtl8169_down(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
- unsigned int intrmask;
rtl8169_delete_timer(dev);
@@ -4692,11 +4671,14 @@ static void rtl8169_down(struct net_device *dev)
napi_disable(&tp->napi);
-core_down:
spin_lock_irq(&tp->lock);
rtl8169_asic_down(ioaddr);
-
+ /*
+ * At this point device interrupts can not be enabled in any function,
+ * as netif_running is not true (rtl8169_interrupt, rtl8169_reset_task,
+ * rtl8169_reinit_task) and napi is disabled (rtl8169_poll).
+ */
rtl8169_rx_missed(dev, ioaddr);
spin_unlock_irq(&tp->lock);
@@ -4706,23 +4688,6 @@ core_down:
/* Give a racing hard_start_xmit a few cycles to complete. */
synchronize_sched(); /* FIXME: should this be synchronize_irq()? */
- /*
- * And now for the 50k$ question: are IRQ disabled or not ?
- *
- * Two paths lead here:
- * 1) dev->close
- * -> netif_running() is available to sync the current code and the
- * IRQ handler. See rtl8169_interrupt for details.
- * 2) dev->change_mtu
- * -> rtl8169_poll can not be issued again and re-enable the
- * interruptions. Let's simply issue the IRQ down sequence again.
- *
- * No loop if hotpluged or major error (0xffff).
- */
- intrmask = RTL_R16(IntrMask);
- if (intrmask && (intrmask != 0xffff))
- goto core_down;
-
rtl8169_tx_clear(tp);
rtl8169_rx_clear(tp);
--
1.6.5.2
^ permalink raw reply related
* [PATCH 7/8] r8169: (re)init phy on resume
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
Fix switching device to low-speed mode after resume reported in:
https://bugzilla.redhat.com/show_bug.cgi?id=502974
Reported-and-tested-by: Laurentiu Badea <bugzilla-redhat@wotevah.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index ad3f37a..1165e7d 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4824,6 +4824,9 @@ static int rtl8169_resume(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct net_device *dev = pci_get_drvdata(pdev);
+ struct rtl8169_private *tp = netdev_priv(dev);
+
+ rtl8169_init_phy(dev, tp);
if (netif_running(dev))
__rtl8169_resume(dev);
@@ -4864,6 +4867,8 @@ static int rtl8169_runtime_resume(struct device *device)
tp->saved_wolopts = 0;
spin_unlock_irq(&tp->lock);
+ rtl8169_init_phy(dev, tp);
+
__rtl8169_resume(dev);
return 0;
--
1.6.5.2
^ permalink raw reply related
* [PATCH 8/8] r8169: print errors when dma mapping fail
From: Stanislaw Gruszka @ 2010-10-21 8:25 UTC (permalink / raw)
To: Francois Romieu, netdev; +Cc: Denis Kirjanov, Stanislaw Gruszka
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
If dma mapping fail we are dropping packages or fail to open device.
But exact reason of drop/fail stays unknow for a user, so print errors.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/r8169.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 1165e7d..cd16077 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -3974,8 +3974,11 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz,
DMA_FROM_DEVICE);
- if (unlikely(dma_mapping_error(d, mapping)))
+ if (unlikely(dma_mapping_error(d, mapping))) {
+ if (net_ratelimit())
+ netif_err(tp, drv, tp->dev, "Failed to map RX DMA!\n");
goto err_out;
+ }
rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
return data;
@@ -4203,8 +4206,12 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
len = frag->size;
addr = ((void *) page_address(frag->page)) + frag->page_offset;
mapping = dma_map_single(d, addr, len, DMA_TO_DEVICE);
- if (unlikely(dma_mapping_error(d, mapping)))
+ if (unlikely(dma_mapping_error(d, mapping))) {
+ if (net_ratelimit())
+ netif_err(tp, drv, tp->dev,
+ "Failed to map TX fragments DMA!\n");
goto err_out;
+ }
/* anti gcc 2.95.3 bugware (sic) */
status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
@@ -4270,8 +4277,11 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
len = skb_headlen(skb);
mapping = dma_map_single(d, skb->data, len, DMA_TO_DEVICE);
- if (unlikely(dma_mapping_error(d, mapping)))
+ if (unlikely(dma_mapping_error(d, mapping))) {
+ if (net_ratelimit())
+ netif_err(tp, drv, dev, "Failed to map TX DMA!\n");
goto err_dma_0;
+ }
tp->tx_skb[entry].len = len;
txd->addr = cpu_to_le64(mapping);
--
1.6.5.2
^ permalink raw reply related
* Re: [RFC PATCH 5/9] ipvs network name space aware
From: Horms @ 2010-10-21 8:27 UTC (permalink / raw)
To: Hans Schillstrom
Cc: lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
netfilter-devel@vger.kernel.org, ja@ssi.bg, wensong@linux-vs.org,
daniel.lezcano@free.fr
In-Reply-To: <201010210935.13311.hans.schillstrom@ericsson.com>
On Thu, Oct 21, 2010 at 09:35:12AM +0200, Hans Schillstrom wrote:
> On Wednesday 20 October 2010 17:21:45 Simon Horman wrote:
> > On Fri, Oct 08, 2010 at 01:17:02PM +0200, Hans Schillstrom wrote:
> > > This patch just contains ip_vs_ctl
> > >
> > > Signed-off-by:Hans Schillstrom <hans.schillstrom@ericsson.com>
> > >
> > > diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> > > index ca8ec8c..7e99cbc 100644
> > > --- a/net/netfilter/ipvs/ip_vs_ctl.c
> > > +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> >
> > [ snip ]
> >
> > > @@ -3377,62 +3383,131 @@ static void ip_vs_genl_unregister(void)
> > > }
> > >
> > > /* End of Generic Netlink interface definitions */
> > > +/*
> > > + * per netns intit/exit func.
> > > + */
> > > +int /*__net_init*/ __ip_vs_control_init(struct net *net)
> >
> > Can you describe why __net_init is commented out?
>
> The coloring in my editor get fucked up :-)
> I just forgott to remove the comment
Thanks, I'll remove it :-)
^ permalink raw reply
* Re: [PATCH] Fixed race condition at ip_vs.ko module init.
From: Patrick McHardy @ 2010-10-21 8:31 UTC (permalink / raw)
To: Simon Horman
Cc: Eduardo Blanco, lvs-devel, netdev, netfilter-devel, Wensong Zhang,
Julian Anastasov
In-Reply-To: <20101019152311.GJ6193@verge.net.au>
Am 19.10.2010 17:23, schrieb Simon Horman:
> On Tue, Oct 19, 2010 at 10:26:47AM +0100, Eduardo Blanco wrote:
>> Lists were initialized after the module was registered. Multiple ipvsadm
>> processes at module load triggered a race condition that resulted in a null
>> pointer dereference in do_ip_vs_get_ctl(). As a result, __ip_vs_mutex
>> was left locked preventing all further ipvsadm commands.
>>
>> Signed-off-by: Eduardo J. Blanco <ejblanco@google.com>
>
> Thanks Eduardo.
>
> Patrick, please consider pulling
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick
>
> to get this change.
Pulled, thanks.
^ permalink raw reply
* Re: [PATCH v2 00/14] Move vlan acceleration into networking core.
From: David Miller @ 2010-10-21 8:33 UTC (permalink / raw)
To: jesse; +Cc: netdev
In-Reply-To: <1287618974-4714-1-git-send-email-jesse@nicira.com>
From: Jesse Gross <jesse@nicira.com>
Date: Wed, 20 Oct 2010 16:56:00 -0700
> Hardware vlan acceleration behaves fairly differently from other types of
> offloading, which limits its usefulness. This patch series aims to bring
> it more in line with other common forms of acceleration, such as checksum
> offloading and TSO. In doing this it eliminates common driver bugs, increases
> flexibility, and improves performance, while reducing the number of lines of
> code.
>
> The first eleven patches can be applied immediately, while the last three need
> to wait until all drivers that support vlan acceleration are updated. If
> people agree that this patch set makes sense I will go ahead and switch over
> the dozen or so drivers that would need to change.
First 11 patches applied, thanks!
^ permalink raw reply
* Re: [PATCH -next 1/2] ibmveth: Cleanup error handling inside ibmveth_open
From: David Miller @ 2010-10-21 8:34 UTC (permalink / raw)
To: dkirjanov; +Cc: rcj, netdev
In-Reply-To: <20101020142113.GA1026@hera.kernel.org>
From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Wed, 20 Oct 2010 14:21:13 +0000
> Remove duplicated code in one place.
>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Applied.
^ permalink raw reply
* Re: [PATCH -next 2/2] ibmveth: Free irq on error path
From: David Miller @ 2010-10-21 8:34 UTC (permalink / raw)
To: dkirjanov; +Cc: rcj, netdev
In-Reply-To: <20101020142151.GA1846@hera.kernel.org>
From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Wed, 20 Oct 2010 14:21:51 +0000
> Free irq on error path.
>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH 0/5] enic: updates to version 1.4.1.6
From: David Miller @ 2010-10-21 8:34 UTC (permalink / raw)
To: vkolluri; +Cc: netdev, roprabhu, dwang2
In-Reply-To: <20101020201609.26870.80308.stgit@savbu-pc100.cisco.com>
From: Vasanthy Kolluri <vkolluri@cisco.com>
Date: Wed, 20 Oct 2010 13:16:53 -0700
> The following patch series implements enic driver updates:
>
> 1/5 - Add support for multiple hardware receive queues
> 2/5 - Make firmware cognizant of the user set mac address
> 3/5 - Replace firmware devcmd CMD_ENABLE with CMD_ENABLE_WAIT
> 4/5 - Change min MTU
> 5/5 - Fix log message
>
> Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
> Signed-off-by: David Wang <dwang2@cisco.com>
All applied, thanks.
^ permalink raw reply
* Re: [PATCH 0/8] r8169 patches for net-next v2
From: David Miller @ 2010-10-21 8:35 UTC (permalink / raw)
To: sgruszka; +Cc: romieu, netdev, kirjanov
In-Reply-To: <1287649543-6569-1-git-send-email-sgruszka@redhat.com>
From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Thu, 21 Oct 2010 10:25:35 +0200
> v1 -> v2
> - update to current code and some minor changes/cleanups
> - do not return NETDEV_TX_BUSY from start_xmit when mapping fail (patch 1)
> - add missing unlikely (patch 1)
> - account tx bytes based on skb->len (patch 5)
> - new patches: changing mtu clean up, (re)init phy on resume
> - add net_ratelimit (patch 8)
>
> All patches in series was tested on RTL8111/8168B
All applied, thank you.
^ permalink raw reply
* Re: [PATCH 4/9] tproxy: added tproxy sockopt interface in the IPV6 layer
From: Jan Engelhardt @ 2010-10-21 8:39 UTC (permalink / raw)
To: KOVACS Krisztian; +Cc: netdev, netfilter-devel, Patrick McHardy, David Miller
In-Reply-To: <20101020112118.6260.78508.stgit@este.odu>
On Wednesday 2010-10-20 13:21, KOVACS Krisztian wrote:
>@@ -268,6 +268,10 @@ struct in6_flowlabel_req {
> /* RFC5082: Generalized Ttl Security Mechanism */
> #define IPV6_MINHOPCOUNT 73
>
>+#define IPV6_ORIGDSTADDR 74
>+#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
>+#define IPV6_TRANSPARENT 75
>+
Why do we actually need two names for the same thing?
^ permalink raw reply
* Re: [PATCH 1/2] r6040: fix multicast operations
From: Shawn Lin @ 2010-10-21 8:27 UTC (permalink / raw)
To: Ben Hutchings
Cc: Florian Fainelli, netdev, Marc Leclerc, Albert Chen, David Miller
In-Reply-To: <1287629751.20865.220.camel@localhost>
Dear Ben,
I help to answer your questions.
On Thu, 2010-10-21 at 03:55 +0100, Ben Hutchings wrote:
> On Wed, 2010-10-20 at 22:25 +0100, Florian Fainelli wrote:
> > This patch fixes the following issues with the r6040 NIC operating in
> > multicast:
> >
> > 1) When the IFF_ALLMULTI flag is set, we should write 0xffff to the NIC hash
> > table registers to make it process multicast traffic
> > 2) When the number of multicast address to handle is smaller than MCAST_MAX
> > we should use the NIC multicast registers MID1_{L,M,H}.
> > 3) The hashing of the address was not correct, due to an invalid substraction
> > (15 - (crc & 0x0f)) instead of (crc & 0x0f)
>
> > Reported-by: Marc Leclerc <marc-leclerc@signaturealpha.com>
> > Tested-by: Marc Leclerc <marc-leclerc@signaturealpha.com>
> > Signed-off-by: Shawn Lin <shawn@dmp.com.tw>
> > Signed-off-by: Albert Chen <albert.chen@rdc.com.tw>
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > CC: stable@kernel.org
>
> Remember you'll need to provide a different version for 2.6.27.y and
> 2.6.32.y.
>
> > ---
> > diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
> > index 68a8419..3843363 100644
> > --- a/drivers/net/r6040.c
> > +++ b/drivers/net/r6040.c
> > @@ -852,74 +852,90 @@ static void r6040_multicast_list(struct net_device *dev)
> > struct r6040_private *lp = netdev_priv(dev);
> > void __iomem *ioaddr = lp->base;
> > u16 *adrp;
> > - u16 reg;
> > unsigned long flags;
> > struct netdev_hw_addr *ha;
> > int i;
> >
> > - /* MAC Address */
> > - adrp = (u16 *)dev->dev_addr;
> > - iowrite16(adrp[0], ioaddr + MID_0L);
> > - iowrite16(adrp[1], ioaddr + MID_0M);
> > - iowrite16(adrp[2], ioaddr + MID_0H);
> > -
> > - /* Promiscous Mode */
> > spin_lock_irqsave(&lp->lock, flags);
> >
> > /* Clear AMCP & PROM bits */
> > - reg = ioread16(ioaddr) & ~0x0120;
> > - if (dev->flags & IFF_PROMISC) {
> > - reg |= 0x0020;
> > + lp->mcr0 = ioread16(ioaddr) & ~0x0120;
> > +
> > + /* Promiscuous Mode */
> > + if (dev->flags & IFF_PROMISC)
> > lp->mcr0 |= 0x0020;
> > - }
> > - /* Too many multicast addresses
> > - * accept all traffic */
> > - else if ((netdev_mc_count(dev) > MCAST_MAX) ||
> > - (dev->flags & IFF_ALLMULTI))
> > - reg |= 0x0020;
> >
> > - iowrite16(reg, ioaddr);
> > - spin_unlock_irqrestore(&lp->lock, flags);
> > + /* Enable multicast hash table function to
> > + * receive all multicast packets.
> > + */
> > + else if (dev->flags & IFF_ALLMULTI) {
> > + lp->mcr0 |= 0x0100;
>
> Please give these flags names.
>
> >
> > - /* Build the hash table */
> > - if (netdev_mc_count(dev) > MCAST_MAX) {
> > - u16 hash_table[4];
> > + for (i = 0; i < MCAST_MAX ; i++) {
> > + iowrite16(0, ioaddr + MID_1L + 8 * i);
> > + iowrite16(0, ioaddr + MID_1M + 8 * i);
> > + iowrite16(0, ioaddr + MID_1H + 8 * i);
> > + }
> > +
> > + iowrite16(0xffff, ioaddr + MAR0);
> > + iowrite16(0xffff, ioaddr + MAR1);
> > + iowrite16(0xffff, ioaddr + MAR2);
> > + iowrite16(0xffff, ioaddr + MAR3);
> > + }
> > +
> > + /* Use internal multicast address registers
> > + * if the number of multicast addresses is not greater than MCAST_MAX.
> > + */
> > + else if (netdev_mc_empty(dev)) {
> > + for (i = 0; i < MCAST_MAX ; i++) {
> > + iowrite16(0, ioaddr + MID_1L + 8 * i);
> > + iowrite16(0, ioaddr + MID_1M + 8 * i);
> > + iowrite16(0, ioaddr + MID_1H + 8 * i);
> > + }
> > + } else if (netdev_mc_count(dev) <= MCAST_MAX) {
> > + i = 0;
> > + netdev_for_each_mc_addr(ha, dev) {
> > + adrp = (u16 *) ha->addr;
> > + iowrite16(adrp[0], ioaddr + MID_1L + 8 * i);
> > + iowrite16(adrp[1], ioaddr + MID_1M + 8 * i);
> > + iowrite16(adrp[2], ioaddr + MID_1H + 8 * i);
> > + i++;
> > + }
>
> What about the unused exact match entries? And why is the empty case
> special?
Unused exact match entries? I am not sure which entries are you
mentioned.
There are five match entries in the code:
1) if (dev->flags & IFF_PROMISC)
then write a hardware flag to enable promiscuous function.
2) if (netdev_mc_count(dev) <= 3)
There are two hardware features could be used to filter multicast
frames:
[1] Three extra MAC/Multicast registers that could be used to get the
exact frames from specified multicast addresses.
[2] Multicast hash table registers.
I follow the original code to write exact multicast addresses to the
three registers when they are not greater than 3.
3) if (netdev_mc_empty(dev))
because we masked the multicast hash table flag before examine all
conditions, we only need to clear the addresses in the three
MAC/Multicast registers.
4) if (dev->flags & IFF_ALLMULTI)
then enable multicast hash table function and write 0xffff to all
multicast hash table registers.
5) else
to enablue multicast hash table and calculate corresponding bit
according to each multicast address.
>
> > + }
> > + /* Otherwise, Enable multicast hash table function. */
> > + else {
> > + u16 hash_table[4] = { 0, };
> > u32 crc;
> >
> > - for (i = 0; i < 4; i++)
> > - hash_table[i] = 0;
> > + lp->mcr0 |= 0x0100;
> >
> > + for (i = 0; i < MCAST_MAX ; i++) {
> > + iowrite16(0, ioaddr + MID_1L + 8 * i);
> > + iowrite16(0, ioaddr + MID_1M + 8 * i);
> > + iowrite16(0, ioaddr + MID_1H + 8 * i);
> > + }
> > +
> > + /* Build multicast hash table */
> > netdev_for_each_mc_addr(ha, dev) {
> > char *addrs = ha->addr;
> >
> > if (!(*addrs & 1))
> > continue;
> >
> > - crc = ether_crc_le(6, addrs);
> > + crc = ether_crc(ETH_ALEN, addrs);
>
> You're reversing the order of bits in the CRC, which is not mentioned in
> the commit message; are you sure that's right?
This hash alogorithm is provided by RDC's engineers.
We also verified on different hardware platforms.
I will double confirm it with RDC's engineers.
>
> > crc >>= 26;
> > - hash_table[crc >> 4] |= 1 << (15 - (crc & 0xf));
> > + hash_table[crc >> 4] |= 1 << (crc & 0xf);
> > }
> > +
> > /* Fill the MAC hash tables with their values */
> > iowrite16(hash_table[0], ioaddr + MAR0);
> > iowrite16(hash_table[1], ioaddr + MAR1);
> > iowrite16(hash_table[2], ioaddr + MAR2);
> > iowrite16(hash_table[3], ioaddr + MAR3);
> > }
> > - /* Multicast Address 1~4 case */
> > - i = 0;
> > - netdev_for_each_mc_addr(ha, dev) {
> > - if (i < MCAST_MAX) {
> > - adrp = (u16 *) ha->addr;
> > - iowrite16(adrp[0], ioaddr + MID_1L + 8 * i);
> > - iowrite16(adrp[1], ioaddr + MID_1M + 8 * i);
> > - iowrite16(adrp[2], ioaddr + MID_1H + 8 * i);
> > - } else {
> > - iowrite16(0xffff, ioaddr + MID_1L + 8 * i);
> > - iowrite16(0xffff, ioaddr + MID_1M + 8 * i);
> > - iowrite16(0xffff, ioaddr + MID_1H + 8 * i);
> > - }
>
> This conflicts with my patch in
> <http://article.gmane.org/gmane.linux.network/174926> which Dave has
> already applied (but not pushed out).
>
> Ben.
>
> > - i++;
> > - }
> > + iowrite16(lp->mcr0, ioaddr);
> > +
> > + spin_unlock_irqrestore(&lp->lock, flags);
> > }
> >
> > static void netdev_get_drvinfo(struct net_device *dev,
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> >
>
Hope some issues have been clarified.
--
Regards,
Shawn Lin
===========================================================================================
The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email.
If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately.
Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of DM&P Group is strictly prohibited; and any information in this email irrelevant to the official business of DM&P Group shall be deemed as neither given nor endorsed by DM&P Group.
===========================================================================================
^ permalink raw reply
* Re: [PATCH 6/9] tproxy: added IPv6 socket lookup function to nf_tproxy_core
From: Jan Engelhardt @ 2010-10-21 8:42 UTC (permalink / raw)
To: KOVACS Krisztian; +Cc: netdev, netfilter-devel, Patrick McHardy, David Miller
In-Reply-To: <20101020112118.6260.89471.stgit@este.odu>
On Wednesday 2010-10-20 13:21, KOVACS Krisztian wrote:
>+
>+ pr_debug("tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n",
>+ protocol, saddr, ntohs(sport), daddr, ntohs(dport), lookup_type, sk);
Shorts should preferably be used with %hd/%hu.
^ 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