From patchwork Mon Mar 29 13:54:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170207 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A616C433E0 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2373C61959 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231825AbhC2NzJ (ORCPT ); Mon, 29 Mar 2021 09:55:09 -0400 Received: from mail-bn7nam10on2091.outbound.protection.outlook.com ([40.107.92.91]:33857 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231931AbhC2NzC (ORCPT ); Mon, 29 Mar 2021 09:55:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wyc+7Iqkel32ym8lwcy1hnzXBHqmeVRzIlzP3PwfRkGddofCuMLZbUGLFzALkxg30IHw+3xPung2BGlvh0+szLMsEbr2RJTXxn2ihJQ3Skdhmukn99DmebeQPXNe8jqwjBxSJVit7uhlmgkpDhYXlzDLQVowq+CCjVr5UQmSYigCHR0N65CVvoXaS5od7NTQ03ICmxl4uVxzURSP2mFckofmrt8a1625vs0AdxRQOjY3l9Y2vkGofT4Zn3ui0V3G8ynDBGck7ZN/ZxHZv7UpWIEEzZPSXYx/w9g2Ws2fCoZrcX7JNtKXk5M6RIrEy9cspKnubOtP6QTnnMS43VmiKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ih2PmAJ31qovLuWj1GB6hswfaKDNccGVMnm2wfzEzX8=; b=IGfkl1BTak3MCdye44m7mK0ksnf405ZqL7Jqw7kPwGGiwWgADZW3XRFFFu9jBYKMiFUfs5PufbJO3k63BkIIYxSLhZ6BT1gV552LQpFgD7FQ94UEZNpZ0OopW0cm/6sITkUfc8iATDbm6ApnFGThFCcyYA4vXr0vsThB3uYaClGNSgxGX8mCFEuSKQZk1MTPcj8rZDRpkG+kugu6VKZNdp1b9ac0/zGK+vWspJIC0HA6CNTnfAEfsFNIFm/mojkf8I4dPq6S376e9lEQXk9fOe0ZERoKaR78IhbsGojhilKTnA1Z/PRn44tPskYZU8qLk5Z+/LynHsCj8jrxwRt7Gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ih2PmAJ31qovLuWj1GB6hswfaKDNccGVMnm2wfzEzX8=; b=THT6iHyiVY3ozZE99JC5XopDsCwZHQEkf+vkhVLhoGKl8LnkiM19VTg1Yj/cwzfT053wElIVbkgNkZ8Zr4+YnzpHJT9D7vlgR0j9qq7xL2wUDmp1A/DQBoeeC8Mpa3tA3pb6bPnpI4Wn4HkU9ICG5t5SUMD1EgYytrE8UA4YpBisidoZrBlp5Sn8SA92xiQWRGEx5g3BOg+/vxV4LfhEvmJvZeypVtajQWffJK+6MxFxzafBA4ma/eqxLce7v+a2/hRaVxOUYaofBl2doIfQfZ8L66KKkt2KpShNgX5+OJPJwyFf/uyoZc6hjzW3dCsAS6f+QKyYGCrPe5tYCi7Wqw== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6618.prod.exchangelabs.com (2603:10b6:510:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 13:55:00 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:00 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 01/10] IB/hfi1: Add AIP tx traces Date: Mon, 29 Mar 2021 09:54:07 -0400 Message-Id: <1617026056-50483-2-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:54:59 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdae2178-36ad-4f3e-9d25-08d8f2ba3ec7 X-MS-TrafficTypeDiagnostic: PH0PR01MB6618: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:217; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9gFkg72XRoWt2X2x44cZ57Y5qH5HYCQmBGtVA/TeD7Se3eq//lGDy+MOqdi91+3WLz/d78rpailAYAHgz4yebhSi6V9hu29Y/WjYz2RpYvEcRAkgh3PQ6hV9tHNJpUw7jloRcdae3SdaZazq9py6aFmacjb5Ax+TctBQh4uvEXPtAcsrXbis+oAw0RuXngWKEwFf81hpIV7Yqr7gKpBkj63gOwsmaPkXSJKzpeKuc2uZJz3CwCjkIBkQVOEN4Gl2ycHo9gpP+/ML4sMaMRZ9uYYaodCr4C/P0ssEjRp6x2HBs4JaRGFcxpRN1C6r8nXD0XWBFlAnBZAaLy4yzhD9N+MPuMxb8eG4tJTDkdfjDt5+KIOgOw2qqpNtTu/fuPE23uavg9cv5xsVrbOLwG0TyHi9VhrUzTgeYLtGaYW/h2Dfn1EdIQl/cVVU3/Usbbra7A8nrta234x/TiqVh9stj+JmTlWJ5ooVEgyTz9khxk1X0dbCPrYwb5fn5rWegJHDjURJKtnrWzVJDfHxQrrOqvcLpJYuEEkE5F+8Qjq0RKLM83spCDFCvB+Bkuu6p+IfrZ/Y8gFzHxKEQyljQO76eRF9FsfVbHV24IUG7HwR4qJrkglCJGSa1h5QjNdiprJgx2grifXTx+UCwtDsqJjmZSB9Z/aJW6eovUVS6CpfuWc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39830400003)(366004)(346002)(376002)(396003)(86362001)(5660300002)(52116002)(186003)(4326008)(7696005)(2906002)(36756003)(66556008)(8936002)(956004)(66476007)(107886003)(2616005)(478600001)(54906003)(83380400001)(66946007)(6486002)(38100700001)(8676002)(26005)(316002)(9686003)(6666004)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: N3BRq2q0kSA8SjYFi7VJfG1aEeU8jgM3NbIKrAcPcc5wUMwxx5vH/vIgINZikD7g8FGH5m6UAL6lOhXzIlsV+jIlbf4ftbYeeN0ouZekMnykdsKbyqGlAfnV4TApzypeLLjOOCEIQrso/gtOsTx62EAiqZddgYa/IfnIIL7/n1OYtU/6BQSZkmaR77qgQZFnaquWnh2Wi0g5Byt98KWSbf9p11njEvUJDDDm8mJddmcHEmihIe8zXPLsxXBnPZbyF+sdC954woORkmqyNj/ZWe3qiYK/0WcUck31jFkqgCxYC3HS52uQS1d3Peeoyw3JProJKk0UwH4xDN0/pAvphL/8Tc/n6pn15QpTajNVO6gNtKbVhvJ+At07fJt47zXErAC/xu4/4x34hFR3k+RJImbyuKOsMcon7Nf6PBzrb62Rg2LUl5aU4dKgVaOLLc4pDPXFDGvNT4PtvfqAdlr24epW/KTdmKhj2aKv4ttxZy2mFwbEPHuN+orFImtjXhavorRNORTCVLi05ejhIJ36Op8Rns6wT74hEXa4NkxplmOf9RBvlJCA0CUtGAx3gD+EfDApo5vW8omm7QVgYSkCss8V6TNVwQqHFJmqPWt35HabH2Flx4AaRtMHPQNdrDy3zvHbrlKNUc1vNdDNylljRFUSCoimagN3Mf7R+Qiq98d2fBwCRfYT/BnplH8DDSaaIiIymkIkxHjGQz8U78EIyIDs3haAR1si8/p7H4OWNcYTT1LZmcNHHBWZjDeDBHyfTQZHjtX69L0f5w7E78av/G0/i5TZhoz2owxIfQ1Vn8lHcBX+TYgyDRMyIT5i/HeCymeAVXP4i/DvpPH23d47fBlDYt9zUOps68A91OwMgfgxaalP2m5HmQvGK683NeGdqJpiAF+FwUyFcK5eFmk2acDQRkZaW/PXDZGUnrBCNyyqu/1evVdbzitvFjBuTofPvpJZFd4/TLQoMmxkROZOxe+H284NVQOkv9ls+zrVmBkf/PGkswZTNMggdPz4YHtRqloniRl5cJJZAOr5//8JRb+30i1witDvtp0yBnXDwqvfqxxui/hpyPlXQS9r9AIl/Wo1MwY/1iD3wtvDVYpCVbWteXr76tVGcdQXzLBdIGsk9gyJBlGqZnne3hl3UgWNN8xdpVGNHIb/GK1nF+ulG1LZoyXHrATl6DN2+wn1qOcvLqQ46SWg5yH7Am4YtP2aEE8/ogZ0fgL3k6WhhwJ360K8rBcsrCeyqr6EfvZlJmyU3qp1hVUaLYXGwZJqaU6oDTCUv5/Js8bmGf1qD2x3+FgUaxSwwouc0KvOouyO9ogDPyeYHC/8vd9ozCFLPesQ X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdae2178-36ad-4f3e-9d25-08d8f2ba3ec7 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:00.5845 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: OJXZFbBSOGdvZUZ2HQxfpHV4mxNcC+WvreGwp6TxD8v5Gaiog0XIQDH3lJIph37d4iBvg1Ptb9uDti3t3j0gsf7MyvuzHRTlOaJ2466N6VBuKXMU+DzDizEinZqafwFB X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6618 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn Add traces to allow for debugging issues with AIP tx. Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/ipoib_tx.c | 18 +++++- drivers/infiniband/hw/hfi1/trace_tx.h | 104 ++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/ipoib_tx.c b/drivers/infiniband/hw/hfi1/ipoib_tx.c index edd4eea..5129dc9 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_tx.c +++ b/drivers/infiniband/hw/hfi1/ipoib_tx.c @@ -15,6 +15,7 @@ #include "verbs.h" #include "trace_ibhdrs.h" #include "ipoib.h" +#include "trace_tx.h" /* Add a convenience helper */ #define CIRC_ADD(val, add, size) (((val) + (add)) & ((size) - 1)) @@ -63,12 +64,14 @@ static u64 hfi1_ipoib_used(struct hfi1_ipoib_txq *txq) static void hfi1_ipoib_stop_txq(struct hfi1_ipoib_txq *txq) { + trace_hfi1_txq_stop(txq); if (atomic_inc_return(&txq->stops) == 1) netif_stop_subqueue(txq->priv->netdev, txq->q_idx); } static void hfi1_ipoib_wake_txq(struct hfi1_ipoib_txq *txq) { + trace_hfi1_txq_wake(txq); if (atomic_dec_and_test(&txq->stops)) netif_wake_subqueue(txq->priv->netdev, txq->q_idx); } @@ -89,8 +92,10 @@ static void hfi1_ipoib_check_queue_depth(struct hfi1_ipoib_txq *txq) { ++txq->sent_txreqs; if (hfi1_ipoib_used(txq) >= hfi1_ipoib_ring_hwat(txq) && - !atomic_xchg(&txq->ring_full, 1)) + !atomic_xchg(&txq->ring_full, 1)) { + trace_hfi1_txq_full(txq); hfi1_ipoib_stop_txq(txq); + } } static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq) @@ -112,8 +117,10 @@ static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq) * to protect against ring overflow. */ if (hfi1_ipoib_used(txq) < hfi1_ipoib_ring_lwat(txq) && - atomic_xchg(&txq->ring_full, 0)) + atomic_xchg(&txq->ring_full, 0)) { + trace_hfi1_txq_xmit_unstopped(txq); hfi1_ipoib_wake_txq(txq); + } } static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget) @@ -405,6 +412,7 @@ static struct ipoib_txreq *hfi1_ipoib_send_dma_common(struct net_device *dev, sdma_select_engine_sc(priv->dd, txp->flow.tx_queue, txp->flow.sc5); + trace_hfi1_flow_switch(txp->txq); } return tx; @@ -525,6 +533,7 @@ static int hfi1_ipoib_send_dma_list(struct net_device *dev, if (txq->flow.as_int != txp->flow.as_int) { int ret; + trace_hfi1_flow_flush(txq); ret = hfi1_ipoib_flush_tx_list(dev, txq); if (unlikely(ret)) { if (ret == -EBUSY) @@ -635,8 +644,10 @@ static int hfi1_ipoib_sdma_sleep(struct sdma_engine *sde, /* came from non-list submit */ list_add_tail(&txreq->list, &txq->tx_list); if (list_empty(&txq->wait.list)) { - if (!atomic_xchg(&txq->no_desc, 1)) + if (!atomic_xchg(&txq->no_desc, 1)) { + trace_hfi1_txq_queued(txq); hfi1_ipoib_stop_txq(txq); + } iowait_queue(pkts_sent, wait->iow, &sde->dmawait); } @@ -659,6 +670,7 @@ static void hfi1_ipoib_sdma_wakeup(struct iowait *wait, int reason) struct hfi1_ipoib_txq *txq = container_of(wait, struct hfi1_ipoib_txq, wait); + trace_hfi1_txq_wakeup(txq); if (likely(txq->priv->netdev->reg_state == NETREG_REGISTERED)) iowait_schedule(wait, system_highpri_wq, WORK_CPU_UNBOUND); } diff --git a/drivers/infiniband/hw/hfi1/trace_tx.h b/drivers/infiniband/hw/hfi1/trace_tx.h index 769e5e4..8476541 100644 --- a/drivers/infiniband/hw/hfi1/trace_tx.h +++ b/drivers/infiniband/hw/hfi1/trace_tx.h @@ -53,6 +53,7 @@ #include "hfi.h" #include "mad.h" #include "sdma.h" +#include "ipoib.h" const char *parse_sdma_flags(struct trace_seq *p, u64 desc0, u64 desc1); @@ -858,6 +859,109 @@ TP_ARGS(qp, flag) ); +DECLARE_EVENT_CLASS(/* AIP */ + hfi1_ipoib_txq_template, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq), + TP_STRUCT__entry(/* entry */ + DD_DEV_ENTRY(txq->priv->dd) + __field(struct hfi1_ipoib_txq *, txq) + __field(struct sdma_engine *, sde) + __field(ulong, head) + __field(ulong, tail) + __field(uint, used) + __field(uint, flow) + __field(int, stops) + __field(int, no_desc) + __field(u8, idx) + __field(u8, stopped) + ), + TP_fast_assign(/* assign */ + DD_DEV_ASSIGN(txq->priv->dd) + __entry->txq = txq; + __entry->sde = txq->sde; + __entry->head = txq->tx_ring.head; + __entry->tail = txq->tx_ring.tail; + __entry->idx = txq->q_idx; + __entry->used = + txq->sent_txreqs - + atomic64_read(&txq->complete_txreqs); + __entry->flow = txq->flow.as_int; + __entry->stops = atomic_read(&txq->stops); + __entry->no_desc = atomic_read(&txq->no_desc); + __entry->stopped = + __netif_subqueue_stopped(txq->priv->netdev, txq->q_idx); + ), + TP_printk(/* print */ + "[%s] txq %llx idx %u sde %llx head %lx tail %lx flow %x used %u stops %d no_desc %d stopped %u", + __get_str(dev), + (unsigned long long)__entry->txq, + __entry->idx, + (unsigned long long)__entry->sde, + __entry->head, + __entry->tail, + __entry->flow, + __entry->used, + __entry->stops, + __entry->no_desc, + __entry->stopped + ) +); + +DEFINE_EVENT(/* queue stop */ + hfi1_ipoib_txq_template, hfi1_txq_stop, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* queue wake */ + hfi1_ipoib_txq_template, hfi1_txq_wake, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* flow flush */ + hfi1_ipoib_txq_template, hfi1_flow_flush, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* flow switch */ + hfi1_ipoib_txq_template, hfi1_flow_switch, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* wakeup */ + hfi1_ipoib_txq_template, hfi1_txq_wakeup, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* full */ + hfi1_ipoib_txq_template, hfi1_txq_full, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* queued */ + hfi1_ipoib_txq_template, hfi1_txq_queued, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* xmit_stopped */ + hfi1_ipoib_txq_template, hfi1_txq_xmit_stopped, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + +DEFINE_EVENT(/* xmit_unstopped */ + hfi1_ipoib_txq_template, hfi1_txq_xmit_unstopped, + TP_PROTO(struct hfi1_ipoib_txq *txq), + TP_ARGS(txq) +); + #endif /* __HFI1_TRACE_TX_H */ #undef TRACE_INCLUDE_PATH From patchwork Mon Mar 29 13:54:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170215 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22E00C433E8 for ; Mon, 29 Mar 2021 13:55:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA39561879 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231591AbhC2NzK (ORCPT ); Mon, 29 Mar 2021 09:55:10 -0400 Received: from mail-bn7nam10on2091.outbound.protection.outlook.com ([40.107.92.91]:33857 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231932AbhC2NzD (ORCPT ); Mon, 29 Mar 2021 09:55:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJbUdfUW/eXSbD2WofWCNW4LSHzM7qTnl3djg3kwgycMOw0WH0r8PgnvD/BqRMkkDmGmqBNbYkRnKUWCiSUtqoZXmVcfEEITXYCAgyekfz0p3th9cl2Y3CQEQDGgl1YwQ7pZ3UeWakQ/JTrx/2iHEWyMjUEaoE+aXbTIMEHVM7xrvxyfWKRZUQ0VW+yulVPsH1PaPEINsy4N+5KqrHl+r0fpxTVwD1bSlgF6mdYrfJORZZeHa5J0KKpxB5XwFqxnmFpv4G/+kNYygJVL01V+1E/OVhA+0GK8A4emzNLfiD8lV1e7di/lNloCwcEWFW9aRPf1GJRP+S2QDDsX+zEOMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5gJLStY8HjQjyKzLnWTjmGHB9trP7eM2wVTKv10HclQ=; b=REn1FgLgVnqUO1MHD4UXO1xofp5wkzPUqF6WKf79pjJ6OfQlRKCLfjhE4C3ZGmHlkjSUMpulLSRhBrxTTg23a+p7UDf6w2hhYZ1s3gZsOIbC2Qer2jyNwRITQM4yQ2hTlzweqoPV3D3PacTiRUoNMx8NFv2c55SeirmZUimExzCtyH8+VxEyzIOmoHUAwlHSrkwdA9H9fvX5SUx1qmOj0xL85CB6OicT52y/LqaFqtl2bevVh5tHPZOkeFnMa3Ble9WRrWndHmLsguDXxqvUj25AEH9s4z2fxT5ouHyZcVvg+mhAwZIn9Apb41Zpl9ZtMxEcS/yVFGF1a8qW4KvF2g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5gJLStY8HjQjyKzLnWTjmGHB9trP7eM2wVTKv10HclQ=; b=WtsHd2D5mJv1JgoP+2hXz/ATuN5+QFjIfS5mC1xoNLISL/Y9fVJYGezo6todcmOAV/8al3LqrsGNqvZ9pzNPaxjVpT39b1CbeMEDEJodeTYSe08T9uON8JmAGXDITkdVEZsl2rYlpgj3YmqqjOVt/JRSQcRAEUiGocgyp4es3wiDj3rePRJg9zoU9oKywq5KMQ72p5hI5GIjnyMqQuWzYbfZsbzFmESnkJ5+++/1JYzv9SyZHphPtU5efEBlrs8phIYWd37jmK3zIFb3GbLGNB5VmeL1957PfgIY/BDpDDcfwJ3DwIaOQZ2GEqewELuW60b7sdEqsFOG6Jq6p8q4iQ== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6618.prod.exchangelabs.com (2603:10b6:510:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 13:55:01 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:01 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 02/10] IB/{ipoib,hfi1}: Add a timeout handler for rdma_netdev Date: Mon, 29 Mar 2021 09:54:08 -0400 Message-Id: <1617026056-50483-3-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f852e6a8-2cea-4416-e384-08d8f2ba3f67 X-MS-TrafficTypeDiagnostic: PH0PR01MB6618: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QDIw5p7h7xhOhnOFUtmyKXn7BJeY1nIAJ5iwrnqpTlrI7O4BJQdm+5OwYKuXAxiUbl3URPli48aiXl71A9xYFP6P9+TtEPTtRZluxTmi5+VixaYE98vDQis5buUzldESXmMKE/Lt97EdpFWz7qZSpg0eBW9kpQm78g7imTdlMXFlMvqTuK22s6veLZU3LPJbj+fX/blhLLN3+aqB9A52kN9F1k0oljFSmjhUAQXGGrU+ymz055KDz0R2EKfQys4l1ObbRx1mSTl6Lluwp4Db3pl4jhaWIrDu3jPldUzXsujKpu5TjV9jcI1i/WSxYw7ahQTBjny+mnn5h1B1UfstEVdLmF3jK2GhO3b5tB8x+z9AKNdrNVyNhUwfLiLpbBuFOrspaXquzmP1SsafeXxSgBnIqSsCAuXL55I1MXPXgPE3ZjqMAI+pw+zaaYV1KUuq2KpLlpECDOM3UYQ22d5j7A0dWp/+tddlYsn0Tu/b5aa9SS5xrHm1hrK2BIAaM+U7Gm4PPRGQoCV7s31EOd+NO6/Mtw4IAgs1XNEQS3X/kQkqc6VoWYkt32tVS5AWHkYoQ35NGWwuTdAxyW0ukVbdeumB+LPlS8a8n7WoPPS9ukX17JjyQdguk9BXXLvnXEjDoJOod2zlLON8MJC5p3FSzCUyVz44uLDa1h5RlqRBnm0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39830400003)(366004)(346002)(376002)(396003)(86362001)(5660300002)(52116002)(186003)(4326008)(7696005)(2906002)(36756003)(66556008)(8936002)(956004)(66476007)(107886003)(2616005)(478600001)(54906003)(83380400001)(66946007)(6486002)(38100700001)(8676002)(26005)(316002)(9686003)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: vq6xvnINvAqIub9FoLNDO4TxdqcTmlGOPhkEHz8x4eLxJznE4h/PEWKeiKoSZZKVTgXuc8I2fd3UYtKYtcYcyUXlpezRKwfOkgF88VGnRGJWjsfbUpiPA/IOmviU/EX+Kcw8qvUnYteXlKm4SG4LgcCt1hHHC3sdTxx5FJpcG89mhlSQjwB69GLM24eZR73MpHLoy1NHFdysD4nqbzbJB13uqyslo9meBmwOsVUMwzSalKxqipcgkWJIufXJAxVMjG5xBIuoptxRU1RcxxvdcFYQkJyi8ceYRmvX0G5AmdHpN7uqxgFD+FhpVmvKLg3i4QMojtRjUHRfZeppOP2QYft6Qkn0bUcm24t7ExP6/u7FS+xbys6e0i+rPKgY74o/b/Wkk6qU4kpUjcgGw+6a2ins4MAW2Xvq0RIsegzTc3e3BYnRE7nWUav1Dl7DHC3+Mp63cki45tFUQu4H+dRVwJyy1R0+/0/Bmx9JqR+f1rcA5UQifveInnlLX0KUHKI7KmhQ2cpSuTo7fn9fjjeEYcdXO3G/TjnZ0SREiUKs5BlrZILHHB7y3QgMLHrVpfoikBeNNPG0RUmqa6FKnMz5TxpYWpo7DNwM9wtPuRTctDxwz3k0T33tReI5CfNyvwiXFDxHHfOApVfgJpFwFIX+8kQfqObg0Y7YeETViIT2UdC2U6JV7TWLQrmucc/mcB0CseX4OAwrwTm7eXhfc35flkI4xmOSjq+Bia5Z4QsuOOqQBS4wWS5DEzDt+PuU+7y/xHMV7rtRI8BH8wa5/2/4kTWfOD5KVYF9YeQSMQm99NjyHxEMzpyBzvXyVP5usnA1UbGULxdTa01wot9Bip8l5RTvaG+9CHH+jQtHPp0I81kat/4uez/gWFuISxIMDxlCH+Li6re1I1NRYuLIK2QeZb86DEnUq/cmUHPXE3johFbr4vj2yYsvxD3wu6tTbetQo5RAJHnog4w8nrADV6ZGNaN2EHSlwlf8fDdv8IhPg+9eLsa1Mn1tN6Us7hNM4A3TAZRJuid/F+TK/YFLhc+dO2apJ3gcNQiNO0BCJVjX2Is+iZkoQJrmU3CBFlR6B9rykuBzbgj5ig6DjoyqS72Pkn0Xs5JMTpyxY0Tlbq/LegD8xLUQ8BBBaxLqJYsxDWNwZS2tfnyqE3stSzwuciuPZgJDjs0zDCRzEQdhAXo41FlBE6i2FNelbjjTuRcZAkCIlfcSZaGr3aB42tlTy6FitGWjzWK42NvXGLfuCPyi0hus3MvzWWlvsJoTJZdosXuHotgQdz4lux8OYuH/TBMbH1sb+z9LMshED+TWjnBGmIWVnix7A5SLcT2ReFztl1SY X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: f852e6a8-2cea-4416-e384-08d8f2ba3f67 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:01.5632 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cWWwdN/swFc3MPGnF/Wojj1yJ0+BqaX4xXOk+tAgOiLtyDFs7aN1/6rIf30Y2siu6CwM9XpcCT6+YB9iNdc9H5yrRFW8RLlTjCyv/kIKrvDec2/IMJCv/HODV9VtyLtU X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6618 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn The current rdma_netdev handling in ipoib hooks the tx_timeout handler, but prints out a totally useless message that prevents effective debugging especially when multiple transmit queues are being used. Add a tx_timeout rdma_netdev hook and implement the callback in the hfi1 to print additional information. The existing non-helpful message is avoided when the driver has presented a callback. Reviewed-by: Kaike Wan Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/ipoib.h | 2 ++ drivers/infiniband/hw/hfi1/ipoib_main.c | 1 + drivers/infiniband/hw/hfi1/ipoib_tx.c | 29 +++++++++++++++++++++++++++++ drivers/infiniband/ulp/ipoib/ipoib_main.c | 5 +++++ include/rdma/ib_verbs.h | 2 ++ 5 files changed, 39 insertions(+) diff --git a/drivers/infiniband/hw/hfi1/ipoib.h b/drivers/infiniband/hw/hfi1/ipoib.h index f650cac..1659beb 100644 --- a/drivers/infiniband/hw/hfi1/ipoib.h +++ b/drivers/infiniband/hw/hfi1/ipoib.h @@ -147,4 +147,6 @@ int hfi1_ipoib_rn_get_params(struct ib_device *device, enum rdma_netdev_t type, struct rdma_netdev_alloc_params *params); +void hfi1_ipoib_tx_timeout(struct net_device *dev, unsigned int q); + #endif /* _IPOIB_H */ diff --git a/drivers/infiniband/hw/hfi1/ipoib_main.c b/drivers/infiniband/hw/hfi1/ipoib_main.c index 3242290..b8838fa 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_main.c +++ b/drivers/infiniband/hw/hfi1/ipoib_main.c @@ -204,6 +204,7 @@ static int hfi1_ipoib_setup_rn(struct ib_device *device, int rc; rn->send = hfi1_ipoib_send; + rn->tx_timeout = hfi1_ipoib_tx_timeout; rn->attach_mcast = hfi1_ipoib_mcast_attach; rn->detach_mcast = hfi1_ipoib_mcast_detach; rn->set_id = hfi1_ipoib_set_id; diff --git a/drivers/infiniband/hw/hfi1/ipoib_tx.c b/drivers/infiniband/hw/hfi1/ipoib_tx.c index 5129dc9..e8dece5 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_tx.c +++ b/drivers/infiniband/hw/hfi1/ipoib_tx.c @@ -866,3 +866,32 @@ void hfi1_ipoib_napi_tx_disable(struct net_device *dev) (void)hfi1_ipoib_drain_tx_ring(txq, txq->tx_ring.max_items); } } + +void hfi1_ipoib_tx_timeout(struct net_device *dev, unsigned int q) +{ + struct hfi1_ipoib_dev_priv *priv = hfi1_ipoib_priv(dev); + struct hfi1_ipoib_txq *txq = &priv->txqs[q]; + u64 completed = atomic64_read(&txq->complete_txreqs); + + dd_dev_info(priv->dd, "timeout txq %llx q %u stopped %u stops %d no_desc %d ring_full %d\n", + (unsigned long long)txq, q, + __netif_subqueue_stopped(dev, txq->q_idx), + atomic_read(&txq->stops), + atomic_read(&txq->no_desc), + atomic_read(&txq->ring_full)); + dd_dev_info(priv->dd, "sde %llx engine %u\n", + (unsigned long long)txq->sde, + txq->sde ? txq->sde->this_idx : 0); + dd_dev_info(priv->dd, "flow %x\n", txq->flow.as_int); + dd_dev_info(priv->dd, "sent %llu completed %llu used %llu\n", + txq->sent_txreqs, completed, hfi1_ipoib_used(txq)); + dd_dev_info(priv->dd, "tx_queue_len %u max_items %lu\n", + dev->tx_queue_len, txq->tx_ring.max_items); + dd_dev_info(priv->dd, "head %lu tail %lu\n", + txq->tx_ring.head, txq->tx_ring.tail); + dd_dev_info(priv->dd, "wait queued %u\n", + !list_empty(&txq->wait.list)); + dd_dev_info(priv->dd, "tx_list empty %u\n", + list_empty(&txq->tx_list)); +} + diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index e16b40c..2fb2fa16 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1181,7 +1181,12 @@ static netdev_tx_t ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) static void ipoib_timeout(struct net_device *dev, unsigned int txqueue) { struct ipoib_dev_priv *priv = ipoib_priv(dev); + struct rdma_netdev *rn = netdev_priv(dev); + if (rn->tx_timeout) { + rn->tx_timeout(dev, txqueue); + return; + } ipoib_warn(priv, "transmit timeout: latency %d msecs\n", jiffies_to_msecs(jiffies - dev_trans_start(dev))); ipoib_warn(priv, diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 21c19b1..84f7084 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -2215,6 +2215,8 @@ struct rdma_netdev { int set_qkey, u32 qkey); int (*detach_mcast)(struct net_device *dev, struct ib_device *hca, union ib_gid *gid, u16 mlid); + /* timeout */ + void (*tx_timeout)(struct net_device *dev, unsigned int txqueue); }; struct rdma_netdev_alloc_params { From patchwork Mon Mar 29 13:54:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170203 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45166C433C1 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D4316191B for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbhC2NzK (ORCPT ); Mon, 29 Mar 2021 09:55:10 -0400 Received: from mail-bn7nam10on2091.outbound.protection.outlook.com ([40.107.92.91]:33857 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231934AbhC2NzE (ORCPT ); Mon, 29 Mar 2021 09:55:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fjs2Pf9o6oLKx5oPkhcFL7zjQgiNfBH36nfFPiyYVR8mYKfVf3GDjYsEFuFRFFoh4Rz8bCkuk0BAPCEO15KwhMWlrZGaAAZN+ISsRlGmMX8fNKR6VLQu7U0k6mKFj17FambVnu/O0cR3tFJ5kH9AzhCs3LaK3rMG2UcSSfFjdCbn1Nbo5FKI9f6XtqNArMLPktwIr5mioPb7bthHbTSg8i8F+jWKPgtO6FgvsCNrlTNrjde6XjCeaMuQGOYiWBukvNK3hd/qKO1nLu3N3Gvdq1JD9nkXyWrI6cbq/jRhAAILGIUiHhKFBMKs/mB0X+KW0xy1Pb5FIjRGMjmwttEICw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h6sW7eHePmpg0qDS0MGA5Fe22kM2wRiLX5hkpdvX0z8=; b=WKlhAtMzhjY8Vrwv2RelAJ4LWeb9ZbqU0LkNMTcDHNZgtIRDz2q2xfszEbJCGoj79WkVyRZ4vBenhp7R3zpQ5hKxofsJXGgvvihRMXVJRdTT8Ja2GAFMpzh+AAScEM8zOX/z5qKIrKlje0PzHHCX07s3R3Aukxt8HFdRSZ9y/94xfsEGCe2ZRMgc3aC5FBkhzCtfl0GBTiAfWB6PndHuArznnhaFPBSTp8QycAQjE1l4wtVkCDDazZAvYzztoUTIOUe2insGnT9vyslChUy8UklYF9jJkZ4KGVYCEFmUK5GbwrVdmn328zaeffukTlEddr6XMpWf2AXN29AKvLSDPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h6sW7eHePmpg0qDS0MGA5Fe22kM2wRiLX5hkpdvX0z8=; b=R+xuZ32M1jOlFp6PjhnPW5BX1yLgCehyUEBCJ2Wfuc3aEW2DrDMF/3rEOm6HePVfOXtIhBI5LEefKE+mcPZ3sFBtr+dCDbCEXHezZ8gR3X6MVRslpSJPT1Rjv0u8q43F2iQbbyM4IvwDUxBGMnkz2bHpGjX3RujEicJDoYBD0TC7AgohEnuFL0uZG88Hv+uMWFMdTMtzK12/SY9bFpRF00/AJ1B21qrmBcdfQHIOwo0RXOMbykvGyQyNxk9B8KWx01B6SVA718+wROjuQTGPF1kKQs4Vu1sX8/O0GB4D673XGpkaSGKojmkQ21LrqxgruOgBx2Ws0/JLFXdqXSKR0w== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6618.prod.exchangelabs.com (2603:10b6:510:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 13:55:02 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:02 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 03/10] IB/hfi1: Correct oversized ring allocation Date: Mon, 29 Mar 2021 09:54:09 -0400 Message-Id: <1617026056-50483-4-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 942c25d7-00d4-4680-6097-08d8f2ba3ffd X-MS-TrafficTypeDiagnostic: PH0PR01MB6618: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DsJ3Aqfl9NdlRLpyFNU7jXG5bRC2EdNh+nzAXwBzfULkWOIww+h5ewg8t+ZTUoG4uB4exlO3rByvoNkx797UAQNGoFpQ311Z8ExSpVYJb0hkVoew7W6SHtJJqbu2Q6A4gqoz4Z7fpDxZ2pJbpVqTQ90DIdPJc304ISaOuZmalkMaQwR7lgi0G+0geKXndQy/+vCw2REK+GYsQQ/M0LbxdjfBBa01mqkOT15DzbeH4eGwwozoFIFEiH2OSglSLm3DdDPRxaUHOXKRExQl6ouKnvcePClh+BhSB8ZCtKJKBwgV/aiU60kI0IrALTv6DewfjFNFS23UVCmnIi6hjG70b0qU00g97/p3eCFfMc9Of49JQVUBJRPr8gvServWT7VYq+MTOZXsN4OE6qG1tpp4BXY0nY4ysjiL88goYdxU1+SlAOQBWNelQQ5fJ3ClR6jFwHhogh4YBCWyyfHcgRJs8cbhObtjxe7gaqIAjhnif1ZJBJ17V+Qwn6/h0LV0uqz1c+254EF+YI18OMwBAJ14A2rGrgfW0DTuTrN69VtfsqiiLrG/Vz2b3hX0Px1ROGLdQJWzH71K/0xMSFdP6nBG0AdQfeNeifJQYI1hcWl7C2Z1LwnhUJpdtszGwQV+2gSyiuX4lR11cVS54XrvOKGh2d4uH53XdBpxuB9JAsE+P+Q= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39830400003)(366004)(346002)(376002)(396003)(86362001)(5660300002)(52116002)(186003)(4326008)(7696005)(2906002)(36756003)(66556008)(8936002)(956004)(66476007)(107886003)(2616005)(478600001)(54906003)(83380400001)(66946007)(6486002)(38100700001)(8676002)(26005)(316002)(9686003)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: bZq3TuEPAmKt37n1QAWduu0US0IZ4fBICmY7zQ/iVwUotJdhD32GIqjZfT6/8bdDaNJ7xYt5HTG3XbuXlbPOiDwWEnayCIENlVFdokY5QPxvpMII+MatNDdicHnLX0FXrBCZzUlS7a2yu9vn+oxlV7/G0TvarIxKShH+3K67AGb5iRn6fEZYFck1Be4vkp1kl9IjEF20Uuq+hhZX9iMGOX3z9QkJCKppxSagJtzJWZOzSKu2573gcqZu7Fwpy6jpP4EdiM3DDyVm4p1CYmADSSEf74Ib5mmll4ud+/RphpzJLJeXKmQR+XKDw+Y8EHQ3bmocAIyoAfHYTxMrCf/wWwRvtP6Hf8c6LI/R0TdnROQyreHCCFltwDEGwpyr8qYqKbjz7xSSmARY6f+eyWzy0ceREU1hUGbxiNrHGaOr3p+/GU2oeDFMSdWTQ9iUwj2Q4a3ezFPFzCgEe9f4OH2sonHp3jWAms5waKGb5l3HWvY0HFYxB0QYsVHK/KuK6A7j/xz6+VzLCsc4M/olyQAPHkZ/JGGIoXCr06TvW/Em0LpbLqVmZWmd+XkzH98XS0lYhGu3UtqsK4aJLVbgBQZhu8H/qJsPq8RgwaU/d8QVlbSpIqha8qHn43KgejzUKxjMBV1EZkh45WM8yVRM2b+WW91jHbqm6ilVdP43jqShoMeZM0AazD9d58rhqvkVMOvbVMDitmPr/uq0pWfvkwnbN1vSwWEh319ubi1pL6ZfGbTHDxYX1taeL3FxPkY/h63c9XfSCfFjIK3XSC4Y6H9KKzcIu/0yrSPqy50E8j4uCGR8vKedbjuDI7c7fQAjy+ZbdVacwUm9yWFsc3tZHDQKqbjE6XKp1ZxUouGE3hqAqowfOhI6ooy+4CmfSCevvcNUgnMXS6wVY5elo8KtUyoTGj+9SBiRUXa7ZysSpNNmQBRwWYt/6+kx+31KA2C6zVUoCRLusYjcSp72Vus+jmTCvEwn4dlvn8/YhYTpkWus07RQ1S72KIQ9wx/5NcFMQ5tXSpuZwpnhMjvtQqN0tKuUfHfa4Z4HBYIMXxWNJ5Norg8y5MtRSJpoGpBPF2MR5L90JSih6EVwqilQ6c/+aZCbiVdF4g4YlDVGLRhqOmgbDdJzTv00hl3iu0Kse8WesC8TWSaalz/PD7pVxzSLgRQJ2KPtasJQsdaoafrBv1E+fuOOikOvJlGPOkA2Th2rDF/I3aOjF2a9+I2Cf4161Jm6AQp48lnDltJ1X83JTruwoi6+U7Fr0TPyIgE/szKeH08CUoGYCj855oPRHlhMI/A7YnTbhSGrLtS9TTRueRg0EfQJo46DNLiS6x88nzyAbv6U X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 942c25d7-00d4-4680-6097-08d8f2ba3ffd X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:02.6096 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aicHK1KmrmAHSrpwF3ggm4+lgSMl11wY9P19ZT0ipCU5MvdYBhYUj6otQSQUrgtibD847Oq51HZQqK7J65H9XGvvBYO9nfdjZl/QRkcP7UgYyHYwCW12s732gdiLFauA X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6618 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn The completion ring for tx is using the wrong size to size the ring, oversizing the ring by two orders of magniture. Correct the allocation size and use kcalloc_node() to allocate the ring. Fix mistaken GFP defines in similar allocations. Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/ipoib.h | 3 ++- drivers/infiniband/hw/hfi1/ipoib_tx.c | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/ipoib.h b/drivers/infiniband/hw/hfi1/ipoib.h index 1659beb..39c8909 100644 --- a/drivers/infiniband/hw/hfi1/ipoib.h +++ b/drivers/infiniband/hw/hfi1/ipoib.h @@ -52,8 +52,9 @@ * @producer_lock: producer sync lock * @consumer_lock: consumer sync lock */ +struct ipoib_txreq; struct hfi1_ipoib_circ_buf { - void **items; + struct ipoib_txreq **items; unsigned long head; unsigned long tail; unsigned long max_items; diff --git a/drivers/infiniband/hw/hfi1/ipoib_tx.c b/drivers/infiniband/hw/hfi1/ipoib_tx.c index e8dece5..1c38c38 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_tx.c +++ b/drivers/infiniband/hw/hfi1/ipoib_tx.c @@ -714,14 +714,14 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) priv->tx_napis = kcalloc_node(dev->num_tx_queues, sizeof(struct napi_struct), - GFP_ATOMIC, + GFP_KERNEL, priv->dd->node); if (!priv->tx_napis) goto free_txreq_cache; priv->txqs = kcalloc_node(dev->num_tx_queues, sizeof(struct hfi1_ipoib_txq), - GFP_ATOMIC, + GFP_KERNEL, priv->dd->node); if (!priv->txqs) goto free_tx_napis; @@ -753,9 +753,9 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) priv->dd->node); txq->tx_ring.items = - vzalloc_node(array_size(tx_ring_size, - sizeof(struct ipoib_txreq)), - priv->dd->node); + kcalloc_node(tx_ring_size, + sizeof(struct ipoib_txreq *), + GFP_KERNEL, priv->dd->node); if (!txq->tx_ring.items) goto free_txqs; @@ -776,7 +776,7 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) struct hfi1_ipoib_txq *txq = &priv->txqs[i]; netif_napi_del(txq->napi); - vfree(txq->tx_ring.items); + kfree(txq->tx_ring.items); } kfree(priv->txqs); @@ -829,7 +829,7 @@ void hfi1_ipoib_txreq_deinit(struct hfi1_ipoib_dev_priv *priv) hfi1_ipoib_drain_tx_list(txq); netif_napi_del(txq->napi); (void)hfi1_ipoib_drain_tx_ring(txq, txq->tx_ring.max_items); - vfree(txq->tx_ring.items); + kfree(txq->tx_ring.items); } kfree(priv->txqs); From patchwork Mon Mar 29 13:54:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170213 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3581C433E4 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C58BF6191B for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231915AbhC2NzK (ORCPT ); Mon, 29 Mar 2021 09:55:10 -0400 Received: from mail-bn7nam10on2091.outbound.protection.outlook.com ([40.107.92.91]:33857 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231945AbhC2NzF (ORCPT ); Mon, 29 Mar 2021 09:55:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEuT79sV2YuTXcOWhPQj+8SmrRUXY1ZW7anbLVRrJjyH4UlzAYexlcFIb49YrsXt//4wYP4Zpc6Ia6u/maUKaglULfOp/o9FFQVK0Sep2fhYuvlKmgJvJLl2O7lalmRChJEak+pNhxZ5JJ+j6G+NuWPy5Nm0tF1p7v2i26FDNqXAyNBCPCNKWhhAqnJbzBBB1+HaOw94IhJxTFDfZX7vZP5CloArkzjq9HWLW+eBFM0J9rG2Sqsza8hri/sYipeeXM245nB+Y7EOnkuJdjd6xZbRMxTyVH2x20E/VJOLxK610wGYGmtcdGcoCCxP+HBfDDa4jaCC9uaGjvjdOrCoTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4JlNF6t90J4PR1SEJEUMxo8pseMhKRxDAHB378WosgA=; b=kHQSGv+8/mnW/8zlHF1s4nuQcReFN8t77s4UO2ZT1oN4R+VVOyBWk+LoUusEEN189qVXQsjrg+5zoxhJLIPES1O6HhN/xvbXP3zu6WF/sI5cK03CusdoCk2Srq59CKao9+PbtMwqgYftkyOLOZp9iDp+3EmPXJGrbEYITas4jbmWZ9ZFuE00SrdqScrrrasuwyMLwBlP8d6SN1eyzqaWhxnTMGgxI1nn6aX0gZAN1h8A05V//2lEZJrHJSW8psVnyLQoYry5gxqmt9al0wyuLmNm5JUq2dBhbxmYqVrsLe7mxdnO/MgLA8vYuOnI6D79bKHLEpFkUYbVLtiWsGgMcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4JlNF6t90J4PR1SEJEUMxo8pseMhKRxDAHB378WosgA=; b=bqFXfRovweE3NnMBRG1kK3DfvpDOk9vk9liC6dR0mT/l85DG9i27DwPkZKWQUnVIR7yHP7Z0hrDum/vQjJSQe5SebJQNcpMi7AhJHQnpbjXKuYkAHuX+HNDb7bZ2xhlv0QeXeLR3qAqtFAlMGIapawi9TAE8osHaTOpGlDjMQSk9Q1j4VRALBZDjGIKRLNPW7uZmLx7CRzmxqUKlN4kGdsZ0T+/duIL0MkGSr78wlk6OLPGeoaFcXqoEoFwsEDa2CpxbRwrKiicqvYMlu7P6LvmIusHuPkWhD6P2wnzGFcxcA0nCDZrr1FcXWVUs0esY0UH8ENbE6wz5+bSCx9/aNw== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6618.prod.exchangelabs.com (2603:10b6:510:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 13:55:03 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:03 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 04/10] IB/hfi1: Use napi_schedule_irqoff() for tx napi Date: Mon, 29 Mar 2021 09:54:10 -0400 Message-Id: <1617026056-50483-5-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:02 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8231ba64-346b-415d-de1b-08d8f2ba409e X-MS-TrafficTypeDiagnostic: PH0PR01MB6618: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:747; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ealvH7Sv+jPZmLkq3lSh2l3V29zh50hSKnKcKtm/uY/iOyj4BI3Q9T78pDpK/zXLjNkk/peZSYMPpA8gqpNr1Vgs3hFveyz3uNE8SKr8Zl3N25kzWhg9wWy7oyMTC46M9hxNRoa9rgTDyCX/rOSpkB9+E5hILDdch+aoU0UEf4TOxoFXrxZ6dj476fHjaih/XBuimA7N3LoZ0aTzOXAXmMbo6AKV1EXpZCwnwvd7bjAaAvchBZkf0Y9rIlLAcGVnm1C9xS/B2jO787ATuZe4+z7iBxELrNcPJpq/JqiCGpg50GVrpgkodYlH1nc8ixgtJRfYaOMe76MwDAE5Y6pjC2fBKArLcTXzec/17UfsV27JzRJiPEzP2UafJEpylS4LQhqRR8cTHzmswr70F6VbRecMNZXCjGXiya4fasyRHOTeozkGBWDu/pxp1dD9QKnzprehf0nj2esCJ9iNq+933CbsWNJNMgaGfdrTqXWt2WEZ3ZT5rA0fHyFyp/HMQ0xDbaKHx5+femX90BFuh2YthFKZ2G2mhb8F54pdm8DgUtlKPYucSSUtOgHsC88YTiDBXgXCLkryVXNxQlgujSUV30I3v7HTjheWGdPiA5vldywfMLdeZBYiPAC0x+wX+/UUW11DcgEa1sQRKYW53lJ5cA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39830400003)(366004)(346002)(376002)(396003)(86362001)(5660300002)(52116002)(186003)(4326008)(7696005)(2906002)(36756003)(66556008)(8936002)(956004)(66476007)(107886003)(2616005)(478600001)(54906003)(83380400001)(66946007)(6486002)(38100700001)(8676002)(26005)(316002)(9686003)(6666004)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: /hwnL3dqZWEvmtVGzLdqH05p6Npac6jhIC9AB+aJJO2ilUCevGO/kBMsDeiIEbQbrH+DiL085rW0cw+a1BPUPUAQ3ge5WgSaj0YYMDGp6Ex0D3am9jqpaaYOrPKwgPceDDX0sNk4GqPXXVFCut8BvGI7R0FcKSkpL/PllG1duyYDSKy3XbeTkbL4oEC6HpjKN4FGhx4e7nBpdBAsEHswv3z95wZU+f5pxnZ8ofuNWHHulT5AnukLfvM5fJSMzeEfKnapvpH3Se9R07CcrfVT3Np5yWhwOs5gFivO0E8ka1YDOmRQrpZ05zDcQOIv+CZKnbykVSwv8xfW8+56jcR/6l9T/dWDFVLm4u+qrPimfQj0FRjcz36vBKuaU9tDjRENiI37M2pijhh58blH9ryv+uGzt4UPkMZW50sSGQq27ijRZsT49KdGYVdis7l3YX/04Gb0neAZ/+sDXIGRi4ZX5qpZCZqb8Ie+/ICZijcD12ySg0rGFHFIEW5KNrgN7jp03R5XfP3F/otB674Js/3EwUeqjEeKAC6+zfS9tvCOAZ2ZryLdgYfR3o5Co69UfSEfRg242Zo/DXl9Zw1d0vOV7LIaBDOa5x13lFeBR7ULwJWMWrgYnVyWWmDU8uIo+kU64eydIirDoIwAa+dgOB2gRVZ6hFP3UWZQ87ND8FDRn4ZxA/xolYvOZ32AMjiXUrBIPzgqmbJ1+fQZwpQUZRpmI1S+oJ6QwGMDSwl0Qn3wectv95IXGFT6C/JRA/SCHTqPUlUah75HuT8HemABZt0nMe8Tc+iwAjABKpYwbJXk5ajYMJ+dGQq+YwPIfaStuz7a6zZdC+k9DJTAAn+BkRSS46eg7Pav1HcR/vWUUxbApK8vr635n8+uOakrYKBL1gd3pE5Jqr5PRQYrr0W0feGxXVDiRRuFVFqn4OsDAoQn6txSIzRB5/k0/k/EtqcfXNMq6N+Zv9yHV6DeowjwXSNMgEPmQo9uifD+WBwtSSJQ8ffsRJO7bP32mAFICI4NeaQOoxwDqn6evKH9z43Jw1j82ka010bbGrd3FFh4VfIe3jQ6DFoBqW0l8OO8zDYrj109+MdaVW7CY1INXr4601GaBo3iIVN93UhkOcHM3SmLFY0i/WhtUZanQ3gTU7Chi6I6nPeAikmejyrecaj730/ghYo+hPEmbZb5YwOAdIEYzCoRJv+25Wr2fRGTPDeVGNXyu9D0+LZDoDxx65Y50xw/sBXbV9I9/Pj8UMOPtaq7qXU4hTkoxg49oDU5nLIpOexSYf8TIQCpw7lLHx0/aKZUwhlhJFixUJQknS9jc/pCl6nvXIKymflaq6HCo/si9Kml X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8231ba64-346b-415d-de1b-08d8f2ba409e X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:03.6649 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: myap4Pr/xnQY0JaX/SrFKPUBQnt8c8aBOAB4VN7hhY3kGjceS8s9zN1KiofggJPOt99VYe7f8a17PdQllphFzNRUSkJ4TNe+3y7w7h2zVu7G0oXWdpi0duDvRugErSlf X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6618 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn The call is from an ISR context and napi_schedule_irqoff() can be used. Change the call to the more efficient type. Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/ipoib_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/ipoib_tx.c b/drivers/infiniband/hw/hfi1/ipoib_tx.c index 1c38c38..8ebb653 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_tx.c +++ b/drivers/infiniband/hw/hfi1/ipoib_tx.c @@ -209,7 +209,7 @@ static void hfi1_ipoib_add_tx(struct ipoib_txreq *tx) /* Finish storing txreq before incrementing head. */ smp_store_release(&tx_ring->head, CIRC_ADD(head, 1, max_tx)); - napi_schedule(tx->txq->napi); + napi_schedule_irqoff(tx->txq->napi); } else { struct hfi1_ipoib_txq *txq = tx->txq; struct hfi1_ipoib_dev_priv *priv = tx->priv; From patchwork Mon Mar 29 13:54:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170209 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF20DC433E5 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A27FB61879 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbhC2NzL (ORCPT ); Mon, 29 Mar 2021 09:55:11 -0400 Received: from mail-bn7nam10on2091.outbound.protection.outlook.com ([40.107.92.91]:33857 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231946AbhC2NzF (ORCPT ); Mon, 29 Mar 2021 09:55:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ST+g2T7bfyswzqdhatYgH+5/hVmDdOlNxEF2LB2+zb/r2Tjq5szRslOY2H7gsCufxeVn6a9bbZ7ig7aIcICWKuvdhMv8z1OmIhs1uvfcYPZqTn7cOkscBJ2NPgZL1X16Nt/iHK96dmtVr/WZL1Sm7TvvoO/VeZd9oITy047S3Ve2UXg1IIcQwQG5fO1NVGFSvEtBJd5D88tJeh3wmKzdKg6X/TattCbQ3eu6ogrvjd0o0Q8dtFEFaJefV1pbS1ri6JPsZrGud0ACL5c8u2hbB5N+urna2adbE3pzJhvBpvwjK3Q5b9o0LbWcjMimvyuImx4/K/MpWz9EZJaipe3DXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZLT7FRxoli+0SOgbtMxf/VJM0e5EnYQUj6dr903ckJ4=; b=faWoM/Dh3KC+dP7SoZriKbVxT3rsb/ys+BrfrnP2gYmnpQP5PN3XMfr8rNNMH79flo51pydHTHPoCFzMX0ZeLXSxh+boxwXTEUinwV5vu/PvGaSuWqm1CawAy/VUWU0X8EsNzXMEFInbct/PXY37pLfY5YgLgkKK5gc2+SvafrL+rs1ZtnjLxJClE/zN95p/VgLFGO5XgzLB4GAW98Wsvv91PtAaIGfapS6X5hh59BdZjxq25d8nsvdjuOfuT3X2zWMJy0/1I3GUzUM/XdxebhMz0BuaP4WQxlg2oLNH+H7J7NJTXB+QYN4IvTHOT3sqfaIuAAFh6+HXAHNi7zS/Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZLT7FRxoli+0SOgbtMxf/VJM0e5EnYQUj6dr903ckJ4=; b=FRHEAjek0CCXM/uUu6YsALRkIKsmRSx5yhqyAc/kXN5nzeopNK6ZUJBMqSRHTeAgUCKf+oZcSwl3g+ShNP6WT1GcI4PO31DwQkzZJdw1kpPHaBc75mkLTHE+l9HXOI6O/gVVkU5OihAvcq+ptWNDG0RWk9k/QjX6rKPESxX6bGbyKtebL2FGyxPyjAoAVG1nsp9zRMDBwwVOMQC11ee8PsQhfyJeeLVZ4XOQqOQR5qTJ5Xcsd/z1irf+Q8kavUUjUC7/V/yj3Xouh1G9JewE0Z0Dn1wEETg31yG8ZMUPr61Bgv2GY1+HtkDwXZ3JA2bnq9BgCWruJT+AqeZWqSGItw== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6618.prod.exchangelabs.com (2603:10b6:510:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 13:55:04 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:04 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 05/10] IB/hfi1: Remove indirect call to hfi1_ipoib_send_dma() Date: Mon, 29 Mar 2021 09:54:11 -0400 Message-Id: <1617026056-50483-6-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5551486c-75a3-4bbd-d6b1-08d8f2ba413e X-MS-TrafficTypeDiagnostic: PH0PR01MB6618: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:283; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4gkmhdqGQDZSUQXCXDwo016Do6tnd29SW5s8kLkL9hFXCCrVLAnugWnzGdLMWYL1aLiGzQVxrTjIVU+rqdrYcC72OGOccRM0JLB0kGkspLdDsLe/suSYTQa2+6lvmIrVwZ24mA7+Q6NUOebpz2Uem+Crav45NO1sLSEFQ2AB2IvU9CoWI+h/BoLbT7zw4VAIQwR512Z9Q7xAb8Rzda52NjQD4c82SbUkJu1ZtccbDc9q5VXR3KFw3OkogmaY8SKWNvyl9BuFvDXS0UKQQgKmVrHVZSm6L7c2uMjuLSq7i7J+di9Z1kiUQOAw5CqJjU61cKbsFVUBkhxphF+NV1d5GM+LtXisj+H70CzXHq8zVGOw9tlBulyVTuPKx2ntAXkVsj+Exe+MpBQnigU/ibpkZVa1iZPrnYp+l0i2zTAWn2Qzdk9xyh3E3JU+86ADwaAoT8E0hBYZ3gO9/WDxq9GpR7ECzrvnpa56xc9Y8eHO5R/MzHF++AvGX0SpFLPBihyCAa/MledkR01JRkcTGdQYwpO+gvZ4/rs2wV4xTfVEUFLoCa+peOcFqBsNSMz5KpX8dcHVYY8AFrl9pDte1N6gICEGneZlWlfTX8znbkZVjtxwD/nYnHDBaT9s4WbzMc8e7r/KMfrQSQ5TwzZca53t3g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39830400003)(366004)(346002)(376002)(396003)(86362001)(5660300002)(52116002)(186003)(4326008)(7696005)(2906002)(36756003)(66556008)(8936002)(956004)(66476007)(107886003)(2616005)(478600001)(54906003)(83380400001)(66946007)(6486002)(38100700001)(8676002)(26005)(316002)(9686003)(6666004)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: jBCPHs3xowgAVw5QiT6iNBrRjXHpA9h8ahQASOWy5SFAnUpWM+g9+hjqmngI+DpFZjAQTPbsiU/Y3H1qJbh/+79HJiloR8kSZYbdD+Q1Eoba1PfHC9x6lmaub3QcyfhIqRp3BsyeuOY4zVaiKADW95KZ5otfkbKeSkUSCEzFtC/ON+atAHr5wXhoTy+MoIDLcURufH+yDcdcFl2Emyc1QdfpYdWX2KjEdsjkM0uGSLHqAilDLwgUZOpy4GqGWgB0OtdvQUYskfQZLqsVEqZ12/IEPlb6x0HiXFb/4QZg2avBqtl2PIXb/GKQ7Nvd+PBi+U2nzk+4E1gGq5di6tUUJq6AWiwpOehqZEmPLVTJOG9vsjI22e0H0lP87q75Q/6zk5McIMTRxtG9ct4xKgdCHxQiMBzYRv+h9KS97B4BjpCUnK3okVsciVXUvggaNEEyaHRsgA3a1tuYPximTDyKCfNnOAJpw7Migh8PQ5Z2js68zLsu2kE437PP4Rx4bQ5KX8/thLqSRGrS1KMW6yH09JmJbbWeVnVaVbm3eT4qFe2O/4xp75+fF7mzI1iDJgAkrhJ0jylZ+3f4AoKOgu38IbAg8hpC/o59o6VrvdEMyD2oIzwnGe1iA2S8dPCjQVfmDS8qpy3MhPWnm+mrCKry2hhgSBFwouypCbwN9DqtzT6a6AkdRYSFoJw9kHtMoiP9RIbAI7S6O7r52/QxvyfKpd5ohfYW4G+WD649hvlhs9N3kLGeAEH5StZhK+qL7AxeYHUthR/HfjIFQsPNcPiYiR/Qq3sTp2zxiJIxCsWAYbrQEmFXUelZYdzUa/g6P6s3AC2Tr8cDQYndyRcoDsmHXqT/wh10zb9c9ikwQP3FvlKNTsO9MAbb9cuPRCRn+VPkY4E4IHDz3xGeZ1Ppk+60Wyh8eo58RNbcWr6U9O7xADAF69M7wRytLnwz1z03dvfxceJaHUKSWxKaRuL0X6wdjjRmzrhVw1NdKyvDXGzbMJBnPpZqZFqz034b6wz3wtJr4TOxAqi1XpeidRr7YSuSYFp5gzzh6Z4N2VSShpGp4ULyqK32ukOohQ31DiDQE8FSLcBn6wWROyr/GZZb1OUYoeKREUdO4wHULpSIldbf0wJAh5mWwDfuXIm28CAC+3e561U8yDBsdu5xR5rnu9uKroMx8m9KpdtkhU6saJWB34oD4IskfUV4OMedD4hLqbWfEuBKsZEUZUw8P0f4VmkHgM6Bf1G/R3i+AQTyLv2l0pnv0dggwI1QbLmhX1Z/zn2MA1z3u7V6gD1MZk38f3oDrzViE5r5zDJ+dasnOViCBWjnR+80th+lhyX9XQ5Q7uF0 X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5551486c-75a3-4bbd-d6b1-08d8f2ba413e X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:04.7193 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5q5gC2YchjeESHIzvN4T+CDn8VZmKB62P2zAi9JC9JtQTCaSPnjFBWXvvlFaJas3yvP9bup1GCsDy1AGNN4l0+vjrXiR4Ozd5zQvYJmbxCPmUf4hu+t+mDB0XgZ+GIqR X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6618 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn hfi1_ipoib_send() directly calls hfi1_ipoib_send_dma() with no value add. Fix by renaming hfi1_ipoib_send_dma() to hfi1_ipoib_send(). Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/ipoib.h | 8 ++++---- drivers/infiniband/hw/hfi1/ipoib_main.c | 8 -------- drivers/infiniband/hw/hfi1/ipoib_tx.c | 8 ++++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/ipoib.h b/drivers/infiniband/hw/hfi1/ipoib.h index 39c8909..bd0c9af 100644 --- a/drivers/infiniband/hw/hfi1/ipoib.h +++ b/drivers/infiniband/hw/hfi1/ipoib.h @@ -126,10 +126,10 @@ struct hfi1_ipoib_rdma_netdev { return &((struct hfi1_ipoib_rdma_netdev *)netdev_priv(dev))->dev_priv; } -int hfi1_ipoib_send_dma(struct net_device *dev, - struct sk_buff *skb, - struct ib_ah *address, - u32 dqpn); +int hfi1_ipoib_send(struct net_device *dev, + struct sk_buff *skb, + struct ib_ah *address, + u32 dqpn); int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv); void hfi1_ipoib_txreq_deinit(struct hfi1_ipoib_dev_priv *priv); diff --git a/drivers/infiniband/hw/hfi1/ipoib_main.c b/drivers/infiniband/hw/hfi1/ipoib_main.c index b8838fa..b737354 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_main.c +++ b/drivers/infiniband/hw/hfi1/ipoib_main.c @@ -101,14 +101,6 @@ static int hfi1_ipoib_dev_stop(struct net_device *dev) .ndo_get_stats64 = dev_get_tstats64, }; -static int hfi1_ipoib_send(struct net_device *dev, - struct sk_buff *skb, - struct ib_ah *address, - u32 dqpn) -{ - return hfi1_ipoib_send_dma(dev, skb, address, dqpn); -} - static int hfi1_ipoib_mcast_attach(struct net_device *dev, struct ib_device *device, union ib_gid *mgid, diff --git a/drivers/infiniband/hw/hfi1/ipoib_tx.c b/drivers/infiniband/hw/hfi1/ipoib_tx.c index 8ebb653..993f983 100644 --- a/drivers/infiniband/hw/hfi1/ipoib_tx.c +++ b/drivers/infiniband/hw/hfi1/ipoib_tx.c @@ -581,10 +581,10 @@ static u8 hfi1_ipoib_calc_entropy(struct sk_buff *skb) return (u8)skb_get_queue_mapping(skb); } -int hfi1_ipoib_send_dma(struct net_device *dev, - struct sk_buff *skb, - struct ib_ah *address, - u32 dqpn) +int hfi1_ipoib_send(struct net_device *dev, + struct sk_buff *skb, + struct ib_ah *address, + u32 dqpn) { struct hfi1_ipoib_dev_priv *priv = hfi1_ipoib_priv(dev); struct ipoib_txparms txp; From patchwork Mon Mar 29 13:54:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA37CC433E1 for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8228D6191B for ; Mon, 29 Mar 2021 13:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231931AbhC2NzL (ORCPT ); Mon, 29 Mar 2021 09:55:11 -0400 Received: from mail-bn7nam10on2096.outbound.protection.outlook.com ([40.107.92.96]:28224 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231947AbhC2NzH (ORCPT ); Mon, 29 Mar 2021 09:55:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQ9eIMzEUaXVWGbrPD7j0ahrouGw2MERWku/wc0jQCoWx37Bagq452Hrzo/tBzcr6y6gbOIzbAM3ezZYRd6cRlXfbfPIewtXfSTTH8qAPWX8X2+k4ixuZRLPcN/9J+egBkU/0h8kuXF6OQfJizkfngI2IBW6uFdqN1dhRezfSHZUuF3i1CBJAOSVXBpj7E1zQ3+0lqV1R85971pWaCaa5n0+GHh2urpiPEKZwLeSFjD06XcoS1f5T9qX43QUhiEYmsAjiarLLScJ8taij8EPd+lGkiAySircaFtkzUn528Nv6hvkx0ps+9RLU2pfiMcplD7cUIPi9qT/5Y0h3jPayQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2Sy7mI6vqCgV4Cggqb7Uf5JI5WfnQnVE+PQEZNM9Wv8=; b=BDsanK/mMfdSeRjEYHEI7Jw7SLz8oqEe8dzjuaa/wV4gDBiCuU/5VSJhyWFw4orH9klToWrbQoWeNAU9rn5s+478JGFDtxnt7O1OpAyEW4aTf/AoQKa7qPBGh94yIijCyhiRB53+WOtsDKLl4adfFXXNW/kaCJyGdNS+mNLEUNCz2C7eLqvwz7SoYugvUmtgf+mlNO4CzQ2LbZ575EW+fzt+aZwAODpa9886Zxa2X7V21BQZZmHqn0nHJYQw3/Fh5gmr88+j3HH5MyYcL5jCs0sXNUP3SepGwVYMBMdnroLjKh814AyXXeBgnkQSgWiweJTLpzZgnGTy/hkNCALj9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2Sy7mI6vqCgV4Cggqb7Uf5JI5WfnQnVE+PQEZNM9Wv8=; b=iM3xhbTIHYfkMGX++QpLrSm8u/W+y4QWmArqRknt481T0e7uSE+Rg582kSa7m3eO27YKFhK/Yka707xgLESCemP+nVT+U9Y+APAGyws4Xej7LLQkaTSnyh7Rh7nTyH896KwPjVIOSeNkWbMWwE3ui6Qd3zZxsarjk7oeLk9GiRZisa9xR1MEJr4bPPfHegD7S+nXPpCvdwh8VbE+wBwZJNMJMfK/wfWwqiQjICRGwsWduS2CvOIEVuSr5QT8XrlDAi+RBKXuVoOxRzqCl/x/0KsklUgG45CyxL23LdwQ/DTef7WVruY5lmkIbRFJ4w5FGb9YYsK1CXNDD2i2KMnbzg== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6618.prod.exchangelabs.com (2603:10b6:510:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Mon, 29 Mar 2021 13:55:05 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:05 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Kaike Wan , Dennis Dalessandro Subject: [PATCH for-next 06/10] rdma: Set physical MTU for query_port function Date: Mon, 29 Mar 2021 09:54:12 -0400 Message-Id: <1617026056-50483-7-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:04 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ece9742e-e87e-4808-549b-08d8f2ba41ec X-MS-TrafficTypeDiagnostic: PH0PR01MB6618: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:190; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W4QtfETqyuMhg8+hsnbGZ3DWc51YMpnGSALNQXoKmIG/8v2wIf7o27GwqXSThUFwLokBBzQz5WIjNrM2DOGQR4q6JdAUOd+/SaG4qI0c3VTq4VIHsdjqt4n34oUsMAn/KltU64822/fWHd3OB4CepvkemPSkprOQQoA2nkdHzuTJ0jX2HYbQ18xAArAOxmsycxupWkEmiekm3rc74Xkrb6Vj3tP6fTj8ANSKp3Z5f0V9dIlewXpnmx0B9R4S0CNejtngGmcRTZ+Pozp7pMTHiX0UwZeBHO3+T/BHCWB11YD0QIt2Fc+5n9zDeilt1x5M40+b2gG3ZLjsAZyqO7iLT8ysPgMgC0+nI+mFon3eEi/N3uJLvgE0b+0XV/Tf0KMkUXps51vr4wiZDY642HEBjkgp5lNqepV2FohhUGnk4t8jU+bhb8e/AhHGxWH8n8P4TmA+5m/7oKKeaeeb5tOK2oxwj5R5seOkJDksvCGJOedxuKf2Yxl8iQIXnjcbbMLELtEvXU9cTIf5yqfgkW/JvfepO/wx/bFSu2V3AMg3aeNXToH2tikasyvO/sv+nfbnhRncCk2I6+sFE5SddxqwooILeN8teHH65RjLI5VdTafWGqMHHb3Zx/tpNZJBAzYEYQ+X7p/D7y5d13bTDqcgfywaTRsFJRssSkffdLweAwY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39830400003)(366004)(346002)(376002)(396003)(86362001)(5660300002)(52116002)(186003)(4326008)(7696005)(2906002)(36756003)(66556008)(8936002)(956004)(66476007)(107886003)(2616005)(478600001)(54906003)(83380400001)(66946007)(6486002)(38100700001)(8676002)(26005)(316002)(30864003)(9686003)(6666004)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Vwxm45f++4b5AENIivJBp74Tvqaw2it/BCXM5aq+PU00N8yFfnU/I9KwlvmF928D4M99X5uXCcvVNOFlyJtWONkhuIM2iunc1/fmsWp+RJr7kBaBOGeUIdY4syQT9RjdvizCQgkW/CbwFQ+twLqLpD+N9RqaFv89EgVM6kstKYxFRoRiBANoAgHMimEogWjkoWzRFvTUomI6UtK+b7Eo8c5RMAk3cfAWcx+99F2Q60XL7DDYy1X2OYr5x6q5N5xrDgnT2KK2dXksmUWUOUXOaeYd0PBRVStF7DyHGmwjdXaXYiJ0sHuFQrvYZ67SnVr4zMqOm43bwpGvxVPnO5/5ovQnUYz1gE3hq4We4AJGrygeJde+sKhLcFbOdH69aiRxxWY4MqoXjKd322xqMg7pnphTNlWOALZ0r1efYY9hp340TqYu0P/GyXWlV8Jp+0/6lz3mRee3XsV6zr66XxnFx/p65rJePY9+2mBo79jx4FE/FUdckr2InWHP6Wy5N//rskBWIoo2JMVlMXHoYq9pVw1AUQXC3NfT8SOASD1pL40sLQhzTtBOO4MaUmhtHOgKf+Zywj/Uhx7wg3uuASLxSy9AfhjNzLVx1qgfLZhITK1j5UzZVLcTvtrAJFGSsBlmj8P1DtQDmNbc9zxwClcjXus42Jz5jMy8MFHCNT44dXC1Rb/61bKFHQB/f4D8jP1zqV8CcG8Ubq+cGRggk9m1qq6R70z6pteUFgBlRPx00eZ0aN5qRjFqd5RCYARFAte2YFAt4JZeIZJ2m5ju3BArLDwSHoj/VamFQjXetix4U6vP4mjtBW3NySRtGwTv09QXmFhX8kyrFluQWjPRtj3uTDqGl41U5PipeXTIHQ+SewwguFav4EFaaOkvdmjYqhrtTYO9bR2Iw9IUq5t95OyRC2k8rAx3lwPqI76k6UcFsF/Gx6+OeI+kweLJvZibRC8gJgM6/Kb+b2uxJDGN/fYqHZKvDbronIE32NFk6RYHyHmn8MmUtK5RGNM/0Uqb8YViMcmS5JX9u8hJP4X9V4TeSNsjxr2vgjVHZZQmreu0ur3+huOoCw4PeFHmb5GAwptTRuVualZApOWjKsArNBablp7zW85hYk3lXmR9UBU/42IzUZXyEP+zN97+7p8fKcjujAD42kOLIRBmE6AzOQLmoUbCxsG1044Wu7y1d7OOlNTxfYUlXxuXWwVNdsSp5G4ayx/Mb4FfLqAtlk3J5IEvMfKQDAonSs5RpwHT5mCmPnfcviPCkp7SjT/TSm0bedhOfK5iOndr08yni4mQAx5A1ipCDd3A2VZJocMJPupM/ZxlE2+KlWxW2hoTX6ykho17 X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: ece9742e-e87e-4808-549b-08d8f2ba41ec X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:05.7896 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TwD8CN5zxDZRD1uIF+BHbwYUANwtk8jNB/Zg6PwgRPAaREFU8cemcL4FQ5gXC/nGRU2B3XWCOHnujg5sQz52atFGiJXYj8hcFLY4Ya6II4zE4xXsFU3mIbdf9Gn6ePyz X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6618 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kaike Wan This is a follow on patch to add a phys_mtu field to the ib_port_attr structure to indicate the maximum physical MTU the underlying device supports. Extends the following: commit 6d72344cf6c4 ("IB/ipoib: Increase ipoib Datagram mode MTU's upper limit") Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 1 + drivers/infiniband/hw/cxgb4/provider.c | 1 + drivers/infiniband/hw/efa/efa_verbs.c | 1 + drivers/infiniband/hw/hns/hns_roce_main.c | 1 + drivers/infiniband/hw/i40iw/i40iw_verbs.c | 1 + drivers/infiniband/hw/mlx4/main.c | 1 + drivers/infiniband/hw/mlx5/mad.c | 1 + drivers/infiniband/hw/mlx5/main.c | 2 ++ drivers/infiniband/hw/mthca/mthca_provider.c | 1 + drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 1 + drivers/infiniband/hw/qib/qib_verbs.c | 1 + drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 1 + drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c | 1 + drivers/infiniband/sw/siw/siw_verbs.c | 1 + drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- include/rdma/ib_verbs.h | 17 ----------------- 16 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index ba515ef..17d4871 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -205,6 +205,7 @@ int bnxt_re_query_port(struct ib_device *ibdev, u8 port_num, port_attr->phys_state = IB_PORT_PHYS_STATE_DISABLED; } port_attr->max_mtu = IB_MTU_4096; + port_attr->phys_mtu = ib_mtu_enum_to_int(port_attr->max_mtu); port_attr->active_mtu = iboe_get_mtu(rdev->netdev->mtu); port_attr->gid_tbl_len = dev_attr->max_sgid; port_attr->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP | diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c index 1f1f856..09a995b 100644 --- a/drivers/infiniband/hw/cxgb4/provider.c +++ b/drivers/infiniband/hw/cxgb4/provider.c @@ -311,6 +311,7 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port, IB_PORT_VENDOR_CLASS_SUP | IB_PORT_BOOT_MGMT_SUP; props->gid_tbl_len = 1; props->max_msg_sz = -1; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); return ret; } diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c index 479b604..1a426c0 100644 --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c @@ -261,6 +261,7 @@ int efa_query_port(struct ib_device *ibdev, u8 port, props->active_speed = IB_SPEED_EDR; props->active_width = IB_WIDTH_4X; props->max_mtu = ib_mtu_int_to_enum(dev->dev_attr.mtu); + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = ib_mtu_int_to_enum(dev->dev_attr.mtu); props->max_msg_sz = dev->dev_attr.mtu; props->max_vl_num = 1; diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index 1a747f7..0fb46eb 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -228,6 +228,7 @@ static int hns_roce_query_port(struct ib_device *ib_dev, u8 port_num, /* props being zeroed by the caller, avoid zeroing it here */ props->max_mtu = hr_dev->caps.max_mtu; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->gid_tbl_len = hr_dev->caps.gid_table_len[port]; props->port_cap_flags = IB_PORT_CM_SUP | IB_PORT_REINIT_SUP | IB_PORT_VENDOR_CLASS_SUP | diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c index 375b774..0e76968 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c @@ -104,6 +104,7 @@ static int i40iw_query_port(struct ib_device *ibdev, props->active_width = IB_WIDTH_4X; props->active_speed = 1; props->max_msg_sz = I40IW_MAX_OUTBOUND_MESSAGE_SIZE; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); return 0; } diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index f26a0d9..a33a7b7 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c @@ -702,6 +702,7 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port, props->active_width = out_mad->data[31] & 0xf; props->active_speed = out_mad->data[35] >> 4; props->max_mtu = out_mad->data[41] & 0xf; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = out_mad->data[36] >> 4; props->subnet_timeout = out_mad->data[51] & 0x1f; props->max_vl_num = out_mad->data[37] >> 4; diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c index 652c6cc..9a1806d 100644 --- a/drivers/infiniband/hw/mlx5/mad.c +++ b/drivers/infiniband/hw/mlx5/mad.c @@ -555,6 +555,7 @@ int mlx5_query_mad_ifc_port(struct ib_device *ibdev, u8 port, props->active_width = out_mad->data[31] & 0xf; props->active_speed = out_mad->data[35] >> 4; props->max_mtu = out_mad->data[41] & 0xf; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = out_mad->data[36] >> 4; props->subnet_timeout = out_mad->data[51] & 0x1f; props->max_vl_num = out_mad->data[37] >> 4; diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 9ff28f7..732e5ce 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -511,6 +511,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, props->qkey_viol_cntr = qkey_viol_cntr; } props->max_mtu = IB_MTU_4096; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->max_msg_sz = 1 << MLX5_CAP_GEN(dev->mdev, log_max_msg); props->pkey_tbl_len = 1; props->state = IB_PORT_DOWN; @@ -1321,6 +1322,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, mlx5_query_port_max_mtu(mdev, &max_mtu, port); props->max_mtu = mlx5_mtu_to_ib_mtu(max_mtu); + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); mlx5_query_port_oper_mtu(mdev, &oper_mtu, port); diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index 1a3dd07..87f7b11 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -164,6 +164,7 @@ static int mthca_query_port(struct ib_device *ibdev, props->active_width = out_mad->data[31] & 0xf; props->active_speed = out_mad->data[35] >> 4; props->max_mtu = out_mad->data[41] & 0xf; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = out_mad->data[36] >> 4; props->subnet_timeout = out_mad->data[51] & 0x1f; props->max_vl_num = out_mad->data[37] >> 4; diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 3acb5c1..d0496c1 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -167,6 +167,7 @@ int ocrdma_query_port(struct ib_device *ibdev, props->phys_state = IB_PORT_PHYS_STATE_DISABLED; } props->max_mtu = IB_MTU_4096; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = iboe_get_mtu(netdev->mtu); props->lid = 0; props->lmc = 0; diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 8e0de26..0534a12 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c @@ -1209,6 +1209,7 @@ static int qib_query_port(struct rvt_dev_info *rdi, u8 port_num, props->max_vl_num = qib_num_vls(ppd->vls_supported); props->max_mtu = qib_ibmtu ? qib_ibmtu : IB_MTU_4096; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); switch (ppd->ibmtu) { case 4096: mtu = IB_MTU_4096; diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c index 3705c6b..a83eaf0 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c @@ -373,6 +373,7 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port, props->bad_pkey_cntr = 0; props->qkey_viol_cntr = 0; props->max_mtu = IB_MTU_4096; + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = iboe_get_mtu(us_ibdev->ufdev->mtu); /* Userspace will adjust for hdrs */ props->max_msg_sz = us_ibdev->ufdev->mtu; diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c index fc412cb..a40083ae 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c @@ -150,6 +150,7 @@ int pvrdma_query_port(struct ib_device *ibdev, u8 port, props->state = pvrdma_port_state_to_ib(resp->attrs.state); props->max_mtu = pvrdma_mtu_to_ib(resp->attrs.max_mtu); + props->phys_mtu = ib_mtu_enum_to_int(props->max_mtu); props->active_mtu = pvrdma_mtu_to_ib(resp->attrs.active_mtu); props->gid_tbl_len = resp->attrs.gid_tbl_len; props->port_cap_flags = diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c index e389d44..8a5df31 100644 --- a/drivers/infiniband/sw/siw/siw_verbs.c +++ b/drivers/infiniband/sw/siw/siw_verbs.c @@ -173,6 +173,7 @@ int siw_query_port(struct ib_device *base_dev, u8 port, attr->gid_tbl_len = 1; attr->max_msg_sz = -1; attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu); + attr->phys_mtu = ib_mtu_enum_to_int(attr->max_mtu); attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu); attr->phys_state = sdev->state == IB_PORT_ACTIVE ? IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED; diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 2fb2fa16..4ca6150 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1865,7 +1865,7 @@ static int ipoib_parent_init(struct net_device *ndev) priv->port); return result; } - priv->max_ib_mtu = rdma_mtu_from_attr(priv->ca, priv->port, &attr); + priv->max_ib_mtu = attr.phys_mtu; result = ib_query_pkey(priv->ca, priv->port, 0, &priv->pkey); if (result) { diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 84f7084..221c5b2 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -3338,23 +3338,6 @@ static inline int rdma_mtu_enum_to_int(struct ib_device *device, u8 port, return ib_mtu_enum_to_int((enum ib_mtu)mtu); } -/** - * rdma_mtu_from_attr - Return the mtu of the port from the port attribute. - * @device: Device - * @port_num: Port number - * @attr: port attribute - * - * Return the MTU size supported by the port as an integer value. - */ -static inline int rdma_mtu_from_attr(struct ib_device *device, u8 port, - struct ib_port_attr *attr) -{ - if (rdma_core_cap_opa_port(device, port)) - return attr->phys_mtu; - else - return ib_mtu_enum_to_int(attr->max_mtu); -} - int ib_set_vf_link_state(struct ib_device *device, int vf, u8 port, int state); int ib_get_vf_config(struct ib_device *device, int vf, u8 port, From patchwork Mon Mar 29 13:54:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170219 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EAE3C433DB for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 329446191B for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbhC2Nzm (ORCPT ); Mon, 29 Mar 2021 09:55:42 -0400 Received: from mail-mw2nam10on2117.outbound.protection.outlook.com ([40.107.94.117]:39169 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231506AbhC2NzK (ORCPT ); Mon, 29 Mar 2021 09:55:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FsqeyCuWgYPbeDjEWk3cu6szKlLV5YDJExxDhaarEygdJe9an/Kk2qQhkPqqUNrq4q2sTDQuB5UfLqzPDMgzKDp5Th/ObUQNAsr1jDtwhoZd4cueuUMUjH0kwwzKDDBD+ipicNl0lgvw0umWm8LuK6iYIgo29voQMTK/IeXUWDVFF9mVuAx8G/W7sIG5SjHedUBgEKRTuc3JJcTguwvhu+bvWt/IQdutkfNp2jr1+sVkiOWegwkwXsZ7xipFuyxi/uRG9lNFzrOY/WLqJH47jwT4TkOGWzdamC7XeY1atc2b3/TIlXJ7BDah7RFzHzaujDTNqJS5b0qw4w8sP3IrMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2BOkRYdoz9V1U9MKdWuTN5zyFBUcDFL+1Op7U84bwg=; b=DgYIoM8FaZNceKMP+O9zqSb4XuoRPwUi5FkvU7K2BAMSLCUsPe1EDl7vcBUMwwWedYPHCXfZi2Cu9mpKjVyFCLHnSRHo2tzPFrnPtbVN3zkgfwtqEN2D6Q1qtLJl3mq0KtaMIK7Hf+NK015xsR5oR0rN1HBkTXqRjEzC2vgJYI/E+4OfYeu6UzkpmS1XHr15jA4uElqTUnkeX2XxYy1Z9lz8LosMLfOmeFIthK6CJFB/gA33iPOglE1/cIn4D5E1h4edLkmvIgfe6bzCLKmKVsVzgQz4NXnrFBELMRdr3rghpVO2KH+b9n2jD564D+rb0Lzh2L20nKt6w4dwNnx53w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R2BOkRYdoz9V1U9MKdWuTN5zyFBUcDFL+1Op7U84bwg=; b=WNHSPvmwjc4w1xavylN1yLCiof1fNvp8nPUJ0/paA7RjW/zLtungGqPbJYefnyDZ6JfBTPbfFhqIjpyn9y1pL8GL3sfpSU9TZ5xyW1+uG7/Njk5Ek+ObXd+x8hxR+3kZhq7fRmPZJgRzvyYYzoNdgj75sAp/p4/huYBKb1x8LvwBwBn5FXJaXIy6m1+PB1srb81BQ/r3fSk0sB04v/JwtBAEI7jwQs8E4pcSonH1f47Kf21ECmyYxDzxWvJ3siFq4ZO4gGM2a2aXCGwEGVDXGfwC9pXFyRFTPoEy7zQVAANeumi/owrs2Dox4cteQT+4ZzeCLFgRNZzGE5SMJAtolQ== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6604.prod.exchangelabs.com (2603:10b6:510:79::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.18; Mon, 29 Mar 2021 13:55:07 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:06 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 07/10] IB/hfi1: Add additional usdma traces Date: Mon, 29 Mar 2021 09:54:13 -0400 Message-Id: <1617026056-50483-8-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:06 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9773d67-c90a-4f15-0f3c-08d8f2ba4281 X-MS-TrafficTypeDiagnostic: PH0PR01MB6604: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:274; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gC5D01Fhhz6g69eB+nkCemVJA26EIziursbodHmYWN0tuYPXOV+VvkqJtoQwzRyi3lC5TLjEw3LeBCdKmJksiXsJUAa9PlonD24eeVX1VO+7GNw9giryOWfOqw5Smc2iUpPEvBh9JhH8i9LhTkc/JPHO7SOLjtGiwLqJT80Id/IHeJSOTY0MOIy0HbTeg+bMJjEXW0MCs6sYT3btei5YSSan4jReVLjjme8IqzSU1UYRmGaqh5Mo4Jlkfph8+YAMA6G3TGUj/DvechRVX38jDOtUSttxutCzcpJDlA0O5n8bfH7YSN+weqAu3K9fZEFTL5OnGZvtOxyM0GvI2bo+DwQZygexXTKDRcXE21NimeIYmVZimj/UX9AVVE+KLJKY1erBoXaOkTdNMI2u/5WZGyZTcHiayiF2qCsxEWeL+TNr9VdC2MpxjhV4VlEDxsEQ9uFk+1ykHR+lJc7Mo8nUqDtKMYF5jVWfZ/iQu0XeQ2O75/LX5Ca5j2EU/SpXGPCMK4fGH6SrjuGPGAKDA2SPZiVE7r+xrgAf6Eh7nKBrgRDeGYs3Swh4r4Z0jqbPqNkIWgGN7sOrIIoyOfE9JDG/FPRE17M/LANjCBG9l8Z7P/0r3RNxS5XbDspQ7n2rI//RjKhnDol4+746TfLqLrZlBSUJBVHDbxCPoGcNYrot9s/RzNcm4j60tDHgYChyNfQwMsdJxJFUzHmFvedahGuyrMwewbA5LcBiwEPTLdon2xI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(396003)(39830400003)(366004)(136003)(956004)(2616005)(186003)(66556008)(66476007)(66946007)(36756003)(26005)(83380400001)(5660300002)(316002)(16526019)(54906003)(9686003)(52116002)(7696005)(6666004)(2906002)(86362001)(4326008)(966005)(6486002)(8676002)(107886003)(38100700001)(8936002)(478600001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: T0gcTIguBEoI9CyoYn1L79qYSfpeF3bD1afs/7mk0NsMAgpkaDkiSlu8dPINRUSmmH/ECxNil4FQ9CzUeGxtDDNuyWIToDQJi8Uz/4ND8sYu7L8AUnVYYhL8xAOGPSBPjYUnnyp3ojYTpy6XCnB/dqvkhHOMrM+M0EVptVRYj6rlOva028yxFxQRquzpLiW7gawqgcSBvp4iXGX44b9ZVAKODhoTupelowwrDCP5v7XPhvNxI9kTdEJl9SslG1j/nbjf/LrANpbSJpzMGAFyBMrshArEnq9SBkUnkvrVwR4V5Dh8HPeFeKKOkPwAN+XTzKZw5klwistnpGSAYywKIULI+2LO7vwMig/d1G6D8EPnSCXxzMJXHN1qboYbpuKPsOPRdmOD79CpQtnp6jkamCg5zoii9OSTc6wc3APqY0LnsDmr18BJscyY5gqQxK9vVnnnyA8Qw9AcozMg5gfCuXGqDInkklkOtTNeIoQsPcyjsds3rmn9yvoJ9j4gn2rVUM+GgVtgDfcAt1OkAQAqYLrwOk0wJBu0QjDWvB1n0tuogGkpL9TkGzGnajUtg3fQ8EAkA5bOWQlaurON6Ub2b8/1945uAl3qAFparYt3tB5HMSL1X2wvf4pASciplOlAcNjTxOIxheS+8FTYu5f2sO7C3hGkconqDS4mmgEBn/zmcrBPevdmafQ0Bx8G3ip5yU5/UiJXkboVf447DWcJc8Nj6MTTAOgmaOSFBcaI2V4txzU5bQ/9DHyB+EBLfzbPkCPu0ufjo3A/dtPGykMFfuiSVaj5CtxM2FSPW9uxXHpID5RjvdnaKIaxMKBGSQ7RPrzf2R2SZvwrBOAf8jOMeW/O/8bgrbqsFY37JK7+YGdz2arj/CIlrjFMzbUyFvuqehrhbyXQb3tjnhpxJm8VAwcJbGbts2mogLUnXp3bmTZIjT+V7aHpJReCkAOml2caXdiFkhDPoyRzCAl/FFDnb/HxWqGnVvLRx54KHxr1ns0ZlwnM9S/ASTshKa4txaDbyDgPBTlaVSebMPhLlhu8JoVnuHORULQtDZ0WnyjSvClU8O24s2xhlHvKuw+DYWhii4ixHa2WmTWyI+cO0UvqKOkg58bTAOfC6b8hu4OzgA5ZMmKoXwgftrTW2ju4zfiONbejuVM0vgsjUtRl+rfFeKzBXOxRgxWjeJPzHRt9Z0uDGXYbhlQ55f4YN07/QSCrMu4MxEfsuVIYYRwA12QaWzRaHYlJGg08qAX5b149BTIfxWuaDvQnV2kvjhWv76KzohrPjl7dTcgrTqlM3p9Vb8Ck5yRUkqyBzOqSyNlfsJha/ViZ90RsSyY0tD+Uzu+1 X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9773d67-c90a-4f15-0f3c-08d8f2ba4281 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:06.7782 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 43bVqqNO2jMNKxceMwXyFlJQ2VYkb/AeStk+uYC0rOUleWXjvSD3dqKyyVIkT4OgquQ9hLFdEC7SxT3PXW+oMUXDeTTQXl/g9xvzzAvMsb/jc6R/IFcBGSNaQxaqF1nJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6604 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn Add traces that were vital in isolating an issue with pq waitlist. See URL below. Reviewed-by: Kaike Wan URL: https://lore.kernel.org/linux-rdma/20200504130917.175613.43231.stgit@awfm-01.aw.intel.com/ Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/trace_tx.h | 75 ++++++++++++++++++++++++++++++++++ drivers/infiniband/hw/hfi1/user_sdma.c | 12 ++++-- drivers/infiniband/hw/hfi1/user_sdma.h | 1 + 3 files changed, 85 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/trace_tx.h b/drivers/infiniband/hw/hfi1/trace_tx.h index 8476541..d44fc54 100644 --- a/drivers/infiniband/hw/hfi1/trace_tx.h +++ b/drivers/infiniband/hw/hfi1/trace_tx.h @@ -54,6 +54,7 @@ #include "mad.h" #include "sdma.h" #include "ipoib.h" +#include "user_sdma.h" const char *parse_sdma_flags(struct trace_seq *p, u64 desc0, u64 desc1); @@ -654,6 +655,80 @@ __entry->code) ); +TRACE_EVENT(hfi1_usdma_defer, + TP_PROTO(struct hfi1_user_sdma_pkt_q *pq, + struct sdma_engine *sde, + struct iowait *wait), + TP_ARGS(pq, sde, wait), + TP_STRUCT__entry(DD_DEV_ENTRY(pq->dd) + __field(struct hfi1_user_sdma_pkt_q *, pq) + __field(struct sdma_engine *, sde) + __field(struct iowait *, wait) + __field(int, engine) + __field(int, empty) + ), + TP_fast_assign(DD_DEV_ASSIGN(pq->dd); + __entry->pq = pq; + __entry->sde = sde; + __entry->wait = wait; + __entry->engine = sde->this_idx; + __entry->empty = list_empty(&__entry->wait->list); + ), + TP_printk("[%s] pq %llx sde %llx wait %llx engine %d empty %d", + __get_str(dev), + (unsigned long long)__entry->pq, + (unsigned long long)__entry->sde, + (unsigned long long)__entry->wait, + __entry->engine, + __entry->empty + ) +); + +TRACE_EVENT(hfi1_usdma_activate, + TP_PROTO(struct hfi1_user_sdma_pkt_q *pq, + struct iowait *wait, + int reason), + TP_ARGS(pq, wait, reason), + TP_STRUCT__entry(DD_DEV_ENTRY(pq->dd) + __field(struct hfi1_user_sdma_pkt_q *, pq) + __field(struct iowait *, wait) + __field(int, reason) + ), + TP_fast_assign(DD_DEV_ASSIGN(pq->dd); + __entry->pq = pq; + __entry->wait = wait; + __entry->reason = reason; + ), + TP_printk("[%s] pq %llx wait %llx reason %d", + __get_str(dev), + (unsigned long long)__entry->pq, + (unsigned long long)__entry->wait, + __entry->reason + ) +); + +TRACE_EVENT(hfi1_usdma_we, + TP_PROTO(struct hfi1_user_sdma_pkt_q *pq, + int we_ret), + TP_ARGS(pq, we_ret), + TP_STRUCT__entry(DD_DEV_ENTRY(pq->dd) + __field(struct hfi1_user_sdma_pkt_q *, pq) + __field(int, state) + __field(int, we_ret) + ), + TP_fast_assign(DD_DEV_ASSIGN(pq->dd); + __entry->pq = pq; + __entry->state = pq->state; + __entry->we_ret = we_ret; + ), + TP_printk("[%s] pq %llx state %d we_ret %d", + __get_str(dev), + (unsigned long long)__entry->pq, + __entry->state, + __entry->we_ret + ) +); + const char *print_u32_array(struct trace_seq *, u32 *, int); #define __print_u32_hex(arr, len) print_u32_array(p, arr, len) diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index 4a4956f9..da5b2e3 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c @@ -133,6 +133,7 @@ static int defer_packet_queue( container_of(wait->iow, struct hfi1_user_sdma_pkt_q, busy); write_seqlock(&sde->waitlock); + trace_hfi1_usdma_defer(pq, sde, &pq->busy); if (sdma_progress(sde, seq, txreq)) goto eagain; /* @@ -157,7 +158,8 @@ static void activate_packet_queue(struct iowait *wait, int reason) { struct hfi1_user_sdma_pkt_q *pq = container_of(wait, struct hfi1_user_sdma_pkt_q, busy); - pq->busy.lock = NULL; + + trace_hfi1_usdma_activate(pq, wait, reason); xchg(&pq->state, SDMA_PKT_Q_ACTIVE); wake_up(&wait->wait_dma); }; @@ -599,13 +601,17 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd, while (req->seqsubmitted != req->info.npkts) { ret = user_sdma_send_pkts(req, pcount); if (ret < 0) { + int we_ret; + if (ret != -EBUSY) goto free_req; - if (wait_event_interruptible_timeout( + we_ret = wait_event_interruptible_timeout( pq->busy.wait_dma, pq->state == SDMA_PKT_Q_ACTIVE, msecs_to_jiffies( - SDMA_IOWAIT_TIMEOUT)) <= 0) + SDMA_IOWAIT_TIMEOUT)); + trace_hfi1_usdma_we(pq, we_ret); + if (we_ret <= 0) flush_pq_iowait(pq); } } diff --git a/drivers/infiniband/hw/hfi1/user_sdma.h b/drivers/infiniband/hw/hfi1/user_sdma.h index 1e8c02f..fabe581 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.h +++ b/drivers/infiniband/hw/hfi1/user_sdma.h @@ -53,6 +53,7 @@ #include "common.h" #include "iowait.h" #include "user_exp_rcv.h" +#include "mmu_rb.h" /* The maximum number of Data io vectors per message/request */ #define MAX_VECTORS_PER_REQ 8 From patchwork Mon Mar 29 13:54:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170217 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 716F3C433C1 for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 430246192F for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbhC2Nzm (ORCPT ); Mon, 29 Mar 2021 09:55:42 -0400 Received: from mail-mw2nam12on2105.outbound.protection.outlook.com ([40.107.244.105]:45024 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231479AbhC2NzK (ORCPT ); Mon, 29 Mar 2021 09:55:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jMo4jKHHvmoxT18vrxv8OdOD1mV9xM9xDVMQ27GprEXQ0xCGN799t9p3tCPCE3APXHtNnnlDeJ6QA0O6IOgN1LwFrRltR5yvsRpZJy6whUrtMFFvDP0qJWXmABI70IKRgeYtLvUQzLk9xaMhnuedh10sgtZCnz6LVOGGWpACxgMxhnX1qqYPZ6KAxQXml51gciScVTZTSRP2za6vWF6PdolCLhh2l/vmYIACr3u0lpuotl7Gd/4PSILnuaschDakyyNnyvvwAaAlHiPdeH2fbJXrHU2ktLZvUYbvSNIFU/vDBDVTS/85ZB39abXuUHjPZWHSGAVfXsa/YeY66JaFDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=egXcVTTYXIduAKWiZKQfB+kutuMHlXi7hhgIpiJN+Gs=; b=lZhCXC/9pR8Lu+y2iztDZN2vsvqFbVdnMu6fbuNRlYZ+etg4usI1gSlfkfk8YvMJK6f8Nz16uWwA9i+sldd+qgVkx+c0NRHt2QfUm89wXFbveQ6q89d/Kw8R5BuW6pwL5gpYP/ottdouwFjgyMTudtbeG5qhzrO7OSuMIOGxNTpaNaP7RMKsDLygCWBjkG3RdaNwuJAmOC5l5iXcRMjpSAE/vbRC1DflelV69KnSGAoPqz5Trwql09zhGVrEos8OzRjihRyDbB+7USqTzfi1fIDFjQ69oS+FK7bJMBugLu2rAwDm8DzA/SEdp48tGBYFXG+IlGBCvDlcKYMlqrViXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=egXcVTTYXIduAKWiZKQfB+kutuMHlXi7hhgIpiJN+Gs=; b=KcFcLY7wFFdGTDXNIMtYcuDq7EvtVhzVLXG60CGz7DCIuseM5+ELldJbX8HQI7o+dykJ36vjGEpRKypQwzI2+AW9ix3kfDlnBeR4ERvsr+G+ynrEbJJh1GZBvZkNhYqfTrgZsgzu2lR2ESVbn2M5joDdr2fkM7VWIE2cW8gONISvYAWc15jtyypKkdWHKeNTMyr9Udw4oQaelg97qUY8ePgHFX5z7C1SjdItHprlSLUMBf4zF7FwNaAqNmJBfI+BUikmL3rT70Qf4VjzMAfFI3JAj8UtCf4vPISIXo4XzMJn72BaMO4kAVA10NXQJblqKgOGjPnu3StvSzwbo6BefA== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6729.prod.exchangelabs.com (2603:10b6:510:97::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.32; Mon, 29 Mar 2021 13:55:08 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:08 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 08/10] IB/hfi1: Use kzalloc() for mmu_rb_handler allocation Date: Mon, 29 Mar 2021 09:54:14 -0400 Message-Id: <1617026056-50483-9-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1782ed02-30a7-4386-2b4f-08d8f2ba431c X-MS-TrafficTypeDiagnostic: PH0PR01MB6729: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VpaNyi+Vn44Lq8wPo4aezVgtP4LrR9tPtzkElWaeq9ldNXkf5OpSJVolK/cQqIXZErajuuN8/XS/AUVbHXdnVOoFcB1OEyTsNeM1dFyyOrvgVIYpcTgU36dVC7+rI5Jd0fa2fejPoIqTdlP8WBTE8FZmALH/4uYOulTDNS+8qDJ9tDzezKMHu5zdG8u4RrWnSYLUQN+fc2Wvf4Cta7r/0eWEtJB8y4gcTygplrzbUg40EXzzYY7rS8mtvOKVyW7wUAEEb9K0sUUrErg3pyCXFlGM1OetUW1ni5Oh30G3SHcpF5K/OWsAIW1q820qjk++9hnFstUBWnJ6nr8esgNxmDCXfj0GNJEEN8nKJWbBrm+drEGTF1WTRHd6i8n4kGTDKNJEy2/yq+9HRECWz+WgnAqwQsyY/ty2/DihJcceQtHGMze/cJnncKv08dvgOXbzdxQyGN1w+n1/lD216lvvv1t2VdQvjM2Kk7Gad2kwstK1Oq28Dx6+OI4qpPPzITCYEDtkkxG5QfxOMcWRNuJ+ULofvun45PpnQ/1bQSjuAFylAOCpV0wni7WzUMvR0GB5jmcvpZQYp99VinzaotpD0fG1otr6ohz6cUv6hbQrznQLPfCP1X+tpoo5deWwSmBXA+7nZg2DHpx7K2RwjE0gFbmvaQ6LYCNGqjVmoN/hgN4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(396003)(346002)(366004)(39830400003)(9686003)(52116002)(8936002)(8676002)(6486002)(38100700001)(66946007)(316002)(7696005)(16526019)(186003)(2616005)(956004)(66556008)(4326008)(26005)(83380400001)(2906002)(478600001)(54906003)(36756003)(6666004)(66476007)(5660300002)(107886003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: eIyYJt+NEyEk4TMzUjbgeHaH5Bv+oJMU3lEVYnTNxPcxcX1yBQL7jxMsVmHV2z/8ekRPA1uXRGXio35KYQ2PsGR10IpBYjm3yDOg55nhYaSNh4txmiW8+qcoQPcl0yrhHCTS25QSQeoywZGt4G403hC3yVxnOMB1LiZeYk+gID8PpRhgjOzi8dvPFk2oyun7+mh5U10zaVWk6Tlgu9n5UG+OaeyNqgyxML6Jo8JxrGJlPlRcQnO3Cc2T4VGoIc14+DFVW/HIVEiehZZqI4L0kQXxQSpVBcFhpcvBR9C4HT0T4thkBdV5FVl/UZGd5x5TOHD2aTllY52QS5NbfRumg33qG1rETfx5Kr5QMPObp364EvtPs9BF0hzZ/30z8NG1JGq4DCW4KGSh8ws1+om0IlYsl2WHroxH9739RdiUS51RlnUjButvk6d6VgweWjgDTS8qpHdQggHGd4SmE6oRoyOwAdL4GDX7rMnSd1hUfnQCboWTEdsZOnxOVqk05XFB21zb/4uOu+oVgeP6xadOKh3fNvVmu4I3fGGF/M8IszbpruOpdip5Gn3sz5v8TdEpH86K0Hc2si3Sm/MveOxyfAA+8zgDVUwTvWo+QCyOXPGO/TD6GSY5YYOEoL42hBvlTOQKQWPdK273ghJXOjJ1BoFxMZGVsnA+bypCgDMbmy0JON6MLq0eJa9FAR2/fEtxOiv8dzF5OMFU+iiNtjoo7Pzsoeum3P5c8br8SbG0Y7Os28g2dLX60Jf/ZGf85up1CZVJwx1gKwBoE8uzFM9noGG/xJ1c6gIDLGVNhVZoDGdw6caH7hGeaZFea0cCNvnfW0VrVNEsUdYVunG2e43sFHTY+qFAuWaGs1mfIlwK3yvGTL4e9YDhjnEckSdau0KL0gQFjz/8+jbudBgJYX69365dexZ+oebNbKMLNavE+/QhI9GO0xS9Pxd8zPHhGTTyK+6ow3fMti6ku6ddC0DXzYZ66Fr8MQOg/ctf2PhoPXiGYgE/nPBXvc5UEJ7Uz6tzIePrMtXfsiyicUXuJYWlV4gNok+s/cGpju6MEmm3QKrrI7XlzU0gOJ1hUtl+jFy7d2L/1kdVu8coE3hEVgjOFFUGfptQa7I2izVyt+cvzZsc8snuoivNfJFGyiPfqXKbI+vzDyqFXCUjMhoJfJRYC+YTwkO+8GQGke676ehKu4WwFl1pPzXPKbe2iShZ7sccz1QakenpXJuRih2qMessvP3OF2Bki8NbyuOXOjYecBHP8a4jMV9LuJVonTuT8Vi6nUFyMVQ3I6X4S0gdQqZzBv64MCzyl3A0BiW25igE98mNdMycy7ryMBiPKaiiWTUn X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1782ed02-30a7-4386-2b4f-08d8f2ba431c X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:07.8495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UqsWmMLWQICP6tGh5YaWyotGMF6q113P7GKvQXjATRXcQ62buDOQc/4mjLeZnkZfB4NPOPwtE5ffEQzz+R4rcD9ivOvfeMK4xqt7Z1p9vTOLAQbaGDETDs9/LYRIC+vN X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6729 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn The code currently assumes that the mmu_notifier struct embedded in mmu_rb_handler only contains two fields. There are now extra fields: struct mmu_notifier { struct hlist_node hlist; const struct mmu_notifier_ops *ops; struct mm_struct *mm; struct rcu_head rcu; unsigned int users; }; Given that there in no init for the mmu_notifier, a kzalloc() should be used to insure that any newly added fields are given a predictable initial value of zero. Fixes: 06e0ffa69312 ("IB/hfi1: Re-factor MMU notification code") Reviewed-by: Adam Goldman Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/mmu_rb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.c b/drivers/infiniband/hw/hfi1/mmu_rb.c index 375a881..dccb4c1 100644 --- a/drivers/infiniband/hw/hfi1/mmu_rb.c +++ b/drivers/infiniband/hw/hfi1/mmu_rb.c @@ -89,7 +89,7 @@ int hfi1_mmu_rb_register(void *ops_arg, struct mmu_rb_handler *h; int ret; - h = kmalloc(sizeof(*h), GFP_KERNEL); + h = kzalloc(sizeof(*h), GFP_KERNEL); if (!h) return -ENOMEM; From patchwork Mon Mar 29 13:54:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170221 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9734CC433E2 for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73CB861938 for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229709AbhC2Nzp (ORCPT ); Mon, 29 Mar 2021 09:55:45 -0400 Received: from mail-mw2nam12on2105.outbound.protection.outlook.com ([40.107.244.105]:45024 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231639AbhC2NzK (ORCPT ); Mon, 29 Mar 2021 09:55:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPDpLZUFQ4wOKkJCR1dVlJQpeHQPqEvFdpOomqb4S7ztuUcG5smDnjm0VifQaaoOOEmxi3mVUqD0Qqq6XPumgxEmQX2m1UjmPYibYkpv9tayP6Fayt6xAkX9a3bTh5adyoD0ToCgIqDcNlsMdvGY/yCstOPSc1UkTvr1bsTDX2v3RgHnJSmiWFt1Fa1coiNC6CJ29Iz+1ABRFc6d6KQ8T5CK8rvB8zHztp2K28k6PZxMfRVvrUEZ36QEPU4sEON7BsanTspHDD9F9z4nfRbUbnoYeBTp7VlTVQosVWczfR7x5bDEYpvucnXVByB82rgBoh7eQ/aqXcfQSQV14mwNOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5NzrF1Sqv2HWrKDIDpjb29M49Kx4F4GAB7lXGc+tvYo=; b=LfGoyd4iRIHq692hhGHxZGgmvtNxGoz7ZP2Y7qbd5wFvq9k2YeShKdcZJrQwdbfMxki9QSvRetUQJ75lCbTae3MI+ZDATARulV4GeudOHlOMKRESid9AgqdAXErOiy9kqC3gf2Rb/nI7GkqmsSjS1cCDHBrFME4CZQMyNirU8xyVrsbVTx9ON0eP0RnvSs12Hp3PGWV2YaLKG5p1tJBIy/+hNiNZ6BIZ6MVXw2d9Hy4yWzrbZgqgmEEdHeSv4VCAe0GNWLuw10NNkiUL1FSYBWFzUGk8Uvo3ruDXlQzTqKWEGmNI4gFBYiLicDA30XpEsfoJE+qDDoV/Uum7cOZ45A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5NzrF1Sqv2HWrKDIDpjb29M49Kx4F4GAB7lXGc+tvYo=; b=UNunO8kHm3VQ5WSSCYTR5QpnOrbkc77pXdOoeMn5WMuLrlLyq/JsQqtj2EkJiXD8Eu4QYMxUHo7I4wL+TRjp69cGziR9uqRLqpu9Pb9dUx4pl1Ej3UEWkTLEsM0fViQ5GVdYE8TV62OBBzDxm6We+T8aXL4dEuHyxo0MTMqIPOG+HEg3ZUUSrwb94/SvNsMXPLziUEex+0CcMQutC1FeO5n9t4oDPxgRvpV0BQkLcyVZeyb0vWzAVZVXrePEip/R4smGvWO8L9ufKXNJ01SNoC6T3g/R279S+2qsGygW0hvnfeNr2u2JY130gzhbObPRkq+yWbH39Iyq2MoUnFsVSw== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6729.prod.exchangelabs.com (2603:10b6:510:97::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.32; Mon, 29 Mar 2021 13:55:09 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:09 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Kaike Wan , Kaike Wan , Dennis Dalessandro Subject: [PATCH for-next 09/10] IB/hfi1: Remove unused function Date: Mon, 29 Mar 2021 09:54:15 -0400 Message-Id: <1617026056-50483-10-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 665c120e-6320-4557-e05a-08d8f2ba43ca X-MS-TrafficTypeDiagnostic: PH0PR01MB6729: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zEroH+/hNWYoIfkn54u/vGblnyJQRaUH/wxXTYcA5XdrPFaHm+f8QEw4dnfgTS8cpzwDnzLw3F8h0fU3Xc4oTw9xTSwcWADgTT8osXvA3Dj0pBevrp6epsB+9tAoqJrLdgQ15uqNZyRNoxfbPVV9NIAKJF35FbB/jntO0DrHQXhGq24gKa88+u6KURYjUK0r4DPJ6pLHE5owM1JCrbOSf2SkIWjMgJ5LM0hSzTHWBYmkyt1AdGhVtOE72NR9lAGOzZCgXMtD1xkhx5gj6F3VXXT1fwuCLVoj8ENG9Z4gQhSnqC4EdB7WOY7HlgFmWCNKZ0BpxPRdryQXJ4bese1BHeS+CQIfaP4VVflJVzZloHYNA3NO+edIXu9327mo3Cm6Pc0IjIAxaYTqsg9AN6a6C/W6oPUSm+8Nwy01BoNdCWZXNkQSvR26pkkB5pzH1mr8MCOMvxTU0Cah8tCUd9SQsTv7s+Lj6AWy+Ue6hj4YKFsfV3naLBKDbk3sUSORxFrFs1jMB5jKvpFE9v97QbDtm+fbGnA1ZVVfSTtSxILDI/0sJcs3jgcaMTDYmgXBkpu8R0Rvd1GwmqkI2dkgBLNhu8Sd1twa/Jgzo8+eATVHVc1bEpzf5iq2fXe7iOfYYmBEkr0Gw7a7fDYc7lW9HRJs+zgBguEm8U0M1+pE5lrJWU8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(396003)(346002)(366004)(39830400003)(9686003)(52116002)(8936002)(8676002)(6486002)(38100700001)(66946007)(316002)(7696005)(16526019)(186003)(2616005)(956004)(66556008)(4326008)(26005)(83380400001)(2906002)(478600001)(54906003)(36756003)(6666004)(66476007)(5660300002)(107886003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: C0C8zxxDq8X6QN21FRmttYJWfCKoKFJJugpyGBSRcSoT3uHWa810TfrrvuJHjkL2fADuTkOAIKVNd1m+47RH0TrLeQU/KC9b5ejAQ6gq+YnBJQ24+/hWeSE6TeTrZ9/ItGuELeDMAG+bn5+El69W8NKKC71qOCzGiDNkLaBPK5UVj+BjsOiZs0KC7FsHQk6dgRqSvJPfAWfmRj/NIiCsOv0xP+5LQ7v0lF7qdgeTWo0al4Gs8CoE8B3laxGwyfkjunvACQ1e3jtVzxu/hqjbvmuP5mQU0YNRIaWDwyRZmDtynyTa8/u2R7VVap0Am9268sdApZRJtx/D7dV4f3Ay7bc1ifqTln4IpKLs0WjVvahE2OydRCkhWZImfzbceHK3rmueFvvqTxaPENqUh6DuIi4gQ7nmvEtXl/UFvzLKY20Bx2xFx1KzOsVh2RNcDR9joNTXMYmHObTVX97sE56f++DcNQIE1ZR1nVXvQADX33wNmGWTWQ4+x5qWRv0ge10oVBySrs0CqBrxcQqoo2bKJcNO9LBQrx+bI7GqFqj1Nwu6h1paQleNR/642dfMO6TC+KkO5pBf39q5sQbmjBOFhQxtAJjGtBnpc5yGt9PDwUvLZDDKTfmGeMbDVr2zJ9IAc9z6tUlS5d1ipmgzy9KNAyMIo52l5j0ts0LqliH3Uf21UpeOWiWi52AzbI6EwjcI5i5YBAbReTUCapbdEF1m07Ry5VLJvfYElbEyJguEO4hzXvD/UqSYrsBK3mMYscwzEWElwFTdolTjGZnsjmi6xsTFW/bVSo9JCrYxaUUFrAnoB6bsAH+tFfpU02xSgmWerFev3s9k3uVndI28EKVi7FrPIRVQNFXUd68mfgHyAx5yMFnGgDKbzfWu/8S/zoKlPR17NlCyniRc7k2HC/u/eU20sVHLynZwEZGx2E0QwriJhY0tCiVArSHRrPq3bzu8uXi+EwWT9RC93mRS1CTPzuZOOl0BjYBe74fk5Wrf6l2Kaul6bTee2iR9mNMlnlfwzVXvOaNbD8y34Hv5eafk++xz+ijwsB3VVnNsYgv7S7XxTDlilwZ8QmrYQcYPf/XLiO6eRhOD6rhnrYn71HbUd2Pho7gTptyr5UPNymzj3+7aGxBg/KknQh2kvAaVM6QyYT6nZIS2iknwndwQ1TV4N8vaXCzJESlMuI9G65zkVL5tBPx2o4dcm7cVDopGh7FjHrd5n85KL9Td+yzxy2z7Gc6YwbyO16Jwoh8V4Iph+KM4srl4Z3x5vgltmAMNBjrRwu3ccHwF3S0ggiJXXIGjX/4D0960UfiETDNRLmhfRbHHn5boLiM58rwhKW3r8rEo X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 665c120e-6320-4557-e05a-08d8f2ba43ca X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:08.9915 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c5oGdyqvfNiRYc5Go2q+Wrurx0Xa5R06L0SHHuPtaEmJlZVhlrPs2VSWnBUi5andwCTyN5L9T4gtJ6GmiDRbzIvcA8q0Gdtob1odbtT/rmvGIZlXYFySCv8Wks5tJ5tx X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6729 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kaike Wan Remove the unused function sdma_iowait_schedule(). Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/sdma.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/sdma.h b/drivers/infiniband/hw/hfi1/sdma.h index 7a85119..f57d552 100644 --- a/drivers/infiniband/hw/hfi1/sdma.h +++ b/drivers/infiniband/hw/hfi1/sdma.h @@ -907,24 +907,6 @@ static inline unsigned sdma_progress(struct sdma_engine *sde, unsigned seq, return 0; } -/** - * sdma_iowait_schedule() - initialize wait structure - * @sde: sdma_engine to schedule - * @wait: wait struct to schedule - * - * This function initializes the iowait - * structure embedded in the QP or PQ. - * - */ -static inline void sdma_iowait_schedule( - struct sdma_engine *sde, - struct iowait *wait) -{ - struct hfi1_pportdata *ppd = sde->dd->pport; - - iowait_schedule(wait, ppd->hfi1_wq, sde->cpu); -} - /* for use by interrupt handling */ void sdma_engine_error(struct sdma_engine *sde, u64 status); void sdma_engine_interrupt(struct sdma_engine *sde, u64 status); From patchwork Mon Mar 29 13:54:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Dalessandro X-Patchwork-Id: 12170223 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 864ACC433E0 for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52D3A61879 for ; Mon, 29 Mar 2021 13:56:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbhC2Nzo (ORCPT ); Mon, 29 Mar 2021 09:55:44 -0400 Received: from mail-mw2nam12on2105.outbound.protection.outlook.com ([40.107.244.105]:45024 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231917AbhC2NzL (ORCPT ); Mon, 29 Mar 2021 09:55:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fvJ3qiw8wKJy49CRu3kwcnEZUm5z1l9kVDSBS+h3FjoePA9i44FTTGQc+V1kbox7IGSRH7VKP9IE7MQxX2+akvm8uQ4xaKnpR4VZ4u5M/udaZnaIXbPyEAfTR7TiR8yVQrKR3UMTfb3m34FLrc6F/o2zM1S54gMTCcHVuks4C2Bi2Z4fEDVpasRhnmOyKW34oOpA/j3GZgkfyEERm6d4DBI/8k87uSa0J9PgB+IQw8jrVhs4pDDxIzv3n8T2uyuYb8b7JeVDIM4Vt/0Gxc9MCZo6Vw/jw1saz0pB57p5e6pIxz2Da/FlFiiL+BLqxD3yUgAbl3qUAfA2Rjf+b1c8zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ktwNAwb1naGveb/J8TT+NeKbW7Kv4pdVTz/1vC0TI2Q=; b=WngaCpDjWpIZFGcrt6Oow1z5uKKWZJ9AtbX6UAM+Ni00VZrrnueOexVFujgu6dK7tvyiLkCDQPkvEk3CUlXSCZ1tvC+nVnFVL/wxHwKwIthXGcXRDgmJiOvVHijByl0ztjSZyf85dyQlAoE+X9L8ovht8wMcqkSmJM1P1xfM/42H05cvXiFfuqgL98/96XNm/OdtljHCsAh2Nz4ofHItk3fRMuJK+NZEHs2lAYcgm0+zAemaejDbAsdXN2vjYZ+VWhig/W+MG5LExz5jgs7Ra2fGSyurt8WemmRQM38wkUXEoVZHQ8PrwO+gJX3y6+MVHI1UK/RVgnR7uOa/B+v2GA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornelisnetworks.com; dmarc=pass action=none header.from=cornelisnetworks.com; dkim=pass header.d=cornelisnetworks.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornelisnetworks.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ktwNAwb1naGveb/J8TT+NeKbW7Kv4pdVTz/1vC0TI2Q=; b=Id+0C73n5e9nkyF+ocf3txFAP5P0CBRCCP6buDR9j6lmV9beZNCXGrxxUUGasM11OCNaKLWxcfvoTkVKeIyYBN4rCohUUcIVQ2UFCBNENIoeHxZxn/QpA8zVFH1ctOtvLL8roMkbXiLAoQwrpeYoEjKJkn3nf5UL8ahyWHcL4F0x62O8EjbU4rg5G3K2GW3u5A4YcrFkI2QDyROmcz5+7UuQdNPOsMNau6Vy7IstXz/ziwGxz7YjAkRDSX/2LnZwaer/GIWCYWJzol1YP+WrVJtJS2AraoMC0jIupSBZEQssQqNW3xRGTmnL8HB3M0uExSzP3jJ85XqO7cIlb5EVsg== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=cornelisnetworks.com; Received: from PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) by PH0PR01MB6729.prod.exchangelabs.com (2603:10b6:510:97::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.32; Mon, 29 Mar 2021 13:55:10 +0000 Received: from PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860]) by PH0PR01MB6439.prod.exchangelabs.com ([fe80::75a5:79c6:dd14:3860%5]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 13:55:10 +0000 From: dennis.dalessandro@cornelisnetworks.com To: dledford@redhat.com, jgg@ziepe.ca Cc: linux-rdma@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro Subject: [PATCH for-next 10/10] IB/hfi1: Rework AIP and VNIC dummy netdev usage Date: Mon, 29 Mar 2021 09:54:16 -0400 Message-Id: <1617026056-50483-11-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> References: <1617026056-50483-1-git-send-email-dennis.dalessandro@cornelisnetworks.com> X-Originating-IP: [198.175.72.68] X-ClientProxiedBy: SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) To PH0PR01MB6439.prod.exchangelabs.com (2603:10b6:510:d::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from awfm-01.cornelisnetworks.com (198.175.72.68) by SJ0PR03CA0166.namprd03.prod.outlook.com (2603:10b6:a03:338::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Mon, 29 Mar 2021 13:55:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ea8d3ae-8b89-465a-2a93-08d8f2ba447c X-MS-TrafficTypeDiagnostic: PH0PR01MB6729: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XfZC544ioFmgAURWqOIKFD7lFN0kdEVX8bX0PG0aFSb3R4bQC6wR/PkKPZCfHeJ+L+00e/Poi0DsC+cQEg5VjjFgxRmMv+VqOa22Qe+Xw2sfuKj0jlNpJaWqERpTOfRKCpI0hQ+MZ8iwLNVdA4Aj63omyCYZoKUkyc9O4GWfdui9UQnjkFBeWCmhk35ACpT18NVMV0IKRV0s7PDloxivHv3x8XJW0KMVXiWWcrCg2b+BIbMiqsFjUKN1NCgk/OpQAMGMeGt4V2fZMV55X6LEvCe7DhQYW/aflp6CaNZfOiFFKrXPrfFvgfKnIB6EpyX+xmwVbOvt/3s1lcjJQqh7jdEK4QTjHWtS5i4dHWn+pHkuI3tBdAGWyEwVLrK4wbAwbxYX75gQ/UoBMWy/2Y3yDWSKIgBOGDiuCWL35qkt++vHWNMGrUcl/vLVCJLhchvu6OCmKc5bcXMWG29nxpd9nldtCE1RYp+EUTSgK4booz8Ptgt+5+97O7LUpXPEYlUByBbw8YvnNmttZ5lxfZmX6mpaDFPmi/E1I7G+VPPUI2D3DYHOUFOwFa31XqOfL/2ywCM5AzkqH8NJ2ubR0YvN9PS/VmGXq3ljzmV5oJh5cGh5xF13mykYSTLmvqe4kI893s1tabXJcklldNnlaXyHG1hJq81p+81Hn0Qq+PvUOXE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB6439.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(396003)(346002)(366004)(39830400003)(9686003)(30864003)(52116002)(8936002)(8676002)(6486002)(38100700001)(66946007)(316002)(7696005)(16526019)(186003)(2616005)(956004)(66556008)(4326008)(26005)(83380400001)(2906002)(478600001)(54906003)(36756003)(6666004)(66476007)(5660300002)(107886003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: NT2K8wbIQPOSdsf9l9tO5Y4YhS9aHf0+DPHVy4uiKCqeTf3/40R77V2VfiCDX+zbCCusdX6csRNCMLZiuPyFSu5YvT7F3DIIj5IETQ7uVQtya5gQhbHxSDORU2iEz43tNpop2Bp2t4YhwXAD+gjCyV65tbSBYSWNuagxA2HFD1jkPTYkWnbEmIXbKti+fFPYN0Bv5+aBHwebrn7vCm/8W+nZbKhpYgBV6qXiYwOcVDY9uIiugwQZjbORZYEvq16epjRK9FnFelykvNOiHJj4CYM0f7Dqzvz9sbi7Oy2NW1nKBLwm5S7SWxT2TE0EBLgNQEhtW27oD+wjV6AKMe6QSqi1KKt+IYAGy0roHMdI90RLvaZtayY60VmEZXn5oGahWF5OVZm8UVs7niIWNlRIJMlmN7XnptBsJjcu4m5cjj3s3gSKVL3axop2mmyD2GlJKq2UrIw6JUQUsk9pFwBbsiEZSkvNeQBZz0hazkOwVqu/oJ9iVDl8Sg5ZEdOpPx/oWTDEE7JH0b6xitpvoChU7f9mVaPEvsuPdJ1dGVs3PtHw3PP1S85XiEV/cYHVmOr7XvjWBdnR1fslsCVKksX/AB7SXxZ1lDVcyCad0wS3jszgxl5UwO+scKB/W37E2to0oFTNfMcBpWbVtB/4l9HwIk1uFnEWpHlO313tAkLeEMdwuicEEpUbgXthWthwFRZHKJZtMC2z186ZySspbROQ0u5u0vWgIAEVggyk+PpSNtzDa/9yztuC5eWlOD0Oe7k2m0V+2dQslpIfbcJH2QqGS3XflijdM47Pl4Qjf9z8NDsJLp4w9ra3r2esNoIqhnkdDOu63zohAQUCEh0j2vubksIC7dIYgAKxmOwLrN7OogxqszmBmMlE2WDduzqWQSo3o4z7KlOZcI8ZQePDO8CQY+WHWzc5Y2jgZHzIVdzgN49ZgI7W16BhGsuEw8x2zMhf7+6vWYAmXXb56R8AQw6/Xy5za5DSC6SaIKmmoEXwHpgwS8hwY/xOa9616Jk8bas4M4u+OQC3fwWaLuZFj8dgGuIQmVd561Eqb24NCrSDDmg4+03JP5WXzALLIDQGUsAMj2Kmnj8ZDDS0aJtRhZ9qIGRKlLDX0vGhZj5WVyWae4tiRxsh1UmN2gxTo789uScclOWHGHr75nvas1JVQGg1W3poZpSvRlE6eMLxd5lwxdZds/bXMcQic11IyMMJ6WQAvA/7jQV3TBhoGAD4tn6tmqi3XXsWdlF8uLSOsPgefVsOFvTaA4tyXEXiW7GyeqsXHrg9tw/nMVMVzQofjYizQDVc6hxFA+b6vvpVebnexAFj8Rq1zcwnoRXv7F6ebRw8 X-OriginatorOrg: cornelisnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ea8d3ae-8b89-465a-2a93-08d8f2ba447c X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB6439.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 13:55:10.0857 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4dbdb7da-74ee-4b45-8747-ef5ce5ebe68a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xhOlL+EGe478Mfdf5J8E1oZRhA2sdkt6C0TvJy4TCeBMNXqbDFf2WwzECCJ8Gz2MROM1cnnvSp9LPM5WKLex2CGFQ+cGjfQgKvV/PMZUt/D8tfWbH3UZXU7YWWTwIaX5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6729 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Mike Marciniszyn All other users of the dummy netdevice embed the netdev in other structures: init_dummy_netdev(&mal->dummy_dev); init_dummy_netdev(ð->dummy_dev); init_dummy_netdev(&ar->napi_dev); init_dummy_netdev(&irq_grp->napi_ndev); init_dummy_netdev(&wil->napi_ndev); init_dummy_netdev(&trans_pcie->napi_dev); init_dummy_netdev(&dev->napi_dev); init_dummy_netdev(&bus->mux_dev); The AIP and VNIC implementation turns that model inside out and used a kfree() to free what appears to be a netdev struct when in reality, it is a struct that enbodies the rx state as well as the dummy netdev used to support napi_poll across disparate receive contexts. The relationship is infered by the odd allocation: const int netdev_size = sizeof(*dd->dummy_netdev) + sizeof(struct hfi1_netdev_priv); dd->dummy_netdev = kcalloc_node(1, netdev_size, GFP_KERNEL, dd->node); Correct the issue by: - Correctly naming the alloc and free functions - Renaming hfi1_netdev_priv to hfi1_netdev_rx - Replacing dd dummy_netdev with a netdev_rx pointer - Embedding the net_device in hfi1_netdev_rx - Moving the init_dummy_netdev to the alloc routine - Adjusting wrappers to fit the new model Fixes: 6991abcb993c ("IB/hfi1: Add functions to receive accelerated ipoib packets") Reviewed-by: Kaike Wan Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro --- drivers/infiniband/hw/hfi1/chip.c | 6 +- drivers/infiniband/hw/hfi1/hfi.h | 4 +- drivers/infiniband/hw/hfi1/init.c | 2 +- drivers/infiniband/hw/hfi1/netdev.h | 39 +++----- drivers/infiniband/hw/hfi1/netdev_rx.c | 177 +++++++++++++++++---------------- 5 files changed, 108 insertions(+), 120 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index a156522..5eeae8d 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c @@ -15243,8 +15243,8 @@ int hfi1_init_dd(struct hfi1_devdata *dd) (dd->revision >> CCE_REVISION_SW_SHIFT) & CCE_REVISION_SW_MASK); - /* alloc netdev data */ - ret = hfi1_netdev_alloc(dd); + /* alloc VNIC/AIP rx data */ + ret = hfi1_alloc_rx(dd); if (ret) goto bail_cleanup; @@ -15348,7 +15348,7 @@ int hfi1_init_dd(struct hfi1_devdata *dd) hfi1_comp_vectors_clean_up(dd); msix_clean_up_interrupts(dd); bail_cleanup: - hfi1_netdev_free(dd); + hfi1_free_rx(dd); hfi1_pcie_ddcleanup(dd); bail_free: hfi1_free_devdata(dd); diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index d341b8a..8afb757 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h @@ -69,7 +69,6 @@ #include #include #include -#include #include #include "chip_registers.h" @@ -1060,6 +1059,7 @@ struct hfi1_vnic_data { #define SERIAL_MAX 16 /* length of the serial number */ typedef int (*send_routine)(struct rvt_qp *, struct hfi1_pkt_state *, u64); +struct hfi1_netdev_rx; struct hfi1_devdata { struct hfi1_ibdev verbs_dev; /* must be first */ /* pointers to related structs for this device */ @@ -1402,7 +1402,7 @@ struct hfi1_devdata { /* Lock to protect IRQ SRC register access */ spinlock_t irq_src_lock; int vnic_num_vports; - struct net_device *dummy_netdev; + struct hfi1_netdev_rx *netdev_rx; struct hfi1_affinity_node *affinity_entry; /* Keeps track of IPoIB RSM rule users */ diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index 6d03aa0..447b5dab 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -1775,7 +1775,7 @@ static void remove_one(struct pci_dev *pdev) hfi1_unregister_ib_device(dd); /* free netdev data */ - hfi1_netdev_free(dd); + hfi1_free_rx(dd); /* * Disable the IB link, disable interrupts on the device, diff --git a/drivers/infiniband/hw/hfi1/netdev.h b/drivers/infiniband/hw/hfi1/netdev.h index 947543a..8aa0746 100644 --- a/drivers/infiniband/hw/hfi1/netdev.h +++ b/drivers/infiniband/hw/hfi1/netdev.h @@ -14,15 +14,14 @@ /** * struct hfi1_netdev_rxq - Receive Queue for HFI - * dummy netdev. Both IPoIB and VNIC netdevices will be working on - * top of this device. + * Both IPoIB and VNIC netdevices will be working on the rx abstraction. * @napi: napi object - * @priv: ptr to netdev_priv + * @rx: ptr to netdev_rx * @rcd: ptr to receive context data */ struct hfi1_netdev_rxq { struct napi_struct napi; - struct hfi1_netdev_priv *priv; + struct hfi1_netdev_rx *rx; struct hfi1_ctxtdata *rcd; }; @@ -36,7 +35,8 @@ struct hfi1_netdev_rxq { #define NUM_NETDEV_MAP_ENTRIES HFI1_MAX_NETDEV_CTXTS /** - * struct hfi1_netdev_priv: data required to setup and run HFI netdev. + * struct hfi1_netdev_rx: data required to setup and run HFI netdev. + * @rx_napi: the dummy netdevice to support "polling" the receive contexts * @dd: hfi1_devdata * @rxq: pointer to dummy netdev receive queues. * @num_rx_q: number of receive queues @@ -48,7 +48,8 @@ struct hfi1_netdev_rxq { * @netdevs: atomic counter of netdevs using dummy netdev. * When 0 receive queues will be freed. */ -struct hfi1_netdev_priv { +struct hfi1_netdev_rx { + struct net_device rx_napi; struct hfi1_devdata *dd; struct hfi1_netdev_rxq *rxq; int num_rx_q; @@ -61,41 +62,27 @@ struct hfi1_netdev_priv { }; static inline -struct hfi1_netdev_priv *hfi1_netdev_priv(struct net_device *dev) -{ - return (struct hfi1_netdev_priv *)&dev[1]; -} - -static inline int hfi1_netdev_ctxt_count(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); - - return priv->num_rx_q; + return dd->netdev_rx->num_rx_q; } static inline struct hfi1_ctxtdata *hfi1_netdev_get_ctxt(struct hfi1_devdata *dd, int ctxt) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); - - return priv->rxq[ctxt].rcd; + return dd->netdev_rx->rxq[ctxt].rcd; } static inline int hfi1_netdev_get_free_rmt_idx(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); - - return priv->rmt_start; + return dd->netdev_rx->rmt_start; } static inline void hfi1_netdev_set_free_rmt_idx(struct hfi1_devdata *dd, int rmt_idx) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); - - priv->rmt_start = rmt_idx; + dd->netdev_rx->rmt_start = rmt_idx; } u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts, @@ -105,8 +92,8 @@ u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts, void hfi1_netdev_disable_queues(struct hfi1_devdata *dd); int hfi1_netdev_rx_init(struct hfi1_devdata *dd); int hfi1_netdev_rx_destroy(struct hfi1_devdata *dd); -int hfi1_netdev_alloc(struct hfi1_devdata *dd); -void hfi1_netdev_free(struct hfi1_devdata *dd); +int hfi1_alloc_rx(struct hfi1_devdata *dd); +void hfi1_free_rx(struct hfi1_devdata *dd); int hfi1_netdev_add_data(struct hfi1_devdata *dd, int id, void *data); void *hfi1_netdev_remove_data(struct hfi1_devdata *dd, int id); void *hfi1_netdev_get_data(struct hfi1_devdata *dd, int id); diff --git a/drivers/infiniband/hw/hfi1/netdev_rx.c b/drivers/infiniband/hw/hfi1/netdev_rx.c index c1fa53d..f8995f3 100644 --- a/drivers/infiniband/hw/hfi1/netdev_rx.c +++ b/drivers/infiniband/hw/hfi1/netdev_rx.c @@ -17,11 +17,11 @@ #include #include -static int hfi1_netdev_setup_ctxt(struct hfi1_netdev_priv *priv, +static int hfi1_netdev_setup_ctxt(struct hfi1_netdev_rx *rx, struct hfi1_ctxtdata *uctxt) { unsigned int rcvctrl_ops; - struct hfi1_devdata *dd = priv->dd; + struct hfi1_devdata *dd = rx->dd; int ret; uctxt->rhf_rcv_function_map = netdev_rhf_rcv_functions; @@ -118,11 +118,11 @@ static void hfi1_netdev_deallocate_ctxt(struct hfi1_devdata *dd, hfi1_free_ctxt(uctxt); } -static int hfi1_netdev_allot_ctxt(struct hfi1_netdev_priv *priv, +static int hfi1_netdev_allot_ctxt(struct hfi1_netdev_rx *rx, struct hfi1_ctxtdata **ctxt) { int rc; - struct hfi1_devdata *dd = priv->dd; + struct hfi1_devdata *dd = rx->dd; rc = hfi1_netdev_allocate_ctxt(dd, ctxt); if (rc) { @@ -130,7 +130,7 @@ static int hfi1_netdev_allot_ctxt(struct hfi1_netdev_priv *priv, return rc; } - rc = hfi1_netdev_setup_ctxt(priv, *ctxt); + rc = hfi1_netdev_setup_ctxt(rx, *ctxt); if (rc) { dd_dev_err(dd, "netdev ctxt setup failed %d\n", rc); hfi1_netdev_deallocate_ctxt(dd, *ctxt); @@ -183,31 +183,31 @@ u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts, (u32)HFI1_MAX_NETDEV_CTXTS); } -static int hfi1_netdev_rxq_init(struct net_device *dev) +static int hfi1_netdev_rxq_init(struct hfi1_netdev_rx *rx) { int i; int rc; - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dev); - struct hfi1_devdata *dd = priv->dd; + struct hfi1_devdata *dd = rx->dd; + struct net_device *dev = &rx->rx_napi; - priv->num_rx_q = dd->num_netdev_contexts; - priv->rxq = kcalloc_node(priv->num_rx_q, sizeof(struct hfi1_netdev_rxq), - GFP_KERNEL, dd->node); + rx->num_rx_q = dd->num_netdev_contexts; + rx->rxq = kcalloc_node(rx->num_rx_q, sizeof(*rx->rxq), + GFP_KERNEL, dd->node); - if (!priv->rxq) { + if (!rx->rxq) { dd_dev_err(dd, "Unable to allocate netdev queue data\n"); return (-ENOMEM); } - for (i = 0; i < priv->num_rx_q; i++) { - struct hfi1_netdev_rxq *rxq = &priv->rxq[i]; + for (i = 0; i < rx->num_rx_q; i++) { + struct hfi1_netdev_rxq *rxq = &rx->rxq[i]; - rc = hfi1_netdev_allot_ctxt(priv, &rxq->rcd); + rc = hfi1_netdev_allot_ctxt(rx, &rxq->rcd); if (rc) goto bail_context_irq_failure; hfi1_rcd_get(rxq->rcd); - rxq->priv = priv; + rxq->rx = rx; rxq->rcd->napi = &rxq->napi; dd_dev_info(dd, "Setting rcv queue %d napi to context %d\n", i, rxq->rcd->ctxt); @@ -227,7 +227,7 @@ static int hfi1_netdev_rxq_init(struct net_device *dev) bail_context_irq_failure: dd_dev_err(dd, "Unable to allot receive context\n"); for (; i >= 0; i--) { - struct hfi1_netdev_rxq *rxq = &priv->rxq[i]; + struct hfi1_netdev_rxq *rxq = &rx->rxq[i]; if (rxq->rcd) { hfi1_netdev_deallocate_ctxt(dd, rxq->rcd); @@ -235,20 +235,19 @@ static int hfi1_netdev_rxq_init(struct net_device *dev) rxq->rcd = NULL; } } - kfree(priv->rxq); - priv->rxq = NULL; + kfree(rx->rxq); + rx->rxq = NULL; return rc; } -static void hfi1_netdev_rxq_deinit(struct net_device *dev) +static void hfi1_netdev_rxq_deinit(struct hfi1_netdev_rx *rx) { int i; - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dev); - struct hfi1_devdata *dd = priv->dd; + struct hfi1_devdata *dd = rx->dd; - for (i = 0; i < priv->num_rx_q; i++) { - struct hfi1_netdev_rxq *rxq = &priv->rxq[i]; + for (i = 0; i < rx->num_rx_q; i++) { + struct hfi1_netdev_rxq *rxq = &rx->rxq[i]; netif_napi_del(&rxq->napi); hfi1_netdev_deallocate_ctxt(dd, rxq->rcd); @@ -256,41 +255,41 @@ static void hfi1_netdev_rxq_deinit(struct net_device *dev) rxq->rcd = NULL; } - kfree(priv->rxq); - priv->rxq = NULL; - priv->num_rx_q = 0; + kfree(rx->rxq); + rx->rxq = NULL; + rx->num_rx_q = 0; } -static void enable_queues(struct hfi1_netdev_priv *priv) +static void enable_queues(struct hfi1_netdev_rx *rx) { int i; - for (i = 0; i < priv->num_rx_q; i++) { - struct hfi1_netdev_rxq *rxq = &priv->rxq[i]; + for (i = 0; i < rx->num_rx_q; i++) { + struct hfi1_netdev_rxq *rxq = &rx->rxq[i]; - dd_dev_info(priv->dd, "enabling queue %d on context %d\n", i, + dd_dev_info(rx->dd, "enabling queue %d on context %d\n", i, rxq->rcd->ctxt); napi_enable(&rxq->napi); - hfi1_rcvctrl(priv->dd, + hfi1_rcvctrl(rx->dd, HFI1_RCVCTRL_CTXT_ENB | HFI1_RCVCTRL_INTRAVAIL_ENB, rxq->rcd); } } -static void disable_queues(struct hfi1_netdev_priv *priv) +static void disable_queues(struct hfi1_netdev_rx *rx) { int i; - msix_netdev_synchronize_irq(priv->dd); + msix_netdev_synchronize_irq(rx->dd); - for (i = 0; i < priv->num_rx_q; i++) { - struct hfi1_netdev_rxq *rxq = &priv->rxq[i]; + for (i = 0; i < rx->num_rx_q; i++) { + struct hfi1_netdev_rxq *rxq = &rx->rxq[i]; - dd_dev_info(priv->dd, "disabling queue %d on context %d\n", i, + dd_dev_info(rx->dd, "disabling queue %d on context %d\n", i, rxq->rcd->ctxt); /* wait for napi if it was scheduled */ - hfi1_rcvctrl(priv->dd, + hfi1_rcvctrl(rx->dd, HFI1_RCVCTRL_CTXT_DIS | HFI1_RCVCTRL_INTRAVAIL_DIS, rxq->rcd); napi_synchronize(&rxq->napi); @@ -307,15 +306,14 @@ static void disable_queues(struct hfi1_netdev_priv *priv) */ int hfi1_netdev_rx_init(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); + struct hfi1_netdev_rx *rx = dd->netdev_rx; int res; - if (atomic_fetch_inc(&priv->netdevs)) + if (atomic_fetch_inc(&rx->netdevs)) return 0; mutex_lock(&hfi1_mutex); - init_dummy_netdev(dd->dummy_netdev); - res = hfi1_netdev_rxq_init(dd->dummy_netdev); + res = hfi1_netdev_rxq_init(rx); mutex_unlock(&hfi1_mutex); return res; } @@ -328,12 +326,12 @@ int hfi1_netdev_rx_init(struct hfi1_devdata *dd) */ int hfi1_netdev_rx_destroy(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); + struct hfi1_netdev_rx *rx = dd->netdev_rx; /* destroy the RX queues only if it is the last netdev going away */ - if (atomic_fetch_add_unless(&priv->netdevs, -1, 0) == 1) { + if (atomic_fetch_add_unless(&rx->netdevs, -1, 0) == 1) { mutex_lock(&hfi1_mutex); - hfi1_netdev_rxq_deinit(dd->dummy_netdev); + hfi1_netdev_rxq_deinit(rx); mutex_unlock(&hfi1_mutex); } @@ -341,43 +339,46 @@ int hfi1_netdev_rx_destroy(struct hfi1_devdata *dd) } /** - * hfi1_netdev_alloc - Allocates netdev and private data. It is required - * because RMT index and MSI-X interrupt can be set only - * during driver initialization. - * + * hfi1_alloc_rx - Allocates the rx support structure * @dd: hfi1 dev data + * + * Allocate the rx structure to support gathering the receive + * resources and the dummy netdev. + * + * Updates dd struct pointer upon success. + * + * Return: 0 (success) -error on failure + * */ -int hfi1_netdev_alloc(struct hfi1_devdata *dd) +int hfi1_alloc_rx(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv; - const int netdev_size = sizeof(*dd->dummy_netdev) + - sizeof(struct hfi1_netdev_priv); + struct hfi1_netdev_rx *rx; - dd_dev_info(dd, "allocating netdev size %d\n", netdev_size); - dd->dummy_netdev = kcalloc_node(1, netdev_size, GFP_KERNEL, dd->node); + dd_dev_info(dd, "allocating rx size %ld\n", sizeof(*rx)); + rx = kzalloc_node(sizeof(*rx), GFP_KERNEL, dd->node); - if (!dd->dummy_netdev) + if (!rx) return -ENOMEM; + rx->dd = dd; + init_dummy_netdev(&rx->rx_napi); - priv = hfi1_netdev_priv(dd->dummy_netdev); - priv->dd = dd; - xa_init(&priv->dev_tbl); - atomic_set(&priv->enabled, 0); - atomic_set(&priv->netdevs, 0); + xa_init(&rx->dev_tbl); + atomic_set(&rx->enabled, 0); + atomic_set(&rx->netdevs, 0); + dd->netdev_rx = rx; return 0; } -void hfi1_netdev_free(struct hfi1_devdata *dd) +void hfi1_free_rx(struct hfi1_devdata *dd) { - if (dd->dummy_netdev) { - struct hfi1_netdev_priv *priv = - hfi1_netdev_priv(dd->dummy_netdev); - - dd_dev_info(dd, "hfi1 netdev freed\n"); - xa_destroy(&priv->dev_tbl); - kfree(dd->dummy_netdev); - dd->dummy_netdev = NULL; + if (dd->netdev_rx) { + struct hfi1_netdev_rx *rx = dd->netdev_rx; + + dd_dev_info(dd, "hfi1 rx freed\n"); + xa_destroy(&rx->dev_tbl); + kfree(dd->netdev_rx); + dd->netdev_rx = NULL; } } @@ -392,33 +393,33 @@ void hfi1_netdev_free(struct hfi1_devdata *dd) */ void hfi1_netdev_enable_queues(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv; + struct hfi1_netdev_rx *rx; - if (!dd->dummy_netdev) + if (!dd->netdev_rx) return; - priv = hfi1_netdev_priv(dd->dummy_netdev); - if (atomic_fetch_inc(&priv->enabled)) + rx = dd->netdev_rx; + if (atomic_fetch_inc(&rx->enabled)) return; mutex_lock(&hfi1_mutex); - enable_queues(priv); + enable_queues(rx); mutex_unlock(&hfi1_mutex); } void hfi1_netdev_disable_queues(struct hfi1_devdata *dd) { - struct hfi1_netdev_priv *priv; + struct hfi1_netdev_rx *rx; - if (!dd->dummy_netdev) + if (!dd->netdev_rx) return; - priv = hfi1_netdev_priv(dd->dummy_netdev); - if (atomic_dec_if_positive(&priv->enabled)) + rx = dd->netdev_rx; + if (atomic_dec_if_positive(&rx->enabled)) return; mutex_lock(&hfi1_mutex); - disable_queues(priv); + disable_queues(rx); mutex_unlock(&hfi1_mutex); } @@ -434,9 +435,9 @@ void hfi1_netdev_disable_queues(struct hfi1_devdata *dd) */ int hfi1_netdev_add_data(struct hfi1_devdata *dd, int id, void *data) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); + struct hfi1_netdev_rx *rx = dd->netdev_rx; - return xa_insert(&priv->dev_tbl, id, data, GFP_NOWAIT); + return xa_insert(&rx->dev_tbl, id, data, GFP_NOWAIT); } /** @@ -448,9 +449,9 @@ int hfi1_netdev_add_data(struct hfi1_devdata *dd, int id, void *data) */ void *hfi1_netdev_remove_data(struct hfi1_devdata *dd, int id) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); + struct hfi1_netdev_rx *rx = dd->netdev_rx; - return xa_erase(&priv->dev_tbl, id); + return xa_erase(&rx->dev_tbl, id); } /** @@ -461,9 +462,9 @@ void *hfi1_netdev_remove_data(struct hfi1_devdata *dd, int id) */ void *hfi1_netdev_get_data(struct hfi1_devdata *dd, int id) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); + struct hfi1_netdev_rx *rx = dd->netdev_rx; - return xa_load(&priv->dev_tbl, id); + return xa_load(&rx->dev_tbl, id); } /** @@ -474,11 +475,11 @@ void *hfi1_netdev_get_data(struct hfi1_devdata *dd, int id) */ void *hfi1_netdev_get_first_data(struct hfi1_devdata *dd, int *start_id) { - struct hfi1_netdev_priv *priv = hfi1_netdev_priv(dd->dummy_netdev); + struct hfi1_netdev_rx *rx = dd->netdev_rx; unsigned long index = *start_id; void *ret; - ret = xa_find(&priv->dev_tbl, &index, UINT_MAX, XA_PRESENT); + ret = xa_find(&rx->dev_tbl, &index, UINT_MAX, XA_PRESENT); *start_id = (int)index; return ret; }