Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Jack Morgenstein <jackm@dev.mellanox.co.il>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	<netdev@vger.kernel.org>, <dotanb@mellanox.co.il>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: Re: mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet
Date: Sun, 10 Jun 2012 02:03:37 +0100	[thread overview]
Message-ID: <1339290217.21665.164.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <201206091429.17171.jackm@dev.mellanox.co.il>

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.

  reply	other threads:[~2012-06-10  1:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-09  9:09 mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet Dan Carpenter
2012-06-09 11:29 ` Jack Morgenstein
2012-06-10  1:03   ` Ben Hutchings [this message]
2012-06-17 15:18     ` Jack Morgenstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1339290217.21665.164.camel@deadeye.wl.decadent.org.uk \
    --to=bhutchings@solarflare.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dotanb@mellanox.co.il \
    --cc=jackm@dev.mellanox.co.il \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox