[ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-07 Thread David Decotigny
From: David Decotigny More info with kernel SHA1: 8d3f2806f8fbd9b22 "Merge branch 'ethtool-ksettings'". Signed-off-by: David Decotigny --- ethtool.c | 682 +++-- internal.h | 67 ++ test-cmdline.c | 12 + 3 files changed, 602

[ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-11 Thread David Decotigny
From: David Decotigny More info with kernel SHA1: 8d3f2806f8fbd9b22 "Merge branch 'ethtool-ksettings'". Signed-off-by: David Decotigny --- ethtool.c | 682 +++-- internal.h | 67 ++ test-cmdline.c | 12 + 3 files changed, 602

Re: [ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-13 Thread Ben Hutchings
On Fri, 2016-03-11 at 09:58 -0800, David Decotigny wrote: [...] > +static int parse_hex_u32_bitmap(const char *s, > + unsigned int nbits, u32 *result) > +{ > + const unsigned nwords = __KERNEL_DIV_ROUND_UP(nbits, 32); > + size_t slen = strlen(s); > + size_t i

RE: [ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-14 Thread David Laight
> > + /* ignore optional '0x' prefix */ > > + if ((slen > 2) && ( Unnecessary (). > > + (0 == memcmp(s, "0x", 2) > > +  || (0 == memcmp(s, "0X", 2) { A-about-F comparisons. > memcmp() is a really poor tool for comparing strings.  You should use > strncasecmp(

Re: [ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-15 Thread David Decotigny
Just sent v5 of the series: now only this patch left. Applied all your suggestions. Many thanks for the 2 bugs you caught, path was not covered by my tests. v5 was tested on a 10G nic with: ethtool -s eth1 msglvl 0x15 speed 1 duplex full On Sun, Mar 13, 2016 at 6:32 PM, Ben Hutchings wrote:

Re: [ethtool PATCH v4 10/11] ethtool.c: add support for ETHTOOL_xLINKSETTINGS ioctls

2016-03-15 Thread David Decotigny
Please note that v5 patch depends on Ben Hutchings' http://patchwork.ozlabs.org/patch/596879/ to make any sense. On Tue, Mar 15, 2016 at 4:42 PM, David Decotigny wrote: > Just sent v5 of the series: now only this patch left. Applied all your > suggestions. > > Many thanks for the 2 bugs you caugh