From: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
To: "Nicholas A. Bellinger"
<nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>,
target-devel
<target-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>,
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] ib_srpt: Add missing ioctx->buf + ->dma alloc_session_cb init
Date: Mon, 4 Apr 2016 11:40:03 -0700 [thread overview]
Message-ID: <5702B503.1060006@sandisk.com> (raw)
In-Reply-To: <1459794233-19187-1-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
On 04/04/2016 11:28 AM, Nicholas A. Bellinger wrote:
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 0bd3cb2..c4e0a0a 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -1266,7 +1266,9 @@ static struct srpt_send_ioctx *srpt_get_send_ioctx(struct srpt_rdma_ch *ch)
> {
> struct se_session *se_sess;
> struct srpt_send_ioctx *ioctx;
> - int tag;
> + void *buf;
> + dma_addr_t dma;
> + int tag, index;
>
> BUG_ON(!ch);
> se_sess = ch->sess;
> @@ -1277,12 +1279,19 @@ static struct srpt_send_ioctx *srpt_get_send_ioctx(struct srpt_rdma_ch *ch)
> return NULL;
> }
> ioctx = &((struct srpt_send_ioctx *)se_sess->sess_cmd_map)[tag];
> + buf = ioctx->ioctx.buf;
> + dma = ioctx->ioctx.dma;
> + index = ioctx->ioctx.index;
> +
> memset(ioctx, 0, sizeof(struct srpt_send_ioctx));
> ioctx->ch = ch;
> spin_lock_init(&ioctx->spinlock);
> ioctx->state = SRPT_STATE_NEW;
> init_completion(&ioctx->tx_done);
>
> + ioctx->ioctx.buf = buf;
> + ioctx->ioctx.dma = dma;
> + ioctx->ioctx.index = index;
> ioctx->cmd.map_tag = tag;
>
> return ioctx;
> @@ -1961,6 +1970,24 @@ static void srpt_free_ch(struct kref *kref)
> kfree(ch);
> }
These assignments should happen once, namely just after I/O context
allocation, instead of performing these assignments during every
srpt_get_send_ioctx() call.
Bart.
--
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-04-04 18:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 18:23 [PATCH] ib_srpt: Add missing ioctx->buf + ->dma alloc_session_cb init Nicholas A. Bellinger
[not found] ` <1459794233-19187-1-git-send-email-nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
2016-04-04 18:40 ` Bart Van Assche [this message]
[not found] ` <5702B503.1060006-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-04 22:41 ` Nicholas A. Bellinger
2016-04-04 22:44 ` Bart Van Assche
[not found] ` <5702EE56.10503-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-04 22:58 ` Nicholas A. Bellinger
2016-04-06 15:31 ` Bart Van Assche
[not found] ` <57052BCB.6070405-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-07 22:31 ` Nicholas A. Bellinger
2016-04-07 22:48 ` Bart Van Assche
[not found] ` <5706E3BB.70302-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-04-07 23:28 ` Nicholas A. Bellinger
2016-04-04 19:11 ` [PATCH] ib_srpt: fix ifnullfree.cocci warnings kbuild test robot
2016-04-04 19:11 ` [PATCH] ib_srpt: Add missing ioctx->buf + ->dma alloc_session_cb init kbuild test robot
[not found] ` <201604050303.V0jVrIjf%fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-04-04 22:42 ` Nicholas A. Bellinger
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=5702B503.1060006@sandisk.com \
--to=bart.vanassche-xdaiopvojttbdgjk7y7tuq@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org \
--cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
--cc=target-devel-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