* Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.
From: Alan Cox @ 2012-05-19 12:30 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: Ondrej Zary, davem, netdev
In-Reply-To: <20120518220305.GC15256@windriver.com>
> You miss the point. We've got someone with a modern i7 machine who is
> getting confused by seeing messages from some ancient 3c501 driver,
> but he doesn't have the context to know it is ancient and the message
> is a red herring. Will it fix a distro's broken init that tries to
> modprobe everything? No. Will it help by not muddying the waters
> with meaningless printk from 3c501 that confuse users? Yes.
That seems a totally bogus reason for removing stuff. The kernel cannot
manage every possible distribution and user screw up. They have more
variety so they will always win the battle.
Removing it because nobody is running one even in a museum might be a
good reason, but then the driver still works fine.
Also btw: the 3c501 isn't all TTL it's integrated. The 3c500 is all TTL
and an amazing beast, its so big it won't fit a 16bit slot as it has to
drop down after the connector to get all the chips on.
(and yes I have a 3c500)
However I don't think this is the right way to tackle the ethernet
history situation. As with MCA we should pull *all* the real historical
interest only bits in one go so it's immediately obvious where the
break point is for all devices.
That or we'll replace confused distros and uses with confused ancient
machine owners, and the latter can be far more persistent and
irritating ;)
So should we dump ISA ?
Alan
^ permalink raw reply
* [PATCH 1/1] net:ipv6:fixed space issues relating to operators.
From: Jeffrin Jose @ 2012-05-19 11:59 UTC (permalink / raw)
To: davem, kuznet, jmorris, yoshfuji, kaber; +Cc: netdev, linux-kernel, ahiliation
Fixed space issues relating to operators found by
checkpatch.pl tool in net/ipv6/udp.c
Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
net/ipv6/udp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 847253c..f05099f 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -349,7 +349,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
bool slow;
if (addr_len)
- *addr_len=sizeof(struct sockaddr_in6);
+ *addr_len = sizeof(struct sockaddr_in6);
if (flags & MSG_ERRQUEUE)
return ipv6_recv_error(sk, msg, len);
@@ -1379,7 +1379,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
* do checksum of UDP packets sent as multiple IP fragments.
*/
offset = skb_checksum_start_offset(skb);
- csum = skb_checksum(skb, offset, skb->len- offset, 0);
+ csum = skb_checksum(skb, offset, skb->len - offset, 0);
offset += skb->csum_offset;
*(__sum16 *)(skb->data + offset) = csum_fold(csum);
skb->ip_summed = CHECKSUM_NONE;
--
1.7.10
^ permalink raw reply related
* [PATCH 1/1] net:ipv6:fixed a trailing white space issue.
From: Jeffrin Jose @ 2012-05-19 11:45 UTC (permalink / raw)
To: davem, kuznet, jmorris, yoshfuji, kaber; +Cc: netdev, linux-kernel, ahiliation
Fixed a trailing white space issue found by
checkpatch.pl tool in net/ipv6/udp.c
Signed-off-by: Jeffrin Jose <ahiliation@yahoo.co.in>
---
net/ipv6/udp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index c1d91a7..847253c 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -103,7 +103,7 @@ int udp_v6_get_port(struct sock *sk, unsigned short snum)
{
unsigned int hash2_nulladdr =
udp6_portaddr_hash(sock_net(sk), &in6addr_any, snum);
- unsigned int hash2_partial =
+ unsigned int hash2_partial =
udp6_portaddr_hash(sock_net(sk), &inet6_sk(sk)->rcv_saddr, 0);
/* precompute partial secondary hash */
--
1.7.10
^ permalink raw reply related
* Hello
From: ''Dr. Ma Weihua'' @ 2012-05-19 10:36 UTC (permalink / raw)
To: Recipients
Hello to you,
My letter may come to you as a surprise but I had to contact you in this manner due to the importance and urgent business situation I have at hand. I need you as a partner in a lucratice business which involve the transfer of $32,500,000.00 U.S Dollars from China to your country. We shall share in a ratio to be agreed by both of us when the deal is completed. Please reply for more information if you are interested in doing business with me and also getting to know each other better before proceeding.
Kind Regards,
Dr. Ma Weihua
^ permalink raw reply
* Re: [PATCH] net : fix for dst_gc_task not getting scheduled if __dst_free() is called consistently
From: Eric Dumazet @ 2012-05-19 10:04 UTC (permalink / raw)
To: b15745; +Cc: netdev
In-Reply-To: <1337420654-28200-1-git-send-email-b15745@freescale.com>
On Sat, 2012-05-19 at 04:44 -0500, b15745@freescale.com wrote:
> From: Rajan Gupta <b15745@freescale.com>
>
> dst_gc_work is cancelled and again rescheduled in __ds_free(). In case
> __dsf_free() is consistently called dst_gc_work will never get called resulting in
> memory not getting freed at all until one stops calling __dst_free
> Signed-off-by: Rajan Gupta <b15745@freescale.com>
> ---
> net/core/dst.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/core/dst.c b/net/core/dst.c
> index 8246d47..6820206 100644
> --- a/net/core/dst.c
> +++ b/net/core/dst.c
> @@ -215,7 +215,6 @@ void __dst_free(struct dst_entry *dst)
> if (dst_garbage.timer_inc > DST_GC_INC) {
> dst_garbage.timer_inc = DST_GC_INC;
> dst_garbage.timer_expires = DST_GC_MIN;
> - cancel_delayed_work(&dst_gc_work);
> schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires);
> }
> spin_unlock_bh(&dst_garbage.lock);
Strange, I never met this....
Since "if (dst_garbage.timer_inc > DST_GC_INC)" will be false if
timer_inc is DST_GC_INC.
^ permalink raw reply
* [PATCH] net : fix for dst_gc_task not getting scheduled if __dst_free() is called consistently
From: b15745 @ 2012-05-19 9:44 UTC (permalink / raw)
To: netdev; +Cc: Rajan Gupta
From: Rajan Gupta <b15745@freescale.com>
dst_gc_work is cancelled and again rescheduled in __ds_free(). In case
__dsf_free() is consistently called dst_gc_work will never get called resulting in
memory not getting freed at all until one stops calling __dst_free
Signed-off-by: Rajan Gupta <b15745@freescale.com>
---
net/core/dst.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index 8246d47..6820206 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -215,7 +215,6 @@ void __dst_free(struct dst_entry *dst)
if (dst_garbage.timer_inc > DST_GC_INC) {
dst_garbage.timer_inc = DST_GC_INC;
dst_garbage.timer_expires = DST_GC_MIN;
- cancel_delayed_work(&dst_gc_work);
schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires);
}
spin_unlock_bh(&dst_garbage.lock);
--
1.7.9.5
^ permalink raw reply related
* [PATCH] net : fix for dst_gc_task not getting scheduled if __dst_free() is called consistently
From: rajan.gupta @ 2012-05-19 9:41 UTC (permalink / raw)
To: netdev, kuznet; +Cc: Rajan Gupta
From: Rajan Gupta <rajan.gupta@freescale.com>
dst_gc_work is cancelled and again rescheduled in __ds_free(). In case
__dsf_free() is consistently called dst_gc_work will never get called resulting in
memory not getting freed at all until one stops calling __dst_free
Signed-off-by: Rajan Gupta <rajan.gupta@freescale.com>
---
net/core/dst.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index 8246d47..6820206 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -215,7 +215,6 @@ void __dst_free(struct dst_entry *dst)
if (dst_garbage.timer_inc > DST_GC_INC) {
dst_garbage.timer_inc = DST_GC_INC;
dst_garbage.timer_expires = DST_GC_MIN;
- cancel_delayed_work(&dst_gc_work);
schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires);
}
spin_unlock_bh(&dst_garbage.lock);
--
1.7.9.5
^ permalink raw reply related
* [PATCH] net : fix for dst_gc_task not getting scheduled if __dst_free() is called consistently
From: rajan.gupta @ 2012-05-19 9:39 UTC (permalink / raw)
To: "netdev; +Cc: Rajan Gupta
From: Rajan Gupta <rajan.gupta@freescale.com>
dst_gc_work is cancelled and again rescheduled in __ds_free(). In case
__dsf_free() is consistently called dst_gc_work will never get called resulting in
memory not getting freed at all until one stops calling __dst_free
Signed-off-by: Rajan Gupta <rajan.gupta@freescale.com>
---
net/core/dst.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index 8246d47..6820206 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -215,7 +215,6 @@ void __dst_free(struct dst_entry *dst)
if (dst_garbage.timer_inc > DST_GC_INC) {
dst_garbage.timer_inc = DST_GC_INC;
dst_garbage.timer_expires = DST_GC_MIN;
- cancel_delayed_work(&dst_gc_work);
schedule_delayed_work(&dst_gc_work, dst_garbage.timer_expires);
}
spin_unlock_bh(&dst_garbage.lock);
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.
From: Ondrej Zary @ 2012-05-19 8:58 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: davem, netdev, Alan Cox
In-Reply-To: <20120518220305.GC15256@windriver.com>
On Saturday 19 May 2012 00:03:06 Paul Gortmaker wrote:
> [Re: [PATCH net-next] drivers/net: delete old 8bit ISA 3c501 driver.] On
18/05/2012 (Fri 20:16) Ondrej Zary wrote:
> > On Friday 18 May 2012 19:39:29 Paul Gortmaker wrote:
> > > It was amusing that linux was able to make use of this 1980's
> > > technology on machines long past its intended lifespan, but
> > > it probably should go now -- it is causing issues in some
> > > distros[1], and while that might be fixable, it is just not
> > > worth it.
> > >
> > > [1]
> > > http://www.linuxquestions.org/questions/linux-networking-3/3com-3c501-c
> > >ard- not-detecting-934344/
> >
> > That looks like a bug elsewhere and removing this driver will not fix it.
>
> You miss the point. We've got someone with a modern i7 machine who is
> getting confused by seeing messages from some ancient 3c501 driver, but
> he doesn't have the context to know it is ancient and the message is a
> red herring. Will it fix a distro's broken init that tries to modprobe
> everything? No. Will it help by not muddying the waters with
> meaningless printk from 3c501 that confuse users? Yes.
Are you going to remove all drivers that complain that the HW is not present
because some broken script is trying to modprobe them all? Or only the first
one? 3c501 is probably the first in alphabet. You remove that and the script
will modprobe 3c503 then...
--
Ondrej Zary
^ permalink raw reply
* Re: [PATCH net-next] tg3: use netdev_alloc_frag() API
From: Eric Dumazet @ 2012-05-19 8:17 UTC (permalink / raw)
To: David Miller; +Cc: netdev, mcarlson, mchan
In-Reply-To: <20120519.040101.508727755785767140.davem@davemloft.net>
On Sat, 2012-05-19 at 04:01 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Sat, 19 May 2012 09:31:41 +0200
>
> > Indeed, there is an extra space at the end of one line in my tree... ???
> >
> > atomic_add((PAGE_SIZE / TG3_FRAGSIZE) - 1, &page->_count); <HERE>
>
> I silently fix trailing whitespace errors in your patches.
OK, good to know ;)
^ permalink raw reply
* Re: [PATCH net-next] ipv6: disable GSO on sockets hitting dst_allfrag
From: David Miller @ 2012-05-19 8:03 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, tore
In-Reply-To: <1337413904.7029.93.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 09:51:44 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> If the allfrag feature has been set on a host route (due to an ICMPv6
> Packet Too Big received indicating a MTU of less than 1280), we hit a
> very slow behavior in TCP stack, because all big packets are dropped and
> only a retransmit timer is able to push one MSS frame every 200 ms.
>
> One way to handle this is to disable GSO on the socket the first time a
> super packet is dropped. Adding a specific dst_allfrag() in the fast
> path is probably overkill since the dst_allfrag() case almost never
> happen.
>
> Result on netperf TCP_STREAM, one flow :
>
> Before : 60 kbit/sec
> After : 1.6 Gbit/sec
>
> Reported-by: Tore Anderson <tore@fud.no>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Tested-by: Tore Anderson <tore@fud.no>
Applied.
^ permalink raw reply
* Re: [PATCH v2 net-next] tg3: use netdev_alloc_frag() API
From: David Miller @ 2012-05-19 8:03 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, mcarlson, mchan
In-Reply-To: <1337412819.7029.81.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 09:33:39 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Update our reference driver to use netdev_alloc_frag() API instead of
> the temporary custom allocator I introduced in commit 8d4057a938
> (tg3: provide frags as skb head)
>
> This removes the memory leak we had, since we could leak one page at
> device dismantle.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] tg3: use netdev_alloc_frag() API
From: David Miller @ 2012-05-19 8:01 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, mcarlson, mchan
In-Reply-To: <1337412701.7029.79.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 09:31:41 +0200
> Indeed, there is an extra space at the end of one line in my tree... ???
>
> atomic_add((PAGE_SIZE / TG3_FRAGSIZE) - 1, &page->_count); <HERE>
I silently fix trailing whitespace errors in your patches.
^ permalink raw reply
* [PATCH net-next] ipv6: disable GSO on sockets hitting dst_allfrag
From: Eric Dumazet @ 2012-05-19 7:51 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Tore Anderson
From: Eric Dumazet <edumazet@google.com>
If the allfrag feature has been set on a host route (due to an ICMPv6
Packet Too Big received indicating a MTU of less than 1280), we hit a
very slow behavior in TCP stack, because all big packets are dropped and
only a retransmit timer is able to push one MSS frame every 200 ms.
One way to handle this is to disable GSO on the socket the first time a
super packet is dropped. Adding a specific dst_allfrag() in the fast
path is probably overkill since the dst_allfrag() case almost never
happen.
Result on netperf TCP_STREAM, one flow :
Before : 60 kbit/sec
After : 1.6 Gbit/sec
Reported-by: Tore Anderson <tore@fud.no>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Tore Anderson <tore@fud.no>
---
Sorry for the delay, thanks Tore for the gentle reminders ;)
( http://thread.gmane.org/gmane.linux.network/217998/focus=218080 )
net/ipv6/ip6_output.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 3dc633f..d99fdc6 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -643,7 +643,10 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
/* We must not fragment if the socket is set to force MTU discovery
* or if the skb it not generated by a local socket.
*/
- if (!skb->local_df && skb->len > mtu) {
+ if (unlikely(!skb->local_df && skb->len > mtu)) {
+ if (skb->sk && dst_allfrag(skb_dst(skb)))
+ sk_nocaps_add(skb->sk, NETIF_F_GSO_MASK);
+
skb->dev = skb_dst(skb)->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
^ permalink raw reply related
* [PATCH v2 net-next] tg3: use netdev_alloc_frag() API
From: Eric Dumazet @ 2012-05-19 7:33 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Matt Carlson, Michael Chan
In-Reply-To: <1337411749.7029.77.camel@edumazet-glaptop>
From: Eric Dumazet <edumazet@google.com>
Update our reference driver to use netdev_alloc_frag() API instead of
the temporary custom allocator I introduced in commit 8d4057a938
(tg3: provide frags as skb head)
This removes the memory leak we had, since we could leak one page at
device dismantle.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Matt Carlson <mcarlson@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 38 +++-----------------------
drivers/net/ethernet/broadcom/tg3.h | 2 -
2 files changed, 5 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 39b92f5..d55df32 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -195,15 +195,6 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
#define TG3_RX_OFFSET(tp) (NET_SKB_PAD)
#endif
-/* This driver uses the new build_skb() API providing a frag as skb->head
- * This strategy permits better GRO aggregation, better TCP coalescing, and
- * better splice() implementation (avoids a copy from head to a page), at
- * minimal memory cost.
- * In this 2048 bytes block, we have enough room to store the MTU=1500 frame
- * and the struct skb_shared_info.
- */
-#define TG3_FRAGSIZE 2048
-
/* minimum number of free TX descriptors required to wake up TX process */
#define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4)
#define TG3_TX_BD_DMA_MAX_2K 2048
@@ -5631,25 +5622,6 @@ static void tg3_tx(struct tg3_napi *tnapi)
}
}
-static void *tg3_frag_alloc(struct tg3_rx_prodring_set *tpr)
-{
- void *data;
-
- if (tpr->rx_page_size < TG3_FRAGSIZE) {
- struct page *page = alloc_page(GFP_ATOMIC);
-
- if (!page)
- return NULL;
- atomic_add((PAGE_SIZE / TG3_FRAGSIZE) - 1, &page->_count);
- tpr->rx_page_addr = page_address(page);
- tpr->rx_page_size = PAGE_SIZE;
- }
- data = tpr->rx_page_addr;
- tpr->rx_page_addr += TG3_FRAGSIZE;
- tpr->rx_page_size -= TG3_FRAGSIZE;
- return data;
-}
-
static void tg3_frag_free(bool is_frag, void *data)
{
if (is_frag)
@@ -5668,7 +5640,7 @@ static void tg3_rx_data_free(struct tg3 *tp, struct ring_info *ri, u32 map_sz)
pci_unmap_single(tp->pdev, dma_unmap_addr(ri, mapping),
map_sz, PCI_DMA_FROMDEVICE);
- tg3_frag_free(skb_size <= TG3_FRAGSIZE, ri->data);
+ tg3_frag_free(skb_size <= PAGE_SIZE, ri->data);
ri->data = NULL;
}
@@ -5721,9 +5693,9 @@ static int tg3_alloc_rx_data(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
*/
skb_size = SKB_DATA_ALIGN(data_size + TG3_RX_OFFSET(tp)) +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
- if (skb_size <= TG3_FRAGSIZE) {
- data = tg3_frag_alloc(tpr);
- *frag_size = TG3_FRAGSIZE;
+ if (skb_size <= PAGE_SIZE) {
+ data = netdev_alloc_frag(skb_size);
+ *frag_size = skb_size;
} else {
data = kmalloc(skb_size, GFP_ATOMIC);
*frag_size = 0;
@@ -5736,7 +5708,7 @@ static int tg3_alloc_rx_data(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
data_size,
PCI_DMA_FROMDEVICE);
if (unlikely(pci_dma_mapping_error(tp->pdev, mapping))) {
- tg3_frag_free(skb_size <= TG3_FRAGSIZE, data);
+ tg3_frag_free(skb_size <= PAGE_SIZE, data);
return -EIO;
}
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 7c85545..93865f8 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2815,8 +2815,6 @@ struct tg3_rx_prodring_set {
struct ring_info *rx_jmb_buffers;
dma_addr_t rx_std_mapping;
dma_addr_t rx_jmb_mapping;
- void *rx_page_addr;
- unsigned int rx_page_size;
};
#define TG3_IRQ_MAX_VECS_RSS 5
^ permalink raw reply related
* Re: [PATCH net-next] tg3: use netdev_alloc_frag() API
From: Eric Dumazet @ 2012-05-19 7:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev, mcarlson, mchan
In-Reply-To: <20120519.031914.1744866102736414778.davem@davemloft.net>
On Sat, 2012-05-19 at 03:19 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Sat, 19 May 2012 09:15:49 +0200
>
> > From: Eric Dumazet <edumazet@google.com>
> >
> > Update our reference driver to use netdev_alloc_frag() API instead of
> > the temporary custom allocator I introduced in commit 8d4057a938
> > (tg3: provide frags as skb head)
> >
> > This removes the memory leak we had, since we could leak one page at
> > device dismantle.
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
>
> Hmmm, doesn't apply cleanly to net-next for some reason:
>
> [davem@drr net-next]$ git am --signoff net-next-tg3-use-netdev_alloc_frag-API.patch
> Applying: tg3: use netdev_alloc_frag() API
> error: patch failed: drivers/net/ethernet/broadcom/tg3.c:5631
> error: drivers/net/ethernet/broadcom/tg3.c: patch does not apply
> Patch failed at 0001 tg3: use netdev_alloc_frag() API
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
Indeed, there is an extra space at the end of one line in my tree... ???
atomic_add((PAGE_SIZE / TG3_FRAGSIZE) - 1, &page->_count); <HERE>
I submit a v2 immediately.
Sorry
^ permalink raw reply
* Re: [PATCH net-next] tg3: use netdev_alloc_frag() API
From: David Miller @ 2012-05-19 7:19 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, mcarlson, mchan
In-Reply-To: <1337411749.7029.77.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 09:15:49 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Update our reference driver to use netdev_alloc_frag() API instead of
> the temporary custom allocator I introduced in commit 8d4057a938
> (tg3: provide frags as skb head)
>
> This removes the memory leak we had, since we could leak one page at
> device dismantle.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Hmmm, doesn't apply cleanly to net-next for some reason:
[davem@drr net-next]$ git am --signoff net-next-tg3-use-netdev_alloc_frag-API.patch
Applying: tg3: use netdev_alloc_frag() API
error: patch failed: drivers/net/ethernet/broadcom/tg3.c:5631
error: drivers/net/ethernet/broadcom/tg3.c: patch does not apply
Patch failed at 0001 tg3: use netdev_alloc_frag() API
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
^ permalink raw reply
* [PATCH net-next] tg3: use netdev_alloc_frag() API
From: Eric Dumazet @ 2012-05-19 7:15 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Matt Carlson, Michael Chan
From: Eric Dumazet <edumazet@google.com>
Update our reference driver to use netdev_alloc_frag() API instead of
the temporary custom allocator I introduced in commit 8d4057a938
(tg3: provide frags as skb head)
This removes the memory leak we had, since we could leak one page at
device dismantle.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Matt Carlson <mcarlson@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
---
drivers/net/ethernet/broadcom/tg3.c | 38 +++-----------------------
drivers/net/ethernet/broadcom/tg3.h | 2 -
2 files changed, 5 insertions(+), 35 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 4230e70..d55df32 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -195,15 +195,6 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
#define TG3_RX_OFFSET(tp) (NET_SKB_PAD)
#endif
-/* This driver uses the new build_skb() API providing a frag as skb->head
- * This strategy permits better GRO aggregation, better TCP coalescing, and
- * better splice() implementation (avoids a copy from head to a page), at
- * minimal memory cost.
- * In this 2048 bytes block, we have enough room to store the MTU=1500 frame
- * and the struct skb_shared_info.
- */
-#define TG3_FRAGSIZE 2048
-
/* minimum number of free TX descriptors required to wake up TX process */
#define TG3_TX_WAKEUP_THRESH(tnapi) ((tnapi)->tx_pending / 4)
#define TG3_TX_BD_DMA_MAX_2K 2048
@@ -5631,25 +5622,6 @@ static void tg3_tx(struct tg3_napi *tnapi)
}
}
-static void *tg3_frag_alloc(struct tg3_rx_prodring_set *tpr)
-{
- void *data;
-
- if (tpr->rx_page_size < TG3_FRAGSIZE) {
- struct page *page = alloc_page(GFP_ATOMIC);
-
- if (!page)
- return NULL;
- atomic_add((PAGE_SIZE / TG3_FRAGSIZE) - 1, &page->_count);
- tpr->rx_page_addr = page_address(page);
- tpr->rx_page_size = PAGE_SIZE;
- }
- data = tpr->rx_page_addr;
- tpr->rx_page_addr += TG3_FRAGSIZE;
- tpr->rx_page_size -= TG3_FRAGSIZE;
- return data;
-}
-
static void tg3_frag_free(bool is_frag, void *data)
{
if (is_frag)
@@ -5668,7 +5640,7 @@ static void tg3_rx_data_free(struct tg3 *tp, struct ring_info *ri, u32 map_sz)
pci_unmap_single(tp->pdev, dma_unmap_addr(ri, mapping),
map_sz, PCI_DMA_FROMDEVICE);
- tg3_frag_free(skb_size <= TG3_FRAGSIZE, ri->data);
+ tg3_frag_free(skb_size <= PAGE_SIZE, ri->data);
ri->data = NULL;
}
@@ -5721,9 +5693,9 @@ static int tg3_alloc_rx_data(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
*/
skb_size = SKB_DATA_ALIGN(data_size + TG3_RX_OFFSET(tp)) +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
- if (skb_size <= TG3_FRAGSIZE) {
- data = tg3_frag_alloc(tpr);
- *frag_size = TG3_FRAGSIZE;
+ if (skb_size <= PAGE_SIZE) {
+ data = netdev_alloc_frag(skb_size);
+ *frag_size = skb_size;
} else {
data = kmalloc(skb_size, GFP_ATOMIC);
*frag_size = 0;
@@ -5736,7 +5708,7 @@ static int tg3_alloc_rx_data(struct tg3 *tp, struct tg3_rx_prodring_set *tpr,
data_size,
PCI_DMA_FROMDEVICE);
if (unlikely(pci_dma_mapping_error(tp->pdev, mapping))) {
- tg3_frag_free(skb_size <= TG3_FRAGSIZE, data);
+ tg3_frag_free(skb_size <= PAGE_SIZE, data);
return -EIO;
}
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h
index 7c85545..93865f8 100644
--- a/drivers/net/ethernet/broadcom/tg3.h
+++ b/drivers/net/ethernet/broadcom/tg3.h
@@ -2815,8 +2815,6 @@ struct tg3_rx_prodring_set {
struct ring_info *rx_jmb_buffers;
dma_addr_t rx_std_mapping;
dma_addr_t rx_jmb_mapping;
- void *rx_page_addr;
- unsigned int rx_page_size;
};
#define TG3_IRQ_MAX_VECS_RSS 5
^ permalink raw reply related
* Re: [PATCH net-next] net: napi_frags_skb() is static
From: David Miller @ 2012-05-19 6:51 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1337410146.7029.71.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 08:49:06 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> No need to export napi_frags_skb()
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
^ permalink raw reply
* [PATCH net-next] net: napi_frags_skb() is static
From: Eric Dumazet @ 2012-05-19 6:49 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
No need to export napi_frags_skb()
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
include/linux/netdevice.h | 1 -
net/core/dev.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9c710bd..e7fd468 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2142,7 +2142,6 @@ extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
extern gro_result_t napi_frags_finish(struct napi_struct *napi,
struct sk_buff *skb,
gro_result_t ret);
-extern struct sk_buff * napi_frags_skb(struct napi_struct *napi);
extern gro_result_t napi_gro_frags(struct napi_struct *napi);
static inline void napi_free_frags(struct napi_struct *napi)
diff --git a/net/core/dev.c b/net/core/dev.c
index 33684b6..cd09819 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3602,7 +3602,7 @@ gro_result_t napi_frags_finish(struct napi_struct *napi, struct sk_buff *skb,
}
EXPORT_SYMBOL(napi_frags_finish);
-struct sk_buff *napi_frags_skb(struct napi_struct *napi)
+static struct sk_buff *napi_frags_skb(struct napi_struct *napi)
{
struct sk_buff *skb = napi->skb;
struct ethhdr *eth;
@@ -3637,7 +3637,6 @@ struct sk_buff *napi_frags_skb(struct napi_struct *napi)
out:
return skb;
}
-EXPORT_SYMBOL(napi_frags_skb);
gro_result_t napi_gro_frags(struct napi_struct *napi)
{
^ permalink raw reply related
* Re: ppp/l2tp doing oversized allocations ?
From: David Miller @ 2012-05-19 6:34 UTC (permalink / raw)
To: eric.dumazet; +Cc: davej, netdev, kernel-team, edumazet
In-Reply-To: <1337408730.7029.69.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 08:25:30 +0200
> On Sat, 2012-05-19 at 07:01 +0200, Eric Dumazet wrote:
>> On Sat, 2012-05-19 at 00:46 -0400, David Miller wrote:
>>
>> > So it's ESP encapsulated IPSEC over L2tp.
>> >
>> > Eric, I wonder if session->hdr_len can take on undesirable values and
>> > thus trip up the skb COW'ing calculations you added?
>>
>> I take a look, thanks
>>
>
> hdr_len is u16, I have no idea how we can reach MAX_ORDER page
> allocations... (more than 2 Mbytes...)
>
> Maybe a memory corruption, or a signed/unsigned mismatch.
Yes, the trace looks really weird to me too.
It's also possible that the big length comes accidently from IPSEC
too.
If this can be readily reproduced, we can construct some debugging
patches for the user to try.
^ permalink raw reply
* Re: [PATCH net-next] ppp: avoid false drop_monitor false positives
From: David Miller @ 2012-05-19 6:33 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1337408580.7029.66.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 19 May 2012 08:23:00 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Call consume_skb() in place of kfree_skb() were appropriate.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
^ permalink raw reply
* Re: ppp/l2tp doing oversized allocations ?
From: Eric Dumazet @ 2012-05-19 6:25 UTC (permalink / raw)
To: David Miller; +Cc: davej, netdev, kernel-team, edumazet
In-Reply-To: <1337403685.7029.63.camel@edumazet-glaptop>
On Sat, 2012-05-19 at 07:01 +0200, Eric Dumazet wrote:
> On Sat, 2012-05-19 at 00:46 -0400, David Miller wrote:
>
> > So it's ESP encapsulated IPSEC over L2tp.
> >
> > Eric, I wonder if session->hdr_len can take on undesirable values and
> > thus trip up the skb COW'ing calculations you added?
>
> I take a look, thanks
>
hdr_len is u16, I have no idea how we can reach MAX_ORDER page
allocations... (more than 2 Mbytes...)
Maybe a memory corruption, or a signed/unsigned mismatch.
^ permalink raw reply
* [PATCH net-next] ppp: avoid false drop_monitor false positives
From: Eric Dumazet @ 2012-05-19 6:23 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
Call consume_skb() in place of kfree_skb() were appropriate.
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
drivers/net/ppp/ppp_async.c | 2 +-
drivers/net/ppp/ppp_generic.c | 14 +++++++-------
drivers/net/ppp/ppp_synctty.c | 4 ++--
drivers/net/ppp/pppoe.c | 6 ++++--
drivers/net/ppp/pptp.c | 2 +-
5 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c
index af95a98..a031f6b 100644
--- a/drivers/net/ppp/ppp_async.c
+++ b/drivers/net/ppp/ppp_async.c
@@ -613,7 +613,7 @@ ppp_async_encode(struct asyncppp *ap)
*buf++ = PPP_FLAG;
ap->olim = buf;
- kfree_skb(ap->tpkt);
+ consume_skb(ap->tpkt);
ap->tpkt = NULL;
return 1;
}
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 21d7151..5c05572 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1092,13 +1092,13 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
new_skb->data, skb->len + 2,
compressor_skb_size);
if (len > 0 && (ppp->flags & SC_CCP_UP)) {
- kfree_skb(skb);
+ consume_skb(skb);
skb = new_skb;
skb_put(skb, len);
skb_pull(skb, 2); /* pull off A/C bytes */
} else if (len == 0) {
/* didn't compress, or CCP not up yet */
- kfree_skb(new_skb);
+ consume_skb(new_skb);
new_skb = skb;
} else {
/*
@@ -1112,7 +1112,7 @@ pad_compress_skb(struct ppp *ppp, struct sk_buff *skb)
if (net_ratelimit())
netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
kfree_skb(skb);
- kfree_skb(new_skb);
+ consume_skb(new_skb);
new_skb = NULL;
}
return new_skb;
@@ -1178,7 +1178,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
!(ppp->flags & SC_NO_TCP_CCID));
if (cp == skb->data + 2) {
/* didn't compress */
- kfree_skb(new_skb);
+ consume_skb(new_skb);
} else {
if (cp[0] & SL_TYPE_COMPRESSED_TCP) {
proto = PPP_VJC_COMP;
@@ -1187,7 +1187,7 @@ ppp_send_frame(struct ppp *ppp, struct sk_buff *skb)
proto = PPP_VJC_UNCOMP;
cp[0] = skb->data[2];
}
- kfree_skb(skb);
+ consume_skb(skb);
skb = new_skb;
cp = skb_put(skb, len + 2);
cp[0] = 0;
@@ -1703,7 +1703,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
}
skb_reserve(ns, 2);
skb_copy_bits(skb, 0, skb_put(ns, skb->len), skb->len);
- kfree_skb(skb);
+ consume_skb(skb);
skb = ns;
}
else
@@ -1851,7 +1851,7 @@ ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb)
goto err;
}
- kfree_skb(skb);
+ consume_skb(skb);
skb = ns;
skb_put(skb, len);
skb_pull(skb, 2); /* pull off the A/C bytes */
diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c
index 55e466c..1a12033 100644
--- a/drivers/net/ppp/ppp_synctty.c
+++ b/drivers/net/ppp/ppp_synctty.c
@@ -588,7 +588,7 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)
skb_reserve(npkt,2);
skb_copy_from_linear_data(skb,
skb_put(npkt, skb->len), skb->len);
- kfree_skb(skb);
+ consume_skb(skb);
skb = npkt;
}
skb_push(skb,2);
@@ -656,7 +656,7 @@ ppp_sync_push(struct syncppp *ap)
if (sent < ap->tpkt->len) {
tty_stuffed = 1;
} else {
- kfree_skb(ap->tpkt);
+ consume_skb(ap->tpkt);
ap->tpkt = NULL;
clear_bit(XMIT_FULL, &ap->xmit_flags);
done = 1;
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index dd15b8f..cbf7047 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -984,8 +984,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
if (skb) {
total_len = min_t(size_t, total_len, skb->len);
error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
- if (error == 0)
- error = total_len;
+ if (error == 0) {
+ consume_skb(skb);
+ return total_len;
+ }
}
kfree_skb(skb);
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 72b50f5..1c98321 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -209,7 +209,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
}
if (skb->sk)
skb_set_owner_w(new_skb, skb->sk);
- kfree_skb(skb);
+ consume_skb(skb);
skb = new_skb;
}
^ permalink raw reply related
* Re: [PATCH v2 4/5] staging: octeon_ethernet: Convert to use device tree.
From: Grant Likely @ 2012-05-19 6:07 UTC (permalink / raw)
To: David Daney, linux-mips, ralf, devicetree-discuss, Rob Herring
Cc: linux-kernel, David Daney, netdev, Greg Kroah-Hartman,
David S. Miller
In-Reply-To: <1335489630-27017-5-git-send-email-ddaney.cavm@gmail.com>
On Thu, 26 Apr 2012 18:20:29 -0700, David Daney <ddaney.cavm@gmail.com> wrote:
> From: David Daney <david.daney@cavium.com>
>
> Get MAC address and PHY connection from the device tree. The driver
> is converted to a platform driver.
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: David Daney <david.daney@cavium.com>
> Cc: netdev@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: David S. Miller <davem@davemloft.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
^ 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