From patchwork Fri Jun 23 15:38:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13290801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6D66EB64DD for ; Fri, 23 Jun 2023 15:50:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232088AbjFWPus (ORCPT ); Fri, 23 Jun 2023 11:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232253AbjFWPur (ORCPT ); Fri, 23 Jun 2023 11:50:47 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61CDD2123 for ; Fri, 23 Jun 2023 08:50:46 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6b58e439696so690460a34.1 for ; Fri, 23 Jun 2023 08:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1687535445; x=1690127445; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=35Zvw+R6k6wrL7jcU/Gma7VaaeWSIIMSi2FwUpxEeD4=; b=AgAiIZ4VDMj4Q62GHxJu5FQ49992WbR+mYodtNC5/+4bxNeVS7lBYsd5KnBZtnZYVw Yj/rRna8Gyc/Boz7fRvBy75QpCMm60UsAcjtwB3LvA4GxUMdTVVJtPKIp1dD7Tb/i2gp WjrIBF/AlAiZxHR/2xah0cdO6FnY66DC5P9Lg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687535445; x=1690127445; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=35Zvw+R6k6wrL7jcU/Gma7VaaeWSIIMSi2FwUpxEeD4=; b=k0E0MEtQjucxPO9jvn84vmT7ZG0ZomdEi7s/nepI0rSbn7u4pfmuXpSVAC+V1rATIz c/YXJjykbqMBM9clAosPyT+8p2+YjtqvcSVpVCi9rem/gCj2KU0i5dvIFnYRN/94kRSR 8KzVotwlqnEByJi+8wAfn8iTfJAtcVylapNlpZ0CUnU02xOq0arzjiwTesT2sZiX50+p 2pgZ6piMIyk6RLFFMtZUAl1Hb7ki+BcaLxA7qQpgoMeS0H6VoGl6DCJONGPjfkp2ibJK LT3CKnT+LDP8ayuitPwZeBYkcp0AJE7QCuYt8ep59lLdz3VkcXj52sdDr7SgrmAi3qNX dosA== X-Gm-Message-State: AC+VfDyshk0QIKsXTei/N/S92LX9A5rZ1muhqgGA4cxUV0m5j+8zS3zw ARQswnuXcYVl5zlywokENZOwIw== X-Google-Smtp-Source: ACHHUZ6BzAo3kkI7SkXkhIvKxqiMRpdrWl5SrSwQgua/PX4+lKjJ663uBio2TQCGOFQTUFsZv95QRA== X-Received: by 2002:a05:6830:189:b0:6b7:1d93:72e0 with SMTP id q9-20020a056830018900b006b71d9372e0mr3723834ota.32.1687535445673; Fri, 23 Jun 2023 08:50:45 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id z124-20020a636582000000b00553d96d7feesm6637100pgb.35.2023.06.23.08.50.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2023 08:50:44 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, michael.chan@broadcom.com, Chandramohan Akula , Selvin Xavier Subject: [PATCH for-next 7/7] RDMA/bnxt_re: Add a new uapi for driver notification Date: Fri, 23 Jun 2023 08:38:37 -0700 Message-Id: <1687534717-17968-8-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1687534717-17968-1-git-send-email-selvin.xavier@broadcom.com> References: <1687534717-17968-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Chandramohan Akula Add driver notify uapi for application notifying the driver about the doorbell FIFO congestion. Signed-off-by: Chandramohan Akula Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 15 +++++++++++++++ include/uapi/rdma/bnxt_re-abi.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c index 229c2c4..763b027 100644 --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -4183,6 +4183,15 @@ void bnxt_re_mmap_free(struct rdma_user_mmap_entry *rdma_entry) kfree(bnxt_entry); } +static int UVERBS_HANDLER(BNXT_RE_METHOD_NOTIFY_DRV)(struct uverbs_attr_bundle *attrs) +{ + struct bnxt_re_ucontext *uctx; + + uctx = container_of(ib_uverbs_get_ucontext(attrs), struct bnxt_re_ucontext, ib_uctx); + bnxt_re_pacing_alert(uctx->rdev); + return 0; +} + static int UVERBS_HANDLER(BNXT_RE_METHOD_ALLOC_PAGE)(struct uverbs_attr_bundle *attrs) { struct ib_uobject *uobj = uverbs_attr_get_uobject(attrs, BNXT_RE_ALLOC_PAGE_HANDLE); @@ -4318,7 +4327,13 @@ DECLARE_UVERBS_NAMED_OBJECT(BNXT_RE_OBJECT_ALLOC_PAGE, &UVERBS_METHOD(BNXT_RE_METHOD_ALLOC_PAGE), &UVERBS_METHOD(BNXT_RE_METHOD_DESTROY_PAGE)); +DECLARE_UVERBS_NAMED_METHOD(BNXT_RE_METHOD_NOTIFY_DRV); + +DECLARE_UVERBS_GLOBAL_METHODS(BNXT_RE_OBJECT_NOTIFY_DRV, + &UVERBS_METHOD(BNXT_RE_METHOD_NOTIFY_DRV)); + const struct uapi_definition bnxt_re_uapi_defs[] = { UAPI_DEF_CHAIN_OBJ_TREE_NAMED(BNXT_RE_OBJECT_ALLOC_PAGE), + UAPI_DEF_CHAIN_OBJ_TREE_NAMED(BNXT_RE_OBJECT_NOTIFY_DRV), {} }; diff --git a/include/uapi/rdma/bnxt_re-abi.h b/include/uapi/rdma/bnxt_re-abi.h index 78a324f..6e7c67a 100644 --- a/include/uapi/rdma/bnxt_re-abi.h +++ b/include/uapi/rdma/bnxt_re-abi.h @@ -132,6 +132,7 @@ enum bnxt_re_shpg_offt { enum bnxt_re_objects { BNXT_RE_OBJECT_ALLOC_PAGE = (1U << UVERBS_ID_NS_SHIFT), + BNXT_RE_OBJECT_NOTIFY_DRV, }; enum bnxt_re_alloc_page_type { @@ -157,4 +158,7 @@ enum bnxt_re_alloc_page_methods { BNXT_RE_METHOD_DESTROY_PAGE, }; +enum bnxt_re_notify_drv_methods { + BNXT_RE_METHOD_NOTIFY_DRV = (1U << UVERBS_ID_NS_SHIFT), +}; #endif /* __BNXT_RE_UVERBS_ABI_H__*/