From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH mlx5-next 09/10] net/rds: Handle ODP mr registration/unregistration
Date: Sat, 18 Jan 2020 18:13:26 +0800 [thread overview]
Message-ID: <202001181840.KiJaJGhB%lkp@intel.com> (raw)
In-Reply-To: <20200115124340.79108-10-leon@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 8592 bytes --]
Hi Leon,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rdma/for-next]
[also build test ERROR on net-next/master net/master linus/master v5.5-rc6 next-20200117]
[cannot apply to sparc-next/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Leon-Romanovsky/Use-ODP-MRs-for-kernel-ULPs/20200116-234233
base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=c6x
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
net///rds/rdma.c: In function 'rds_cmsg_rdma_args':
>> net///rds/rdma.c:767:8: error: 'struct scatterlist' has no member named 'dma_length'; did you mean 'length'?
sg->dma_length = sg->length;
^~~~~~~~~~
length
vim +767 net///rds/rdma.c
600
601 /*
602 * The application asks for a RDMA transfer.
603 * Extract all arguments and set up the rdma_op
604 */
605 int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
606 struct cmsghdr *cmsg,
607 struct rds_iov_vector *vec)
608 {
609 struct rds_rdma_args *args;
610 struct rm_rdma_op *op = &rm->rdma;
611 int nr_pages;
612 unsigned int nr_bytes;
613 struct page **pages = NULL;
614 struct rds_iovec *iovs;
615 unsigned int i, j;
616 int ret = 0;
617 bool odp_supported = true;
618
619 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_rdma_args))
620 || rm->rdma.op_active)
621 return -EINVAL;
622
623 args = CMSG_DATA(cmsg);
624
625 if (ipv6_addr_any(&rs->rs_bound_addr)) {
626 ret = -ENOTCONN; /* XXX not a great errno */
627 goto out_ret;
628 }
629
630 if (args->nr_local > UIO_MAXIOV) {
631 ret = -EMSGSIZE;
632 goto out_ret;
633 }
634
635 if (vec->len != args->nr_local) {
636 ret = -EINVAL;
637 goto out_ret;
638 }
639 /* odp-mr is not supported for multiple requests within one message */
640 if (args->nr_local != 1)
641 odp_supported = false;
642
643 iovs = vec->iov;
644
645 nr_pages = rds_rdma_pages(iovs, args->nr_local);
646 if (nr_pages < 0) {
647 ret = -EINVAL;
648 goto out_ret;
649 }
650
651 pages = kcalloc(nr_pages, sizeof(struct page *), GFP_KERNEL);
652 if (!pages) {
653 ret = -ENOMEM;
654 goto out_ret;
655 }
656
657 op->op_write = !!(args->flags & RDS_RDMA_READWRITE);
658 op->op_fence = !!(args->flags & RDS_RDMA_FENCE);
659 op->op_notify = !!(args->flags & RDS_RDMA_NOTIFY_ME);
660 op->op_silent = !!(args->flags & RDS_RDMA_SILENT);
661 op->op_active = 1;
662 op->op_recverr = rs->rs_recverr;
663 op->op_odp_mr = NULL;
664
665 WARN_ON(!nr_pages);
666 op->op_sg = rds_message_alloc_sgs(rm, nr_pages, &ret);
667 if (!op->op_sg)
668 goto out_pages;
669
670 if (op->op_notify || op->op_recverr) {
671 /* We allocate an uninitialized notifier here, because
672 * we don't want to do that in the completion handler. We
673 * would have to use GFP_ATOMIC there, and don't want to deal
674 * with failed allocations.
675 */
676 op->op_notifier = kmalloc(sizeof(struct rds_notifier), GFP_KERNEL);
677 if (!op->op_notifier) {
678 ret = -ENOMEM;
679 goto out_pages;
680 }
681 op->op_notifier->n_user_token = args->user_token;
682 op->op_notifier->n_status = RDS_RDMA_SUCCESS;
683 }
684
685 /* The cookie contains the R_Key of the remote memory region, and
686 * optionally an offset into it. This is how we implement RDMA into
687 * unaligned memory.
688 * When setting up the RDMA, we need to add that offset to the
689 * destination address (which is really an offset into the MR)
690 * FIXME: We may want to move this into ib_rdma.c
691 */
692 op->op_rkey = rds_rdma_cookie_key(args->cookie);
693 op->op_remote_addr = args->remote_vec.addr + rds_rdma_cookie_offset(args->cookie);
694
695 nr_bytes = 0;
696
697 rdsdebug("RDS: rdma prepare nr_local %llu rva %llx rkey %x\n",
698 (unsigned long long)args->nr_local,
699 (unsigned long long)args->remote_vec.addr,
700 op->op_rkey);
701
702 for (i = 0; i < args->nr_local; i++) {
703 struct rds_iovec *iov = &iovs[i];
704 /* don't need to check, rds_rdma_pages() verified nr will be +nonzero */
705 unsigned int nr = rds_pages_in_vec(iov);
706
707 rs->rs_user_addr = iov->addr;
708 rs->rs_user_bytes = iov->bytes;
709
710 /* If it's a WRITE operation, we want to pin the pages for reading.
711 * If it's a READ operation, we need to pin the pages for writing.
712 */
713 ret = rds_pin_pages(iov->addr, nr, pages, !op->op_write);
714 if ((!odp_supported && ret <= 0) ||
715 (odp_supported && ret <= 0 && ret != -EOPNOTSUPP))
716 goto out_pages;
717
718 if (ret == -EOPNOTSUPP) {
719 struct rds_mr *local_odp_mr;
720
721 if (!rs->rs_transport->get_mr) {
722 ret = -EOPNOTSUPP;
723 goto out_pages;
724 }
725 local_odp_mr =
726 kzalloc(sizeof(*local_odp_mr), GFP_KERNEL);
727 if (!local_odp_mr) {
728 ret = -ENOMEM;
729 goto out_pages;
730 }
731 RB_CLEAR_NODE(&local_odp_mr->r_rb_node);
732 refcount_set(&local_odp_mr->r_refcount, 1);
733 local_odp_mr->r_trans = rs->rs_transport;
734 local_odp_mr->r_sock = rs;
735 local_odp_mr->r_trans_private =
736 rs->rs_transport->get_mr(
737 NULL, 0, rs, &local_odp_mr->r_key, NULL,
738 iov->addr, iov->bytes, ODP_VIRTUAL);
739 if (IS_ERR(local_odp_mr->r_trans_private)) {
740 ret = IS_ERR(local_odp_mr->r_trans_private);
741 rdsdebug("get_mr ret %d %p\"", ret,
742 local_odp_mr->r_trans_private);
743 kfree(local_odp_mr);
744 ret = -EOPNOTSUPP;
745 goto out_pages;
746 }
747 rdsdebug("Need odp; local_odp_mr %p trans_private %p\n",
748 local_odp_mr, local_odp_mr->r_trans_private);
749 op->op_odp_mr = local_odp_mr;
750 op->op_odp_addr = iov->addr;
751 }
752
753 rdsdebug("RDS: nr_bytes %u nr %u iov->bytes %llu iov->addr %llx\n",
754 nr_bytes, nr, iov->bytes, iov->addr);
755
756 nr_bytes += iov->bytes;
757
758 for (j = 0; j < nr; j++) {
759 unsigned int offset = iov->addr & ~PAGE_MASK;
760 struct scatterlist *sg;
761
762 sg = &op->op_sg[op->op_nents + j];
763 sg_set_page(sg, pages[j],
764 min_t(unsigned int, iov->bytes, PAGE_SIZE - offset),
765 offset);
766
> 767 sg->dma_length = sg->length;
768 rdsdebug("RDS: sg->offset %x sg->len %x iov->addr %llx iov->bytes %llu\n",
769 sg->offset, sg->length, iov->addr, iov->bytes);
770
771 iov->addr += sg->length;
772 iov->bytes -= sg->length;
773 }
774
775 op->op_nents += nr;
776 }
777
778 if (nr_bytes > args->remote_vec.bytes) {
779 rdsdebug("RDS nr_bytes %u remote_bytes %u do not match\n",
780 nr_bytes,
781 (unsigned int) args->remote_vec.bytes);
782 ret = -EINVAL;
783 goto out_pages;
784 }
785 op->op_bytes = nr_bytes;
786 ret = 0;
787
788 out_pages:
789 kfree(pages);
790 out_ret:
791 if (ret)
792 rds_rdma_free_op(op);
793 else
794 rds_stats_inc(s_send_rdma);
795
796 return ret;
797 }
798
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 50655 bytes --]
next prev parent reply other threads:[~2020-01-18 10:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 12:43 [PATCH mlx5-next 00/10] Use ODP MRs for kernel ULPs Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 01/10] IB: Allow calls to ib_umem_get from " Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 02/10] IB/core: Introduce ib_reg_user_mr Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 03/10] IB/core: Add interface to advise_mr for kernel users Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 04/10] IB/mlx5: Add ODP WQE handlers for kernel QPs Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 05/10] RDMA/mlx5: Don't fake udata for kernel path Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 06/10] IB/mlx5: Mask out unsupported ODP capabilities for kernel QPs Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 07/10] RDMA/mlx5: Fix handling of IOVA != user_va in ODP paths Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 08/10] net/rds: Detect need of On-Demand-Paging memory registration Leon Romanovsky
2020-01-15 21:42 ` santosh.shilimkar
2020-01-15 12:43 ` [PATCH mlx5-next 09/10] net/rds: Handle ODP mr registration/unregistration Leon Romanovsky
2020-01-15 21:51 ` santosh.shilimkar
2020-01-16 7:11 ` Leon Romanovsky
2020-01-16 7:22 ` santosh.shilimkar
2020-01-18 10:13 ` kbuild test robot [this message]
2020-01-18 10:18 ` Leon Romanovsky
2020-01-18 10:19 ` Leon Romanovsky
2020-01-15 12:43 ` [PATCH mlx5-next 10/10] net/rds: Use prefetch for On-Demand-Paging MR Leon Romanovsky
2020-01-15 21:43 ` santosh.shilimkar
2020-01-16 6:59 ` [PATCH mlx5-next 00/10] Use ODP MRs for kernel ULPs Leon Romanovsky
2020-01-16 13:57 ` Jason Gunthorpe
2020-01-16 14:04 ` Leon Romanovsky
2020-01-16 19:34 ` santosh.shilimkar
2020-01-17 14:12 ` Jason Gunthorpe
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=202001181840.KiJaJGhB%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.