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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160128.200038.1283811216884732396.davem@davemloft.net>
Date:	Thu, 28 Jan 2016 20:00:38 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	ogerlitz@...lanox.com
Cc:	netdev@...r.kernel.org, eranbe@...lanox.com, saeedm@...lanox.com
Subject: Re: [PATCH net 2/2] net/mlx5e: Use a private copy of netdev ops

From: Or Gerlitz <ogerlitz@...lanox.com>
Date: Wed, 27 Jan 2016 17:02:25 +0200

> From: Saeed Mahameed <saeedm@...lanox.com>
> 
> 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 <saeedm@...lanox.com>
> Signed-off-by: Or Gerlitz <ogerlitz@...lanox.com>

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ