[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <88B766C272F2C64B944B21AD078333151C964A63FF@EXMAIL.ad.emulex.com>
Date: Wed, 21 Mar 2012 12:10:20 -0700
From: <Parav.Pandit@...lex.Com>
To: <roland@...estorage.com>
CC: <linux-rdma@...r.kernel.org>, <netdev@...r.kernel.org>
Subject: RE: [PATCH 6/9] ocrdma: Driver for Emulex OneConnect RDMA adapter
> -----Original Message-----
> From: Roland Dreier [mailto:roland@...estorage.com]
> Sent: Wednesday, March 21, 2012 10:13 PM
> To: Pandit, Parav
> Cc: linux-rdma@...r.kernel.org; netdev@...r.kernel.org
> Subject: Re: [PATCH 6/9] ocrdma: Driver for Emulex OneConnect RDMA
> adapter
>
> > +struct ib_pd *ocrdma_alloc_pd(struct ib_device *ibdev,
> > + struct ib_ucontext *context,
> > + struct ib_udata *udata) {
> > + struct ocrdma_dev *dev = get_ocrdma_dev(ibdev);
> > + struct ocrdma_pd *pd;
> > + int status;
> > +
> > + pd = kzalloc(sizeof(*pd), GFP_KERNEL);
> > + if (!pd)
> > + return ERR_PTR(-ENOMEM);
> > + pd->dev = dev;
> > + if (udata && context) {
> > + pd->dpp_enabled = (dev->nic_info.dev_family ==
> > + OCRDMA_GEN2_FAMILY) ? true :
> > + false;
>
> Writing
>
> (<bool expr>) ? true : false
>
> is pretty silly, since it's just an obfuscated way of writing
>
> <bool expr>
>
> IOW, you can just write
>
> pd->dpp_enabled = (dev->nic_info.dev_family ==
> OCRDMA_GEN2_FAMILY);
>
>
> > +int ocrdma_dealloc_pd(struct ib_pd *ibpd) {
> > + struct ocrdma_pd *pd = get_ocrdma_pd(ibpd);
> > + struct ocrdma_dev *dev = pd->dev;
> > + int status;
> > + u64 usr_db;
> > +
> > + if (atomic_read(&pd->use_cnt)) {
> > + ocrdma_err("%s(%d) pd=0x%x is in use.\n",
> > + __func__, dev->id, pd->id);
> > + status = -EFAULT;
> > + goto dealloc_err;
> > + }
>
> all of the use_cnt tracking in this driver seems to duplicate what the rdma
> midlayer already does... is there any reason we need that in the low-level
> hardware driver too, or can we just get rid of the various use_cnt members?
This use_cnt can be removed from low-level hardware driver. I'll remove it.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists