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  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 Jan 2016 20:00:38 -0800 (PST)
From:	David Miller <>
Subject: Re: [PATCH net 2/2] net/mlx5e: Use a private copy of netdev ops

From: Or Gerlitz <>
Date: Wed, 27 Jan 2016 17:02:25 +0200

> From: Saeed Mahameed <>
> Currently our netdevice ops is a static global variable which
> is referenced by all mlx5e netdevice instances. This can be
> problematic when different driver instances do not share same
> HW capabilities (e.g SRIOV PF and VFs probed to the host).
> Remove the global variable and add a private net_device_ops
> field in netdevice private data, which is initialized at
> netdev construction.
> Fixes: 66e49dedada6 ("net/mlx5e: Add support for SR-IOV ndos")
> Signed-off-by: Saeed Mahameed <>
> Signed-off-by: Or Gerlitz <>

This is not the canonical way to fix this.  Please look at how
other drivers handle this situation before inventing your own
way of solving the problem.

The proper way is to have multiple netdevice ops instances, and simply
choose the one which is correct for the chip in question.

You should also mark the ops as const.  They should never _ever_ be
modified at runtime.

Powered by blists - more mailing lists