On Mon, Sep 21, 2009 at 10:30:07AM +0200, [email protected] wrote:
>
> Hello Wolfgang,
>
> I have tested SW again and cannot reproduce error situation I had
> yesterday.
> Everything turns out to be OK. Was it Sunday effect? I have no idea...
> The write function issue you have mentioned is fixed (see attached).
I looked at the code.
while( (nbytes=write(s, &tx_frames[send_pos],
sizeof(*tx_frames))) !=
sizeof(*tx_frames) )
{
if(nbytes!=EAGAIN)
{
perror("write");
return 1;
}
}
I don't know the exact purpose of the test.
This loops asks for sunday effects, isn't it?
nbytes would return -1, not EAGAIN!
if ((nbytes < 0)&&(EAGAIN == errno))
is what I think you meant
my preference:
int ret;
struct pollfd pollfd;
pollfd.fd = s;
pollfd.events = POLLOUT;
while ((ret = poll(&pollfd, 1, -1)) < 0) {
if (EAGAIN == errno) {
perror("write");
return 1;
}
}
nbytes = write(s, ....)
// nbytes with anything other than sizeof(*tx_frames) is a serious
// poll issue
>
> Regards,
> Vladislav
Kurt
>
> -----Original Message-----
> From: Wolfgang Grandegger [mailto:[email protected]]
> Sent: Sunday, September 20, 2009 6:11 PM
> To: Gribov, Vladislav
> Cc: [email protected]
> Subject: Re: [PATCH] mscan: fix TX message handling to ensure proper
> message ordering
>
> [email protected] wrote:
> > Hello Wolfgang,
> >
> > I have tested the latest SVN version (r1060) and the order of frame
> > problem is gone (tested also with IXXAT proprietary test environment).
>
> >
> > However, if setting the CAN_MSG_COUNT to bigger that 12 in the
> > canecho_gen.c , the messages are lost on the MSCAN DUT.
> >
> > Attached is the trace with CAN_MSG_COUNT equal to 20. Message #55
> > is wrong here, two CAN messages with ID 77 are lost on reception.
>
> Before I start inspecting the trace, did you fix your code, which does
> not check the return value of the write functions?
>
> Wolfgang.
> _______________________________________________
> Socketcan-core mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/socketcan-core
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core