diff mbox

Re: PACKET_TX_RING: packet size is too long

Message ID 20091015201028.GA9780@boogie.lpds.sztaki.hu
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Gabor Gombas Oct. 15, 2009, 8:10 p.m. UTC
Currently PACKET_TX_RING forces certain amount of every frame to remain
unused. This probably originates from an early version of the
PACKET_TX_RING patch that in fact used the extra space when the (since
removed) CONFIG_PACKET_MMAP_ZERO_COPY option was enabled. The current
code does not make any use of this extra space.

This patch removes the extra space reservation and lets userspace make
use of the full frame size.

Signed-off-by: Gabor Gombas <gombasg@sztaki.hu>
---

On Tue, Oct 13, 2009 at 12:54:38AM -0700, David Miller wrote:

> Gabor, please resubmit your patch with a proper Signed-off-by:
> tag so I can apply it if it is correct.

Sure. I have pumped out more than 150 GiB of data using this patch
without apparent ill effects so it is also tested now.

Comments

David Miller Oct. 29, 2009, 10:19 a.m. UTC | #1
From: Gabor Gombas <gombasg@sztaki.hu>
Date: Thu, 15 Oct 2009 22:10:29 +0200

> Currently PACKET_TX_RING forces certain amount of every frame to remain
> unused. This probably originates from an early version of the
> PACKET_TX_RING patch that in fact used the extra space when the (since
> removed) CONFIG_PACKET_MMAP_ZERO_COPY option was enabled. The current
> code does not make any use of this extra space.
> 
> This patch removes the extra space reservation and lets userspace make
> use of the full frame size.
> 
> Signed-off-by: Gabor Gombas <gombasg@sztaki.hu>

Applied, thanks!
--
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
Gabor Gombas Oct. 29, 2009, 10:29 a.m. UTC | #2
On Thu, Oct 29, 2009 at 03:19:17AM -0700, David Miller wrote:

> From: Gabor Gombas <gombasg@sztaki.hu>
> Date: Thu, 15 Oct 2009 22:10:29 +0200
> 
> > Currently PACKET_TX_RING forces certain amount of every frame to remain
> > unused. This probably originates from an early version of the
> > PACKET_TX_RING patch that in fact used the extra space when the (since
> > removed) CONFIG_PACKET_MMAP_ZERO_COPY option was enabled. The current
> > code does not make any use of this extra space.
> > 
> > This patch removes the extra space reservation and lets userspace make
> > use of the full frame size.
> > 
> > Signed-off-by: Gabor Gombas <gombasg@sztaki.hu>
> 
> Applied, thanks!

Thanks! Does it have a chance to be included in 2.6.32, or it is too
late in the rc series?

Gabor
David Miller Oct. 29, 2009, 10:40 a.m. UTC | #3
From: Gabor Gombas <gombasg@sztaki.hu>
Date: Thu, 29 Oct 2009 11:29:24 +0100

> On Thu, Oct 29, 2009 at 03:19:17AM -0700, David Miller wrote:
> 
>> From: Gabor Gombas <gombasg@sztaki.hu>
>> Date: Thu, 15 Oct 2009 22:10:29 +0200
>> 
>> > Currently PACKET_TX_RING forces certain amount of every frame to remain
>> > unused. This probably originates from an early version of the
>> > PACKET_TX_RING patch that in fact used the extra space when the (since
>> > removed) CONFIG_PACKET_MMAP_ZERO_COPY option was enabled. The current
>> > code does not make any use of this extra space.
>> > 
>> > This patch removes the extra space reservation and lets userspace make
>> > use of the full frame size.
>> > 
>> > Signed-off-by: Gabor Gombas <gombasg@sztaki.hu>
>> 
>> Applied, thanks!
> 
> Thanks! Does it have a chance to be included in 2.6.32, or it is too
> late in the rc series?

It will be merged to Linus for 2.6.23
--
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
diff mbox

Patch

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index f9f7177..745a016 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -985,10 +985,7 @@  static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
 		goto out_put;
 
 	size_max = po->tx_ring.frame_size
-		- sizeof(struct skb_shared_info)
-		- po->tp_hdrlen
-		- LL_ALLOCATED_SPACE(dev)
-		- sizeof(struct sockaddr_ll);
+		- (po->tp_hdrlen - sizeof(struct sockaddr_ll));
 
 	if (size_max > dev->mtu + reserve)
 		size_max = dev->mtu + reserve;