Commit 192539f4 authored by Ganesh Goudar's avatar Ganesh Goudar Committed by Doug Ledford

iw_cxgb4: clean up send_connect()

Clean up send_connect() and make use of t6 specific
active open request struct.
Acked-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarBharat Teja <bharat@chelsio.com>
Signed-off-by: default avatarGanesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 6dd7abae
...@@ -692,6 +692,10 @@ static int send_connect(struct c4iw_ep *ep) ...@@ -692,6 +692,10 @@ static int send_connect(struct c4iw_ep *ep)
int ret; int ret;
enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type; enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type;
u32 isn = (prandom_u32() & ~7UL) - 1; u32 isn = (prandom_u32() & ~7UL) - 1;
struct net_device *netdev;
u64 params;
netdev = ep->com.dev->rdev.lldi.ports[0];
switch (CHELSIO_CHIP_VERSION(adapter_type)) { switch (CHELSIO_CHIP_VERSION(adapter_type)) {
case CHELSIO_T4: case CHELSIO_T4:
...@@ -768,6 +772,8 @@ static int send_connect(struct c4iw_ep *ep) ...@@ -768,6 +772,8 @@ static int send_connect(struct c4iw_ep *ep)
opt2 |= T5_ISS_F; opt2 |= T5_ISS_F;
} }
params = cxgb4_select_ntuple(netdev, ep->l2t);
if (ep->com.remote_addr.ss_family == AF_INET6) if (ep->com.remote_addr.ss_family == AF_INET6)
cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0], cxgb4_clip_get(ep->com.dev->rdev.lldi.ports[0],
(const u32 *)&la6->sin6_addr.s6_addr, 1); (const u32 *)&la6->sin6_addr.s6_addr, 1);
...@@ -809,18 +815,22 @@ static int send_connect(struct c4iw_ep *ep) ...@@ -809,18 +815,22 @@ static int send_connect(struct c4iw_ep *ep)
req->opt0 = cpu_to_be64(opt0); req->opt0 = cpu_to_be64(opt0);
if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) {
req->params = cpu_to_be32(cxgb4_select_ntuple( req->params = cpu_to_be32(params);
ep->com.dev->rdev.lldi.ports[0],
ep->l2t));
req->opt2 = cpu_to_be32(opt2); req->opt2 = cpu_to_be32(opt2);
} else { } else {
t5req->params = cpu_to_be64(FILTER_TUPLE_V( if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) {
cxgb4_select_ntuple( t5req->params =
ep->com.dev->rdev.lldi.ports[0], cpu_to_be64(FILTER_TUPLE_V(params));
ep->l2t))); t5req->rsvd = cpu_to_be32(isn);
t5req->rsvd = cpu_to_be32(isn); PDBG("%s snd_isn %u\n", __func__, t5req->rsvd);
PDBG("%s snd_isn %u\n", __func__, t5req->rsvd); t5req->opt2 = cpu_to_be32(opt2);
t5req->opt2 = cpu_to_be32(opt2); } else {
t6req->params =
cpu_to_be64(FILTER_TUPLE_V(params));
t6req->rsvd = cpu_to_be32(isn);
PDBG("%s snd_isn %u\n", __func__, t6req->rsvd);
t6req->opt2 = cpu_to_be32(opt2);
}
} }
} else { } else {
switch (CHELSIO_CHIP_VERSION(adapter_type)) { switch (CHELSIO_CHIP_VERSION(adapter_type)) {
...@@ -859,18 +869,24 @@ static int send_connect(struct c4iw_ep *ep) ...@@ -859,18 +869,24 @@ static int send_connect(struct c4iw_ep *ep)
req6->opt0 = cpu_to_be64(opt0); req6->opt0 = cpu_to_be64(opt0);
if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) {
req6->params = cpu_to_be32(cxgb4_select_ntuple( req6->params = cpu_to_be32(cxgb4_select_ntuple(netdev,
ep->com.dev->rdev.lldi.ports[0], ep->l2t));
ep->l2t));
req6->opt2 = cpu_to_be32(opt2); req6->opt2 = cpu_to_be32(opt2);
} else { } else {
t5req6->params = cpu_to_be64(FILTER_TUPLE_V( if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) {
cxgb4_select_ntuple( t5req6->params =
ep->com.dev->rdev.lldi.ports[0], cpu_to_be64(FILTER_TUPLE_V(params));
ep->l2t))); t5req6->rsvd = cpu_to_be32(isn);
t5req6->rsvd = cpu_to_be32(isn); PDBG("%s snd_isn %u\n", __func__, t5req6->rsvd);
PDBG("%s snd_isn %u\n", __func__, t5req6->rsvd); t5req6->opt2 = cpu_to_be32(opt2);
t5req6->opt2 = cpu_to_be32(opt2); } else {
t6req6->params =
cpu_to_be64(FILTER_TUPLE_V(params));
t6req6->rsvd = cpu_to_be32(isn);
PDBG("%s snd_isn %u\n", __func__, t6req6->rsvd);
t6req6->opt2 = cpu_to_be32(opt2);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment