Linux-CXL Archive mirror
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] cxl/events: Use a common struct for DRAM and General Media events
Date: Fri, 17 May 2024 12:08:45 +0200	[thread overview]
Message-ID: <6226704.vuYhMxLoTh@fdefranc-mobl3> (raw)
In-Reply-To: <20240516173319.00007429@Huawei.com>

Jonathan,

Thanks for your comments.

On Thursday, May 16, 2024 6:33:19 PM GMT+2 Jonathan Cameron wrote:
> On Thu, 16 May 2024 12:19:53 +0200
> 
> "Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com> wrote:
> > cxl_event_common was a poor naming choice and caused confusion with the
> > existing Common Event Record.
> > 
> > Use cxl_event_media as a common structure to record information about DRAM
> > and General Media events because it simplifies handling the two events.
> > 
> > Suggested-by: Dan Williams <dan.j.williams@intel.com>
> > Fixes: 6aec00139d3a ("cxl/core: Add region info to cxl_general_media and
> > cxl_dram events") Signed-off-by: Fabio M. De Francesco
> > <fabio.m.de.francesco@linux.intel.com> ---
> 
> Packing question inline.
>
> > [...]
> > 
> > -struct cxl_event_dram {
> > +struct cxl_event_media {
> > 
> >  	struct cxl_event_record_hdr hdr;
> > 
> > -	__le64 phys_addr;
> > -	u8 descriptor;
> > -	u8 type;
> > -	u8 transaction_type;
> > -	u8 validity_flags[2];
> > -	u8 channel;
> > -	u8 rank;
> > -	u8 nibble_mask[3];
> > -	u8 bank_group;
> > -	u8 bank;
> > -	u8 row[3];
> > -	u8 column[2];
> > -	u8 correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE];
> > -	u8 reserved[0x17];
> > +	struct_group_tagged(cxl_event_media_hdr, media_hdr,
> > +		__le64 phys_addr;
> > +		u8 descriptor;
> > +		u8 type;
> > +		u8 transaction_type;
> > +		u8 validity_flags[2];
> > +		u8 channel;
> > +		u8 rank;
> > +	);
> 
> Does the struct that is created end up __packed?

No, I should have noticed it.

> Also, why is tagged useful here?

It is not useful. I'll rework it not tagged.

Again thanks,

Fabio

> > +	union {
> > +		struct_group(general,
> > +			u8 device[3];
> > +			u8 
component_id[CXL_EVENT_GEN_MED_COMP_ID_SIZE];
> > +			u8 gen_reserved[46];
> > +		);
> > +		struct_group(dram,
> > +			u8 nibble_mask[3];
> > +			u8 bank_group;
> > +			u8 bank;
> > +			u8 row[3];
> > +			u8 column[2];
> > +			u8 
correction_mask[CXL_EVENT_DER_CORRECTION_MASK_SIZE];
> > +			u8 dram_reserved[0x17];
> > +		);
> > +	};
> > 
> >  } __packed;
> >  



  reply	other threads:[~2024-05-17 10:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 10:19 [PATCH v2] cxl/events: Use a common struct for DRAM and General Media events Fabio M. De Francesco
2024-05-16 16:33 ` Jonathan Cameron
2024-05-17 10:08   ` Fabio M. De Francesco [this message]
2024-05-16 21:34 ` Ira Weiny
2024-05-17  0:43 ` Dan Williams
2024-05-17 13:16   ` Fabio M. De Francesco

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=6226704.vuYhMxLoTh@fdefranc-mobl3 \
    --to=fabio.m.de.francesco@linux.intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vishal.l.verma@intel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).