public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Michael Kelley <mhklinux@outlook.com>
Cc: "Shradha Gupta" <shradhagupta@linux.microsoft.com>,
	"Dexuan Cui" <decui@microsoft.com>,
	"Wei Liu" <wei.liu@kernel.org>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Konstantin Taranov" <kotaranov@microsoft.com>,
	"Simon Horman" <horms@kernel.org>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Maxim Levitsky" <mlevitsk@redhat.com>,
	"Erni Sri Satya Vennela" <ernis@linux.microsoft.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"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>,
	"Nipun Gupta" <nipun.gupta@amd.com>,
	"Jason Gunthorpe" <jgg@ziepe.ca>,
	"Jonathan Cameron" <Jonathan.Cameron@huwei.com>,
	"Anna-Maria Behnsen" <anna-maria@linutronix.de>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"Long Li" <longli@microsoft.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Rob Herring" <robh@kernel.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczy�~Dski" <kw@linux.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"Paul Rosswurm" <paulros@microsoft.com>,
	"Shradha Gupta" <shradhagupta@microsoft.com>
Subject: Re: [PATCH v3 4/4] net: mana: Allocate MSI-X vectors dynamically
Date: Wed, 14 May 2025 13:07:47 -0400	[thread overview]
Message-ID: <aCTN4yfHBsJGXvnB@yury> (raw)
In-Reply-To: <SN6PR02MB4157AD1A0BA2C0C9237FEAA3D491A@SN6PR02MB4157.namprd02.prod.outlook.com>

On Wed, May 14, 2025 at 05:04:03AM +0000, Michael Kelley wrote:
> From: Shradha Gupta <shradhagupta@linux.microsoft.com> Sent: Friday, May 9, 2025 3:14 AM
> > 
> > Currently, the MANA driver allocates MSI-X vectors statically based on
> > MANA_MAX_NUM_QUEUES and num_online_cpus() values and in some cases ends
> > up allocating more vectors than it needs. This is because, by this time
> > we do not have a HW channel and do not know how many IRQs should be
> > allocated.
> > 
> > To avoid this, we allocate 1 MSI-X vector during the creation of HWC and
> > after getting the value supported by hardware, dynamically add the
> > remaining MSI-X vectors.
> 
> After this patch is applied, there are two functions for setting up IRQs:
> 1. mana_gd_setup_dyn_irqs()
> 2. mana_gd_setup_irqs()
> 
> #1 is about 78 lines of code and comments, while #2 is about 103 lines of
> code and comments. But the two functions have a lot of commonality,
> and that amount of commonality raises a red flag for me.
> 
> Have you looked at parameterizing things so a single function can serve
> both purposes? I haven't worked through all the details, but at first
> glance it looks very feasible, and without introducing unreasonable
> messiness. Saving 70 to 80 lines of fairly duplicative code is worth a bit
> of effort.
> 
> I have some other comments on the code. But if those two functions can
> be combined, I'd rather re-review the result before adding comments that
> may become irrelevant due to the restructuring.
> 
> Michael

On previous iteration I already mentioned that this patch is too big,
doesn't do exactly one thing and should be split to become a reviewable 
change. Shradha split-out the irq_setup() piece, and your review proves
that splitting helps to reviewability.

The rest of the change is still a mess. I agree that the functions you
mention likely duplicate each other. But overall, this patch bomb is
above my ability to review. Fortunately, I don't have to.

Thanks,
Yury

  reply	other threads:[~2025-05-14 17:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09 10:12 [PATCH v3 0/4] Allow dyn MSI-X vector allocation of MANA Shradha Gupta
2025-05-09 10:13 ` [PATCH v3 1/4] PCI/MSI: Export pci_msix_prepare_desc() for dynamic MSI-X allocations Shradha Gupta
2025-05-09 10:13 ` [PATCH v3 2/4] PCI: hv: Allow dynamic MSI-X vector allocation Shradha Gupta
2025-05-12  7:00   ` Manivannan Sadhasivam
2025-05-12  7:38     ` Shradha Gupta
2025-05-09 10:13 ` [PATCH v3 3/4] net: mana: Allow irq_setup() to skip cpus for affinity Shradha Gupta
2025-05-09 15:49   ` Yury Norov
2025-05-12  5:49     ` Shradha Gupta
2025-05-14  4:53   ` Michael Kelley
2025-05-14 16:55     ` Yury Norov
2025-05-14 17:26       ` Michael Kelley
2025-05-14 17:58         ` Yury Norov
2025-05-15  4:51           ` Shradha Gupta
2025-05-15  4:49         ` Shradha Gupta
2025-05-09 10:13 ` [PATCH v3 4/4] net: mana: Allocate MSI-X vectors dynamically Shradha Gupta
2025-05-14  5:04   ` Michael Kelley
2025-05-14 17:07     ` Yury Norov [this message]
2025-05-15  5:10       ` Shradha Gupta
2025-05-21 16:27   ` Michael Kelley
2025-05-22  9:17     ` Shradha Gupta

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=aCTN4yfHBsJGXvnB@yury \
    --to=yury.norov@gmail.com \
    --cc=Jonathan.Cameron@huwei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anna-maria@linutronix.de \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=ernis@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=horms@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kotaranov@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kw@linux.com \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mhklinux@outlook.com \
    --cc=mlevitsk@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nipun.gupta@amd.com \
    --cc=pabeni@redhat.com \
    --cc=paulros@microsoft.com \
    --cc=peterz@infradead.org \
    --cc=robh@kernel.org \
    --cc=shradhagupta@linux.microsoft.com \
    --cc=shradhagupta@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=wei.liu@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