Re: [RTnet-developers] Patches for SOCKET_RAW and ETH_P_ALL
Brought to you by:
bet-frogger,
kiszka
|
From: Jan K. <jan...@we...> - 2006-09-11 10:51:59
|
Jorge Almeida wrote: > OPS Sorry :) >=20 > There it goes :) >=20 >=20 > JAN, >=20 > In attach goes the patches for the SOCKET_RAW and ETH_P_ALL functionali= ties for RTnet. > The only thing that was not done was the configurable option for the ET= H_P_ALL.=20 >=20 Thanks, will have a look at them later. >=20 > After some tests in the same computer, with two different cards, i find= something interesting that i need to talk with you (or anybody that that= wants to participate in the discution). Both NICs attached to the same network? > I have two small test programs, one for sending, and another one to rec= eive the message. In both there's one socket opened with the ETH_P_ALL fe= ature. Making two different filedescriptors in the same machine. > After i send the message it is sended for both sockets (REmenber that w= e are in the same machine), but i only read from one.=20 > This means, after some time the queue for the opened socket used to wri= te only (not read) will fill.=20 > Wath is the behaviour for this problem? Buffers for TX and RX are taken from the same pool. Thus, once incoming unhandled packets consumed all of them, TX will fail. >=20 > This queue should fill and start to give errors when no more memory is = available? > Or we should not send the message to one sockt thas is only writing? Ho= w can we know if the socket is only writting? > Or we can set a maximum value to the queued message in one determined q= ueue? (I think this is the best option) Simple solution: if you have a send-only socket, don't open it with ETH_P_ALL. Use some arbitrary unused protocol instead. This also helps to reduce the system load due to unnecessary packet delivery via costly cloning. Jan |