All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH libibverbs V3 2/3] Use neighbour lookup for RoCE UD QPs Eth L2 resolution
Date: Thu, 8 May 2014 13:29:07 -0600	[thread overview]
Message-ID: <20140508192907.GC25849@obsidianresearch.com> (raw)
In-Reply-To: <1399531883-30599-3-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On Thu, May 08, 2014 at 09:51:22AM +0300, Or Gerlitz wrote:

> In order to implement RoCE IP based addressing for UD QPs, without
> introducing uverbs changes, we need a way to resolve the L2 Ethernet
> addresses from user-space.

Please put anything that changes the public verbs ABI in a seperate
patch.

Burying the create_ah_ex stuff in this giant thing is not condusive to
reviewing the ABI portion.

The ABI is *important* do everything you can to bring as many eyes as
possible to those changes!!

> +struct ibv_ah_attr_ex {
> +	struct ibv_global_route	grh;
> +	uint16_t		dlid;
> +	uint8_t			sl;
> +	uint8_t			src_path_bits;
> +	uint8_t			static_rate;
> +	uint8_t			is_global;
> +	uint8_t			port_num;
> +	uint32_t		comp_mask;
> +	struct {
> +		enum ll_address_type type;
> +		uint32_t	len;
> +		char		*address;
> +	} ll_address;
> +	uint16_t		vid;
> +};

The above looks sorta reasonable, but:

What is the 'char *address'? Should it be 'const void *' ?????

Who owns that memory? Who allocates it, who frees it? Seems sketchy
as heck.

What happens if a ibv_ah_attr_ex is returned in some kind of
ibv_qp_attr_ex structure from a future query_qp?

Can you just put in a 'uint64_t address[8];' or sockaddr_storage, or
something?

> +
>  enum ibv_srq_attr_mask {
>  	IBV_SRQ_MAX_WR	= 1 << 0,
>  	IBV_SRQ_LIMIT	= 1 << 1
> @@ -968,11 +998,14 @@ enum verbs_context_mask {
>  	VERBS_CONTEXT_QP	= 1 << 2,
>  	VERBS_CONTEXT_CREATE_FLOW = 1 << 3,
>  	VERBS_CONTEXT_DESTROY_FLOW = 1 << 4,
> -	VERBS_CONTEXT_RESERVED	= 1 << 5
> +	VERBS_CONTEXT_CREATE_AH = 1 << 5,
> +	VERBS_CONTEXT_RESERVED	= 1 << 6
>  };

What is going on here??

verbs_context_mask is messed up already!?

It is NOT supposed to be a mask if the function is available - we
can already test for NULL for that.

It is supposed to indicate if structures *allocated by the provider*
are extended. 

For instance if VERBS_CONTEXT_QP is set, then everyone knows that the
'struct ibv_qp' returned by *any* driver function (crate_qp, open_qp,
create_qp_ex) is convertible to 'verbs_qp'.

VERBS_CONTEXT_CREATE_FLOW/VERBS_CONTEXT_DESTROY_FLOW are screwed
up. They shouldn't even exist, there is no unextended ibv_flow
structure to worry about.

Fix this patch to not add VERBS_CONTEXT_CREATE_AH, ibv_ah_attr_ex is
not a provider allocated structure so it doesn't need an entry.

Please send a patch to remove the screwed up two above and replace
with RESERVED.

And BE MORE CAREFUL. THIS SHOULD NOT HAVE HAPPENED!

Jason
--
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:[~2014-05-08 19:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  6:51 [PATCH libibverbs V3 0/3] Add support for UD QPs under RoCE IP addressing Or Gerlitz
     [not found] ` <1399531883-30599-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-05-08  6:51   ` [PATCH libibverbs V3 1/3] Add ibv_port_cap_flags Or Gerlitz
2014-05-08  6:51   ` [PATCH libibverbs V3 2/3] Use neighbour lookup for RoCE UD QPs Eth L2 resolution Or Gerlitz
     [not found]     ` <1399531883-30599-3-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-05-08 19:29       ` Jason Gunthorpe [this message]
2014-05-08  6:51   ` [PATCH libibverbs V3 3/3] Add ibv_query_port_ex support Or Gerlitz
     [not found]     ` <1399531883-30599-4-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-05-08 19:09       ` Jason Gunthorpe
     [not found]         ` <20140508190951.GB25849-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-05-08 19:40           ` Christoph Lameter
     [not found]             ` <alpine.DEB.2.10.1405081439370.26267-gkYfJU5Cukgdnm+yROfE0A@public.gmane.org>
2014-05-08 19:47               ` Jason Gunthorpe
2014-05-09 14:01           ` Roland Dreier
     [not found]             ` <CAL1RGDUiBtOaYKZVR3ghOZzG6J0p5EV5o4FTTW0E43mHz-BaVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-09 18:10               ` Jason Gunthorpe
     [not found]                 ` <20140509181043.GC18257-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-05-09 18:20                   ` Roland Dreier
     [not found]                     ` <CAL1RGDVmeTKz1TXGLP+h4t9ffuaVeBCkWKPC2AuFyygcNweRWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-09 18:39                       ` Hefty, Sean
2014-05-09 18:40                       ` Jason Gunthorpe
2014-05-11 12:35                   ` Or Gerlitz
     [not found]                     ` <536F6EAC.8020109-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-05-12  6:35                       ` Jason Gunthorpe
2014-05-12 12:22           ` Matan Barak
     [not found]             ` <5370BCF2.7050107-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-05-12 16:43               ` Jason Gunthorpe
     [not found]                 ` <20140512164323.GA20666-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-05-12 21:57                   ` Roland Dreier
     [not found]                     ` <CAL1RGDXYwPHrS7dSWg0ojyiPG7TF1Y0800q801kWvMxoyn3c8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-13 13:18                       ` Doug Ledford
     [not found]                     ` <23840589.5954.1399987081862.JavaMail."DougLedford"@Phenom>
2014-05-13 20:02                       ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
2014-05-08 20:05 [PATCH libibverbs V3 2/3] Use neighbour lookup for RoCE UD QPs Eth L2 resolution Or Gerlitz
     [not found] ` <CAJZOPZLrLL444ce_hXdnN5_JPfUVAy_Qsj+eVo2-YG3Jqqe01Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-08 20:15   ` Jason Gunthorpe
     [not found]     ` <20140508201549.GA32622-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2014-05-08 20:22       ` Or Gerlitz
     [not found]         ` <CAJZOPZJzcvQLar+Hkgbg3CGhVGrydsbgomocpiEAagan63MmdA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-08 20:46           ` Jason Gunthorpe
2014-05-09 14:03       ` Roland Dreier

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=20140508192907.GC25849@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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.