public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Jeff Squyres (jsquyres)"
	<jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Upinder Malhi (umalhi)"
	<umalhi-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
	Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 2/2] Ad IB_MTU_1500|9000 enums.
Date: Fri, 19 Apr 2013 23:55:02 -0400	[thread overview]
Message-ID: <51721196.9040606@redhat.com> (raw)
In-Reply-To: <EF66BBEB19BADC41AC8CCF5F684F07FC44042439-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>

On 04/19/2013 11:24 AM, Jeff Squyres (jsquyres) wrote:
> On Apr 12, 2013, at 11:40 AM, Jeff Squyres (jsquyres) <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> wrote:
> 
>>> As an aside I like the use of RDMA_MTU_* for these values.  Again to distinguish them from the IBTA values.  But I know that is poor form.
>>
>> So what's the right way to move forward on this?  Is it this:
>>
>> enum ib_mtu {
>>       IB_MTU_256  = 1,
>>       IB_MTU_512  = 2,
>>       IB_MTU_1024 = 3,
>>       IB_MTU_2048 = 4,
>>       IB_MTU_4096 = 5,
>>       RDMA_MTU_1500 = 1500,
>>       RDMA_MTU_9000 =	9000
>> };
> 
> 
> Bump.
> 

This seems reasonable, but still concerns me a bit.  The original
version was flat out wrong because you can't re-arrange any exposed enum
like this without requiring that all user space apps be recompiled.
This is especially true because ibv_mtu_enum_to_int is an inline, so any
compiled programs won't have been updated by a shared library update,
yet the new enum values can end up showing up, so the apps break when
they start seeing -1 as the return value, or when they interpret 1500 as
2048, etc.

I wonder if the correct way forward isn't to leave these two functions
alone (as inlines you can't change them without a recompile anyway).
However, I would officially change the documentation to specify that
both enum ib_mtu in the queue_pair structs and the result of
ib_mtu_enum_to_int is not exact on non-IB link layers and is deprecated
in favor of a new function: ib_qp_mtu() (or similar) that takes a queue
pair and returns the real mtu for that queue pair based on params and
device the queue pair is on (I could also see it being
ibv_dev_mtu(struct ibv_device *) instead if you want to query the mtu
before you make a queue pair instead).  Then for both IBoE and USNIC
devices, I would just store the actual MTU in the internal ibv device
struct and return that when requested.

This maintains 100% back compatibility with existing apps but allows a
path for people to get better performance/utilization by using the new
function instead of the old one.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-04-20  3:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03 13:13 [PATCH 1/2] Add RDMA_*_USNIC enums for the Cisco Ethernet Virtual NIC Jeff Squyres
     [not found] ` <1364994796-10642-1-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2013-04-03 13:13   ` [PATCH 2/2] Ad IB_MTU_1500|9000 enums Jeff Squyres
     [not found]     ` <1364994796-10642-2-git-send-email-jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2013-04-03 16:52       ` Roland Dreier
     [not found]         ` <CAL1RGDUefwamQ2Gsm9QKC5+jxskxqE5orwNnbS_t060a+YXZDw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-03 17:13           ` Steve Wise
2013-04-04 12:22           ` Jeff Squyres (jsquyres)
     [not found]             ` <EF66BBEB19BADC41AC8CCF5F684F07FC43FE1631-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-04-04 12:31               ` Hal Rosenstock
     [not found]                 ` <515D728B.5010202-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2013-04-04 14:43                   ` Hefty, Sean
     [not found]                     ` <1828884A29C6694DAF28B7E6B8A823736F36B8B5-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-04 17:33                       ` Weiny, Ira
     [not found]                         ` <2807E5FD2F6FDA4886F6618EAC48510E0156FC7B-8k97q/ur5Z1cIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-04 17:43                           ` Hefty, Sean
     [not found]                             ` <1828884A29C6694DAF28B7E6B8A823736F36B9EA-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-04 17:57                               ` Weiny, Ira
     [not found]                                 ` <2807E5FD2F6FDA4886F6618EAC48510E0156FCB1-8k97q/ur5Z1cIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-08 21:56                                   ` Jeff Squyres (jsquyres)
     [not found]                                     ` <EF66BBEB19BADC41AC8CCF5F684F07FC43FFA8E0-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-04-08 22:16                                       ` Hefty, Sean
     [not found]                                         ` <1828884A29C6694DAF28B7E6B8A823736F36CCCA-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-09 22:27                                           ` Jeff Squyres (jsquyres)
     [not found]                                             ` <EF66BBEB19BADC41AC8CCF5F684F07FC43FFDBA8-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-04-09 23:59                                               ` Weiny, Ira
     [not found]                                                 ` <2807E5FD2F6FDA4886F6618EAC48510E01575317-8k97q/ur5Z1cIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-10  1:30                                                   ` Hefty, Sean
     [not found]                                                     ` <1828884A29C6694DAF28B7E6B8A823736F36D455-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-10  2:44                                                       ` Weiny, Ira
     [not found]                                                         ` <2807E5FD2F6FDA4886F6618EAC48510E015759CF-8k97q/ur5Z1cIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-12 18:40                                                           ` Jeff Squyres (jsquyres)
     [not found]                                                             ` <EF66BBEB19BADC41AC8CCF5F684F07FC4401EEDD-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-04-19 15:24                                                               ` Jeff Squyres (jsquyres)
     [not found]                                                                 ` <EF66BBEB19BADC41AC8CCF5F684F07FC44042439-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-04-20  3:55                                                                   ` Doug Ledford [this message]
     [not found]                                                                     ` <51721196.9040606-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-20 23:29                                                                       ` Hefty, Sean
     [not found]                                                                         ` <1828884A29C6694DAF28B7E6B8A823736FD1DD83-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-22 17:30                                                                           ` Doug Ledford
     [not found]                                                                             ` <517573C9.6050206-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-04-22 18:00                                                                               ` Jeff Squyres (jsquyres)
     [not found]                                                                                 ` <EF66BBEB19BADC41AC8CCF5F684F07FC440469B5-nsZYYkk5h5QQ2GdVW7+PtKBKnGwkPULj@public.gmane.org>
2013-04-22 20:00                                                                                   ` Doug Ledford
     [not found]                                                                                     ` <517596E3.4080000-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-05-02 10:43                                                                                       ` Jeff Squyres (jsquyres)
2013-04-09 20:10                                       ` Weiny, Ira
     [not found]                                         ` <2807E5FD2F6FDA4886F6618EAC48510E015748E1-8k97q/ur5Z1cIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-04-09 22:29                                           ` Jeff Squyres (jsquyres)

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=51721196.9040606@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=umalhi-FYB4Gu1CFyUAvxtiuMwx3w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox