Skip to content

Commit b225598

Browse files
committed
Merge branch 'qed-iWARP-related-fixes'
Michal Kalderon says: ==================== qed: iWARP related fixes This series contains two fixes related to iWARP flow. ==================== Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: Ariel Elior <[email protected]>
2 parents fa6a91e + 16da090 commit b225598

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

drivers/net/ethernet/qlogic/qed/qed_iwarp.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,6 +1703,13 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn,
17031703
iph = (struct iphdr *)((u8 *)(ethh) + eth_hlen);
17041704

17051705
if (eth_type == ETH_P_IP) {
1706+
if (iph->protocol != IPPROTO_TCP) {
1707+
DP_NOTICE(p_hwfn,
1708+
"Unexpected ip protocol on ll2 %x\n",
1709+
iph->protocol);
1710+
return -EINVAL;
1711+
}
1712+
17061713
cm_info->local_ip[0] = ntohl(iph->daddr);
17071714
cm_info->remote_ip[0] = ntohl(iph->saddr);
17081715
cm_info->ip_version = TCP_IPV4;
@@ -1711,6 +1718,14 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn,
17111718
*payload_len = ntohs(iph->tot_len) - ip_hlen;
17121719
} else if (eth_type == ETH_P_IPV6) {
17131720
ip6h = (struct ipv6hdr *)iph;
1721+
1722+
if (ip6h->nexthdr != IPPROTO_TCP) {
1723+
DP_NOTICE(p_hwfn,
1724+
"Unexpected ip protocol on ll2 %x\n",
1725+
iph->protocol);
1726+
return -EINVAL;
1727+
}
1728+
17141729
for (i = 0; i < 4; i++) {
17151730
cm_info->local_ip[i] =
17161731
ntohl(ip6h->daddr.in6_u.u6_addr32[i]);
@@ -1928,8 +1943,8 @@ qed_iwarp_update_fpdu_length(struct qed_hwfn *p_hwfn,
19281943
/* Missing lower byte is now available */
19291944
mpa_len = fpdu->fpdu_length | *mpa_data;
19301945
fpdu->fpdu_length = QED_IWARP_FPDU_LEN_WITH_PAD(mpa_len);
1931-
fpdu->mpa_frag_len = fpdu->fpdu_length;
19321946
/* one byte of hdr */
1947+
fpdu->mpa_frag_len = 1;
19331948
fpdu->incomplete_bytes = fpdu->fpdu_length - 1;
19341949
DP_VERBOSE(p_hwfn,
19351950
QED_MSG_RDMA,

0 commit comments

Comments
 (0)