From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: "Elior,
Ariel" <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
"Kalderon,
Michal" <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
"Mintz,
Yuval" <Yuval.Mintz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
"Borundia,
Rajesh" <Rajesh.Borundia-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Amrani,
Ram" <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH qedr 04/10] qedr: Add support for PD,PKEY and CQ verbs
Date: Sat, 8 Oct 2016 18:39:42 +0300 [thread overview]
Message-ID: <20161008153942.GY9282@leon.nu> (raw)
In-Reply-To: <a146f562-1970-e939-1bd5-074af868f7d6-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]
On Sat, Oct 08, 2016 at 09:35:06AM -0400, Doug Ledford wrote:
> On 10/7/2016 10:24 AM, Leon Romanovsky wrote:
> > On Fri, Oct 07, 2016 at 10:47:18AM +0000, Elior, Ariel wrote:
> >>>> @@ -66,6 +85,12 @@ struct rdma_cqe_common {
> >>>> struct regpair qp_handle;
> >>>> __le16 reserved1[7];
> >>>> u8 flags;
> >>>> +#define RDMA_CQE_COMMON_TOGGLE_BIT_MASK 0x1
> >>>> +#define RDMA_CQE_COMMON_TOGGLE_BIT_SHIFT 0
> >>>> +#define RDMA_CQE_COMMON_TYPE_MASK 0x3
> >>>> +#define RDMA_CQE_COMMON_TYPE_SHIFT 1
> >>>> +#define RDMA_CQE_COMMON_RESERVED2_MASK 0x1F
> >>>> +#define RDMA_CQE_COMMON_RESERVED2_SHIFT 3
> >>>> u8 status;
> >>>
> >>> It is VERY uncommon to mix defines and structs together.
> >>> Please don't do it, it confuses a lot and doesn't help to
> >>> readability/debug.
> >>
> >> Hi Leon,
> >> Firstly, thanks for investing your time in reviewing our driver.
> >> As for mixed defines and structures, far from being very uncommon, they are
> >> actually ubiquitous throughout the kernel and are used by the foremost
> >> developers (Dave Miller, Linus, Jeff Kirsher).
> >
> > Net subsystem is very different from other kernel community.
> > For example, this article from LWN [1] - "Coding-style exceptionalism"
> > talks about it.
>
> > [1] https://lwn.net/Articles/694755/
>
> That article only refers to multi-line comments, not to embedding
> #defines inside of structs that the #defines are used with.
That article supports my claim that net subsystem is different from the
rest of the kernel.
>
> My personal taste on things like this is that if you had something like
> a variable with a result code, then use a separate enum for the possible
> options. However, in this case, you have a multi-mask item and the
> defines are the three masks and their shifts. I'm OK with that being
> mixed in or being separate, but if it's separate, I would want it
> immediately before the struct with a comment specifying that this is the
> format of the status byte in the struct. What I wouldn't want is the
> #defines moved far away from the struct with a bunch of other defines
> where the context of the struct is lost.
It looks like you are neutral on the topic, and I'm against mixing these
specific defines with structures. Every change in such define changes
struct as well which can be easily missed out.
Ram,
Please invest an extra effort and help the reviewers to accomplish their
task.
Thanks
>
> --
> Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> GPG Key ID: 0E572FDD
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-10-08 15:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 15:47 [PATCH qedr 00/10] QLogic RDMA Driver (qedr) Ram Amrani
[not found] ` <1475682483-9878-1-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2016-10-05 15:47 ` [PATCH qedr 01/10] qedr: Add RoCE driver framework Ram Amrani
2016-10-05 15:47 ` [PATCH qedr 02/10] qedr: Add support for RoCE HW init Ram Amrani
2016-10-05 15:47 ` [PATCH qedr 03/10] qedr: Add support for user context verbs Ram Amrani
2016-10-05 15:47 ` [PATCH qedr 04/10] qedr: Add support for PD,PKEY and CQ verbs Ram Amrani
[not found] ` <1475682483-9878-5-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2016-10-06 13:33 ` Leon Romanovsky
[not found] ` <20161006133357.GP9282-2ukJVAZIZ/Y@public.gmane.org>
2016-10-06 18:34 ` Amrani, Ram
2016-10-07 10:47 ` Elior, Ariel
[not found] ` <CY1PR0701MB1337AC7B933E917765C3EBC990C60-UpKza+2NMNLi6bjPjkn3FE5OhdzP3rhOnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-10-07 14:24 ` Leon Romanovsky
[not found] ` <20161007142454.GU9282-2ukJVAZIZ/Y@public.gmane.org>
2016-10-08 13:35 ` Doug Ledford
[not found] ` <a146f562-1970-e939-1bd5-074af868f7d6-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-08 15:39 ` Leon Romanovsky [this message]
[not found] ` <20161008153942.GY9282-2ukJVAZIZ/Y@public.gmane.org>
2016-10-08 23:20 ` Elior, Ariel
2016-10-10 6:34 ` Amrani, Ram
[not found] ` <SN1PR07MB22070099EE40A67B81D14C75F8DB0-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-10-10 7:24 ` Leon Romanovsky
2016-10-05 15:47 ` [PATCH qedr 05/10] qedr: Add support for QP verbs Ram Amrani
[not found] ` <1475682483-9878-6-git-send-email-Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
2016-10-09 6:27 ` Leon Romanovsky
2016-10-05 15:47 ` [PATCH qedr 06/10] qedr: Add support for memory registeration verbs Ram Amrani
2016-10-05 15:48 ` [PATCH qedr 07/10] qedr: Add support for data path Ram Amrani
2016-10-05 15:48 ` [PATCH qedr 08/10] qedr: Add LL2 RoCE interface Ram Amrani
2016-10-05 15:48 ` [PATCH qedr 09/10] qedr: Add GSI support Ram Amrani
2016-10-05 15:48 ` [PATCH qedr 10/10] qedr: Add events support and register IB device Ram Amrani
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=20161008153942.GY9282@leon.nu \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=Rajesh.Borundia-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=Yuval.Mintz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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.