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]
Date:	Sun, 10 Jun 2012 02:03:37 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Jack Morgenstein <jackm@....mellanox.co.il>
CC:	Dan Carpenter <dan.carpenter@...cle.com>, <netdev@...r.kernel.org>,
	<dotanb@...lanox.co.il>, Or Gerlitz <ogerlitz@...lanox.com>
Subject: Re: mlx4_core: Modify driver initialization flow to accommodate
 SRIOV for Ethernet

On Sat, 2012-06-09 at 14:29 +0300, Jack Morgenstein wrote:
> On Saturday 09 June 2012 12:09, Dan Carpenter wrote:
> >    423          /*fail if the hca has an unknown capability */
> >    424          if ((hca_param.global_caps | HCA_GLOBAL_CAP_MASK) !=
> >    425              HCA_GLOBAL_CAP_MASK) {
> >    426                  mlx4_err(dev, "Unknown hca global capabilities\n");
> >    427                  return -ENOSYS;
> >    428          }
> > 
> > The test sort of makes sense but HCA_GLOBAL_CAP_MASK is zero so we could
> > as well say:
> > 
> >         if (hca_param.global_caps) { ...
> > 
> The parameter global_caps is to guarantee that the guest OS is capable
> of supporting the driver which is running on the master (hypervisor).
> 
> If a new feature impacts the guests, we will define a bit in the
> global_caps bitmask and the master driver will set this bit and
> the global_caps bitmask with the newly set bit will be passed
> to the slaves.
> 
> The HCA_GLOBAL_CAP_MASK on the slave OS represents the set
> of such features which the slave knows how to support.
> If a new feature appears which is not set in the slave's
> HCA_GLOBAL_CAP_MASK, this test detects the discrepancy and
> the slave driver aborts.
[...]

It would be more idiomatic to write the condition as:

	if (hca_param.global_caps & ~(u64)HCA_GLOBAL_CAP_MASK)

(although that cast probably belongs in the definition of
HCA_GLOBAL_CAP_MASK).

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ