All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	Moshe Lazer <moshel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH libibverbs] Add support for TX/RX checksum offload
Date: Fri, 4 Sep 2015 19:41:49 -0400	[thread overview]
Message-ID: <55EA2C3D.2080904@redhat.com> (raw)
In-Reply-To: <1439826618-3015-1-git-send-email-bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 4237 bytes --]

On 08/17/2015 11:50 AM, Bodong Wang wrote:
> Add a device capability flag IBV_DEVICE_IP_CSUM to denote IPv4 checksum
> offload support. Devices should set this flag if they support
> insertion/verification of IPv4, TCP and UDP checksums on
> outgoing/incoming IPv4 packets sent over IB UD or ETH RAW PACKET QPs.

Correct me if I'm wrong, but the only reason this is only supported on
UD and RAW ETH QPs is a matter of current firmware.  There's no reason
it couldn't be supported on RC, right?

I know I'm probably not going to get an answer to that before I'm done
doing what I'm going to do, so I'm going to write a patch on the basis
that the above is true.  Because if it is, then I *really* don't like
putting the QP types supported into the API.  Instead, I think this
calls for a query_qp_ex verb to be added, and a new struct item,
qp_caps, and in that we can signal if this specific QP supports IP
checksum offload.

> 
> Flags IBV_SEND_IP_CSUM and IBV_WC_IP_CSUM_OK are added for utilizing this
> capability for send and receive separately.
> 
> Change-Id: Ie02d708dcbef07ca0d2eac1b156f12aafdba6a97
> Signed-off-by: Moshe Lazer <moshel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  include/infiniband/verbs.h | 11 +++++++++--
>  man/ibv_poll_cq.3          |  3 +++
>  man/ibv_post_send.3        |  4 ++++
>  3 files changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h
> index 28e1586..6ae7e6e 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
>  };
> @@ -314,9 +315,14 @@ enum ibv_wc_opcode {
>  	IBV_WC_RECV_RDMA_WITH_IMM
>  };
>  
> +enum {
> +	IBV_WC_IP_CSUM_OK_SHIFT	= 2
> +};
> +
>  enum ibv_wc_flags {
>  	IBV_WC_GRH		= 1 << 0,
> -	IBV_WC_WITH_IMM		= 1 << 1
> +	IBV_WC_WITH_IMM		= 1 << 1,
> +	IBV_WC_IP_CSUM_OK	= 1 << IBV_WC_IP_CSUM_OK_SHIFT
>  };
>  
>  struct ibv_wc {
> @@ -653,7 +659,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_poll_cq.3 b/man/ibv_poll_cq.3
> index 57c6daa..539940d 100644
> --- a/man/ibv_poll_cq.3
> +++ b/man/ibv_poll_cq.3
> @@ -50,6 +50,9 @@ It is either 0 or the bitwise OR of one or more of the following flags:
>  .B IBV_WC_GRH \fR      GRH is present (valid only for UD QPs)
>  .TP
>  .B IBV_WC_WITH_IMM \fR Immediate data value is valid
> +.TP
> +.B IBV_WC_IP_CSUM_OK \fR TCP/UDP checksum over IPv4 and IPv4 header checksum are verified.
> +This feature is supported only when \fBIBV_DEVICE_IP_CSUM\fR flag is set in the device capability flags.
>  .PP
>  Not all
>  .I wc
> diff --git a/man/ibv_post_send.3 b/man/ibv_post_send.3
> index 33fbb50..3b07bcb 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 IPv4 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).
> 


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  parent reply	other threads:[~2015-09-04 23:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-17 15:50 [PATCH libibverbs] Add support for TX/RX checksum offload Bodong Wang
     [not found] ` <1439826618-3015-1-git-send-email-bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-09-04 23:41   ` Doug Ledford [this message]
     [not found]     ` <55EA2C3D.2080904-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-05 19:59       ` Or Gerlitz
     [not found]         ` <CAJ3xEMheigQt29mmb50PKHsXfx8pXMex+3bgJeobF0JBAjHsNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-09 15:20           ` Doug Ledford
     [not found]             ` <55F04E2E.5050100-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-09-10  7:10               ` Or Gerlitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55EA2C3D.2080904@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=moshel-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.