Re: [PATCH 1/2] RDMA/rtrs: Use new shared CQ mechanism

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 22, 2021 at 11:31:55AM +0100, Jinpu Wang wrote:
> On Sun, Feb 21, 2021 at 7:23 AM Leon Romanovsky <leon@xxxxxxxxxx> wrote:
> >
> > On Fri, Feb 19, 2021 at 12:50:18PM +0100, Jack Wang wrote:
> > > Has the driver use shared CQs providing ~10%-20% improvement during
> > > test.
> > > Instead of opening a CQ for each QP per connection, a CQ for each QP
> > > will be provided by the RDMA core driver that will be shared between
> > > the QPs on that core reducing interrupt overhead.
> > >
> > > Signed-off-by: Jack Wang <jinpu.wang@xxxxxxxxxxxxxxx>
> > > ---
> > >  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 10 +++++-----
> > >  drivers/infiniband/ulp/rtrs/rtrs-pri.h |  1 +
> > >  drivers/infiniband/ulp/rtrs/rtrs-srv.c | 10 +++++-----
> > >  drivers/infiniband/ulp/rtrs/rtrs.c     | 11 +++++++----
> > >  4 files changed, 18 insertions(+), 14 deletions(-)

<...>

> > >       err = create_qp(con, sess->dev->ib_pd, max_send_wr, max_recv_wr,
> > >                       max_send_sge);
> > >       if (err) {
> > > -             ib_free_cq(con->cq);
> > > +             ib_cq_pool_put(con->cq, con->cq_size);
> > >               con->cq = NULL;
> > > +             con->cq_size = 0;
> >
> > It is better do not clear fields that not used, it hides bugs.
> > Other than that.
> I feel rewinding on the error path by resetting the cq_size is the
> right thing to do.

It is the right thing to do if down the road you have an access to
cq_size with if (..) check. Other than that, it is not right thing to
do.

Thanks



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux