net/mlx: fix setting interface flags
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 4 Jul 2016 08:24:17 +0000 (10:24 +0200)
committerBruce Richardson <bruce.richardson@intel.com>
Tue, 5 Jul 2016 09:51:10 +0000 (11:51 +0200)
commit33242e3e46a553fa7e7eaa4a21ba110f1c590ee9
tree6d96d58749b353626c0d28c2097ca395465c5e9d
parentaf15ee640dfe2b45f1358638d41037e82604be4a
net/mlx: fix setting interface flags

According to the documentation, the function
priv_set_flags(priv, keep, flags) should not modify the flags
in "keep" mask.

So 'flags' argument should be masked with '~keep' before ORing
it with the previous flags value.

This avoids messing up the kernel interface flags when calling
priv_set_flags(priv, ~IFF_UP, ~IFF_UP) in priv_set_link():

  $ ip link
  26: eth0: BROADCAST,MULTICAST,NOARP,ALLMULTI,PROMISC,DEBUG,\
      DYNAMIC,AUTOMEDIA,PORTSEL,NOTRAILERS

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")

Reported-by: Fengtian Guo <fengtian.guo@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/mlx5_ethdev.c