From patchwork Thu Nov 22 23:24:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10694991 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 423D51926 for ; Thu, 22 Nov 2018 23:24:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32D1B2C196 for ; Thu, 22 Nov 2018 23:24:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 272A92C3A1; Thu, 22 Nov 2018 23:24:29 +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 179A92C2F0 for ; Thu, 22 Nov 2018 23:24:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439023AbeKWKGJ (ORCPT ); Fri, 23 Nov 2018 05:06:09 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:46504 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407892AbeKWKGI (ORCPT ); Fri, 23 Nov 2018 05:06:08 -0500 Received: by mail-pl1-f193.google.com with SMTP id t13so9786747ply.13 for ; Thu, 22 Nov 2018 15:24:25 -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:mime-version :content-transfer-encoding; bh=PO5gsxDfRQqnd/FhgbljdezpESz8hIEKdDDoiC4sjw4=; b=INK2WB4UzH/bMezVAKSh0/pWyO+rFEv+yc15iiuWQNQMlmUXkNPVRLxvmCm3Y0ARJS CVlV/RU7bhgoZ5f9jRJyRpeo2q1YPOB1iaFsjxuw9sDJp06ZJQ+otazcPW/Bz2ayW0Xd anAhAOSc2LQlm+a5J863a8uieF2Q1cW6Xp/WmsDrC6AummoQ2qrPQJ+PNVVhR54/bmIj EJHI0gnJZh+MpWpnRRYUFKmzGvQnOT+5rXsWFnTdTIijoLkfxM/NHab7X2rUjUCR+l79 WgKbopQBqcDlSg+DgSws5ykG32ZoVaBZ0rNrnhyk95KNXhcFLLyHDPOn7Jm3cIg423LH T43Q== 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:mime-version :content-transfer-encoding; bh=PO5gsxDfRQqnd/FhgbljdezpESz8hIEKdDDoiC4sjw4=; b=QIaGsvJvJ3hECXvRBQfK9KAg+7ZsXbX/gg4tV9yYNeMCmTCF655QerJOTkT5NDQnux FZI4eKOexM10BwY2b0xcJx96choY7Gvh+wpxG9AisuRRYMqQl6/7cwMMS0IoLlYxS63x 2tTKmuhKNt+jXb+kh9B6rTCfFbjKesV5gGyDVheT+701Xr4b2DW5gbR3rH/093nZbnR2 dgZ1rzMvVn1TrkQC5UYLnOPYZ0gaLY2Etsaht6/UW7cG77FDcgoDe1Ob45f0eZLJeu0Q 0YuZS8VaGjWqs4i8LH6c/uEgVGN3LwpOrQi76XuMvSJTBcC7DUuCBJILMA/tSp6j+dHI iKnA== X-Gm-Message-State: AA+aEWYi/QRlxgwRUuHXhXR16Q2Wyl0prH0L9iMTvOjKr+3nDIichDyt qJxiOSuTPNTLTFY3xNtFNbbtVWZpjFg= X-Google-Smtp-Source: AFSGD/US1mbjP6QW7XRWssLyee+ODtzS+35c7vBjczUP40mnay8IdFPsmg81s3QLqY1tDauUnRnAjA== X-Received: by 2002:a17:902:8a95:: with SMTP id p21mr8237753plo.183.1542929065305; Thu, 22 Nov 2018 15:24:25 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id y1-v6sm51918619pfb.81.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-0007sF-7t; Thu, 22 Nov 2018 16:24:18 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 00/10] Command execution rework Date: Thu, 22 Nov 2018 16:24:06 -0700 Message-Id: <20181122232416.30132-1-jgg@ziepe.ca> X-Mailer: git-send-email 2.19.1 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 series reworks all the places that execute commands to use a consistent set of helpers around write(). The helpers are designed to accept the location of all 5 buffers (hdr, cmd, drv_cmd, resp, drv_resp) involved with a command. This cleanup removes a bunch of duplicated code and paves the way to add more options for delivering commands to the kernel. It is the same theme as the new uverbs kernel series currently on the list. This is PR on github: https://github.com/linux-rdma/rdma-core/pull/434 Jason Gunthorpe (10): verbs: Fix wrong command structure usage verbs: Add explicit arguments to DECLARE_CMD_BUFFER_COMPAT() verbs: Move ibv_create_comp_channel to use execute_write verbs: Consolidate duplicate code in create_rwq_ind_table verbs: Replace IBV_INIT_CMD_RESP() with execute_cmd_write verbs: Replace IBV_INIT_CMD() with execute_cmd_write_resp verbs: Replace IBV_INIT_CMD_RESP_EX*() with execute_cmd_write_ex verbs: Replace execute_write with execute_cmd_write/_req verbs: Replace execute_write_ex with execute_cmd_ex/_resp verbs: use the execute_cmd_write/_ex path for the ioctl fallback CMakeLists.txt | 3 +- debian/control | 2 +- debian/libibverbs1.symbols | 2 +- libibverbs/cmd.c | 547 ++++++++++++++++--------------------- libibverbs/cmd_cq.c | 24 +- libibverbs/cmd_fallback.c | 77 +++--- libibverbs/cmd_ioctl.c | 1 + libibverbs/cmd_write.h | 204 ++++++++------ libibverbs/driver.h | 17 +- libibverbs/ibverbs.h | 49 ---- libibverbs/kern-abi.h | 6 +- libibverbs/verbs.c | 12 +- providers/mlx4/verbs.c | 49 +--- providers/mlx5/verbs.c | 72 ++--- 14 files changed, 458 insertions(+), 607 deletions(-)