mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Banman <abanman@hpe.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: <mingo@redhat.com>, <akpm@linux-foundation.org>, <hpa@zytor.com>,
	<mike.travis@hpe.com>, <rja@hpe.com>, <sivanich@hpe.com>,
	<x86@kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/6] x86/platform/uv/BAU: Add payload descriptor qualifier
Date: Thu, 16 Feb 2017 15:12:48 -0600	[thread overview]
Message-ID: <f232dd11-5df1-6338-7578-93dcf1ede940@hpe.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1702161930120.3543@nanos>

I will resubmit this patch and [Patch 5/6] as separate patches. They are 
both independent of the wait_completion feature.

I agree with your suggestions here. The updated version will have 
KernelDoc comments and proper u** integer types. I'd also like to add a 
preparatory patch to implement the hub version enum constants. This 
patch will replace all the magic numbers used to check uvhub_version. 
Like so:

[Patch 1/2] x86/platform/uv/BAU: Add uv_bau_version enumerated constants
[PATCH 2/2] x86/platform/uv/BAU: Add payload descriptor qualifier


Thank you for the suggestions!

Andrew Banman

On 02/16/2017 12:42 PM, Thomas Gleixner wrote:
> On Tue, 14 Feb 2017, Andrew Banman wrote:
>
>> On UV4, the destination agent verifies each message by checking the
>> descriptor qualifier field of the message payload. Messages without this
>> field set to 0x534749 will cause a hub error to assert.
>
> Ok.
>
> What's missing here is:
>
>   Seperate the message structs for uv123 and uv4.
>
>> Make this the default action for future architectures, anticipating they
>> will have the same requirement.
>
> That's a guarantee to cause issues when uv5 comes around. The way better
> solution for this is to do:
>
> enum uv_bau_version {
>      UV_BAU_V1 = 1,
>      UV_BAU_V2,
>      UV_BAU_V3,
>      UV_BAU_V4,
> };
>
> Make bau->uvhub_version type uv_bau_version and use the enum constants in
> the switch case. That way the compiler will catch you when you add
> UV_BAU_V5 and forgot to update that switch case. That's probably handy to
> have that in a few other places which switch on the bau version.
>
>> -struct bau_msg_payload {
>> +struct uv1_2_3_bau_msg_payload {
>>  	unsigned long	address;		/* signifies a page or all
>>  						   TLB's of the cpu */
>>  	/* 64 bits */
>> @@ -236,6 +238,20 @@ struct bau_msg_payload {
>>  	unsigned int	reserved1:32;		/* not usable */
>>  };
>>
>> +struct uv4_bau_msg_payload {
>> +	unsigned long	address;		/* signifies a page or all
>> +						 * TLB's of the cpu
>> +						 */
>
> Please get rid of these tail comments. Either document the struct members
> with a comment above the member or even better use the KernelDoc comment
> format above the struct to document it.
>
>> +	/* 64 bits */
>
> And these are horrible. I had to look twice where this belongs to. I know
> you copied existing crap, but that does not make it any better. And really,
> if you want to express the size of a member here because you have to talk
> to hardware then use the proper types we have for this: u64, u32, u16 ....
>
>> +	unsigned short	sending_cpu;		/* filled in by sender */
>> +	/* 16 bits */
>> +	unsigned short	acknowledge_count;	/* filled in by destination */
>> +	/* 16 bits */
>> +	unsigned int	reserved1:8;		/* not usable */
>> +	unsigned int	qualifier:24;		/* descriptor qualifier filled
>> +						 * in by sender
>
>
>> @@ -1200,6 +1200,7 @@ const struct cpumask *uv_flush_tlb_other
>>  	struct bau_control *bcp;
>>  	unsigned long descriptor_status;
>>  	unsigned long status;
>> +	unsigned long address;
>
> Same types can go into a single line. No value in wasting lines.
>
> Thanks,
>
> 	tglx
>

      reply	other threads:[~2017-02-16 21:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  1:58 [PATCH 0/6] x86/platform/uv/BAU: UV4 message completion and initialization updates Andrew Banman
2017-02-15  1:58 ` [PATCH 1/6] x86/platform/uv/BAU: Declare bau_operations struct after other BAU structs Andrew Banman
2017-02-16 18:00   ` Thomas Gleixner
2017-02-15  1:58 ` [PATCH 2/6] x86/platform/uv/BAU: Add status_mmr_loc to locate message status bits Andrew Banman
2017-02-16 18:07   ` Thomas Gleixner
2017-02-16 21:53     ` Andrew Banman
2017-02-15  1:58 ` [PATCH 3/6] x86/platform/uv/BAU: Add wait_completion to bau_operations Andrew Banman
2017-02-16 18:11   ` Thomas Gleixner
2017-02-15  1:58 ` [PATCH 4/6] x86/platform/uv/BAU: Implement uv4_wait_completion with read_status Andrew Banman
2017-02-16 18:25   ` Thomas Gleixner
2017-02-15  1:58 ` [PATCH 5/6] x86/platform/uv/BAU: Remove initial write to swack register Andrew Banman
2017-02-16 18:28   ` Thomas Gleixner
2017-02-15  1:58 ` [PATCH 6/6] x86/platform/uv/BAU: Add payload descriptor qualifier Andrew Banman
2017-02-16 18:42   ` Thomas Gleixner
2017-02-16 21:12     ` Andrew Banman [this message]

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=f232dd11-5df1-6338-7578-93dcf1ede940@hpe.com \
    --to=abanman@hpe.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.travis@hpe.com \
    --cc=mingo@redhat.com \
    --cc=rja@hpe.com \
    --cc=sivanich@hpe.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®