From patchwork Sat Jan 16 15:53:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 8049211 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6F3279F716 for ; Sat, 16 Jan 2016 15:56:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B9522034C for ; Sat, 16 Jan 2016 15:56:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 749E120357 for ; Sat, 16 Jan 2016 15:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941AbcAPP4f (ORCPT ); Sat, 16 Jan 2016 10:56:35 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36894 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316AbcAPP4Y (ORCPT ); Sat, 16 Jan 2016 10:56:24 -0500 Received: by mail-wm0-f49.google.com with SMTP id n5so6135126wmn.0 for ; Sat, 16 Jan 2016 07:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leon-nu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=he+Gqu9u5RQNDeKm/TZ4sF43U1N/OPWg4RuiiY++sj8=; b=QkELTad96YmIOnltaMNIEbmipfcscwSLNvT7WEjiExvGjEGcpEETSQb4PZLtJ9GMUp hhZ7vfeldiY1Z9cDfbBel+9sEYruYihbe0scjD2tQ8hFbXkpG2yPMhAcBMtJTdztaNxm 7cARAaRyZLd11Q25IfpuV8tSUYkRF5TEdtriRjcQw1kNdY0ZfdL3i0EixlXFh9mNU03Z AmEIkrrk+IMSLinDhXqMEAgK8MBwDrplqPI257MYgyfmJICxujIidRTJ3dzM3IOS5nck QrqXfXOxRrOY4c9d0Ri7crxLr/h533LtBn4pBtIYztyiKXapcrZSJka8bEZ0kvv+Hpuw yNBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=he+Gqu9u5RQNDeKm/TZ4sF43U1N/OPWg4RuiiY++sj8=; b=IU+3Qt7hOFgEKQhH2B0+L9V7p5hgR0/Yv4YLcBUtpzUjaSyFDQDfTjVvD7Y4YSt1v4 YdGF5070qx5y2vkZ1o0r7iyzC6C1q78bSvTzo8lmAG4mEzLecg6od/wpjTWpfV26SbBK zcWaqu0gjg9UyfiBJwsQN4Hb9gOAR4O2xsgff2DLD3lcVPRBM7hbXKeRSAKSFu1kt+Oy P9i2clTzGptO7s2dPtIb4cm3CNaewfNyaxyZ4Lxlm5BgDQymIrX0YxXbcEOH+DEAwpNF lpJsQ2Yf2iSr4Bgnvy1vnlDFP2MIC3CLKE/woOAsb7O2GyNJs/ndq4S/DM9hiebwQIDS LQzQ== X-Gm-Message-State: AG10YOQge1cV1OWNKPi4h8PlNwJ6V9sU25NT77L+2mQRlriZ3XAab0i9RYVHGZ6A/EFfDw== X-Received: by 10.28.11.77 with SMTP id 74mr4570356wml.36.1452959782558; Sat, 16 Jan 2016 07:56:22 -0800 (PST) Received: from localhost ([213.57.247.249]) by smtp.gmail.com with ESMTPSA id da10sm15511396wjb.22.2016.01.16.07.56.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jan 2016 07:56:21 -0800 (PST) From: Leon Romanovsky To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Leon Romanovsky Subject: [PATCH libibverbs V1 2/5] Add cross-channel QP flags Date: Sat, 16 Jan 2016 17:53:41 +0200 Message-Id: <1452959624-29454-3-git-send-email-leon@leon.nu> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452959624-29454-1-git-send-email-leon@leon.nu> References: <1452959624-29454-1-git-send-email-leon@leon.nu> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Leon Romanovsky The cross-channel feature allows to execute WQEs that involve synchronization of IO operations’ on different QPs. This capability enables to program complex flows with a single function call, hereby significantly reducing overhead associated with IO processing. The queue pairs can be configured to work as a “sync master queue” or “sync slave queues”. QP property flags to indicate if queues are slave or master: * IB_QP_CREATE_MANAGED_SEND indicates that posted send work requests will not be executed immediately and requires enabling. * IB_QP_CREATE_MANAGED_RECV indicates that posted receive work requests will not be executed immediately and requires enabling. * IB_QP_CREATE_CROSS_CHANNEL declares the QP to work in cross-channel mode. If IB_QP_CREATE_MANAGED_SEND and IB_QP_CREATE_MANAGED_RECV are not provided, this QP will be sync master queue, else it will be sync slave. * IBV_QP_CREATE_IGNORE_SQ_OVERFLOW configures QP to discard overflow indications on send queue. * IBV_QP_CREATE_IGNORE_RQ_OVERFLOW instructs QP to discard overflow indications on receive queue. Signed-off-by: Leon Romanovsky Reviewed-by: Sagi Grimberg --- include/infiniband/verbs.h | 5 +++++ man/ibv_create_qp_ex.3 | 18 ++++++++++++++++-- src/cmd.c | 5 ++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index 466d779592bf..7e85de08bfc9 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -769,6 +769,11 @@ enum ibv_qp_init_attr_mask { enum ibv_qp_create_flags { IBV_QP_CREATE_BLOCK_SELF_MCAST_LB = 1 << 1, + IBV_QP_CREATE_CROSS_CHANNEL = 1 << 2, + IBV_QP_CREATE_MANAGED_SEND = 1 << 3, + IBV_QP_CREATE_MANAGED_RECV = 1 << 4, + IBV_QP_CREATE_IGNORE_SQ_OVERFLOW = 1 << 5, + IBV_QP_CREATE_IGNORE_RQ_OVERFLOW = 1 << 6 }; struct ibv_qp_init_attr_ex { diff --git a/man/ibv_create_qp_ex.3 b/man/ibv_create_qp_ex.3 index f772a57b4c55..b80a586306c7 100644 --- a/man/ibv_create_qp_ex.3 +++ b/man/ibv_create_qp_ex.3 @@ -1,6 +1,6 @@ .\" -*- nroff -*- .\" -.TH IBV_CREATE_QP_EX 3 2013-06-26 libibverbs "Libibverbs Programmer's Manual" +.TH IBV_CREATE_QP_EX 3 2015-12-27 libibverbs "Libibverbs Programmer's Manual" .SH "NAME" ibv_create_qp_ex, ibv_destroy_qp \- create or destroy a queue pair (QP) .SH "SYNOPSIS" @@ -47,6 +47,16 @@ uint32_t max_recv_sge; /* Requested max number of s/g elements uint32_t max_inline_data;/* Requested max number of data (bytes) that can be posted inline to the SQ, otherwise 0 */ .in -8 }; +.sp +.mf +enum ibv_qp_create_flags { + IBV_QP_CREATE_BLOCK_SELF_MCAST_LB = 1 << 1, + IBV_QP_CREATE_CROSS_CHANNEL = 1 << 2, /* Set QP to work in cross-channel mode */ + IBV_QP_CREATE_MANAGED_SEND = 1 << 3, /* Send work request posted to this QP won't be executed immediately and requires enabling /* + IBV_QP_CREATE_MANAGED_RECV = 1 << 4, /* Receive work request posted to this QP won't be executed immediately and requires enabling */ + IBV_QP_CREATE_IGNORE_SQ_OVERFLOW = 1 << 5, /* Configure QP to discard overflow indications on send queue */ + IBV_QP_CREATE_IGNORE_RQ_OVERFLOW = 1 << 6 /* Configure QP to discard overflow indications on receive queue */ +}; .fi .PP The function @@ -80,4 +90,8 @@ fails if the QP is attached to a multicast group. .BR ibv_query_qp (3) .SH "AUTHORS" .TP -Yishai Hadas +Yishai Hadas +.RI < yishaih@mellanox.com > +.TP +Leon Romanovsky +.RI < leonro@mellanox.com > diff --git a/src/cmd.c b/src/cmd.c index 675777a8ee5a..ae33491befb4 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -815,7 +815,10 @@ static void create_qp_handle_resp_common(struct ibv_context *context, } enum { - CREATE_QP_EX2_SUP_CREATE_FLAGS = IBV_QP_CREATE_BLOCK_SELF_MCAST_LB, + CREATE_QP_EX2_SUP_CREATE_FLAGS = IBV_QP_CREATE_BLOCK_SELF_MCAST_LB | + IBV_QP_CREATE_CROSS_CHANNEL | + IBV_QP_CREATE_MANAGED_SEND | + IBV_QP_CREATE_MANAGED_RECV }; int ibv_cmd_create_qp_ex2(struct ibv_context *context,