From: Or Gerlitz <ogerlitz@mellanox.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: target-devel <target-devel@vger.kernel.org>,
linux-rdma <linux-rdma@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
Roland Dreier <roland@kernel.org>,
Alexander Nezhinsky <alexandern@mellanox.com>
Subject: Re: [RFC 10/11] iser-target: Add logic for core
Date: Thu, 14 Mar 2013 13:58:35 +0200 [thread overview]
Message-ID: <5141BB6B.9060708@mellanox.com> (raw)
In-Reply-To: <1362707116-31406-11-git-send-email-nab@linux-iscsi.org>
On 08/03/2013 03:45, Nicholas A. Bellinger wrote:
> +void
> +iser_cq_tx_tasklet(unsigned long data)
> +{
> + struct isert_conn *isert_conn = (struct isert_conn *)data;
> + struct ib_cq *tx_cq = isert_conn->conn_tx_cq;
> + struct iser_tx_desc *tx_desc;
> + struct ib_wc wc;
> +
> + while (ib_poll_cq(tx_cq, 1, &wc) == 1) {
> + tx_desc = (struct iser_tx_desc *)(unsigned long)wc.wr_id;
> +
> + if (wc.status == IB_WC_SUCCESS) {
> + isert_send_completion(tx_desc, isert_conn);
> + } else {
> + pr_debug("TX wc.status != IB_WC_SUCCESS >>>>>>>>>>>>>>\n");
> + isert_dump_ib_wc(&wc);
> + atomic_dec(&isert_conn->post_send_buf_count);
> + isert_cq_comp_err(tx_desc, isert_conn);
> + }
> + }
> +
> + ib_req_notify_cq(tx_cq, IB_CQ_NEXT_COMP);
> +}
> +
> +void
> +isert_cq_tx_callback(struct ib_cq *cq, void *context)
> +{
> + struct isert_conn *isert_conn = context;
> +
> + tasklet_schedule(&isert_conn->conn_tx_tasklet);
> +}
> +
> +void
> +iser_cq_rx_tasklet(unsigned long data)
> +{
> + struct isert_conn *isert_conn = (struct isert_conn *)data;
> + struct ib_cq *rx_cq = isert_conn->conn_rx_cq;
> + struct iser_rx_desc *rx_desc;
> + struct ib_wc wc;
> + unsigned long xfer_len;
> +
> + while (ib_poll_cq(rx_cq, 1, &wc) == 1) {
> + rx_desc = (struct iser_rx_desc *)(unsigned long)wc.wr_id;
> +
> + if (wc.status == IB_WC_SUCCESS) {
> + xfer_len = (unsigned long)wc.byte_len;
> + isert_rx_completion(rx_desc, isert_conn, xfer_len);
> + } else {
> + pr_debug("RX wc.status != IB_WC_SUCCESS >>>>>>>>>>>>>>\n");
> + if (wc.status != IB_WC_WR_FLUSH_ERR)
> + isert_dump_ib_wc(&wc);
> +
> + isert_conn->post_recv_buf_count--;
> + isert_cq_comp_err(NULL, isert_conn);
> + }
> + }
> +
> + ib_req_notify_cq(rx_cq, IB_CQ_NEXT_COMP);
> +}
We currently have here the following sequence of calls
isert_cq_rx_callback --> tasklet_schedule ... --> ...
ib_poll_cq --> isert_rx_completion --> isert_rx_queue_desc -->
isert_rx_queue_desc --> queue_work (context switch)
isert_cq_tx_callback --> tasklet_schedule ... --> ...
ib_poll_cq --> isert_send_completion --> isert_completion_rdma_read
--> queue_work (context switch)
which means we have one context switch from the CQ callback to tasklet
and then a PER IO context switch
from the tasklet to a kernel thread context which you might need for IO
submission into the backing store.
This can be optimized by having one context switch from the isert cq
callbacks to a kernel thread, with the work
item being "do polling" and then from the cq polling code do the
submission into the backing store without
any further context switches.
Or.
> +
> +void
> +isert_cq_rx_callback(struct ib_cq *cq, void *context)
> +{
> + struct isert_conn *isert_conn = context;
> +
> + tasklet_schedule(&isert_conn->conn_rx_tasklet);
> +}
next prev parent reply other threads:[~2013-03-14 11:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 1:45 [RFC 00/11] Add support for iSCSI Extentions for RDMA (ISER) target Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 01/11] iscsi-target: Add iscsit_transport API template Nicholas A. Bellinger
2013-03-08 4:14 ` Roland Dreier
[not found] ` <CAG4TOxM=PDYXCAMNdRx629aAP+XF7oZmykg0k4b+a688PzzayA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-08 6:02 ` Nicholas A. Bellinger
2013-03-08 16:59 ` Roland Dreier
2013-03-08 12:36 ` Or Gerlitz
2013-03-08 21:26 ` Nicholas A. Bellinger
2013-03-22 17:23 ` Andy Grover
2013-03-22 22:29 ` Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 02/11] iscsi-target: Initial traditional TCP conversion to iscsit_transport Nicholas A. Bellinger
2013-03-22 17:23 ` Andy Grover
2013-03-22 22:38 ` Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 03/11] iscsi-target: Add iser-target parameter keys + setup during login Nicholas A. Bellinger
2013-03-22 17:23 ` Andy Grover
2013-03-22 22:57 ` Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 05/11] iscsi-target: Refactor RX PDU logic + export request PDU handling Nicholas A. Bellinger
[not found] ` <1362707116-31406-6-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
2013-03-22 17:23 ` Andy Grover
2013-03-22 23:09 ` Nicholas A. Bellinger
[not found] ` <1362707116-31406-1-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
2013-03-08 1:45 ` [RFC 04/11] iscsi-target: Add per transport iscsi_cmd alloc/free Nicholas A. Bellinger
2013-03-08 14:29 ` Asias He
2013-03-08 20:47 ` Nicholas A. Bellinger
[not found] ` <1362707116-31406-5-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
2013-03-22 17:23 ` Andy Grover
2013-03-22 22:59 ` Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 06/11] iscsi-target: Refactor TX queue logic + export response PDU creation Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 07/11] iscsi-target: Add iser network portal attribute Nicholas A. Bellinger
2013-03-08 1:45 ` [RFC 08/11] iser-target: Add base + proto includes Nicholas A. Bellinger
2013-03-14 11:26 ` Or Gerlitz
2013-03-08 1:45 ` [RFC 09/11] iser-target: Add logic for verbs Nicholas A. Bellinger
2013-03-14 11:19 ` Or Gerlitz
[not found] ` <1362707116-31406-10-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
2013-03-14 11:42 ` Or Gerlitz
2013-03-08 1:45 ` [RFC 10/11] iser-target: Add logic for core Nicholas A. Bellinger
2013-03-14 11:08 ` Or Gerlitz
2013-03-14 11:58 ` Or Gerlitz [this message]
2013-03-08 1:45 ` [RFC 11/11] iser-target: Add Makefile + Kconfig Nicholas A. Bellinger
2013-03-14 8:17 ` [RFC 00/11] Add support for iSCSI Extentions for RDMA (ISER) target Or Gerlitz
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=5141BB6B.9060708@mellanox.com \
--to=ogerlitz@mellanox.com \
--cc=alexandern@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=roland@kernel.org \
--cc=target-devel@vger.kernel.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