All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: Paul Bolle <pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
Cc: Steve Wise <swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>,
	Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Hal Rosenstock
	<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Vipul Pandya <vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Subject: Re: infiniband: cxgb4: GCC warnings for 32 bit
Date: Tue, 05 Feb 2013 10:45:55 -0600	[thread overview]
Message-ID: <51113743.6050403@opengridcomputing.com> (raw)
In-Reply-To: <1360082216.14826.17.camel-uMdlDhfIn7prKue/0VVhAg@public.gmane.org>

On 2/5/2013 10:36 AM, Paul Bolle wrote:
> On Tue, 2013-02-05 at 09:46 -0600, Steve Wise wrote:
>> On 2/5/2013 4:15 AM, Paul Bolle wrote:
>>> And why is 'cookie' __u64? Is struct cpl_fw6_msg_ofld_connection_wr_rpl
>>> used in userspace code? Can't 'cookie' be of type "struct sk_buff *"? Is
>>> there a requirement for it to be 64 bits wide on both 32 bit and 64 bit?
>> In general, these fields are __ types to highlight the fact that they
>> define an interface between the host driver and adapter firmware.
> That's something new for me. Is that a custom for infiniband drivers or
> is it used throughout the tree?

I'm not too sure how standardized this is.  I think its SOP for Chelsio 
drivers. :)

>> These
>> "cookie" fields are opaque to the firmware.  They are passed to firmware
>> in a work request and then reflected back to the host in the reply to
>> the work request.  Given this, I think there are two issues:
>>
>> 1) no swapping is really needed.  The values are opaque to firmware, and
>> thus can stay in host byte order.
>>
>> 2) to remove the warning, we need something like:
>>
>> req->cookie = (unsigned long)skb;
>>
>> and
>>    
>> rpl_skb = (struct sk_buff *)(unsigned long)req->cookie;
> That's is exactly what I came up with to silence these warnings. But I
> didn't dare to submit it because I was too puzzled with the current
> code. Anyhow, should I submit the (trivial) patch to fix this?

Sure.  Thanks.

Steve.
--
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

WARNING: multiple messages have this Message-ID (diff)
From: Steve Wise <swise@opengridcomputing.com>
To: Paul Bolle <pebolle@tiscali.nl>
Cc: Steve Wise <swise@chelsio.com>, Roland Dreier <roland@kernel.org>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vipul Pandya <vipul@chelsio.com>
Subject: Re: infiniband: cxgb4: GCC warnings for 32 bit
Date: Tue, 05 Feb 2013 10:45:55 -0600	[thread overview]
Message-ID: <51113743.6050403@opengridcomputing.com> (raw)
In-Reply-To: <1360082216.14826.17.camel@x61.thuisdomein>

On 2/5/2013 10:36 AM, Paul Bolle wrote:
> On Tue, 2013-02-05 at 09:46 -0600, Steve Wise wrote:
>> On 2/5/2013 4:15 AM, Paul Bolle wrote:
>>> And why is 'cookie' __u64? Is struct cpl_fw6_msg_ofld_connection_wr_rpl
>>> used in userspace code? Can't 'cookie' be of type "struct sk_buff *"? Is
>>> there a requirement for it to be 64 bits wide on both 32 bit and 64 bit?
>> In general, these fields are __ types to highlight the fact that they
>> define an interface between the host driver and adapter firmware.
> That's something new for me. Is that a custom for infiniband drivers or
> is it used throughout the tree?

I'm not too sure how standardized this is.  I think its SOP for Chelsio 
drivers. :)

>> These
>> "cookie" fields are opaque to the firmware.  They are passed to firmware
>> in a work request and then reflected back to the host in the reply to
>> the work request.  Given this, I think there are two issues:
>>
>> 1) no swapping is really needed.  The values are opaque to firmware, and
>> thus can stay in host byte order.
>>
>> 2) to remove the warning, we need something like:
>>
>> req->cookie = (unsigned long)skb;
>>
>> and
>>    
>> rpl_skb = (struct sk_buff *)(unsigned long)req->cookie;
> That's is exactly what I came up with to silence these warnings. But I
> didn't dare to submit it because I was too puzzled with the current
> code. Anyhow, should I submit the (trivial) patch to fix this?

Sure.  Thanks.

Steve.

  parent reply	other threads:[~2013-02-05 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05 10:15 infiniband: cxgb4: GCC warnings for 32 bit Paul Bolle
     [not found] ` <1360059358.1343.37.camel-uMdlDhfIn7prKue/0VVhAg@public.gmane.org>
2013-02-05 15:46   ` Steve Wise
2013-02-05 15:46     ` Steve Wise
2013-02-05 16:36     ` Paul Bolle
     [not found]       ` <1360082216.14826.17.camel-uMdlDhfIn7prKue/0VVhAg@public.gmane.org>
2013-02-05 16:45         ` Steve Wise [this message]
2013-02-05 16:45           ` Steve Wise

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=51113743.6050403@opengridcomputing.com \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    --cc=vipul-ut6Up61K2wZBDgjK7y7TUQ@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.