From patchwork Sat Feb 20 07:47:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 8365821 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 F3E879F314 for ; Sat, 20 Feb 2016 07:48:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EC2F20511 for ; Sat, 20 Feb 2016 07:48:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F1F420513 for ; Sat, 20 Feb 2016 07:48:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758118AbcBTHso (ORCPT ); Sat, 20 Feb 2016 02:48:44 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35181 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758120AbcBTHsf (ORCPT ); Sat, 20 Feb 2016 02:48:35 -0500 Received: by mail-wm0-f45.google.com with SMTP id c200so105322649wme.0 for ; Fri, 19 Feb 2016 23:48:35 -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; bh=H/VxvQcNsrZioJluSccu+m2XEi7r/5Fxf7nbdrrOO/I=; b=HfpelZtnLsrCVcN1Nk0TLqFd4LsGFiuzjk18MNHwzPufP/t9w8YKStEOBk827uenIK J48i8q6/f5vuef2QUqqG6TyFWGcSvraHq00cEW4j6St/psdymRy/yDwrutEgKFseJNBO gHSg4upkVgapH+Pd8LPWwhFgx0GzxnTfSU2O8ErSmiLDfZ8oHfgf7o5NIIn7+gdAdewk TGUSrb8N3H129fbVi8tPr0GnQzNKnqMFuU/gV+5EZfBXr2OaXaJdVRQZNZcDK8zSOnU1 GBQxVoegRdrEe+G0g3Or4160uXp3QRXS9f5+fIya311i2VShLHhhDQtN2cwm6oUdn9Bd /9WQ== 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; bh=H/VxvQcNsrZioJluSccu+m2XEi7r/5Fxf7nbdrrOO/I=; b=RnAFjVPxmKnJlyJPeDkPYg1/9IrDo0S+HpqPYkUJjm35wrWhKPOQQuYZwUuCCsUY93 waTrPpCIxtwGedxuOcqCJlXdL3tNS8//r3Co2rgDVrf8dBgl1fMFSo7DafnuzGPw2yi7 Dzy/trdZ3YIF5bz0YS72NMOenQzbazsq7QiT6ox+PFv2K58vEVByUdEJzuhuxogJBqhG trZb/97jflDu/NwS7Fuzewto/iNZhoKJSlSYLUMqDTTMLliKkz36hDnoR0L3l8Fa3CRp A8fj87Zf74UHiHutD0pqZnIhy2bzRCvQQ1jHWCs7V5m8T6NZ3o1buWDf/pgzYH3J8j1h BDog== X-Gm-Message-State: AG10YOTwZQtSHdCvpQP8eX8JJv3u08B22xmQquAcokvNggU6rSYM/dKan+L/aec/yk4Xng== X-Received: by 10.28.2.68 with SMTP id 65mr1237810wmc.85.1455954514760; Fri, 19 Feb 2016 23:48:34 -0800 (PST) Received: from localhost ([213.57.247.249]) by smtp.gmail.com with ESMTPSA id jc7sm14526624wjb.33.2016.02.19.23.48.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Feb 2016 23:48:33 -0800 (PST) From: Leon Romanovsky To: dledford@redhat.com, saeedm@mellanox.com Cc: linux-rdma@vger.kernel.org, Leon Romanovsky Subject: [PATCH rdma-next 7/8] IB/core: Exposure supported CALC capabilities Date: Sat, 20 Feb 2016 09:47:44 +0200 Message-Id: <1455954465-15141-8-git-send-email-leon@leon.nu> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455954465-15141-1-git-send-email-leon@leon.nu> References: <1455954465-15141-1-git-send-email-leon@leon.nu> 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 Add support to return CALC capabilities. Signed-off-by: Leon Romanovsky Reviewed-by: Matan Barak --- drivers/infiniband/core/uverbs_cmd.c | 9 +++++++++ include/rdma/ib_verbs.h | 19 +++++++++++++++++++ include/uapi/rdma/ib_user_verbs.h | 8 ++++++++ 3 files changed, 36 insertions(+) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 3a3f573..3618ca5 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -3641,6 +3641,15 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file, resp.device_cap_flags2 = upper_32_bits(attr.device_cap_flags); resp.response_length += sizeof(resp.device_cap_flags2); + if (ucore->outlen < resp.response_length + sizeof(resp.calc_caps)) + goto end; + + resp.calc_caps.calc_matrix = attr.calc_caps.calc_matrix; + resp.calc_caps.max_vector_count = attr.calc_caps.max_vector_count; + resp.calc_caps.max_chunk_size = attr.calc_caps.max_chunk_size; + resp.calc_caps.op_cap = attr.calc_caps.op_cap; + resp.response_length += sizeof(resp.calc_caps); + end: err = ib_copy_to_udata(ucore, &resp, resp.response_length); return err; diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 51aabf8..1f74ebb 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -258,6 +258,24 @@ struct ib_odp_caps { } per_transport_caps; }; +enum ib_calc_operations { + IB_CALC_NONE, + IB_CALC_ADD, + IB_CALC_MAX, + IB_CALC_AND, + IB_CALC_OR, + IB_CALC_XOR, + IB_CALC_MIN, + IB_CALC_SWAP_ENDIANNESS +}; + +struct ib_calc_caps { + u32 calc_matrix; + u32 max_vector_count; + u32 max_chunk_size; + u32 op_cap; +}; + enum ib_cq_creation_flags { IB_CQ_FLAGS_TIMESTAMP_COMPLETION = 1 << 0, IB_CQ_FLAGS_IGNORE_OVERRUN = 1 << 1, @@ -315,6 +333,7 @@ struct ib_device_attr { struct ib_odp_caps odp_caps; uint64_t timestamp_mask; uint64_t hca_core_clock; /* in KHZ */ + struct ib_calc_caps calc_caps; }; enum ib_mtu { diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index e024c82..c88d8e2 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h @@ -219,6 +219,13 @@ struct ib_uverbs_odp_caps { __u32 reserved; }; +struct ib_uverbs_calc_caps { + __u32 calc_matrix; + __u32 max_vector_count; + __u32 max_chunk_size; + __u32 op_cap; +}; + struct ib_uverbs_ex_query_device_resp { struct ib_uverbs_query_device_resp base; __u32 comp_mask; @@ -231,6 +238,7 @@ struct ib_uverbs_ex_query_device_resp { * by __u32 variable. Need to increase this field */ __u64 device_cap_flags2; + struct ib_uverbs_calc_caps calc_caps; }; struct ib_uverbs_query_port {