public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Cc: jgg@ziepe.ca, Dean Luick <dean.luick@cornelisnetworks.com>,
	Breandan Cunningham <brendan.cunningham@cornelisnetworks.com>,
	Douglas Miller <doug.miller@cornelisnetworks.com>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next resend 01/24] RDMA/hfi2: Start hfi2 driver by basing off of hfi1
Date: Tue, 17 Mar 2026 12:07:49 +0200	[thread overview]
Message-ID: <20260317100749.GU61385@unreal> (raw)
In-Reply-To: <1954a5ec-2a77-4713-b20f-6a6c09b7f18a@cornelisnetworks.com>

On Mon, Mar 16, 2026 at 06:00:22PM -0400, Dennis Dalessandro wrote:
> On 3/16/26 11:51 AM, Leon Romanovsky wrote:

<...>

> > 
> > > +	void (*setextled)(struct hfi2_pportdata *ppd, u32 on);
> > > +	void (*start_led_override)(struct hfi2_pportdata *ppd,
> > > +				   unsigned int timeon,
> > > +				   unsigned int timeoff);
> > > +	void (*shutdown_led_override)(struct hfi2_pportdata *ppd);
> > > +	void (*read_guid)(struct hfi2_devdata *dd);
> > > +	int (*early_per_chip_init)(struct hfi2_devdata *dd);
> > > +	int (*mid_per_chip_init)(struct hfi2_devdata *dd);
> > > +	void (*init_other)(struct hfi2_devdata *dd);
> > > +	int (*late_per_chip_init)(struct hfi2_devdata *dd);
> > > +	void (*start_port)(struct hfi2_pportdata *ppd);
> > > +	void (*stop_port)(struct hfi2_pportdata *ppd);
> > > +	void (*put_tid)(struct hfi2_ctxtdata *rcd, u32 index,
> > > +			u32 type, unsigned long pa, u16 order, bool flush);
> > > +	void (*rcv_array_wc_fill)(struct hfi2_ctxtdata *rcd, u32 index,
> > > +				  u32 type);
> > > +	void (*set_port_tid_config)(struct hfi2_devdata *dd, int pidx, u16 ctxt,
> > > +				    u32 eager_base, u16 alloced,
> > > +				    u32 expected_base, u32 expected_count);
> > > +	void (*set_port_max_mtu)(struct hfi2_pportdata *ppd, u32 maxvlmtu);
> > > +	void (*update_rcv_hdr_size)(struct hfi2_pportdata *ppd, u16 ctxt,
> > > +				    u32 size);
> > > +	bool (*check_synth_status)(struct hfi2_devdata *dd);
> > > +	void (*update_synth_status)(struct hfi2_devdata *dd);
> > > +	u64 (*create_pbc)(struct hfi2_pportdata *ppd, bool loopback, u64 flags,
> > > +			  int srate_mbs, u32 vl, u32 dw_len, u32 l2, u32 dlid, u32 sctxt);
> > > +	void (*set_pio_integrity)(struct hfi2_devdata *dd, u32 pidx, u32 ctxt, int type,
> > > +				  enum spi_cmds cmd);
> > > +	int (*find_used_resources)(struct hfi2_devdata *dd);
> > > +	void (*read_link_quality)(struct hfi2_pportdata *ppd, u8 *link_quality);
> > > +	void (*set_rheq_addr)(struct hfi2_devdata *dd, u16 ctxt, u64 dma_addr);
> > > +	void (*handle_link_bounce)(struct work_struct *work);
> > > +	void (*enable_rcv_context)(struct hfi2_pportdata *ppd, u16 ctxt,
> > > +				   u64 *kctxt_ctrl, bool enable);
> > 
> > Do you really need function pointers inside driver? It makes possible refactoring harder.
> 
> We do use function pointers in a number of places because of performance
> reasons. However these are more for abstracting away the differences between
> the different chips. I'll consult with the team and see if we can clean this
> up any.

BTW, function pointers generally perform worse than direct calls, since  
they always require an indirect jump, which is harder for the branch  
predictor to handle.

Their main purpose is to allow the invoked function to be changed  
dynamically.


<...>

> > > +static inline int valid_opa_max_mtu(unsigned int mtu)
> > > +{
> > > +	return mtu >= 2048 &&
> > > +		(valid_ib_mtu(mtu) || mtu == 8192 || mtu == 10240);
> > > +}
> > 
> > No to module parameter.
> 
> Why? This has been a long standing knob available to users. Same with many
> of the others below. We can look into whittling them down if they are not
> being used regularly. Some of these are important for tuning performance and
> are meant to be tuned driver wide at init time, not per hfi instance which
> generally is my litmus test for if something can be a module paramter.
> 
> Perhaps it would be better dealt with as a follow on patch to this series to
> refine the whole set?

Yes, please remove the module parameters from the initial submission.
We can address them afterward. There is also a possibility that these
parameters could be useful for other drivers.

> 
> Thanks for the detailed review.

I'm continuing the review today as well.

Thanks

> 
> -Denny
> 

  reply	other threads:[~2026-03-17 10:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 17:53 [PATCH for-next resend 00/24] Migrate to hfi2 driver Dennis Dalessandro
2026-03-11 17:53 ` [PATCH for-next resend 01/24] RDMA/hfi2: Start hfi2 driver by basing off of hfi1 Dennis Dalessandro
2026-03-16 15:51   ` Leon Romanovsky
2026-03-16 22:00     ` Dennis Dalessandro
2026-03-17 10:07       ` Leon Romanovsky [this message]
2026-03-11 17:53 ` [PATCH for-next resend 02/24] RDMA/hfi2: Add in HW register definition files Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 03/24] RDMA/hfi2: Add counter accessor functions Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 04/24] RDMA/hfi2: Add in HW register access support Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 05/24] RDMA/hfi2: Add in trace header files Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 06/24] RDMA/hfi2: Add in trace support Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 07/24] RDMA/hfi2: Add system core header files Dennis Dalessandro
2026-03-16 15:58   ` Leon Romanovsky
2026-03-16 21:37     ` Dennis Dalessandro
2026-03-17  9:54       ` Leon Romanovsky
2026-03-11 17:54 ` [PATCH for-next resend 08/24] RDMA/hfi2: Add driver and interrupt infrastructure Dennis Dalessandro
2026-03-18  9:11   ` Leon Romanovsky
2026-03-11 17:54 ` [PATCH for-next resend 09/24] RDMA/hfi2: Add initialization and firmware support Dennis Dalessandro
2026-03-18  9:14   ` Leon Romanovsky
2026-03-11 17:54 ` [PATCH for-next resend 10/24] RDMA/hfi2: Add in MAD handling related headers Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 11/24] RDMA/hfi2: Add cport management Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 12/24] RDMA/hfi2: Implement MAD handling Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 13/24] RDMA/hfi2: Add IO related headers Dennis Dalessandro
2026-03-11 17:54 ` [PATCH for-next resend 14/24] RDMA/hfi2: Add PIO send infrastructure Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 15/24] RDMA/hfi2: Add SDMA infrastructure Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 16/24] RDMA/hfi2: Implement data moving infrastructure Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 17/24] RDMA/hfi2: Add verbs core Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 18/24] RDMA/hfi2: Add RC protocol support Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 19/24] RDMA/hfi2: Add in support for verbs Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 20/24] RDMA/hfi2: Support ipoib Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 21/24] RDMA/hfi2: Add misc header files Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 22/24] RDMA/hfi2: Add the rest of the driver Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 23/24] RDMA/hfi2: Make it build Dennis Dalessandro
2026-03-11 17:55 ` [PATCH for-next resend 24/24] RDMA/hfi2: Modernize mmap to use rdma_user_mmap_entry infrastructure Dennis Dalessandro
2026-03-16 16:02 ` [PATCH for-next resend 00/24] Migrate to hfi2 driver Leon Romanovsky
2026-03-16 21:29   ` Dennis Dalessandro

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=20260317100749.GU61385@unreal \
    --to=leon@kernel.org \
    --cc=brendan.cunningham@cornelisnetworks.com \
    --cc=dean.luick@cornelisnetworks.com \
    --cc=dennis.dalessandro@cornelisnetworks.com \
    --cc=doug.miller@cornelisnetworks.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-rdma@vger.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