This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Please keep your replies on the mailing list so that all benefit.
On 03/01/2010 05:31 AM, Timo Gerber wrote:Am 01.03.2010 13:19, schrieb Gary Thomas:On 03/01/2010 03:27 AM, Timo Gerber wrote:Its a standard ethernet interface with an MTU of 1514Hi guys, I'm working on an ethernet driver with scather gather support and I am wondering: When sending UDP packets from the application with a higher payload-size (e.g. 2500Bytesand more), the ethernet stack calls my DRV_eth_send() function with a weird sg_list. For instance, some packets are fragmented like this: sg_list[1].len => 42 sg_list[1].buf => points to the hdr.
sg_list[2].len => 1472 sg_list[2].buf => points to the payload.
sg_list[3].len => 0 sg_list[3].buf => points to an empty buffer.
As you can see the last sg fragment is kinda weird, but this scheme appears all the time, not only now an then.
What's the MTU on that interface?
Which matches the request (42+1472==1514). The upper layer which creates the SG list must be messing up when this happens.
Which stack (BSD, LWIP) are you using? I don't see how this is possible with the BSD layer as it only counts segments which have a non-zero length.
static int udptest(void) { #define DEST_IP "192.168.222.100" #define PORT 5555 #define NPACK 4 #define BUFLEN (2049) const int nBytes = BUFLEN * NPACK; struct sockaddr_in dest_host; int s, i; int slen = sizeof(dest_host); char buf[BUFLEN];
if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1){ TST_PRINTF("socket error\n"); }
return 0; }
-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |