From patchwork Mon May 25 17:22:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11569129 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEAD460D for ; Mon, 25 May 2020 17:22:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C20762078B for ; Mon, 25 May 2020 17:22:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391289AbgEYRW1 (ORCPT ); Mon, 25 May 2020 13:22:27 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:41898 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388230AbgEYRW1 (ORCPT ); Mon, 25 May 2020 13:22:27 -0400 Received: by mail-pl1-f194.google.com with SMTP id a13so7683424pls.8 for ; Mon, 25 May 2020 10:22:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HhAPnQrHX3/PcCvPRKRSrGzu3ZqP3FWjJECBy4unszE=; b=Zv9MaHfozxH0woxWgyYMOIcN7cQ7xjmaCNAqGlIwrsBu2tj2z0lOj5WfOOcTY6hoff wvMHxiVY8a+n56I4kSefOlJmHX5Bdem3fcQuw1IVfclqwR8g5anT0+IxjHecbqL2JDg6 13l/7ND0Rt4F2AXQYYq/ThoOaMLdwjqQ6GfR7oVTpcH8kLZGObnW+VFP7kPAUsXDnpZx YzvXye6Qow9QEHFdaZRbJXxvuEog8gsuGp0PX0iya3euznERidSEHZE2G6o+Jfz3V8ET RVTIkSx3YOL+lO/ju0wFrjFbACa1Te6Fp1hxD22QEXhMn9cpm1Dt6N9RyuPGEG0aHlZr Bj0Q== X-Gm-Message-State: AOAM530eMairz4xWFF0nVuQFTEdloM9OQiuEsmCmzA3JmVQzgeVFS21K BR2OnrFnG/e09ImqQH4NZ3c= X-Google-Smtp-Source: ABdhPJwYOooy6S7ZupH/K5HuJWJXofYBKBG8FAtgUXGcsS4HN3C5s8G1d3FEq9fG+KDt18+f0WZThQ== X-Received: by 2002:a17:90a:8c8e:: with SMTP id b14mr20291852pjo.222.1590427346051; Mon, 25 May 2020 10:22:26 -0700 (PDT) Received: from localhost.localdomain ([2601:647:4000:d7:2590:9462:ff8a:101f]) by smtp.gmail.com with ESMTPSA id p9sm3213238pff.71.2020.05.25.10.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 10:22:25 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Laurence Oberman , Kamal Heib Subject: [PATCH v2 1/4] RDMA/srp: Make the channel count configurable per target Date: Mon, 25 May 2020 10:22:09 -0700 Message-Id: <20200525172212.14413-2-bvanassche@acm.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525172212.14413-1-bvanassche@acm.org> References: <20200525172212.14413-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Increase the flexibility of the SRP initiator driver by making the channel count configurable per target instead of only providing a kernel module parameter for configuring the channel count. Cc: Laurence Oberman Cc: Kamal Heib Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srp/ib_srp.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 00b4f88b113e..4018c4abf2e2 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3424,6 +3424,7 @@ enum { SRP_OPT_IP_DEST = 1 << 16, SRP_OPT_TARGET_CAN_QUEUE= 1 << 17, SRP_OPT_MAX_IT_IU_SIZE = 1 << 18, + SRP_OPT_CH_COUNT = 1 << 19, }; static unsigned int srp_opt_mandatory[] = { @@ -3457,6 +3458,7 @@ static const match_table_t srp_opt_tokens = { { SRP_OPT_IP_SRC, "src=%s" }, { SRP_OPT_IP_DEST, "dest=%s" }, { SRP_OPT_MAX_IT_IU_SIZE, "max_it_iu_size=%d" }, + { SRP_OPT_CH_COUNT, "ch_count=%u", }, { SRP_OPT_ERR, NULL } }; @@ -3758,6 +3760,14 @@ static int srp_parse_options(struct net *net, const char *buf, target->max_it_iu_size = token; break; + case SRP_OPT_CH_COUNT: + if (match_int(args, &token) || token < 1) { + pr_warn("bad channel count %s\n", p); + goto out; + } + target->ch_count = token; + break; + default: pr_warn("unknown parameter or missing value '%s' in target creation request\n", p); @@ -3921,11 +3931,12 @@ static ssize_t srp_create_target(struct device *dev, goto out; ret = -ENOMEM; - target->ch_count = max_t(unsigned, num_online_nodes(), - min(ch_count ? : - min(4 * num_online_nodes(), - ibdev->num_comp_vectors), - num_online_cpus())); + if (target->ch_count == 0) + target->ch_count = max_t(unsigned, num_online_nodes(), + min(ch_count ? : + min(4 * num_online_nodes(), + ibdev->num_comp_vectors), + num_online_cpus())); target->ch = kcalloc(target->ch_count, sizeof(*target->ch), GFP_KERNEL); if (!target->ch) From patchwork Mon May 25 17:22:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11569131 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 98D2113B4 for ; Mon, 25 May 2020 17:22:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8ABFF2070A for ; Mon, 25 May 2020 17:22:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391296AbgEYRW3 (ORCPT ); Mon, 25 May 2020 13:22:29 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44585 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388230AbgEYRW2 (ORCPT ); Mon, 25 May 2020 13:22:28 -0400 Received: by mail-pl1-f194.google.com with SMTP id bh7so766989plb.11 for ; Mon, 25 May 2020 10:22:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4K9rHHICE3+inYoR2BYCilENf4wIRIaOf+lyZ8wD/kY=; b=IUSrCffmKVbIgMdQJxlC/PYBhKJ4lc65dBVaLj7z+7mcVyB8TKpkGumrhYA4iPicx4 b24DNryWMUas1LJDrKaAE8H1Qm++SIxUj5LswszjpJkvrPKKH8NXF9L3kHkDE655QS6L xbOHzk/QA6EyXJWozeawjM4NkfOwRpkHYsOgl5pgApf5a7cSoMlvBwwC9Ie9cUg+zGIS NhAbSHeQFC6WxZMy3Xeu0Kb2oghsUP4fp4m2bHa4Sjk+g/uN5YOtZBHVMzp+HTvcjiCC jAsHQjzXYkip1TWcoSyKHNN3LgcIzbC4k6u2fo+Li5XvkwnFYBlyxvY6Ao8sD/E7dO8Q 8Rvg== X-Gm-Message-State: AOAM530bW4MCmkanti+eVZFjoDpUi70wv+dEqCgn07M1C833f7hiLAKW iDkrVJ0ZHdaabxAgcz94/+M3WBrL X-Google-Smtp-Source: ABdhPJzXoZnjDwcGcNeUlW9igsqPStaCBMP4UDBrw0DXP1z8b9HokIjD5bUKy76SR+4W2RLGG9nt9A== X-Received: by 2002:a17:90b:3705:: with SMTP id mg5mr20374657pjb.24.1590427347585; Mon, 25 May 2020 10:22:27 -0700 (PDT) Received: from localhost.localdomain ([2601:647:4000:d7:2590:9462:ff8a:101f]) by smtp.gmail.com with ESMTPSA id p9sm3213238pff.71.2020.05.25.10.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 10:22:26 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Laurence Oberman , Kamal Heib Subject: [PATCH v2 2/4] RDMA/srpt: Make debug output more detailed Date: Mon, 25 May 2020 10:22:10 -0700 Message-Id: <20200525172212.14413-3-bvanassche@acm.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525172212.14413-1-bvanassche@acm.org> References: <20200525172212.14413-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Since the session name by itself is not sufficient to uniquely identify a queue pair, include the queue pair number. Show the ASCII channel state name instead of the numeric value. This change makes the ib_srpt debug output more consistent. Cc: Laurence Oberman Cc: Kamal Heib Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index a294630f2100..a39ad9fc4224 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -214,8 +214,9 @@ static const char *get_ch_state_name(enum rdma_ch_state s) */ static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch) { - pr_debug("QP event %d on ch=%p sess_name=%s state=%d\n", - event->event, ch, ch->sess_name, ch->state); + pr_debug("QP event %d on ch=%p sess_name=%s-%d state=%s\n", + event->event, ch, ch->sess_name, ch->qp->qp_num, + get_ch_state_name(ch->state)); switch (event->event) { case IB_EVENT_COMM_EST: @@ -1985,8 +1986,8 @@ static void __srpt_close_all_ch(struct srpt_port *sport) list_for_each_entry(nexus, &sport->nexus_list, entry) { list_for_each_entry(ch, &nexus->ch_list, list) { if (srpt_disconnect_ch(ch) >= 0) - pr_info("Closing channel %s because target %s_%d has been disabled\n", - ch->sess_name, + pr_info("Closing channel %s-%d because target %s_%d has been disabled\n", + ch->sess_name, ch->qp->qp_num, dev_name(&sport->sdev->device->dev), sport->port); srpt_close_ch(ch); From patchwork Mon May 25 17:22:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11569133 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BA6413B4 for ; Mon, 25 May 2020 17:22:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0464120776 for ; Mon, 25 May 2020 17:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391301AbgEYRWa (ORCPT ); Mon, 25 May 2020 13:22:30 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:50396 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388230AbgEYRWa (ORCPT ); Mon, 25 May 2020 13:22:30 -0400 Received: by mail-pj1-f68.google.com with SMTP id nu7so190533pjb.0 for ; Mon, 25 May 2020 10:22:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f98PTCIHfsRe/PVHZ+ofAlaoYmlI4YmDVK0u2K32q6M=; b=f/c9+sWouOpMFALm3bgWYoxVZw9Go4KEKT2VbsNdVZ8r3A2iLt7IHVCRz4NwaGIz7R jciGnkTuI42stX+KFhpTiJajCmepbMUM/LjmBsTS0BWr06OOqe74O7MPP3Pf+u1tkLXb RHylNYAnDreP8rHN+8G25W/abuszlPN8HNrrzah6CVBX1TEP9cqmf3F0WfPBA+SrJC5Z bWVm0KKkis+2ioyabB8QjpqdtEWTQrBlyjGzTMeo1lpeVO12yqlQxFKo5TciWQ7ipshf VCh7n8rdvuEdaqIfnjFo5EoOBZOIW+6B8ouy9cwX8NzMjCfVBJk6QiLyyFdzO9Lwyhqv h6gw== X-Gm-Message-State: AOAM5333SSO52YThW3O4Fh6Qz6s6ZXydfwPJ0GU+EeNX95FHaN452VIJ d7f0hOTmkPlDUa7+J/cYGyk= X-Google-Smtp-Source: ABdhPJx/rvpm0QZHstVYZWNZvJWzOs3ZFHnealDvOLjURew7kITDNuZNiSC221TT2BsC7Sl9VsxMTA== X-Received: by 2002:a17:90a:8a0f:: with SMTP id w15mr19958778pjn.27.1590427349177; Mon, 25 May 2020 10:22:29 -0700 (PDT) Received: from localhost.localdomain ([2601:647:4000:d7:2590:9462:ff8a:101f]) by smtp.gmail.com with ESMTPSA id p9sm3213238pff.71.2020.05.25.10.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 10:22:28 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Laurence Oberman , Kamal Heib Subject: [PATCH v2 3/4] RDMA/srpt: Reduce max_recv_sge to 1 Date: Mon, 25 May 2020 10:22:11 -0700 Message-Id: <20200525172212.14413-4-bvanassche@acm.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525172212.14413-1-bvanassche@acm.org> References: <20200525172212.14413-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Since srpt_post_recv() always sets num_sge to 1, reduce the max_recv_sge parameter that is used at queue pair allocation time to 1. Cc: Laurence Oberman Cc: Kamal Heib Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index a39ad9fc4224..1ad3cc7c553a 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1818,16 +1818,12 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) qp_init->cap.max_rdma_ctxs = sq_size / 2; qp_init->cap.max_send_sge = min(attrs->max_send_sge, SRPT_MAX_SG_PER_WQE); - qp_init->cap.max_recv_sge = min(attrs->max_recv_sge, - SRPT_MAX_SG_PER_WQE); + qp_init->cap.max_recv_sge = 1; qp_init->port_num = ch->sport->port; - if (sdev->use_srq) { + if (sdev->use_srq) qp_init->srq = sdev->srq; - } else { + else qp_init->cap.max_recv_wr = ch->rq_size; - qp_init->cap.max_recv_sge = min(attrs->max_recv_sge, - SRPT_MAX_SG_PER_WQE); - } if (ch->using_rdma_cm) { ret = rdma_create_qp(ch->rdma_cm.cm_id, sdev->pd, qp_init); From patchwork Mon May 25 17:22:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 11569135 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A65F960D for ; Mon, 25 May 2020 17:22:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96B6620776 for ; Mon, 25 May 2020 17:22:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389523AbgEYRWc (ORCPT ); Mon, 25 May 2020 13:22:32 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:39346 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388230AbgEYRWb (ORCPT ); Mon, 25 May 2020 13:22:31 -0400 Received: by mail-pg1-f195.google.com with SMTP id w20so3863690pga.6 for ; Mon, 25 May 2020 10:22:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gQgX5pBPHUT8PJw0TS32WLCIl7+LLGoh84FEwLrugTI=; b=rqV4vIDLaFRKQi9DeAW/n+Lk8G0Er914K2F11kIoL6BBLgcIjCKyzRRNlhysDUueVh 1p/cyRGkPQ31Z+7zyK0WjumpFieHaRIbw4iZ2LqSJIzGtRIP0XwIs2T1rpjBV4YyQWZs HNGxxlMzlHIs3xc6omQiC0nexNzGS5Mpgg24a2sQjkp0YRTjR3a+1bfhLLlZxhgYmTsd aBfGjN6f4h2oJkaCtKsIVUh7sUnfR8v9ga0Cpg/RfT0/W+8wEZkXZCc3Xcj2tR+s5O44 9Fp7dkk5YXBuYQW8qvmqOI+7ugnJ22+91ojDEymnktUXXdSh6gGlhKnlsWb/nLqs0zx+ 6jWA== X-Gm-Message-State: AOAM5335lcUiFs27OdadZmYjrHbZtNjPfa4kv5Ukmj2dHUmLDyygbq2Q R9hq6wuOB4Kd9aJPsqZSCFM= X-Google-Smtp-Source: ABdhPJxbfr+goayARI9hzYrx2M3WE+LuUAHotUQEJVp+LdE0/r/66igSmzseCqR83yCdNkCr0HDkvg== X-Received: by 2002:aa7:8d8a:: with SMTP id i10mr14904461pfr.193.1590427350750; Mon, 25 May 2020 10:22:30 -0700 (PDT) Received: from localhost.localdomain ([2601:647:4000:d7:2590:9462:ff8a:101f]) by smtp.gmail.com with ESMTPSA id p9sm3213238pff.71.2020.05.25.10.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 10:22:30 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Laurence Oberman , Kamal Heib Subject: [PATCH v2 4/4] RDMA/srpt: Increase max_send_sge Date: Mon, 25 May 2020 10:22:12 -0700 Message-Id: <20200525172212.14413-5-bvanassche@acm.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525172212.14413-1-bvanassche@acm.org> References: <20200525172212.14413-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The ib_srpt driver limits max_send_sge to 16. Since that is a workaround for an mlx4 bug that has been fixed, increase max_send_sge. For mlx4, do not use the value advertised by the driver (32) since that causes QP's to transition to the error status. See also commit f95ccffc715b ("IB/mlx4: Use 4K pages for kernel QP's WQE buffer"). Cc: Laurence Oberman Cc: Kamal Heib Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +-- drivers/infiniband/ulp/srpt/ib_srpt.h | 5 ----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 1ad3cc7c553a..86e4c87e7ec2 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1816,8 +1816,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch) */ qp_init->cap.max_send_wr = min(sq_size / 2, attrs->max_qp_wr); qp_init->cap.max_rdma_ctxs = sq_size / 2; - qp_init->cap.max_send_sge = min(attrs->max_send_sge, - SRPT_MAX_SG_PER_WQE); + qp_init->cap.max_send_sge = attrs->max_send_sge; qp_init->cap.max_recv_sge = 1; qp_init->port_num = ch->sport->port; if (sdev->use_srq) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 2e1a69840857..f31c349d07a1 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h @@ -105,11 +105,6 @@ enum { SRP_CMD_ACA = 0x4, SRPT_DEF_SG_TABLESIZE = 128, - /* - * An experimentally determined value that avoids that QP creation - * fails due to "swiotlb buffer is full" on systems using the swiotlb. - */ - SRPT_MAX_SG_PER_WQE = 16, MIN_SRPT_SQ_SIZE = 16, DEF_SRPT_SQ_SIZE = 4096,