lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKT-o-eJi0Tt=4T+_SHb=sTMdR12dO3Frj+eN5sAkCy0MYXzKw@mail.gmail.com>
Date:   Tue, 23 May 2017 10:47:15 +0200
From:   Kołłątaj, Remigiusz 
        <remigiusz.kollataj@...ica.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     netdev@...r.kernel.org, linux-can@...r.kernel.org
Subject: Re: [PATCH iproute2] ip: add handling for new CAN netlink interface

Hi Stephen,

On 22 May 2017 at 22:37, Stephen Hemminger <stephen@...workplumber.org> wrote:
> On Fri, 19 May 2017 14:54:49 +0200
> Remigiusz Kołłątaj         <remigiusz.kollataj@...ica.com> wrote:
>
>> This patch adds handling for new CAN netlink interface introduced in
>> 4.11 kernel:
>> - IFLA_CAN_TERMINATION,
>> - IFLA_CAN_TERMINATION_CONST,
>> - IFLA_CAN_BITRATE_CONST,
>> - IFLA_CAN_DATA_BITRATE_CONST
>>
>> Output example:
>> $ip -d link show can0
>> 6: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN mode DEFAULT group default qlen 10
>>     link/can  promiscuity 0
>>     can state STOPPED (berr-counter tx 0 rx 0) restart-ms 0
>>           bitrate 80000
>>              [   20000,    33333,    50000,    80000,    83333,   100000,
>>                 125000,   150000,   175000,   200000,   225000,   250000,
>>                 275000,   300000,   500000,   625000,   800000,  1000000 ]
>>           termination 0 [ 0, 120 ]
>>           clock 0numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
>>
>> Signed-off-by: Remigiusz Kołłątaj <remigiusz.kollataj@...ica.com>
>
> What is output without the -d flag?

Output _before_ changes:

$ ip link show can0
7: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN
mode DEFAULT group default qlen 10
    link/can

7: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN
mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 1000000 sample-point 0.000
          tq 0 prop-seg 0 phase-seg1 0 phase-seg2 0 sjw 0
          clock 0numtxqueues 1 numrxqueues 1 gso_max_size 65536
gso_max_segs 65535

Output _after_ changes:

$ ./ip link show can0
7: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN
mode DEFAULT group default qlen 10
    link/can

$ ./ip -d link show can0
7: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN
mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 1000000
             [   20000,    33333,    50000,    80000,    83333,   100000,
                125000,   150000,   175000,   200000,   225000,   250000,
                275000,   300000,   500000,   625000,   800000,  1000000 ]
          termination 0 [ 0, 120 ]
          clock 0numtxqueues 1 numrxqueues 1 gso_max_size 65536
gso_max_segs 65535

> In general iproute2 show commands are designed to be invertable.
> I.e the show command looks like the same command to set.
>
> Printing the bitrates and the format of the state output looks quite different
> than the set command. Is it limited to detail (-d)?

The change is limited to -d indeed.

4.11 kernel introduced new mechanism for devices that have predefined
bitrates. Before the change there was no possibility to pass to user
space supported bitrate values (other than printk).

I was also wondering about changing the output to:

$ ./ip -d link show can0
7: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc fq_codel state UNKNOWN
mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 1000000
          bitrate_const  20000,    33333,    50000,    80000,
83333,   100000,
                125000,   150000,   175000,   200000,   225000,   250000,
                275000,   300000,   500000,   625000,   800000,  1000000
          termination 0
          termination_const 0, 120
          clock 0numtxqueues 1 numrxqueues 1 gso_max_size 65536
gso_max_segs 65535

Is it better from your point of view?


Regards,
Remik

-- 
____________________
Remigiusz Kołłątaj
Mobica Ltd
Technology Consultant
Skype: remigiusz.kollataj
www.mobica.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ