public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: "Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "linux-rdma
	(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
Subject: Re: [PATCH 4/5] rdma/cm: Update port reservation to support AF_IB
Date: Thu, 1 Dec 2011 10:49:05 +0200	[thread overview]
Message-ID: <4ED73F81.6060605@mellanox.com> (raw)
In-Reply-To: <1828884A29C6694DAF28B7E6B8A8237316E8D150-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>

On 11/4/2011 9:08 AM, Hefty, Sean wrote:
> +static struct idr *cma_select_ib_ps(struct rdma_id_private *id_priv)
> [...]
> +	if (ps) {
> +		sib->sib_sid = cpu_to_be64(sid_ps | ntohs(cma_port((struct sockaddr *) sib)));
> +		sib->sib_sid_mask = cpu_to_be64(RDMA_IB_IP_PS_MASK | sib->sib_sid_mask);
> +	}
> +	return ps;

looks like ntohs(cma_port((struct sockaddr *) sib)) introduced this sparse warning

> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer
> drivers/infiniband/core/cma.c:2338:37: warning: restricted __be64 
> degrades to integer


>
> +}
> +
> +static int cma_get_port(struct rdma_id_private *id_priv)
> +{
> +	struct idr *ps;
> +	int ret;
> +
> +	if (id_priv->id.route.addr.src_addr.ss_family != AF_IB)
> +		ps = cma_select_inet_ps(id_priv);
> +	else
> +		ps = cma_select_ib_ps(id_priv);
> +	if (!ps)
> +		return -EPROTONOSUPPORT;
> +
>   	mutex_lock(&lock);
>   	if (cma_any_port((struct sockaddr *)&id_priv->id.route.addr.src_addr))
>   		ret = cma_alloc_any_port(ps, id_priv);
> diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
> index 51988f8..5eb3179 100644
> --- a/include/rdma/rdma_cm.h
> +++ b/include/rdma/rdma_cm.h
> @@ -70,6 +70,11 @@ enum rdma_port_space {
>   	RDMA_PS_UDP   = 0x0111,
>   };
>
> +#define RDMA_IB_IP_PS_MASK   0xFFFFFFFFFFFF0000ULL
> +#define RDMA_IB_IP_PS_TCP    0x0000000001060000ULL
> +#define RDMA_IB_IP_PS_UDP    0x0000000001110000ULL
> +#define RDMA_IB_IP_PS_IB     0x00000000013F0000ULL
> +
>   struct rdma_addr {
>   	struct sockaddr_storage src_addr;
>   	struct sockaddr_storage dst_addr;
>
>
> --
> 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

--
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:[~2011-12-01  8:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-04  7:08 [PATCH 4/5] rdma/cm: Update port reservation to support AF_IB Hefty, Sean
     [not found] ` <1828884A29C6694DAF28B7E6B8A8237316E8D150-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-12-01  8:37   ` Or Gerlitz
     [not found]     ` <4ED73CAE.9080805-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-12-01 18:14       ` Hefty, Sean
2011-12-01  8:49   ` Or Gerlitz [this message]
     [not found]     ` <4ED73F81.6060605-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-12-01 18:31       ` Hefty, Sean
2011-12-02 22:41       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373256521A6-P5GAC/sN6hlcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-12-03 22:12           ` 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=4ED73F81.6060605@mellanox.com \
    --to=ogerlitz-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@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