From patchwork Wed Sep 16 15:56:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bodong Wang X-Patchwork-Id: 7196261 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 6BAB69F336 for ; Wed, 16 Sep 2015 15:56:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8168720890 for ; Wed, 16 Sep 2015 15:56:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F8042088F for ; Wed, 16 Sep 2015 15:56:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753696AbbIPP4f (ORCPT ); Wed, 16 Sep 2015 11:56:35 -0400 Received: from mail-ob0-f177.google.com ([209.85.214.177]:35104 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752031AbbIPP4e (ORCPT ); Wed, 16 Sep 2015 11:56:34 -0400 Received: by obbzf10 with SMTP id zf10so96960910obb.2 for ; Wed, 16 Sep 2015 08:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=mLHedFaHiMocbloFfs6kTOKJcQ+BipKcdP3Dpgw5BXY=; b=vLAcMqg1weAygqxT0GlunW96uw88sB8+YPQLB/mdtObvoscusPHIfHfGk7QnLR404H 2I+MltsQ3xp6l7b8SvlDYagRsJXk4Nkxv13lAoWrPSSEDbLHzlAqxifYHzkDgJW0fAED YNIBomwggAywkWAhzp/gsH+xA8J8H4x90H4re1DTWRaDVxJFVOJ65aT12h6i+vqV13GE s5m3L7QFafM+2qeJGnx2+QnJctXfXFm9aYFqEAe/zKD9lWWcUVKuWraOMkwHWepOX7jn kMoyE7cwebAcXPBFnJCEUnNvp8bIhAtdBWrBphDW5jB7Qu/MLRot2PQR8b4UQum5HQ3v aN0w== X-Received: by 10.60.175.41 with SMTP id bx9mr24263353oec.46.1442418993503; Wed, 16 Sep 2015 08:56:33 -0700 (PDT) Received: from localhost.localdomain ([207.140.101.5]) by smtp.gmail.com with ESMTPSA id op6sm11332402obb.11.2015.09.16.08.56.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 08:56:32 -0700 (PDT) From: Bodong Wang X-Google-Original-From: Bodong Wang To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, bodong@mellanox.com, ogerlitz@mellanox.com, jgunthorpe@obsidianresearch.com, moshel@mellanox.com, haggaie@mellanox.com, matanb@mellanox.com Subject: [PATCH 2/3] IB/uverbs: Add support for checksum capability reporting in user verbs Date: Wed, 16 Sep 2015 18:56:07 +0300 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 New field csum_cap is added to respective uverbs counterpart according to ib_verbs. Signed-off-by: Bodong Wang --- drivers/infiniband/core/uverbs_cmd.c | 7 +++++++ include/uapi/rdma/ib_user_verbs.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index bbb02ff..9d5deec 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -3464,6 +3464,13 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file, resp.hca_core_clock = attr.hca_core_clock; resp.response_length += sizeof(resp.hca_core_clock); + if (ucore->outlen < resp.response_length + sizeof(resp.csum_cap)) + goto end; + + resp.csum_cap.eth_csum_cap = attr.csum_cap.eth_csum_cap; + resp.csum_cap.ib_csum_cap = attr.csum_cap.ib_csum_cap; + resp.response_length += sizeof(resp.csum_cap); + end: err = ib_copy_to_udata(ucore, &resp, resp.response_length); if (err) diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 978841e..9d69546 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h @@ -218,6 +218,11 @@ struct ib_uverbs_odp_caps { __u32 reserved; }; +struct ib_uverbs_csum_cap_per_link { + __u32 eth_csum_cap; + __u32 ib_csum_cap; +}; + struct ib_uverbs_ex_query_device_resp { struct ib_uverbs_query_device_resp base; __u32 comp_mask; @@ -225,6 +230,7 @@ struct ib_uverbs_ex_query_device_resp { struct ib_uverbs_odp_caps odp_caps; __u64 timestamp_mask; __u64 hca_core_clock; /* in KHZ */ + struct ib_uverbs_csum_cap_per_link csum_cap; }; struct ib_uverbs_query_port {