linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Sunil Muthuswamy <sunilmut@microsoft.com>
Cc: Wei Liu <wei.liu@kernel.org>, KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Wei Liu <liuwe@microsoft.com>, Dexuan Cui <decui@microsoft.com>,
	Michael Kelley <mikelley@microsoft.com>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [EXTERNAL] Re: [PATCH 1/1] PCI: hv: Support for create interrupt v3
Date: Fri, 9 Jul 2021 19:15:24 +0000	[thread overview]
Message-ID: <20210709191524.vbtlyg42v77f5drw@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <MW4PR21MB200200F17E1D0E4AEEA87D0DC0189@MW4PR21MB2002.namprd21.prod.outlook.com>

On Fri, Jul 09, 2021 at 04:42:13PM +0000, Sunil Muthuswamy wrote:
> > > +/*
> > > + * struct hv_msi_desc3 - 1.3 version of hv_msi_desc
> > > + *	Everything is the same as in 'hv_msi_desc2' except that the size
> > > + *	of the 'vector_count' field is larger to support bigger vector
> > > + *	values. For ex: LPI vectors on ARM.
> > > + */
> > > +struct hv_msi_desc3 {
> > > +	u32	vector;
> > > +	u8	delivery_mode;
> > > +	u8	reserved;
> > > +	u16	vector_count;
> > > +	u16	processor_count;
> > > +	u16	processor_array[32];
> > > +} __packed;
> > > +
> > >  /**
> > >   * struct tran_int_desc
> > >   * @reserved:		unused, padding
> > > @@ -383,6 +402,12 @@ struct pci_create_interrupt2 {
> > >  	struct hv_msi_desc2 int_desc;
> > >  } __packed;
> > >
> > > +struct pci_create_interrupt3 {
> > > +	struct pci_message message_type;
> > > +	union win_slot_encoding wslot;
> > > +	struct hv_msi_desc3 int_desc;
> > > +} __packed;
> > > +
> > >  struct pci_delete_interrupt {
> > >  	struct pci_message message_type;
> > >  	union win_slot_encoding wslot;
> > > @@ -1334,26 +1359,55 @@ static u32 hv_compose_msi_req_v1(
> > >  	return sizeof(*int_pkt);
> > >  }
> > >
> > > +static void hv_compose_msi_req_get_cpu(struct cpumask *affinity, int *cpu,
> > > +				       u16 *count)
> > 
> > Isn't count redundant here? I don't see how this can be used safely for
> > passing back more than 1 cpu, since if cpu is pointing to an array, its
> > size is not specified.
> > 
> > Wei.
> 
> Yes, it is at the moment. But, the function can be extended in the future to take
> a size as well. But, it will always be 1 and I preferred keeping that information
> with the implementation. If you have preference, I can hard code that in the
> caller. It seems fine for me either ways.

Since this is not too much trouble I would rather you remove count and
then introduce it when it is needed.

Wei.

> 
> - Sunil

  reply	other threads:[~2021-07-09 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 23:04 Sunil Muthuswamy
2021-07-09 10:24 ` Wei Liu
2021-07-09 16:42   ` [EXTERNAL] " Sunil Muthuswamy
2021-07-09 19:15     ` Wei Liu [this message]
2021-07-12 19:07 ` Michael Kelley
2021-07-12 19:13   ` Sunil Muthuswamy

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=20210709191524.vbtlyg42v77f5drw@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mikelley@microsoft.com \
    --cc=robh@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --subject='Re: [EXTERNAL] Re: [PATCH 1/1] PCI: hv: Support for create interrupt v3' \
    /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

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 NNTP newsgroup(s).