Skip to content

Commit

Permalink
net: Fix 'Re: PACKET_TX_RING: packet size is too long'
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gabor Gombas authored and David S. Miller committed Oct 29, 2009
1 parent 06b71b6 commit b5dd884
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/packet/af_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,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;
Expand Down

0 comments on commit b5dd884

Please sign in to comment.