diff options
author | Paul Bolle <pebolle@tiscali.nl> | 2013-02-05 15:51:30 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-02-14 18:55:05 -0500 |
commit | 710a31102be46ffc2f087119dca19c894dc237eb (patch) | |
tree | c8c61415270bd3a186d13ee3b0274fe4c8b32663 /drivers/infiniband | |
parent | ef5d6355ed4bcf574e8473c3ce667cbf6c66a0ee (diff) |
RDMA/cxgb4: "cookie" can stay in host endianness
Work requests are passed between the host and the firmware with a
"cookie". This cookie is swapped to big-endian when passed to the
firmware and back to host endianness on return. This swapping seems
to be implemented incorrectly. Moreover, the byte swapping triggers
GCC warnings on 32 bit:
drivers/infiniband/hw/cxgb4/cm.c: In function ‘passive_ofld_conn_reply’:
drivers/infiniband/hw/cxgb4/cm.c:2803:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
drivers/infiniband/hw/cxgb4/cm.c: In function ‘send_fw_pass_open_req’:
drivers/infiniband/hw/cxgb4/cm.c:2941:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
[...]
But byte swapping isn't needed as the firmware doesn't actually touch
the cookie. Dropping byte swapping makes the warnings go away too.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index dfca515cc933..565bfb161c1a 100644 --- a/drivers/infiniband/hw/cxgb4/cm.c +++ b/drivers/infiniband/hw/cxgb4/cm.c | |||
@@ -2818,7 +2818,7 @@ static void passive_ofld_conn_reply(struct c4iw_dev *dev, struct sk_buff *skb, | |||
2818 | struct cpl_pass_accept_req *cpl; | 2818 | struct cpl_pass_accept_req *cpl; |
2819 | int ret; | 2819 | int ret; |
2820 | 2820 | ||
2821 | rpl_skb = (__force struct sk_buff *)cpu_to_be64(req->cookie); | 2821 | rpl_skb = (struct sk_buff *)(unsigned long)req->cookie; |
2822 | BUG_ON(!rpl_skb); | 2822 | BUG_ON(!rpl_skb); |
2823 | if (req->retval) { | 2823 | if (req->retval) { |
2824 | PDBG("%s passive open failure %d\n", __func__, req->retval); | 2824 | PDBG("%s passive open failure %d\n", __func__, req->retval); |
@@ -2962,7 +2962,7 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb, | |||
2962 | * TP will ignore any value > 0 for MSS index. | 2962 | * TP will ignore any value > 0 for MSS index. |
2963 | */ | 2963 | */ |
2964 | req->tcb.opt0 = cpu_to_be64(V_MSS_IDX(0xF)); | 2964 | req->tcb.opt0 = cpu_to_be64(V_MSS_IDX(0xF)); |
2965 | req->cookie = (__force __u64) cpu_to_be64((u64)skb); | 2965 | req->cookie = (unsigned long)skb; |
2966 | 2966 | ||
2967 | set_wr_txq(req_skb, CPL_PRIORITY_CONTROL, port_id); | 2967 | set_wr_txq(req_skb, CPL_PRIORITY_CONTROL, port_id); |
2968 | cxgb4_ofld_send(dev->rdev.lldi.ports[0], req_skb); | 2968 | cxgb4_ofld_send(dev->rdev.lldi.ports[0], req_skb); |