From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: oulijun <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: Linuxarm <linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [For help] rdma-roce build quesiton
Date: Wed, 26 Oct 2016 10:09:02 -0600 [thread overview]
Message-ID: <20161026160902.GD24898@obsidianresearch.com> (raw)
In-Reply-To: <581059FA.6070507-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
On Wed, Oct 26, 2016 at 03:23:38PM +0800, oulijun wrote:
> the build is fail and the print log as follows:
>
> error: size of unnamed array is negative
> attr->cap.max_recv_wr = min(context->max_qp_wr, attr->cap.max_recv_wr);
It is telling you the types are not the same, and this is a source of bugs
as C has some counter intuitive rules regarding type promotion.
1) Audit max_qp_wr and max_recv_wr to see if they really should be
different types, if not fix context->max_qp_wr to match
2) If they are legitimately different then use
min_t(<desired type>, context->max_qp_wr, attr->cap.max_recv_wr);
Think carefully about what common type is used because both arguments
will be casted, and the goal is to avoid a loss of precision or
signdedness in the cast.
Jason
--
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:[~2016-10-26 16:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 7:23 [For help] rdma-roce build quesiton oulijun
[not found] ` <581059FA.6070507-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-10-26 16:09 ` Jason Gunthorpe [this message]
[not found] ` <20161026160902.GD24898-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-27 2:15 ` oulijun
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=20161026160902.GD24898@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=oulijun-hv44wF8Li93QT0dZR+AlfA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.