increase buffer size

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

increase buffer size

Steffen Rose-2
Hello,

I want to increase the transmit quere of a can device.

As I understand, the virtual devices don't have a quere. Is it right?

As I understand, for physical devices the transmit quere is located within the
sockets, not in the can device driver. Is it right?

Do you have an small code snippet for the changing of the quere size?

Thank you very much.
--
Mit freundlichen Grüßen / Regards
Steffen Rose
http://www.emtas.de

_______________________________________________
Socketcan-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/socketcan-users
Reply | Threaded
Open this post in threaded view
|

Re: increase buffer size

Oliver Hartkopp
Hi Steffen,

On 24.01.2012 12:18, Steffen Rose wrote:

> I want to increase the transmit quere of a can device.


You can do this with ifconfig or the 'ip' tool from the iproute2 package.

Examples:

ifconfig can0 txqueuelen 1000

or

ip link set can0 txqueuelen 1000


>
> As I understand, the virtual devices don't have a quere. Is it right?
>


Generally yes. A vcan is a software device like the 'lo' interface for IP.
Both (vcan & lo) transfer the packets directly back to the rx queue instantly.

But you can create vcans having a tx-queue len:

Here i created a virtual CAN interface 'xxx' with a txqueuelen of 10:

root# ip link add xxx type vcan
root# ip link set xxx txqueuelen 10
root# ip link set xxx up
root# ip link show xxx
10: xxx: <NOARP,UP,LOWER_UP> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
    link/can
root#

But this has no effect as long as you do not add some kind of queueing
discipline that throttles the bandwidth on the specific interface.

> As I understand, for physical devices the transmit quere is located within the
> sockets, not in the can device driver. Is it right?


The tx buffers of the sockets are not really used e.g. for CAN_RAW sockets.
The tx queue len of the CAN network interface are relevant for you.

>
> Do you have an small code snippet for the changing of the quere size?


Better use the tools stated above.

But you can (as root) modify these values e.g. with netlink sockets.

Regards,
Oliver

ps.

please do not use this mailing list any longer but send your questions
to the new "linux-can" mailing list address "[hidden email]".
For subscription or mailing list archives please have a look to:

   http://vger.kernel.org/vger-lists.html#linux-can

Mail archives of the new linux-can mailing list can be found at:

   http://dir.gmane.org/gmane.linux.can
   http://marc.info/?l=linux-can&r=1&w=2

_______________________________________________
Socketcan-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/socketcan-users
Reply | Threaded
Open this post in threaded view
|

Re: increase buffer size

Steffen Rose-2
Hi Oliver,

thank you very much for the buffer related answer and for the hint to the new
news list.

--
Mit freundlichen Grüßen / Regards

Steffen Rose

--------------------------------------------------------------

emtas - your embedded solution partner

--------------------------------------------------------------
emtas GmbH
Fischweg 17
06217 Merseburg
Tel.:  +49(0)3461-79416-0
Fax.:  +49(0)3461-79416-10
www.emtas.de - [hidden email]
Geschäftsführer: Andreas Boebel, Torsten Gedenk, Steffen Rose
Registergericht: Amtsgericht Stendal
Registernummer:  HRB 17616
--------------------------------------------------------------

_______________________________________________
Socketcan-users mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/socketcan-users