public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux Netdev List
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Eddie Wai <eddie.wai-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
	Devesh Sharma
	<devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
	Somnath Kotur
	<somnath.kotur-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
	Sriharsha Basavapatna
	<sriharsha.basavapatna-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH V5 for-next 16/21] RDMA/bnxt_re: Support poll_cq verb
Date: Mon, 13 Feb 2017 07:45:47 +0200	[thread overview]
Message-ID: <20170213054547.GL14015@mtr-leonro.local> (raw)
In-Reply-To: <CA+sbYW36txPueFBWFOWigHu_XmnTPY+-Vdu5MmGeOQ7uFjrWag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1996 bytes --]

On Mon, Feb 13, 2017 at 10:47:10AM +0530, Selvin Xavier wrote:
> On Sun, Feb 12, 2017 at 8:00 PM, Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> >> +static u8 __rc_to_ib_wc_status(u8 qstatus)
> >> +{
> >> +     switch (qstatus) {
> >> +     case CQ_RES_RC_STATUS_OK:
> >> +             return IB_WC_SUCCESS;
> >> +     case CQ_RES_RC_STATUS_LOCAL_ACCESS_ERROR:
> >> +             return IB_WC_LOC_ACCESS_ERR;
> >> +     case CQ_RES_RC_STATUS_LOCAL_LENGTH_ERR:
> >> +             return IB_WC_LOC_LEN_ERR;
> >> +     case CQ_RES_RC_STATUS_LOCAL_PROTECTION_ERR:
> >> +             return IB_WC_LOC_PROT_ERR;
> >> +     case CQ_RES_RC_STATUS_LOCAL_QP_OPERATION_ERR:
> >> +             return IB_WC_LOC_QP_OP_ERR;
> >> +     case CQ_RES_RC_STATUS_MEMORY_MGT_OPERATION_ERR:
> >> +             return IB_WC_GENERAL_ERR;
> >> +     case CQ_RES_RC_STATUS_REMOTE_INVALID_REQUEST_ERR:
> >> +             return IB_WC_REM_INV_REQ_ERR;
> >> +     case CQ_RES_RC_STATUS_WORK_REQUEST_FLUSHED_ERR:
> >> +             return IB_WC_WR_FLUSH_ERR;
> >> +     case CQ_RES_RC_STATUS_HW_FLUSH_ERR:
> >> +             return IB_WC_WR_FLUSH_ERR;
> >> +     default:
> >> +             return IB_WC_GENERAL_ERR;
> >> +     }
> >> +}
> >> +
> >
> > Why don't you use these defines directly?
>
> CQ_RES* values are returned by the HW and these values are
> different from the corresponding IB_WC status values.   say,
> CQ_RES_RC_STATUS_HW_FLUSH_ERR is 8 where as
> IB_WC_WR_FLUSH_ERR is 5.
> So we thought it is better to map these values in a function rather
> than having a switch/case in the calling function.
>
> Let me know if you meant something different in your query.

Thanks,
This from_u8 -> to_u8 conversion confused me, because of our similar
function mlx5_handle_error_cqe() which updates wc->status at the same
time as it is called. So I expected to see something similar in your code
where you fill wc.

Reviewed-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-02-13  5:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 11:19 [PATCH V5 for-next 00/21] Broadcom RoCE Driver (bnxt_re) Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 01/21] RDMA/bnxt_re: Add bnxt_re RoCE driver files Selvin Xavier
     [not found] ` <1486725593-9872-1-git-send-email-selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-02-10 11:19   ` [PATCH V5 for-next 02/21] RDMA/bnxt_re: Introducing autogenerated Host Software Interface(hsi) file Selvin Xavier
2017-02-10 11:19   ` [PATCH V5 for-next 03/21] RDMA/bnxt_re: register with the NIC driver Selvin Xavier
2017-02-10 11:19   ` [PATCH V5 for-next 08/21] RDMA/bnxt_re: Adding support for port related verbs Selvin Xavier
2017-02-10 11:19   ` [PATCH V5 for-next 16/21] RDMA/bnxt_re: Support poll_cq verb Selvin Xavier
     [not found]     ` <1486725593-9872-17-git-send-email-selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-02-12 14:30       ` Leon Romanovsky
     [not found]         ` <20170212143051.GD14015-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-02-13  5:17           ` Selvin Xavier
     [not found]             ` <CA+sbYW36txPueFBWFOWigHu_XmnTPY+-Vdu5MmGeOQ7uFjrWag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-02-13  5:45               ` Leon Romanovsky [this message]
2017-02-10 11:19   ` [PATCH V5 for-next 18/21] RDMA/bnxt_re: Support for DCB Selvin Xavier
2017-02-10 11:19   ` [PATCH V5 for-next 21/21] RDMA/bnxt_re: Add bnxt_re driver build support Selvin Xavier
2017-02-12  7:54     ` Leon Romanovsky
2017-03-02 14:57   ` [PATCH V5 for-next 00/21] Broadcom RoCE Driver (bnxt_re) Or Gerlitz
2017-03-02 15:01     ` Devesh Sharma
     [not found]       ` <CANjDDBg_QoSwHMqjUOr2UrobaBHwyfrHzzK8N7VXcmq1eEONSA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-02 15:48         ` Or Gerlitz
2017-03-02 15:08     ` Leon Romanovsky
2017-02-10 11:19 ` [PATCH V5 for-next 04/21] RDMA/bnxt_re: Enabling RoCE control path Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 05/21] RDMA/bnxt_re: Adding Notification Queue support Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 06/21] RDMA/bnxt_re: Support for PD, ucontext and mmap verbs Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 07/21] RDMA/bnxt_re: Support for query and modify device verbs Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 09/21] RDMA/bnxt_re: Support for GID related verbs Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 10/21] RDMA/bnxt_re: Support for CQ verbs Selvin Xavier
2017-02-14 12:22   ` Leon Romanovsky
2017-02-10 11:19 ` [PATCH V5 for-next 11/21] RDMA/bnxt_re: Support for AH verbs Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 12/21] RDMA/bnxt_re: Support memory registration verbs Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 13/21] RDMA/bnxt_re: Support QP verbs Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 14/21] RDMA/bnxt_re: Support post_send verb Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 15/21] RDMA/bnxt_re: Support post_recv Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 17/21] RDMA/bnxt_re: Handling dispatching of events to IB stack Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 19/21] RDMA/bnxt_re: Set uverbs command mask Selvin Xavier
2017-02-10 11:19 ` [PATCH V5 for-next 20/21] RDMA/bnxt_re: Add QP event handling Selvin Xavier
2017-02-14 14:59 ` [PATCH V5 for-next 00/21] Broadcom RoCE Driver (bnxt_re) Doug Ledford

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=20170213054547.GL14015@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=eddie.wai-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=somnath.kotur-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=sriharsha.basavapatna-dY08KVG/lbpWk0Htik3J/w@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