All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Yishai Hadas <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: Wed, 9 Sep 2015 11:20:14 -0400	[thread overview]
Message-ID: <55F04E2E.5050100@redhat.com> (raw)
In-Reply-To: <CAJ3xEMheigQt29mmb50PKHsXfx8pXMex+3bgJeobF0JBAjHsNQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

On 09/05/2015 03:59 PM, Or Gerlitz wrote:
> On Sat, Sep 5, 2015 at 2:41 AM, Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>> 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?
> 
> Doug,
> 
> The context here is the ability of the user-space RDMA verbs
> infrastructure to serve as the baseline for implementing user-space
> TCP/IP offloads engines.

Fine.

> Such engines would be production worthy in
> open-systems environments mostly when they are inter-operable which
> whatever stack runs on the other end

OK.

> --> they must not put any
> additional bits on the wire

Maybe.  For base level interop, sure, but for enhanced service in a
homogeneous environment, not necessarily true.

> --> RC isn't an option

Not following here Or.  The IPoIB connected mode packet is 4 byte IPoIB
Header followed by whatever header the TCP stack put on the packet
(likely either IPv4 or IPv6).  The same ipoib_hard_header function is
used for both CM and UD connections, the same ipoib_start_xmit() is used
for both CM and UD connections, and we just hand off to the appropriate
send routine when we have our neighbor lookup complete.  Why would you
need new bits on the wire to do a checksum on an RC send and not for a
UD send?

>, so for IPoIB we
> just need an IPoIB UD QP in user space, and for Ethernet RAW PACKET
> QP. This device capability is there  ~10y for IB UD and we just
> naturally extend it to Eth RAW. If/when a vendor comes up with
> supporting csum for RC, we can add another dev cap and say the well
> established API applies on them too, with just a slight modification
> to man pages and such, makes sense?

So if we ever support RC, then any actual users of this API will have
hardcoded which types of QPs are supported into their apps and they will
*all* have to go modify their source code to re-hardcode the types into
their app and recompile.

Alternatively, we write a reasonable API.  One where the types of QPs
are not set in stone, we tell users to query the API to determine if any
given QP supports IP CSUM offloads, and then if we add more QP types in
the future, the apps just automatically work even on the different QP
types (assuming they used those QP types at all) because it was written
to an API that allowed for it.

Face it Or, the API in this patchset is crap.  I totally get why you are
fighting for it so hard.  You already spelled it out: "This device
capability is there  ~10y for IB UD and we just naturally extend it to
Eth RAW".  I can read between the lines.  You have users of the API,
probably some internal and some external, and if I go demanding a proper
API, all of these people have to recode their apps to the new API, and
you'd like to avoid that if possible.  However, if I don't, and then RC
support is added, then they have to recode their apps anyway.  Wouldn't
it be best to just do it right and get it over with?

So, here's the API I'm proposing:

- Add ibv_query_qp_ex
- In new ibv_query_qp_ex struct, extend the ibv_qp_caps struct to add a
flags element
- Define a flag for IP_CSUM_SUPPORTED
- Define IP_CSUM flag for send operations
- Define the API so that IP_CSUM is ignored on all sends if the QP
doesn't support IP_CSUM and only checked on QPs that support it.  This
way other QP types don't suffer a penalty on send to check this and
return EINVAL if its set
- Define the return flags in the wc struct so we can signal that a CSUM
was performed and succeeded

A user app would then basically follow this flow:

ibv_create_qp()
ibv_query_qp()
  check for IP CSUM and cache result
ibv_post_send()
  set IP_CSUM if QP supports it

ibv_poll_cq()
  if qp supports IP_CSUM, check CSUM result in wc

That's what I would like to see for these changes.

-- 
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-09 15:20 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
     [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 [this message]
     [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=55F04E2E.5050100@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=bodong-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@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.