linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why doesn't the socketcan prio qdisc work for first 10 can frames?
@ 2014-11-27  9:43 Ruan TingQuan (ST-FIR/ENG1-Zhu)
  2014-11-27 11:46 ` Oliver Hartkopp
  0 siblings, 1 reply; 16+ messages in thread
From: Ruan TingQuan (ST-FIR/ENG1-Zhu) @ 2014-11-27  9:43 UTC (permalink / raw)
  To: linux-can@vger.kernel.org

Hello Linux-can-team,

A prio qdisc is created with 8 bands for my different priority sending requirement.  
My test environment: ubuntu 12.04 (kernel 3.11) + PEAK-USB pro (can0 is connect to can1). 
The frame will be send on can0 and receive on can1 (candump)
Below is the setting on can0:
	> ip link set can0 type can bitrate 5000
	> ip link set can1 type can bitrate 5000
	> tc qdisc add dev can0 root handle 1: prio bands 8
	> tc filter add dev $1 parent 1:0 prio 1 basic match canid\(eff 0x1:0x7\) flowid 1:1
	> tc filter add dev $1 parent 1:0 prio 2 basic match canid\(eff 0x2:0x7\) flowid 1:2
	> tc filter add dev $1 parent 1:0 prio 3 basic match canid\(eff 0x3:0x7\) flowid 1:3
	> tc filter add dev $1 parent 1:0 prio 4 basic match canid\(eff 0x4:0x7\) flowid 1:4
	> tc filter add dev $1 parent 1:0 prio 5 basic match canid\(eff 0x5:0x7\) flowid 1:5
	> tc filter add dev $1 parent 1:0 prio 6 basic match canid\(eff 0x6:0x7\) flowid 1:6
	> tc filter add dev $1 parent 1:0 prio 7 basic match canid\(eff 0x7:0x7\) flowid 1:7
	> tc filter add dev $1 parent 1:0 prio 8 basic match canid\(sff 0x0:0x0 eff 0x0:0x0\) flowid 1:8

Then, I made a test program to send 10 frames on can0 socket quickly.
  	can0  81234560   [8]  00 00 00 00 50 50 50 50
  	can0  81234567   [8]  07 07 07 07 4F 4F 4F 4F
  	can0  81234566   [8]  06 06 06 06 4E 4E 4E 4E
  	can0  81234565   [8]  05 05 05 05 4D 4D 4D 4D
	can0  81234564   [8]  04 04 04 04 4C 4C 4C 4C
  	can0  81234563   [8]  03 03 03 03 4B 4B 4B 4B
  	can0  81234562   [8]  02 02 02 02 4A 4A 4A 4A
  	can0  81234561   [8]  01 01 01 01 49 49 49 49
  	can0  81234560   [8]  00 00 00 00 48 48 48 48
  	can0  81234567   [8]  07 07 07 07 47 47 47 47

I expect the frames from can1 with priority sequence high to low:
	can1  01234560   [8]  00 00 00 00 50 50 50 50
	can1  01234561   [8]  01 01 01 01 49 49 49 49  
	can1  01234562   [8]  02 02 02 02 4A 4A 4A 4A
	can1  01234563   [8]  03 03 03 03 4B 4B 4B 4B
	can1  01234564   [8]  04 04 04 04 4C 4C 4C 4C
	can1  01234565   [8]  05 05 05 05 4D 4D 4D 4D
	can1  01234566   [8]  06 06 06 06 4E 4E 4E 4E
	can1  01234567   [8]  07 07 07 07 4F 4F 4F 4F
	can1  01234560   [8]  00 00 00 00 48 48 48 48

But actually, I got the frames with same sequence
	can1  01234560   [8]  00 00 00 00 50 50 50 50
	can1  01234567   [8]  07 07 07 07 4F 4F 4F 4F
	can1  01234566   [8]  06 06 06 06 4E 4E 4E 4E
	can1  01234565   [8]  05 05 05 05 4D 4D 4D 4D
	can1  01234564   [8]  04 04 04 04 4C 4C 4C 4C
	can1  01234563   [8]  03 03 03 03 4B 4B 4B 4B
	can1  01234562   [8]  02 02 02 02 4A 4A 4A 4A
	can1  01234561   [8]  01 01 01 01 49 49 49 49
	can1  01234560   [8]  00 00 00 00 48 48 48 48
	can1  01234567   [8]  07 07 07 07 47 47 47 47
	can1  01234566   [8]  06 06 06 06 46 46 46 46

And I found that just happens for first 10 frames. After that, prio qdisc works fine.
Why? Or What am I missing?

Regards!
Leo Ruan



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

end of thread, other threads:[~2015-08-28 10:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27  9:43 Why doesn't the socketcan prio qdisc work for first 10 can frames? Ruan TingQuan (ST-FIR/ENG1-Zhu)
2014-11-27 11:46 ` Oliver Hartkopp
2014-11-27 17:54   ` CAN implementation on A20 Allwinner Pankajkumar Misra (RBEI/EEA2)
2014-11-27 18:28     ` Uwe Bonnes
     [not found]       ` <58243.88.153.236.115.1417116776.squirrel@webmail.rdts.de>
2014-11-27 19:53         ` Gerhard Bertelsmann
2014-12-02 12:37           ` Marc Kleine-Budde
2015-08-27 13:04             ` Gerhard Bertelsmann
2015-08-27 13:23               ` Marc Kleine-Budde
2015-08-27 13:34                 ` Gerhard Bertelsmann
2015-08-27 13:49                   ` Marc Kleine-Budde
2015-08-27 14:29                     ` Gerhard Bertelsmann
2015-08-27 14:37                       ` Marc Kleine-Budde
2015-08-28  5:41                         ` Misra Pankaj Kumar (RBEI/EEA2)
2015-08-28  6:21                           ` Marc Kleine-Budde
2015-08-28  9:22                             ` Gerhard Bertelsmann
2015-08-28 10:11                               ` 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).