From patchwork Thu Nov 22 23:24:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10694981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE44513B5 for ; Thu, 22 Nov 2018 23:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EAF32BF0F for ; Thu, 22 Nov 2018 23:24:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9318A2C3A1; Thu, 22 Nov 2018 23:24:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FEBF2BF0F for ; Thu, 22 Nov 2018 23:24:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407886AbeKWKGG (ORCPT ); Fri, 23 Nov 2018 05:06:06 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37923 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407882AbeKWKGF (ORCPT ); Fri, 23 Nov 2018 05:06:05 -0500 Received: by mail-pl1-f196.google.com with SMTP id e5so9790208plb.5 for ; Thu, 22 Nov 2018 15:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SPHKZbTHoqaAH/sy5JoX737zYXFvGU00VKKOiu6FWyg=; b=WEsp8SdXT3qVaYj2+iJOaBc9bgYo6/ng+JFowXXyaoJ/glVd1Isgnx/Z/nRonBm238 H/2JwuAIjqQH9X7x6yit4xVIWBKw3qfD1s3ZuBFrSdkZ4bcCTAzauljecGjVWA9fAvE1 yMikD9O1DFl90YP1bW0lAuRNg2zdAdwCpTlRHVX9HaDPExOBLiNmBsIKDaP72N9c5glY hEo1dFtmfyLOy9s0E7d7cp7dehuPVVfaNeRiR4e/Px8/eHQd20VdG0u+6ZiiU0c7dWXB USy5K4ZBchN5PZ00HoAiW5ey3p06hCz+f82xruMAdHHm65QcbSMTsW1pG7oNZglFr8bI nitw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SPHKZbTHoqaAH/sy5JoX737zYXFvGU00VKKOiu6FWyg=; b=GdVXrTm1/eJ/JnmIvFUkZkwLvohM4INzmf+UILf7hJJiKqatPqR8E4D7tXtpkOo9YD 8d5YSck0ur1sOrO4dr57VS8c7kMxucHI+VftYVIsPRphI5CtT6rLf0bo/nRxccoHSkXA SpEZvPhdyBIXhU86vMT946O8IOzNbLgN7NkYwthx/ARBaNhNvhCF5uvZyw7genba7kOy d+Th0b5eta684pGqNnypsDEamNAuRGmyhezIni2Be98Br4b38XxvhNie4jxgviO2UXll W/VmZCHEGIKoqxc3zZeu4iCozQ8KQsLOAsC23RZ/mxI10wehlG4GWVyoYfJzi4vjFDVM CuXQ== X-Gm-Message-State: AA+aEWYY0fDVh3fg6It4KuyEryQJPC0Qv4GMby0xW1HzxEFooPBYSz+E 0jV0HYHP8NWILrJ83QcPnLE2v2vBorA= X-Google-Smtp-Source: AFSGD/X8sFNPLCCxG5A8tqhdwcEXOfTQmX7ZPMshJvUV/m0J86WuF43tOUHs0JpDoxuzXioIojd3Jg== X-Received: by 2002:a17:902:b78b:: with SMTP id e11mr13213131pls.90.1542929062555; Thu, 22 Nov 2018 15:24:22 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id p9-v6sm56859210pfa.22.2018.11.22.15.24.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Nov 2018 15:24:19 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gPyKY-0007sZ-BZ; Thu, 22 Nov 2018 16:24:18 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 03/10] verbs: Move ibv_create_comp_channel to use execute_write Date: Thu, 22 Nov 2018 16:24:09 -0700 Message-Id: <20181122232416.30132-4-jgg@ziepe.ca> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122232416.30132-1-jgg@ziepe.ca> References: <20181122232416.30132-1-jgg@ziepe.ca> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe This was missed in commit 2eeecc77cdbc ("verbs: Convert write path callers to use DECLARE_LEGACY_CORE_BUFS") as it was not in cmd.c. Signed-off-by: Jason Gunthorpe --- libibverbs/verbs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libibverbs/verbs.c b/libibverbs/verbs.c index 37a458a2e6ccc7..9121e2d342560c 100644 --- a/libibverbs/verbs.c +++ b/libibverbs/verbs.c @@ -46,6 +46,7 @@ #include #include +#include #include "ibverbs.h" #ifndef NRESOLVE_NEIGH @@ -341,22 +342,18 @@ LATEST_SYMVER_FUNC(ibv_dereg_mr, 1_1, "IBVERBS_1.1", struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context) { + DECLARE_LEGACY_CORE_BUFS(IB_USER_VERBS_CMD_CREATE_COMP_CHANNEL); struct ibv_comp_channel *channel; - struct ibv_create_comp_channel cmd; - struct ib_uverbs_create_comp_channel_resp resp; channel = malloc(sizeof *channel); if (!channel) return NULL; - IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_COMP_CHANNEL, &resp, sizeof resp); - if (write(context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) { + if (execute_write(context, req, &resp)) { free(channel); return NULL; } - (void) VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp); - channel->context = context; channel->fd = resp.fd; channel->refcnt = 0;