From patchwork Wed Apr 28 11:42:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 12228635 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 D18E2C43460 for ; Wed, 28 Apr 2021 11:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 958EA61422 for ; Wed, 28 Apr 2021 11:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbhD1Lny (ORCPT ); Wed, 28 Apr 2021 07:43:54 -0400 Received: from smtp-fw-9103.amazon.com ([207.171.188.200]:33932 "EHLO smtp-fw-9103.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbhD1Lnx (ORCPT ); Wed, 28 Apr 2021 07:43:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1619610189; x=1651146189; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VBBZFbAzu2PBgR1EAR3eDRzzrtbVM3trmZB3iMA+zxc=; b=b76rltgnmlB295oOsZubrWL/VAEu9q37Ux4toR1kyEmP+jybm+ay1WRO RlAFNqam3GFSb2ZHN4hXUU2/upJzoH1Aa6s7em59LKhJoXgG5mGQdhEiL cnavAAyFXynG221w3sax3klWxFByy12D/b/2SNn9hqvFaTvyDKgTUprEk k=; X-IronPort-AV: E=Sophos;i="5.82,258,1613433600"; d="scan'208";a="929710388" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-2b-55156cd4.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP; 28 Apr 2021 11:43:00 +0000 Received: from EX13D02EUB002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-55156cd4.us-west-2.amazon.com (Postfix) with ESMTPS id C0376A06B5; Wed, 28 Apr 2021 11:42:59 +0000 (UTC) Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D02EUB002.ant.amazon.com (10.43.166.170) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 28 Apr 2021 11:42:57 +0000 Received: from 8c85908914bf.ant.amazon.com.com (10.85.90.101) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 28 Apr 2021 11:42:54 +0000 From: Gal Pressman To: David Ahern CC: , , Yossi Leybovich , Alexander Matushevsky , Leon Romanovsky , Jason Gunthorpe , Gal Pressman Subject: [PATCH iproute2-next 1/2] rdma: update uapi headers Date: Wed, 28 Apr 2021 14:42:30 +0300 Message-ID: <20210428114231.96944-2-galpress@amazon.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210428114231.96944-1-galpress@amazon.com> References: <20210428114231.96944-1-galpress@amazon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Update rdma_netlink.h file upto kernel commit 6cc9e215eb27 ("RDMA/nldev: Add copy-on-fork attribute to get sys command") Signed-off-by: Gal Pressman --- rdma/include/uapi/rdma/rdma_netlink.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h index 4aef76ae317b..37f583ee58fc 100644 --- a/rdma/include/uapi/rdma/rdma_netlink.h +++ b/rdma/include/uapi/rdma/rdma_netlink.h @@ -293,6 +293,10 @@ enum rdma_nldev_command { RDMA_NLDEV_CMD_RES_MR_GET_RAW, + RDMA_NLDEV_CMD_RES_CTX_GET, /* can dump */ + + RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */ + RDMA_NLDEV_NUM_OPS }; @@ -533,6 +537,18 @@ enum rdma_nldev_attr { RDMA_NLDEV_ATTR_RES_RAW, /* binary */ + RDMA_NLDEV_ATTR_RES_CTX, /* nested table */ + RDMA_NLDEV_ATTR_RES_CTX_ENTRY, /* nested table */ + + RDMA_NLDEV_ATTR_RES_SRQ, /* nested table */ + RDMA_NLDEV_ATTR_RES_SRQ_ENTRY, /* nested table */ + RDMA_NLDEV_ATTR_RES_SRQN, /* u32 */ + + RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */ + RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */ + + RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK, /* u8 */ + /* * Always the end */ From patchwork Wed Apr 28 11:42:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 12228633 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 268E0C433B4 for ; Wed, 28 Apr 2021 11:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA2E76140A for ; Wed, 28 Apr 2021 11:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbhD1Lnx (ORCPT ); Wed, 28 Apr 2021 07:43:53 -0400 Received: from smtp-fw-9103.amazon.com ([207.171.188.200]:33932 "EHLO smtp-fw-9103.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbhD1Lnx (ORCPT ); Wed, 28 Apr 2021 07:43:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1619610188; x=1651146188; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J9WlUV3BQ6kRTN7YPHMpT+ukyP5pRrtlyMvySC8qstA=; b=OBPZhnDNbOlOUAW6UX+vJCITLT0Q3vA0GutBwgAKDnI5Y0Ga4HTwKcmD 9xHp8qZVTnJaB7kD2P1C4cE1T0Hoa25SQ0b6SnykdsYwtfkZglWakDb/7 D0eviqhbq3ytsXcJCAamwyW4kNo9UnHQu64d77SdHt9/+r3vILIOfWky9 g=; X-IronPort-AV: E=Sophos;i="5.82,258,1613433600"; d="scan'208";a="929710402" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-2c-579b7f5b.us-west-2.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP; 28 Apr 2021 11:43:04 +0000 Received: from EX13D13EUA003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2c-579b7f5b.us-west-2.amazon.com (Postfix) with ESMTPS id E237DA2194; Wed, 28 Apr 2021 11:43:03 +0000 (UTC) Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D13EUA003.ant.amazon.com (10.43.165.25) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 28 Apr 2021 11:43:02 +0000 Received: from 8c85908914bf.ant.amazon.com.com (10.85.90.101) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 28 Apr 2021 11:42:59 +0000 From: Gal Pressman To: David Ahern CC: , , Yossi Leybovich , Alexander Matushevsky , Leon Romanovsky , Jason Gunthorpe , Gal Pressman Subject: [PATCH iproute2-next 2/2] rdma: Add copy-on-fork to get sys command Date: Wed, 28 Apr 2021 14:42:31 +0300 Message-ID: <20210428114231.96944-3-galpress@amazon.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210428114231.96944-1-galpress@amazon.com> References: <20210428114231.96944-1-galpress@amazon.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The new attribute indicates that the kernel copies DMA pages on fork, hence fork support through madvise and MADV_DONTFORK is not needed. If the attribute is not reported (expected on older kernels), copy-on-fork is disabled. Example: $ rdma sys netns shared copy-on-fork on Signed-off-by: Gal Pressman --- rdma/sys.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rdma/sys.c b/rdma/sys.c index 8fb565d70598..dd9c6da33e2a 100644 --- a/rdma/sys.c +++ b/rdma/sys.c @@ -38,6 +38,15 @@ static int sys_show_parse_cb(const struct nlmsghdr *nlh, void *data) print_color_string(PRINT_ANY, COLOR_NONE, "netns", "netns %s\n", mode_str); } + + if (tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK]) + print_color_on_off(PRINT_ANY, COLOR_NONE, "copy-on-fork", + "copy-on-fork %s\n", + mnl_attr_get_u8(tb[RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK])); + else + print_color_on_off(PRINT_ANY, COLOR_NONE, "copy-on-fork", + "copy-on-fork %s\n", false); + return MNL_CB_OK; }