public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts
Date: Sun, 25 Jan 2015 12:36:30 +0200	[thread overview]
Message-ID: <20150125103629.GB6463@yuval-lab> (raw)
In-Reply-To: <CAJ3xEMght7jLakWzDOHvqTT_gNSqJJHAjLu_F6gD0j+=Narqmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >> >+               if (fname[i])
> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >> >+                                '*' : ' ', fname[i]);
> >> >  }
> >>
> >> I think that the strings should be displayed only if both driver and
> >> FW supports them. You could add a QUERY_DEV_CAP_SUPPORTED_FLAGS
> >> which ors all the supported flags in device.h and check if (flags &
> >> QUERY_DEV_CAP_SUPPORTED_FLAGS) & (1LL << i)).
But that would add an extra place to maintain when new feature will be added to driver, isn't it?
At present, when new feature is added to driver enum and string array needs to be updated.
With this new approach, string array is full, need only to add new enum and to update QUERY_DEV_CAP_SUPPORTED_FLAGS.
Again, two places in the code to change.
Up to you folks, which one you like better?
I like the new approach, it is less error prone.
> >>
> >> >
> >> >  static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >> >@@ -144,8 +172,9 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
> >> >         int i;
> >> >
> >> >         for (i =; i < ARRAY_SIZE(fname); ++i)
> >> >-               if (fname[i] && (flags & (1LL << i)))
> >> >-                       mlx4_dbg(dev, "    %s\n", fname[i]);
> >> >+               if (fname[i])
> >> >+                       mlx4_dbg(dev, "    (%c) %s\n", (flags & (1LL << i)) ?
> >> >+                                '*' : ' ', fname[i]);
> >> >  }
--
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:[~2015-01-25 10:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-07 23:48 [PATCH ] mlx4_core: Enhance device capabilities flags debug printouts Yuval Shaia
     [not found] ` <1417996112-19060-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-12-09 17:55   ` Or Gerlitz
     [not found]     ` <CAJ3xEMgjP0V7h7mRTr84NLW3Rib-QLN8j0rbEk5_MRvORXbDMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-10  8:25       ` Yuval Shaia
2014-12-10 10:10   ` Matan Barak
     [not found]     ` <54881BFF.2030008-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-12-15  9:21       ` Yuval Shaia
2014-12-15  9:35         ` Or Gerlitz
     [not found]           ` <CAJ3xEMght7jLakWzDOHvqTT_gNSqJJHAjLu_F6gD0j+=Narqmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-15 12:25             ` Yuval Shaia
2014-12-15 16:14               ` Or Gerlitz
     [not found]                 ` <CAJ3xEMhespfjA1Epf6qS0wFf_a1wxSODg4L7tpLzAaNpnXiO8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-25 10:20                   ` Yuval Shaia
2015-01-29 12:17                   ` Yuval Shaia
2015-01-25 10:36             ` Yuval Shaia [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-12-14 19:18 [PATCH] " Yuval Shaia
2015-01-26 14:30 Yuval Shaia
     [not found] ` <1422282623-3744-1-git-send-email-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2015-02-16 17:32   ` Yuval Shaia
2015-02-17 12:47     ` Matan Barak
     [not found]       ` <54E33847.5090001-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-02-18  7:12         ` Yuval Shaia
2015-01-27  7:45 Yuval Shaia

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=20150125103629.GB6463@yuval-lab \
    --to=yuval.shaia-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox