Commit b5dd884e authored by Gabor Gombas's avatar Gabor Gombas Committed by David S. Miller

net: Fix 'Re: PACKET_TX_RING: packet size is too long'

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: default avatarGabor Gombas <gombasg@sztaki.hu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06b71b65
...@@ -982,10 +982,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg) ...@@ -982,10 +982,7 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
goto out_put; goto out_put;
size_max = po->tx_ring.frame_size size_max = po->tx_ring.frame_size
- sizeof(struct skb_shared_info) - (po->tp_hdrlen - sizeof(struct sockaddr_ll));
- po->tp_hdrlen
- LL_ALLOCATED_SPACE(dev)
- sizeof(struct sockaddr_ll);
if (size_max > dev->mtu + reserve) if (size_max > dev->mtu + reserve)
size_max = dev->mtu + reserve; size_max = dev->mtu + reserve;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment