Re: bridge-utils: wrong sysfs path odds

2015-11-25 Thread Richard Weinberger
Am 25.11.2015 um 23:38 schrieb Florian Fainelli:
> On 25/11/15 01:21, Richard Weinberger wrote:
>> Am 25.11.2015 um 01:37 schrieb Stephen Hemminger:
>>> On Wed, 25 Nov 2015 01:24:47 +0100
>>> Richard Weinberger  wrote:
>>>
 Am 25.11.2015 um 01:15 schrieb Richard Weinberger:
> Hi!
>
> Today I was hunting down an issue where "brctl stp br0 off"
> always failed on mips64be with n32 userland.
>
> It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
> BRCTL_SET_BRIDGE_STP_STATE
> returned -EOPNOTSUPP.
> First I thought that this is a plain ABI issue on mips as in 
> old_dev_ioctl()
> the ioctl() argument was 0x1 instead of the expected 
> BRCTL_SET_BRIDGE_STP_STATE (0x14)

 Should be 0xe and not 0x14. It is 14 in decimal. :)

 Thanks,
 //richard
>>>
>>> Ask Debian maintainer to send his patches, I don't go patch hunting.
>>>
>>
>> While looking what other distros do I came across this patch:
>> https://pkgs.fedoraproject.org/cgit/bridge-utils.git/tree/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
>>
>> Beside of checking return errors is fixes also the sysfs path in br_set().
>> Can you please merge it upstream?
>>
>> Distros seems to carry more patches for that package, if it helps I can do 
>> the patch hunting for you.
>> It would be nice to have a recent bridge-utils release. The last one is from 
>> 2011.
> 
> Most of what bridge-utils does can be done by iproute2's bridge
> sub-command FWIW.

Sure, but a lot of userspace still depends on brctl.
And IMHO brctl is magnitudes easier to use than iproute's bridge tool.

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: bridge-utils: wrong sysfs path odds

2015-11-25 Thread Florian Fainelli
On 25/11/15 01:21, Richard Weinberger wrote:
> Am 25.11.2015 um 01:37 schrieb Stephen Hemminger:
>> On Wed, 25 Nov 2015 01:24:47 +0100
>> Richard Weinberger  wrote:
>>
>>> Am 25.11.2015 um 01:15 schrieb Richard Weinberger:
 Hi!

 Today I was hunting down an issue where "brctl stp br0 off"
 always failed on mips64be with n32 userland.

 It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
 BRCTL_SET_BRIDGE_STP_STATE
 returned -EOPNOTSUPP.
 First I thought that this is a plain ABI issue on mips as in 
 old_dev_ioctl()
 the ioctl() argument was 0x1 instead of the expected 
 BRCTL_SET_BRIDGE_STP_STATE (0x14)
>>>
>>> Should be 0xe and not 0x14. It is 14 in decimal. :)
>>>
>>> Thanks,
>>> //richard
>>
>> Ask Debian maintainer to send his patches, I don't go patch hunting.
>>
> 
> While looking what other distros do I came across this patch:
> https://pkgs.fedoraproject.org/cgit/bridge-utils.git/tree/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
> 
> Beside of checking return errors is fixes also the sysfs path in br_set().
> Can you please merge it upstream?
> 
> Distros seems to carry more patches for that package, if it helps I can do 
> the patch hunting for you.
> It would be nice to have a recent bridge-utils release. The last one is from 
> 2011.

Most of what bridge-utils does can be done by iproute2's bridge
sub-command FWIW.
-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: bridge-utils: wrong sysfs path odds

2015-11-25 Thread Richard Weinberger
Hi!

Am 25.11.2015 um 23:30 schrieb Santiago Garcia Mantinan:
> Hi!
> 
>> Ask Debian maintainer to send his patches, I don't go patch hunting.
> 
> 
> While looking what other distros do I came across this patch:
> 
> https://pkgs.fedoraproject.org/cgit/bridge-utils.git/tree/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch
> 
> 
> Don't know about the fedora guys but at least I did send some patches which 
> include this /bridge addition, and Stephen did even ack it as you can read on:
> http://lists.linuxfoundation.org/pipermail/bridge/2011-May/007646.html

Meanwhile I've found 
https://git.kernel.org/cgit/linux/kernel/git/shemminger/bridge-utils.git/
It contains some fixes.
So, the problem is that we have fixes but no release which contains these.
Stephen, can you do a maintenance release? Maybe 1.5.1?

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: bridge-utils: wrong sysfs path odds

2015-11-25 Thread Richard Weinberger
Am 25.11.2015 um 01:37 schrieb Stephen Hemminger:
> On Wed, 25 Nov 2015 01:24:47 +0100
> Richard Weinberger  wrote:
> 
>> Am 25.11.2015 um 01:15 schrieb Richard Weinberger:
>>> Hi!
>>>
>>> Today I was hunting down an issue where "brctl stp br0 off"
>>> always failed on mips64be with n32 userland.
>>>
>>> It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
>>> BRCTL_SET_BRIDGE_STP_STATE
>>> returned -EOPNOTSUPP.
>>> First I thought that this is a plain ABI issue on mips as in old_dev_ioctl()
>>> the ioctl() argument was 0x1 instead of the expected 
>>> BRCTL_SET_BRIDGE_STP_STATE (0x14)
>>
>> Should be 0xe and not 0x14. It is 14 in decimal. :)
>>
>> Thanks,
>> //richard
> 
> Ask Debian maintainer to send his patches, I don't go patch hunting.
> 

While looking what other distros do I came across this patch:
https://pkgs.fedoraproject.org/cgit/bridge-utils.git/tree/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch

Beside of checking return errors is fixes also the sysfs path in br_set().
Can you please merge it upstream?

Distros seems to carry more patches for that package, if it helps I can do the 
patch hunting for you.
It would be nice to have a recent bridge-utils release. The last one is from 
2011.

Thanks,
//richard

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: bridge-utils: wrong sysfs path odds

2015-11-24 Thread Stephen Hemminger
On Wed, 25 Nov 2015 01:24:47 +0100
Richard Weinberger  wrote:

> Am 25.11.2015 um 01:15 schrieb Richard Weinberger:
> > Hi!
> > 
> > Today I was hunting down an issue where "brctl stp br0 off"
> > always failed on mips64be with n32 userland.
> > 
> > It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
> > BRCTL_SET_BRIDGE_STP_STATE
> > returned -EOPNOTSUPP.
> > First I thought that this is a plain ABI issue on mips as in old_dev_ioctl()
> > the ioctl() argument was 0x1 instead of the expected 
> > BRCTL_SET_BRIDGE_STP_STATE (0x14)
> 
> Should be 0xe and not 0x14. It is 14 in decimal. :)
> 
> Thanks,
> //richard

Ask Debian maintainer to send his patches, I don't go patch hunting.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: bridge-utils: wrong sysfs path odds

2015-11-24 Thread Richard Weinberger
Am 25.11.2015 um 01:37 schrieb Stephen Hemminger:
> On Wed, 25 Nov 2015 01:24:47 +0100
> Richard Weinberger  wrote:
> 
>> Am 25.11.2015 um 01:15 schrieb Richard Weinberger:
>>> Hi!
>>>
>>> Today I was hunting down an issue where "brctl stp br0 off"
>>> always failed on mips64be with n32 userland.
>>>
>>> It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
>>> BRCTL_SET_BRIDGE_STP_STATE
>>> returned -EOPNOTSUPP.
>>> First I thought that this is a plain ABI issue on mips as in old_dev_ioctl()
>>> the ioctl() argument was 0x1 instead of the expected 
>>> BRCTL_SET_BRIDGE_STP_STATE (0x14)
>>
>> Should be 0xe and not 0x14. It is 14 in decimal. :)
>>
>> Thanks,
>> //richard
> 
> Ask Debian maintainer to send his patches, I don't go patch hunting.

He is Cc'ed :-)

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


bridge-utils: wrong sysfs path odds

2015-11-24 Thread Richard Weinberger
Hi!

Today I was hunting down an issue where "brctl stp br0 off"
always failed on mips64be with n32 userland.

It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
BRCTL_SET_BRIDGE_STP_STATE
returned -EOPNOTSUPP.
First I thought that this is a plain ABI issue on mips as in old_dev_ioctl()
the ioctl() argument was 0x1 instead of the expected BRCTL_SET_BRIDGE_STP_STATE 
(0x14)

Further investigation showed that brctl first tries to open the sysfs file
"/sys/class/net/br0/stp_state" and falls back to the legacy ioctl() upon 
failure.

On my mips setup old_dev_ioctl() seems not to work. And the function's comment
is correct:
/*
 * Legacy ioctl's through SIOCDEVPRIVATE
 * This interface is deprecated because it was too difficult to
 * to do the translation for 32/64bit ioctl compatibility.
 */

Later I've realized that the sysfs path is wrong, the "bridge/" directory
part is missing.
On most setups nobody would notice as the fallback ioctl() works.

Debian's bridge-utils package carries a patch which fixes the sysfs paths.
Can we please have this patch also in upstream bridge-utils?

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: bridge-utils: wrong sysfs path odds

2015-11-24 Thread Richard Weinberger
Am 25.11.2015 um 01:15 schrieb Richard Weinberger:
> Hi!
> 
> Today I was hunting down an issue where "brctl stp br0 off"
> always failed on mips64be with n32 userland.
> 
> It turned out that the ioctl(fd, SIOCDEVPRIVATE, ) with 
> BRCTL_SET_BRIDGE_STP_STATE
> returned -EOPNOTSUPP.
> First I thought that this is a plain ABI issue on mips as in old_dev_ioctl()
> the ioctl() argument was 0x1 instead of the expected 
> BRCTL_SET_BRIDGE_STP_STATE (0x14)

Should be 0xe and not 0x14. It is 14 in decimal. :)

Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html