From patchwork Tue Jan 6 08:30:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 5572101 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 BC0AD9F2ED for ; Tue, 6 Jan 2015 08:31:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DF04201DD for ; Tue, 6 Jan 2015 08:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 814B0201BC for ; Tue, 6 Jan 2015 08:31:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932073AbbAFIbJ (ORCPT ); Tue, 6 Jan 2015 03:31:09 -0500 Received: from [193.47.165.129] ([193.47.165.129]:44121 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754263AbbAFIbI (ORCPT ); Tue, 6 Jan 2015 03:31:08 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from ogerlitz@mellanox.com) with ESMTPS (AES256-SHA encrypted); 6 Jan 2015 10:30:15 +0200 Received: from r-vnc04.mtr.labs.mlnx (r-vnc04.mtr.labs.mlnx [10.208.0.116]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t068UE9k021111; Tue, 6 Jan 2015 10:30:14 +0200 From: Or Gerlitz To: Roland Dreier Cc: linux-rdma@vger.kernel.org, Tal Alon , Moshe Lazer , Eyal Perry , Or Gerlitz Subject: [PATCH libibverbs] Add IP and TCP/UDP TX checksum offload support Date: Tue, 6 Jan 2015 10:30:11 +0200 Message-Id: <1420533011-28483-1-git-send-email-ogerlitz@mellanox.com> X-Mailer: git-send-email 1.7.8.2 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: Moshe Lazer Add a device capability flag IB_DEVICE_IP_SUM to denote checksum offload support. Devices should set this flag if they support insertion of IP, TCP and UDP checksums on outgoing IP packets sent over IB UD or ETH RAW_PACKET QPs. In addition add a send flag IBV_SEND_IP_CSUM to utilize this capability. Signed-off-by: Eyal Perry Signed-off-by: Moshe Lazer Signed-off-by: Or Gerlitz --- include/infiniband/verbs.h | 4 +++- man/ibv_post_send.3 | 4 ++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h index cfa1156..78b5997 100644 --- a/include/infiniband/verbs.h +++ b/include/infiniband/verbs.h @@ -115,6 +115,7 @@ enum ibv_device_cap_flags { IBV_DEVICE_RC_RNR_NAK_GEN = 1 << 12, IBV_DEVICE_SRQ_RESIZE = 1 << 13, IBV_DEVICE_N_NOTIFY_CQ = 1 << 14, + IBV_DEVICE_IP_CSUM = 1 << 18, IBV_DEVICE_XRC = 1 << 20, IBV_DEVICE_MANAGED_FLOW_STEERING = 1 << 29 }; @@ -627,7 +628,8 @@ enum ibv_send_flags { IBV_SEND_FENCE = 1 << 0, IBV_SEND_SIGNALED = 1 << 1, IBV_SEND_SOLICITED = 1 << 2, - IBV_SEND_INLINE = 1 << 3 + IBV_SEND_INLINE = 1 << 3, + IBV_SEND_IP_CSUM = 1 << 4 }; struct ibv_sge { diff --git a/man/ibv_post_send.3 b/man/ibv_post_send.3 index 33fbb50..8070996 100644 --- a/man/ibv_post_send.3 +++ b/man/ibv_post_send.3 @@ -98,6 +98,10 @@ The attribute send_flags describes the properties of the \s-1WR\s0. It is either .TP .B IBV_SEND_INLINE \fR Send data in given gather list as inline data in a send WQE. Valid only for Send and RDMA Write. The L_Key will not be checked. +.TP +.B IBV_SEND_IP_CSUM \fR Offload the IP and TCP/UDP checksum calculation. +Valid only for QPs with Transport Service Type \fBIBV_QPT_UD\fR or \fBIBV_QPT_RAW_PACKET\fR. +This feature supported only when \fBIBV_DEVICE_IP_CSUM\fR the flag is set in the device capability flags. .SH "RETURN VALUE" .B ibv_post_send() returns 0 on success, or the value of errno on failure (which indicates the failure reason).