All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
	devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org,
	faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH V1 01/13] IB/core: Add get FW version string to the core
Date: Wed, 15 Jun 2016 11:20:49 -0400	[thread overview]
Message-ID: <20160615152048.GB8690@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <20160615064008.GS5408-2ukJVAZIZ/Y@public.gmane.org>

On Wed, Jun 15, 2016 at 09:40:08AM +0300, Leon Romanovsky wrote:
> On Wed, Jun 15, 2016 at 02:21:56AM -0400, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> > From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

[snip]

> > 
> > diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
> > index 5c155fa91eec..760ef603a468 100644
> > --- a/drivers/infiniband/core/device.c
> > +++ b/drivers/infiniband/core/device.c
> > @@ -311,6 +311,15 @@ static int read_port_immutable(struct ib_device *device)
> >  	return 0;
> >  }
> >  
> > +void ib_get_device_fw_str(struct ib_device *dev, char *str, size_t str_len)
> > +{
> > +	if (dev->get_dev_fw_str)
> > +		dev->get_dev_fw_str(dev, str, str_len);
> > +	else
> > +		str[0] = '\0';
> 
> Interesting point, what is better for the caller to get as a version?
> You chose empty string, but it can be all Fs or all 0s.

The default here is that a device does not provide a firmware string.  In that
case the assumption is that there is no firmware.  Hence the empty string.  I
don't think that reporting 0's or F's are appropriate if a device does not have
firmware.

In the cases you speak of I would expect the device to supply the firmware
function and report all 0s or all Fs for whatever version that may represent.
(I'm assuming that would be some sort of debug or unreleased firmware...)

I could just as well done something like.

snprintf(str, str_len, "<none>");

Which may be more informative?  I just don't want to get too wrapped up in the
policy here.  I think this is best left to the driver/hw vendor.

Ira

> 
> > +}
> > +EXPORT_SYMBOL(ib_get_device_fw_str);


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

  parent reply	other threads:[~2016-06-15 15:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15  6:21 [PATCH V1 00/13] Create device FW version call back ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <1465971728-24104-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-15  6:21   ` [PATCH V1 01/13] IB/core: Add get FW version string to the core ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found]     ` <1465971728-24104-2-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-15  6:40       ` Leon Romanovsky
     [not found]         ` <20160615064008.GS5408-2ukJVAZIZ/Y@public.gmane.org>
2016-06-15 15:20           ` ira.weiny [this message]
     [not found]             ` <20160615152048.GB8690-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2016-06-15 16:51               ` Jason Gunthorpe
     [not found]                 ` <20160615165106.GA10256-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-06-15 23:26                   ` ira.weiny
     [not found]                     ` <20160615232602.GA4034-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2016-06-16  9:46                       ` Leon Romanovsky
2016-06-15  6:21   ` [PATCH V1 02/13] IB/cxgb3: Support device FW version string ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found]     ` <1465971728-24104-3-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-15 14:21       ` Steve Wise
2016-06-15 14:25         ` Weiny, Ira
2016-06-15  6:21   ` [PATCH V1 03/13] IB/cxgb4: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:21   ` [PATCH V1 04/13] IB/i40iw: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 05/13] IB/mlx4: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 06/13] IB/mlx5: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 07/13] IB/mthca: Supprot " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 08/13] IB/nes: Support " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 09/13] IB/ocrdma: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 10/13] IB/usnic: " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 11/13] IB/ipoib: Use new " ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 12/13] IB/core: Export a common fw_ver sysfs entry ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15  6:22   ` [PATCH V1 13/13] IB/hfi1: Add device FW version string ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2016-06-15 10:55   ` [PATCH V1 00/13] Create device FW version call back Leon Romanovsky
2016-06-23 16:11   ` Doug Ledford

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=20160615152048.GB8690@phlsvsds.ph.intel.com \
    --to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=devesh.sharma-1wcpHE2jlwO1Z/+hSey0Gg@public.gmane.org \
    --cc=dgoodell-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.