Skip to content

Commit d88b504

Browse files
Varun PrakashNicholas Bellinger
authored andcommitted
target/cxgbit: Use T6 specific macros to get ETH/IP hdr len
Signed-off-by: Varun Prakash <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent 3da1110 commit d88b504

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/target/iscsi/cxgbit/cxgbit_cm.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,7 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
10681068
struct sk_buff *skb;
10691069
const struct tcphdr *tcph;
10701070
struct cpl_t5_pass_accept_rpl *rpl5;
1071+
struct cxgb4_lld_info *lldi = &csk->com.cdev->lldi;
10711072
unsigned int len = roundup(sizeof(*rpl5), 16);
10721073
unsigned int mtu_idx;
10731074
u64 opt0;
@@ -1121,8 +1122,13 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
11211122
opt2 |= WND_SCALE_EN_F;
11221123

11231124
hlen = ntohl(req->hdr_len);
1124-
tcph = (const void *)(req + 1) + ETH_HDR_LEN_G(hlen) +
1125-
IP_HDR_LEN_G(hlen);
1125+
1126+
if (is_t5(lldi->adapter_type))
1127+
tcph = (struct tcphdr *)((u8 *)(req + 1) +
1128+
ETH_HDR_LEN_G(hlen) + IP_HDR_LEN_G(hlen));
1129+
else
1130+
tcph = (struct tcphdr *)((u8 *)(req + 1) +
1131+
T6_ETH_HDR_LEN_G(hlen) + T6_IP_HDR_LEN_G(hlen));
11261132

11271133
if (tcph->ece && tcph->cwr)
11281134
opt2 |= CCTRL_ECN_V(1);

0 commit comments

Comments
 (0)