From patchwork Wed Sep 16 15:56:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bodong Wang X-Patchwork-Id: 7196281 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1BD35BF036 for ; Wed, 16 Sep 2015 15:56:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 717C92087D for ; Wed, 16 Sep 2015 15:56:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8348720892 for ; Wed, 16 Sep 2015 15:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753742AbbIPP4g (ORCPT ); Wed, 16 Sep 2015 11:56:36 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:36031 "EHLO mail-ob0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753709AbbIPP4c (ORCPT ); Wed, 16 Sep 2015 11:56:32 -0400 Received: by obqa2 with SMTP id a2so153017051obq.3 for ; Wed, 16 Sep 2015 08:56:32 -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=VBS5F1eqKOoCeiXB0QrKwR8ct9nx/EMOl/KWmm4JmFY=; b=SRKC1HZBx/gWOY4XdqrvO/2OTxVuuCgPxvBU1WTBUBPCmpCG416hnjdaRmoC9Qze6s A0+PU+o87YJXoF9m7GE/HU6d2i1K82uC5nt5cH+klBELC5Ay58lAtcMnaIgooOy39HGC XN2ChuwM41h6pFuHLExbiazfcqc68bOlADPs45Jn0PDheF6daDGDNt6Dx4xk3+RIHKX1 ByCNpOrp/ZEiYQ7ins+mvqIMCZ1h0xiACycOCRIM0qhTZSC1GlnfzN+IocTZ5FfWUntU Zi30XjaFJFUTtSA2+neVKrE2pVJHZr07pdeBYVkItDVbgcerQeLwOHQMNIA5zyZp39aI pffg== X-Received: by 10.60.55.9 with SMTP id n9mr24107834oep.67.1442418992342; Wed, 16 Sep 2015 08:56:32 -0700 (PDT) Received: from localhost.localdomain ([207.140.101.5]) by smtp.gmail.com with ESMTPSA id op6sm11332402obb.11.2015.09.16.08.56.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 08:56:31 -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 1/3] IB/core: Add support of checksum capability reporting in ib verbs Date: Wed, 16 Sep 2015 18:56:06 +0300 Message-Id: <490a38ab04a96f24500d647392e931c38853ba45.1442413048.git.bodong@mellanox.com> 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 A new filed csum_cap is added to both ib_query_device. It contains two members: eth_csum_cap and ib_csum_cap, indicates checksum capability of Ethernet and Infiniband link layer respectively for different QP types. Current checksum caps use the following enum members: - IB_CSUM_SUPPORT_UD: device supports validation/calculation of csum for UD QP. - IB_CSUM_SUPPORT_RAW: device supports validation/calculation of csum for raw QP. Signed-off-by: Bodong Wang --- include/rdma/ib_verbs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index b0f898e..94dbaee 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -183,6 +183,11 @@ struct ib_cq_init_attr { u32 flags; }; +struct ib_csum_cap_per_link { + uint32_t eth_csum_cap; + uint32_t ib_csum_cap; +}; + struct ib_device_attr { u64 fw_ver; __be64 sys_image_guid; @@ -229,6 +234,7 @@ struct ib_device_attr { struct ib_odp_caps odp_caps; uint64_t timestamp_mask; uint64_t hca_core_clock; /* in KHZ */ + struct ib_csum_cap_per_link csum_cap; }; enum ib_mtu { @@ -868,6 +874,10 @@ enum ib_qp_create_flags { IB_QP_CREATE_RESERVED_END = 1 << 31, }; +enum ib_csum_cap_flags { + IB_CSUM_SUPPORT_UD = (1 << IB_QPT_UD), + IB_CSUM_SUPPORT_RAW = (1 << IB_QPT_RAW_PACKET), +}; /* * Note: users may not call ib_close_qp or ib_destroy_qp from the event_handler