From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH 2/4] cxgb4/iw_cxgb4: use firmware ord/ird resource limits
Date: Sun, 13 Jul 2014 13:59:24 +0200 [thread overview]
Message-ID: <1405252764.32637.21.camel@localhost.localdomain> (raw)
In-Reply-To: <1405091662-5270-3-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Hi,
Le vendredi 11 juillet 2014 à 20:44 +0530, Hariprasad Shenai a écrit :
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c
> b/drivers/infiniband/hw/cxgb4/qp.c
> index 6f74e0e..c911e96 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -58,6 +58,30 @@ static int max_fr_immd = T4_MAX_FR_IMMD;
> module_param(max_fr_immd, int, 0644);
> MODULE_PARM_DESC(max_fr_immd, "fastreg threshold for using DSGL
> instead of immedate");
>
> +static int alloc_ird(struct c4iw_dev *dev, u32 ird)
> +{
> + int ret;
> +
> + spin_lock_irq(&dev->lock);
> + if (ird <= dev->avail_ird) {
> + dev->avail_ird -= ird;
> + ret = 0;
> + } else {
> + ret = -ENOMEM;
> + pr_info("%s: device IRD resources exhausted\n",
> + pci_name(dev->rdev.lldi.pdev));
> + }
> + spin_unlock_irq(&dev->lock);
> + return ret;
> +}
> +
I would have written this function has:
static int alloc_ird(struct c4iw_dev *dev, u32 ird)
{
int ret = 0
spin_lock_irq(&dev->lock);
if (ird <= dev->avail_ird)
dev->avail_ird -= ird;
else
ret = -ENOMEM;
spin_unlock_irq(&dev->lock);
if (ret)
dev_warn(dev->rdev.lldi.pdev,
"device IRD resources exhausted\n");
return ret;
}
Regards.
--
Yann Droneaud
OPTEYA
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-07-13 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 15:14 [PATCH 0/4] Misc. fixes for iw_cxgb4 Hariprasad Shenai
2014-07-11 15:14 ` [PATCH 2/4] cxgb4/iw_cxgb4: use firmware ord/ird resource limits Hariprasad Shenai
[not found] ` <1405091662-5270-3-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2014-07-13 11:59 ` Yann Droneaud [this message]
2014-07-11 15:14 ` [PATCH 3/4] cxgb4/iw_cxgb4: display TPTE on errors Hariprasad Shenai
[not found] ` <1405091662-5270-4-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2014-07-13 12:36 ` Yann Droneaud
[not found] ` <1405091662-5270-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2014-07-11 15:14 ` [PATCH 1/4] iw_cxgb4: Detect Ing. Padding Boundary at run-time Hariprasad Shenai
2014-07-13 11:48 ` Yann Droneaud
2014-07-11 15:14 ` [PATCH 4/4] cxgb4/iw_cxgb4: work request logging feature Hariprasad Shenai
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=1405252764.32637.21.camel@localhost.localdomain \
--to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=kumaras-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
--cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.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;
as well as URLs for NNTP newsgroup(s).