Re: [PATCH net-next v3 1/2] net/smc: make wr buffer count configurable

From: Halil Pasic

Date: Sat Sep 27 2025 - 18:55:32 EST


On Thu, 25 Sep 2025 13:25:40 +0200
Halil Pasic <pasic@xxxxxxxxxxxxx> wrote:

> > [...]
> > > @@ -683,6 +678,8 @@ int smc_ib_create_queue_pair(struct smc_link *lnk)
> > > };
> > > int rc;
> > >
> > > + qp_attr.cap.max_send_wr = 3 * lnk->lgr->max_send_wr;
> > > + qp_attr.cap.max_recv_wr = lnk->lgr->max_recv_wr;
> >
> > Possibly:
> >
> > cap = max(3 * lnk->lgr->max_send_wr, lnk->lgr->max_recv_wr);
> > qp_attr.cap.max_send_wr = cap;
> > qp_attr.cap.max_recv_wr = cap
> >
> > to avoid assumption on `max_send_wr`, `max_recv_wr` relative values.
>
> Can you explain a little more. I'm happy to do the change, but I would
> prefer to understand why is keeping qp_attr.cap.max_send_wr ==
> qp_attr.cap.max_recv_wr better? But if you tell: "Just trust me!" I will.

Due to a little accident we ended up having a private conversation
on this, which I'm going to sum up quickly.

Paolo stated that he has no strong preference and that I should at
least add a comment, which I will do for v4.

Unfortunately I don't quite understand why qp_attr.cap.max_send_wr is 3
times the number of send WR buffers we allocate. My understanding
is that qp_attr.cap.max_send_wr is about the number of send WQEs.
I assume that qp_attr.cap.max_send_wr == qp_attr.cap.max_recv_wr
is not something we would want to preserve.

Regards,
Halil