From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [rdma-core v3 5/9] libbnxt_re: Allow apps to poll for flushed completions
Date: Mon, 20 Mar 2017 08:37:36 +0200 [thread overview]
Message-ID: <20170320063736.GV2079@mtr-leonro.local> (raw)
In-Reply-To: <CANjDDBiLnAhJWGfJ2TfJ=3_RoQW_KrfDBkxcSp586JuEL4hQXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 6924 bytes --]
On Sun, Mar 19, 2017 at 08:06:27PM +0530, Devesh Sharma wrote:
> Hi Leon,
>
> Will it okay if I revisit this change as a bug fix I need to validate
> the entire scheme with the suggested change.
Our past experience shows that developers tend to lost
interest and disappear once they submitted their code.
I'm not saying that you are one of such developers, but would be happy
to see fixed code before actually merging.
Thanks
>
> On Sun, Mar 19, 2017 at 1:42 PM, Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> > On Thu, Mar 16, 2017 at 08:52:27PM +0530, Devesh Sharma wrote:
> >> On Thu, Mar 16, 2017 at 12:50 AM, Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> >> > On Wed, Mar 15, 2017 at 06:37:29AM -0400, Devesh Sharma wrote:
> >> >> This patch adds support for reporting flush completions.
> >> >> following is the overview of the algorithm used.
> >> >>
> >> >> Step-1: Poll a completion from h/w CQ.
> >> >> Step-2: check the status, if it is error goto step3 else report
> >> >> completion to user based on the con_idx reported.
> >> >> Step-3: Report the completion with actual error to consumer, and
> >> >> without bothering about the con_idx reported in the
> >> >> completion do following:
> >> >> 3a. Add this QP to the CQ flush list if it was not there
> >> >> already. If this is req-error, add the QP to send-flush
> >> >> list, else add it to recv-flush-list.
> >> >> 3b. Change QP-soft-state to ERROR if it was not in error
> >> >> already.
> >> >>
> >> >> Step-4: If next CQE is TERM CQE, extract this CQE. make sure this CQE
> >> >> is not reported to the consumer. Do the following steps as
> >> >> further processing:
> >> >> 4a. Add this QP to both send-flush-list and recv-flush-list
> >> >> if QP is absent from any of the flush lists.
> >> >> 4b. Change QP-soft-state to ERROR if it was not in error
> >> >> already.
> >> >> Step5: Continue polling from both h/w CQ and flush-lists until
> >> >> all the queues are empty.
> >> >>
> >> >> The QP is removed from the flush list during destroy-qp.
> >> >>
> >> >> Further, it adds network to host format conversion on
> >> >> the received immediate data.
> >> >>
> >> >> This patch also takes care of Hardware specific requirement
> >> >> to skip reporting h/w flush error CQEs to consumer but ring
> >> >> the CQ-DB for them.
> >> >>
> >> >> v1->v2
> >> >> -- Used ccan/list.h instead.
> >> >>
> >> >> Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> >> >> Signed-off-by: Somnath Kotur <somnath.kotur-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> >> >> Signed-off-by: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> >> >> Signed-off-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
> >> >> ---
> >> >> providers/bnxt_re/flush.h | 85 ++++++++++++++++
> >> >> providers/bnxt_re/main.c | 5 +
> >> >> providers/bnxt_re/main.h | 6 ++
> >> >> providers/bnxt_re/memory.h | 5 +
> >> >> providers/bnxt_re/verbs.c | 243 ++++++++++++++++++++++++++++++++++++++++-----
> >> >> 5 files changed, 320 insertions(+), 24 deletions(-)
> >> >> create mode 100644 providers/bnxt_re/flush.h
> >> >>
> >> >> diff --git a/providers/bnxt_re/flush.h b/providers/bnxt_re/flush.h
> >> >> new file mode 100644
> >> >> index 0000000..a39ea71
> >> >> --- /dev/null
> >> >> +++ b/providers/bnxt_re/flush.h
> >> >> @@ -0,0 +1,85 @@
> >> >> +/*
> >> >> + * Broadcom NetXtreme-E User Space RoCE driver
> >> >> + *
> >> >> + * Copyright (c) 2015-2017, Broadcom. All rights reserved. The term
> >> >> + * Broadcom refers to Broadcom Limited and/or its subsidiaries.
> >> >> + *
> >> >> + * This software is available to you under a choice of one of two
> >> >> + * licenses. You may choose to be licensed under the terms of the GNU
> >> >> + * General Public License (GPL) Version 2, available from the file
> >> >> + * COPYING in the main directory of this source tree, or the
> >> >> + * BSD license below:
> >> >> + *
> >> >> + * Redistribution and use in source and binary forms, with or without
> >> >> + * modification, are permitted provided that the following conditions
> >> >> + * are met:
> >> >> + *
> >> >> + * 1. Redistributions of source code must retain the above copyright
> >> >> + * notice, this list of conditions and the following disclaimer.
> >> >> + * 2. Redistributions in binary form must reproduce the above copyright
> >> >> + * notice, this list of conditions and the following disclaimer in
> >> >> + * the documentation and/or other materials provided with the
> >> >> + * distribution.
> >> >> + *
> >> >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
> >> >> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
> >> >> + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
> >> >> + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
> >> >> + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
> >> >> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
> >> >> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> >> >> + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> >> >> + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
> >> >> + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
> >> >> + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> >> >> + *
> >> >> + * Description: A few wrappers for flush queue management
> >> >> + */
> >> >> +
> >> >> +#ifndef __FLUSH_H__
> >> >> +#define __FLUSH_H__
> >> >> +
> >> >> +#include <ccan/list.h>
> >> >> +
> >> >> +struct bnxt_re_fque_node {
> >> >> + uint8_t valid;
> >> >> + struct list_node list;
> >> >> +};
> >> >> +
> >> >> +static inline void fque_init_node(struct bnxt_re_fque_node *node)
> >> >> +{
> >> >> + list_node_init(&node->list);
> >> >> + node->valid = false;
> >> >> +}
> >> >> +
> >> >> +static inline void fque_add_node_tail(struct list_head *head,
> >> >> + struct bnxt_re_fque_node *new)
> >> >> +{
> >> >> + list_add_tail(head, &new->list);
> >> >> + new->valid = true;
> >> >> +}
> >> >> +
> >> >> +static inline void fque_del_node(struct bnxt_re_fque_node *entry)
> >> >> +{
> >> >> + entry->valid = false;
> >> >> + list_del(&entry->list);
> >> >> +}
> >> >> +
> >> >
> >> > I don't see the point of these wrappers.
> >>
> >> Wanted to keep "entry->valid" as a property of list element rather
> >> mixing it in the QP structure to keep things clean. Thus, could not
> >> resist to keep those.
> >
> > It looks like list == NULL can do the trick.
> >
> > Thanks
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-03-20 6:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 10:37 [rdma-core v3 0/9] Broadcom User Space RoCE Driver Devesh Sharma
[not found] ` <1489574253-20300-1-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-03-15 10:37 ` [rdma-core v3 1/9] libbnxt_re: introduce bnxtre user space RDMA provider Devesh Sharma
2017-03-15 10:37 ` [rdma-core v3 2/9] libbnxt_re: Add support for user memory regions Devesh Sharma
2017-03-15 10:37 ` [rdma-core v3 3/9] libbnxt_re: Add support for CQ and QP management Devesh Sharma
2017-03-15 10:37 ` [rdma-core v3 4/9] libbnxt_re: Add support for posting and polling Devesh Sharma
[not found] ` <1489574253-20300-5-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-03-15 16:34 ` Jason Gunthorpe
[not found] ` <20170315163454.GD29562-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-03-16 3:04 ` Devesh Sharma
[not found] ` <CANjDDBh9JP-0W4NDW4p-Jx2fivcSKS9ZAt5AdLRdQPXH8WxxCw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-16 16:17 ` Jason Gunthorpe
[not found] ` <20170316161754.GF23821-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-03-16 16:53 ` Devesh Sharma
2017-03-15 10:37 ` [rdma-core v3 5/9] libbnxt_re: Allow apps to poll for flushed completions Devesh Sharma
[not found] ` <1489574253-20300-6-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-03-15 19:20 ` Leon Romanovsky
[not found] ` <20170315192028.GI2079-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-16 15:22 ` Devesh Sharma
[not found] ` <CANjDDBgPrPPDBOy9N4X=XdU9AUTFpL2pE9-9kPvqAcYj09vDLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-19 8:12 ` Leon Romanovsky
[not found] ` <20170319081258.GR2079-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-19 14:36 ` Devesh Sharma
[not found] ` <CANjDDBiLnAhJWGfJ2TfJ=3_RoQW_KrfDBkxcSp586JuEL4hQXA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-20 6:37 ` Leon Romanovsky [this message]
2017-03-15 10:37 ` [rdma-core v3 6/9] libbnxt_re: Enable UD control path and wqe posting Devesh Sharma
2017-03-15 10:37 ` [rdma-core v3 7/9] libbnxt_re: Enable polling for UD completions Devesh Sharma
2017-03-15 10:37 ` [rdma-core v3 8/9] libbnxt_re: Add support for atomic operations Devesh Sharma
[not found] ` <1489574253-20300-9-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-03-15 19:15 ` Leon Romanovsky
[not found] ` <20170315191515.GH2079-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-16 15:54 ` Devesh Sharma
[not found] ` <CANjDDBjGCCc8MLLQ3jhToWyc0Z+Qm3pYejz3BrMrRketDdZbEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-16 16:07 ` Bart Van Assche
[not found] ` <1489680444.2574.9.camel-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2017-03-16 16:40 ` Jason Gunthorpe
2017-03-15 10:37 ` [rdma-core v3 9/9] libbnxt_re: Add support for SRQ in user lib Devesh Sharma
[not found] ` <1489574253-20300-10-git-send-email-devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-03-15 19:24 ` Leon Romanovsky
[not found] ` <20170315192408.GJ2079-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-19 14:34 ` Devesh Sharma
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=20170320063736.GV2079@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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