From patchwork Mon Mar 12 17:43:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raju Rangoju X-Patchwork-Id: 10276879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 49BDE603B5 for ; Mon, 12 Mar 2018 17:43:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50A3C28DB0 for ; Mon, 12 Mar 2018 17:43:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 458E928DB8; Mon, 12 Mar 2018 17:43:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E03CD28DB0 for ; Mon, 12 Mar 2018 17:43:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932231AbeCLRny (ORCPT ); Mon, 12 Mar 2018 13:43:54 -0400 Received: from stargate.chelsio.com ([12.32.117.8]:37208 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932593AbeCLRnx (ORCPT ); Mon, 12 Mar 2018 13:43:53 -0400 Received: from localhost (junagarh.blr.asicdesigners.com [10.193.185.238]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id w2CHhfkX023306; Mon, 12 Mar 2018 10:43:42 -0700 From: Raju Rangoju To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, swise@opengridcomputing.com, rajur@chelsio.com Subject: [PATCH 3/5] cxgb4: Add support to query HW SRQ parameters Date: Mon, 12 Mar 2018 23:13:01 +0530 Message-Id: <20180312174303.4333-4-rajur@chelsio.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180312174303.4333-1-rajur@chelsio.com> References: <20180312174303.4333-1-rajur@chelsio.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support to query FW for the HW SRQ table start/end, and advertise that for ULDs. Signed-off-by: Raju Rangoju Reviewed-by: Steve Wise --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 20 ++++++++++++++++++++ drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 7b452e85de2a..6ee75638b920 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c @@ -75,6 +75,7 @@ #include "t4fw_api.h" #include "t4fw_version.h" #include "cxgb4_dcb.h" +#include "srq.h" #include "cxgb4_debugfs.h" #include "clip_tbl.h" #include "l2t.h" @@ -583,6 +584,10 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp, const struct cpl_abort_rpl_rss *p = (void *)rsp; hash_del_filter_rpl(q->adap, p); + } else if (opcode == CPL_SRQ_TABLE_RPL) { + const struct cpl_srq_table_rpl *p = (void *)rsp; + + do_srq_table_rpl(q->adap, p); } else dev_err(q->adap->pdev_dev, "unexpected CPL %#x on FW event queue\n", opcode); @@ -4236,6 +4241,20 @@ static int adap_init0(struct adapter *adap) adap->vres.pbl.start = val[4]; adap->vres.pbl.size = val[5] - val[4] + 1; + params[0] = FW_PARAM_PFVF(SRQ_START); + params[1] = FW_PARAM_PFVF(SRQ_END); + ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 2, + params, val); + if (!ret) { + adap->vres.srq.start = val[0]; + adap->vres.srq.size = val[1] - val[0] + 1; + } + if (adap->vres.srq.size) { + adap->srq = t4_init_srq(adap->vres.srq.size); + if (!adap->srq) + dev_warn(&adap->pdev->dev, "could not allocate SRQ, continuing\n"); + } + params[0] = FW_PARAM_PFVF(SQRQ_START); params[1] = FW_PARAM_PFVF(SQRQ_END); params[2] = FW_PARAM_PFVF(CQ_START); @@ -4903,6 +4922,7 @@ static void free_some_resources(struct adapter *adapter) kvfree(adapter->smt); kvfree(adapter->l2t); + kvfree(adapter->srq); t4_cleanup_sched(adapter); kvfree(adapter->tids.tid_tab); cxgb4_cleanup_tc_flower(adapter); diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h index a14e8db51cdc..c77461d0d519 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h @@ -283,6 +283,7 @@ struct cxgb4_virt_res { /* virtualized HW resources */ struct cxgb4_range iscsi; struct cxgb4_range stag; struct cxgb4_range rq; + struct cxgb4_range srq; struct cxgb4_range pbl; struct cxgb4_range qp; struct cxgb4_range cq;