LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Jens Axboe <axboe@kernel.dk>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Max Gurtovoy <maxg@mellanox.com>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>
Subject: linux-next: manual merge of the block tree with Linus' tree
Date: Mon, 4 Sep 2017 13:09:44 +1000	[thread overview]
Message-ID: <20170904130944.3bb37efd@canb.auug.org.au> (raw)

Hi all,

Today's linux-next merge of the block tree got a conflict in:

  drivers/nvme/host/rdma.c

between commit:

  b925a2dc165e ("nvme-rdma: default MR page size to 4k")

from Linus' tree and commits:

  90af35123d3b ("nvme-rdma: move nvme_rdma_configure_admin_queue code location")
  a7b7c7a105a5 ("nvme-rdma: Use unlikely macro in the fast path")

from the block tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/nvme/host/rdma.c
index a7f7d0ae3331,6a7682620d87..000000000000
--- a/drivers/nvme/host/rdma.c
+++ b/drivers/nvme/host/rdma.c
@@@ -605,10 -629,9 +626,10 @@@ out_stop_queues
  	return ret;
  }
  
- static int nvme_rdma_init_io_queues(struct nvme_rdma_ctrl *ctrl)
+ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl)
  {
  	struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
 +	struct ib_device *ibdev = ctrl->device->dev;
  	unsigned int nr_io_queues;
  	int i, ret;
  
@@@ -656,10 -734,144 +741,144 @@@ static void nvme_rdma_destroy_admin_que
  {
  	nvme_rdma_free_qe(ctrl->queues[0].device->dev, &ctrl->async_event_sqe,
  			sizeof(struct nvme_command), DMA_TO_DEVICE);
- 	nvme_rdma_stop_and_free_queue(&ctrl->queues[0]);
- 	blk_cleanup_queue(ctrl->ctrl.admin_q);
- 	blk_mq_free_tag_set(&ctrl->admin_tag_set);
- 	nvme_rdma_dev_put(ctrl->device);
+ 	nvme_rdma_stop_queue(&ctrl->queues[0]);
+ 	if (remove) {
+ 		blk_cleanup_queue(ctrl->ctrl.admin_q);
+ 		nvme_rdma_free_tagset(&ctrl->ctrl, true);
+ 	}
+ 	nvme_rdma_free_queue(&ctrl->queues[0]);
+ }
+ 
+ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl,
+ 		bool new)
+ {
+ 	int error;
+ 
+ 	error = nvme_rdma_alloc_queue(ctrl, 0, NVME_AQ_DEPTH);
+ 	if (error)
+ 		return error;
+ 
+ 	ctrl->device = ctrl->queues[0].device;
+ 
+ 	ctrl->max_fr_pages = min_t(u32, NVME_RDMA_MAX_SEGMENTS,
+ 		ctrl->device->dev->attrs.max_fast_reg_page_list_len);
+ 
+ 	if (new) {
+ 		ctrl->ctrl.admin_tagset = nvme_rdma_alloc_tagset(&ctrl->ctrl, true);
+ 		if (IS_ERR(ctrl->ctrl.admin_tagset))
+ 			goto out_free_queue;
+ 
+ 		ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set);
+ 		if (IS_ERR(ctrl->ctrl.admin_q)) {
+ 			error = PTR_ERR(ctrl->ctrl.admin_q);
+ 			goto out_free_tagset;
+ 		}
+ 	} else {
+ 		error = blk_mq_reinit_tagset(&ctrl->admin_tag_set,
+ 					     nvme_rdma_reinit_request);
+ 		if (error)
+ 			goto out_free_queue;
+ 	}
+ 
+ 	error = nvme_rdma_start_queue(ctrl, 0);
+ 	if (error)
+ 		goto out_cleanup_queue;
+ 
+ 	error = ctrl->ctrl.ops->reg_read64(&ctrl->ctrl, NVME_REG_CAP,
+ 			&ctrl->ctrl.cap);
+ 	if (error) {
+ 		dev_err(ctrl->ctrl.device,
+ 			"prop_get NVME_REG_CAP failed\n");
+ 		goto out_cleanup_queue;
+ 	}
+ 
+ 	ctrl->ctrl.sqsize =
+ 		min_t(int, NVME_CAP_MQES(ctrl->ctrl.cap), ctrl->ctrl.sqsize);
+ 
+ 	error = nvme_enable_ctrl(&ctrl->ctrl, ctrl->ctrl.cap);
+ 	if (error)
+ 		goto out_cleanup_queue;
+ 
+ 	ctrl->ctrl.max_hw_sectors =
 -		(ctrl->max_fr_pages - 1) << (PAGE_SHIFT - 9);
++		(ctrl->max_fr_pages - 1) << (ilog2(SZ_4K) - 9);
+ 
+ 	error = nvme_init_identify(&ctrl->ctrl);
+ 	if (error)
+ 		goto out_cleanup_queue;
+ 
+ 	error = nvme_rdma_alloc_qe(ctrl->queues[0].device->dev,
+ 			&ctrl->async_event_sqe, sizeof(struct nvme_command),
+ 			DMA_TO_DEVICE);
+ 	if (error)
+ 		goto out_cleanup_queue;
+ 
+ 	return 0;
+ 
+ out_cleanup_queue:
+ 	if (new)
+ 		blk_cleanup_queue(ctrl->ctrl.admin_q);
+ out_free_tagset:
+ 	if (new)
+ 		nvme_rdma_free_tagset(&ctrl->ctrl, true);
+ out_free_queue:
+ 	nvme_rdma_free_queue(&ctrl->queues[0]);
+ 	return error;
+ }
+ 
+ static void nvme_rdma_destroy_io_queues(struct nvme_rdma_ctrl *ctrl,
+ 		bool remove)
+ {
+ 	nvme_rdma_stop_io_queues(ctrl);
+ 	if (remove) {
+ 		blk_cleanup_queue(ctrl->ctrl.connect_q);
+ 		nvme_rdma_free_tagset(&ctrl->ctrl, false);
+ 	}
+ 	nvme_rdma_free_io_queues(ctrl);
+ }
+ 
+ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new)
+ {
+ 	int ret;
+ 
+ 	ret = nvme_rdma_alloc_io_queues(ctrl);
+ 	if (ret)
+ 		return ret;
+ 
+ 	if (new) {
+ 		ctrl->ctrl.tagset = nvme_rdma_alloc_tagset(&ctrl->ctrl, false);
+ 		if (IS_ERR(ctrl->ctrl.tagset))
+ 			goto out_free_io_queues;
+ 
+ 		ctrl->ctrl.connect_q = blk_mq_init_queue(&ctrl->tag_set);
+ 		if (IS_ERR(ctrl->ctrl.connect_q)) {
+ 			ret = PTR_ERR(ctrl->ctrl.connect_q);
+ 			goto out_free_tag_set;
+ 		}
+ 	} else {
+ 		ret = blk_mq_reinit_tagset(&ctrl->tag_set,
+ 					   nvme_rdma_reinit_request);
+ 		if (ret)
+ 			goto out_free_io_queues;
+ 
+ 		blk_mq_update_nr_hw_queues(&ctrl->tag_set,
+ 			ctrl->ctrl.queue_count - 1);
+ 	}
+ 
+ 	ret = nvme_rdma_start_io_queues(ctrl);
+ 	if (ret)
+ 		goto out_cleanup_connect_q;
+ 
+ 	return 0;
+ 
+ out_cleanup_connect_q:
+ 	if (new)
+ 		blk_cleanup_queue(ctrl->ctrl.connect_q);
+ out_free_tag_set:
+ 	if (new)
+ 		nvme_rdma_free_tagset(&ctrl->ctrl, false);
+ out_free_io_queues:
+ 	nvme_rdma_free_io_queues(ctrl);
+ 	return ret;
  }
  
  static void nvme_rdma_free_ctrl(struct nvme_ctrl *nctrl)
@@@ -927,12 -1111,8 +1118,12 @@@ static int nvme_rdma_map_sg_fr(struct n
  	struct nvme_keyed_sgl_desc *sg = &c->common.dptr.ksgl;
  	int nr;
  
 -	nr = ib_map_mr_sg(req->mr, req->sg_table.sgl, count, NULL, PAGE_SIZE);
 +	/*
 +	 * Align the MR to a 4K page size to match the ctrl page size and
 +	 * the block virtual boundary.
 +	 */
 +	nr = ib_map_mr_sg(req->mr, req->sg_table.sgl, count, NULL, SZ_4K);
- 	if (nr < count) {
+ 	if (unlikely(nr < count)) {
  		if (nr < 0)
  			return nr;
  		return -EINVAL;

             reply	other threads:[~2017-09-04  3:09 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-04  3:09 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-11-25 23:38 Stephen Rothwell
2021-11-26  5:30 ` Christoph Hellwig
2021-11-01  1:36 Stephen Rothwell
2021-10-25  2:26 Stephen Rothwell
2021-08-17  5:25 Stephen Rothwell
2021-08-17 16:40 ` Tejun Heo
2021-08-17 16:50   ` Christoph Hellwig
2021-08-17 16:52     ` Tejun Heo
2021-08-09  4:29 Stephen Rothwell
2021-08-09 14:05 ` Jens Axboe
2020-12-14  3:56 Stephen Rothwell
2020-09-23  4:05 Stephen Rothwell
2020-01-28  0:38 Stephen Rothwell
2020-01-28  0:40 ` Jens Axboe
2019-04-15  3:06 Stephen Rothwell
2019-04-15 14:15 ` Jens Axboe
2019-04-15  3:00 Stephen Rothwell
2019-03-05  1:48 Stephen Rothwell
2018-11-16  2:19 Stephen Rothwell
2018-11-16  2:21 ` Jens Axboe
2017-06-30  2:08 Stephen Rothwell
2017-06-26  2:44 Stephen Rothwell
2017-06-26  2:28 Stephen Rothwell
2017-06-23  3:06 Stephen Rothwell
2017-06-23  3:09 ` Jens Axboe
2017-06-23  3:24   ` Stephen Rothwell
2017-06-23  3:27     ` Jens Axboe
2017-06-23  3:33       ` Stephen Rothwell
2017-06-23  3:56         ` Jens Axboe
2017-06-23  3:29     ` Jens Axboe
2016-07-21  3:08 Stephen Rothwell
2016-07-08  3:07 Stephen Rothwell
2016-07-08  4:14 ` Stephen Rothwell
2016-07-08 14:11   ` Konrad Rzeszutek Wilk
2016-06-14  2:44 Stephen Rothwell
2016-05-03  4:25 Stephen Rothwell
2016-05-03 20:03 ` Jens Axboe
2016-03-07  3:12 Stephen Rothwell
2016-03-07  3:08 Stephen Rothwell
2016-03-01  0:25 Stephen Rothwell
2016-02-18  2:10 Stephen Rothwell
2016-01-13  2:07 Stephen Rothwell
2015-12-31  3:34 Stephen Rothwell
2016-01-21 22:46 ` Stephen Rothwell
2016-01-21 22:48   ` Jens Axboe
2015-12-14  1:36 Stephen Rothwell
2015-12-07  4:27 Stephen Rothwell
2015-12-07  4:16 Stephen Rothwell
2015-10-06  1:33 Stephen Rothwell
2015-08-27  2:36 Stephen Rothwell
2015-08-17  4:04 Stephen Rothwell
2015-06-04  4:51 Stephen Rothwell
2015-06-04  4:36 Stephen Rothwell
2015-06-03  3:33 Stephen Rothwell
2015-06-03  3:28 Stephen Rothwell
2015-06-01  4:56 Stephen Rothwell
2015-06-01 14:31 ` Mike Snitzer
2015-04-13  4:58 Stephen Rothwell
2015-01-27  4:03 Stephen Rothwell
2014-03-17  3:55 Stephen Rothwell
2014-03-10 15:39 Mark Brown
2013-11-01  3:25 Stephen Rothwell
2013-09-25  3:11 Stephen Rothwell
2013-05-01  5:17 Stephen Rothwell
2013-03-26  2:05 Stephen Rothwell
2012-12-07  2:44 Stephen Rothwell
2012-10-31  2:04 Stephen Rothwell
2012-10-31 13:55 ` Ben Hutchings
2012-10-31 13:57   ` Jens Axboe
2012-11-01 10:04   ` Herton Ronaldo Krzesinski
2011-11-01  5:15 Stephen Rothwell
2011-11-01  8:09 ` Jens Axboe
2011-11-01  9:03   ` Stephen Rothwell
2011-05-19  1:34 Stephen Rothwell
2011-03-21  0:43 Stephen Rothwell
2011-03-21  9:48 ` Jens Axboe
2011-03-07  2:19 Stephen Rothwell
2011-03-07  6:36 ` Tejun Heo
2011-03-07  8:42   ` Jens Axboe
2011-03-07 10:41     ` Sedat Dilek
2011-03-07 10:47       ` Tejun Heo
2011-03-07 11:14         ` Sedat Dilek
2011-03-07 11:16           ` Jens Axboe
2011-03-07 11:25             ` Sedat Dilek
2011-03-07 11:26               ` Jens Axboe
2011-03-07 11:35                 ` Sedat Dilek
2011-03-07 11:46                   ` Jens Axboe
2011-03-07 12:26                     ` Sedat Dilek
2011-03-07 11:42               ` Stephen Rothwell
2011-03-07 11:38             ` Stephen Rothwell
2010-09-16  2:04 Stephen Rothwell
2010-04-29  3:52 Stephen Rothwell
2010-04-29  7:33 ` Jens Axboe
2010-03-17  1:52 Stephen Rothwell
2010-03-17  2:03 ` Li Zefan
2010-02-25  3:10 Stephen Rothwell
2010-02-25  7:47 ` Jens Axboe
2010-02-25 23:11   ` Stephen Rothwell
2009-06-25  3:15 Stephen Rothwell
2009-06-25  3:30 ` Stephen Rothwell
2009-06-25  6:38   ` Jens Axboe
2009-06-25  7:42     ` Jens Axboe

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=20170904130944.3bb37efd@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=maxg@mellanox.com \
    --cc=sagi@grimberg.me \
    --subject='Re: linux-next: manual merge of the block tree with Linus'\'' tree' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).