lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Feb 2017 07:45:47 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Selvin Xavier <selvin.xavier@...adcom.com>
Cc:     Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
        Linux Netdev List <netdev@...r.kernel.org>,
        Eddie Wai <eddie.wai@...adcom.com>,
        Devesh Sharma <devesh.sharma@...adcom.com>,
        Somnath Kotur <somnath.kotur@...adcom.com>,
        Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>
Subject: Re: [PATCH V5 for-next 16/21] RDMA/bnxt_re: Support poll_cq verb

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@...nel.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@...lanox.com>

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ