Re: [PATCH rdma-next v3 2/7] RDMA/core: Add helper function to create named QPs

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

 



On Fri, Jan 12, 2018 at 08:42:43AM +0200, Leon Romanovsky wrote:
> On Thu, Jan 11, 2018 at 07:50:21PM +0000, Bart Van Assche wrote:
> > On Thu, 2018-01-11 at 17:31 +0200, Leon Romanovsky wrote:
> > > --- a/include/rdma/ib_verbs.h
> > > +++ b/include/rdma/ib_verbs.h
> > > @@ -1141,6 +1141,12 @@ struct ib_qp_init_attr {
> > >         u8                      port_num;
> > >         struct ib_rwq_ind_table *rwq_ind_tbl;
> > >         u32                     source_qpn;
> > > +
> > > +       /*
> > > +        * Name of entity which created this QP, empty string means that
> > > +        * it will be taken automatically from task_struct.
> > > +        */
> > > +       char comm[TASK_COMM_LEN];
> > >  };
> >
> > Why is "comm" a char array instead of a const char pointer or dynamically
> > allocated memory (kstrdup())? Can we get rid of the strncpy() calls in code
> > that fills in this data structure?
>
> Yes, we can, initially, I didn't want to bother with corner cases of
> failure in allocations, but in last version of code it is already easy
> to deal, so I'll replace.

OK, I started to replace per-your request and found myself replacing half of
the code from dynamic allocations to be static initialization for the QP
attributes. I need to do it to avoid dealing with release path too.

And found that it is simply too much for this series, and it can come as future
optimization.

Thanks


> >
> > Thanks,
> >
> > Bart.
> >


Attachment: signature.asc
Description: PGP signature


[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