linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cansend app will block while it is sending RTR frames
@ 2013-08-28  9:34 xuewentian
  2013-08-28 12:31 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: xuewentian @ 2013-08-28  9:34 UTC (permalink / raw)
  To: linux-can

Hi all,

  I want to test sending a lot of RTR frames, because select/poll is no 
effect on the flow control, I add the usleep in the cansend app.
  
  The code segment is :
  

	while (infinite || loopcount--) {
		
		ret = write(s, &frame, sizeof(frame));
		if (ret == -1) {
			perror("write");
			printf("Please specify a more long delay time!\n");
			break;
		}
		usleep(delay);//flow control
	}

  Here the "delay" is about 200us, and I used "cansend can0 -r -e -l 500 -
i 0x1234567  0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88" command to send 500 
RTR frames.but candump on
the another board could only received the 336 frames,and candump app 
hasn't print the received RTR frames,and only count the received frmaes.
  and I debugged the send process in the kernel, and I found that it sleep 
on the copy_from_user in the memcpy_fromiovec of the raw_sendmsg
  
  err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);  // in 
the raw_sendmsg function of the net/can/raw.c file.
	if (err < 0)
		goto free_skb;

  What about happens with the write of the cansend app? and I used the 
same way to send the 5000000 data frames, it didn't blocked.

Thanks a lot.


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

end of thread, other threads:[~2013-08-30  7:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-28  9:34 cansend app will block while it is sending RTR frames xuewentian
2013-08-28 12:31 ` Marc Kleine-Budde
2013-08-28 14:21   ` xuewentian
     [not found]   ` <201308301520148531275@embedinfo.com>
2013-08-30  7:27     ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).