Netdev List
 help / color / mirror / Atom feed
* PACKET_TX_RING: packet size is too long
@ 2009-10-09  9:07 Gabor Gombas
  2009-10-09 22:05 ` [PATCH] " Gabor Gombas
  0 siblings, 1 reply; 7+ messages in thread
From: Gabor Gombas @ 2009-10-09  9:07 UTC (permalink / raw)
  To: netdev; +Cc: johann.baudy

Hi,

I have added PACKET_TX_RING support to ggaoed
(http://code.google.com/p/ggaoed) and it have worked nice when I have
tested it with a virtual ethernet pair (veth). However when testing it
on real hardware, I get:

Oct  8 17:30:52 storage2 kernel: [ 1083.714204] packet size is too long (8740 > 8472)

Kernel is 2.6.31 from Debian experimental. The socket is SOCK_RAW, the
MTU is 9000, I'm using TPACKET_V2 format, and the ring have been created
with the following parameters:

block_nr = 256, block_size = 65536, frame_nr = 1792, frame_size = 9056

Documentation/networking/packet_mmap.txt says that a frame for
PACKET_TX_RING consists of a struct tpacket[2]_hdr followed by the data
to send, so IMHO a frame size of 9056 should be enough to send 8740
bytes of data. However, net/packet/af_packet.c has in tpacket_snd():

	size_max = po->tx_ring.frame_size
		- sizeof(struct skb_shared_info)
		- po->tp_hdrlen
		- LL_ALLOCATED_SPACE(dev)
		- sizeof(struct sockaddr_ll);

which is much more than just the struct tpacket[2]_hdr. So which is
right? The code or the documentation? What is the official formula
to compute the required frame length for a SOCK_RAW socket, given the
MTU?

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-29 10:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-09  9:07 PACKET_TX_RING: packet size is too long Gabor Gombas
2009-10-09 22:05 ` [PATCH] " Gabor Gombas
2009-10-13  7:54   ` David Miller
2009-10-15 20:10     ` Gabor Gombas
2009-10-29 10:19       ` David Miller
2009-10-29 10:29         ` Gabor Gombas
2009-10-29 10:40           ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox