* [PATCH net 0/2] qed: iWARP related fixes
@ 2018-03-14 12:49 Michal Kalderon
2018-03-14 12:49 ` [PATCH net 1/2] qed: Fix MPA unalign flow in case header is split across two packets Michal Kalderon
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Michal Kalderon @ 2018-03-14 12:49 UTC (permalink / raw)
To: michal.kalderon, davem
Cc: netdev, dledford, jgg, linux-rdma, Michal Kalderon, Ariel Elior
This series contains two fixes related to iWARP flow.
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium•com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium•com>
Michal Kalderon (2):
qed: Fix MPA unalign flow in case header is split across two packets.
qed: Fix non TCP packets should be dropped on iWARP ll2 connection
drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
--
2.9.5
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH net 1/2] qed: Fix MPA unalign flow in case header is split across two packets. 2018-03-14 12:49 [PATCH net 0/2] qed: iWARP related fixes Michal Kalderon @ 2018-03-14 12:49 ` Michal Kalderon 2018-03-14 12:49 ` [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection Michal Kalderon 2018-03-16 16:14 ` [PATCH net 0/2] qed: iWARP related fixes David Miller 2 siblings, 0 replies; 6+ messages in thread From: Michal Kalderon @ 2018-03-14 12:49 UTC (permalink / raw) To: michal.kalderon, davem Cc: netdev, dledford, jgg, linux-rdma, Michal Kalderon, Ariel Elior There is a corner case in the MPA unalign flow where a FPDU header is split over two tcp segments. The length of the first fragment in this case was not initialized properly and should be '1' Fixes: c7d1d839 ("qed: Add support for MPA header being split over two tcp packets") Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium•com> Signed-off-by: Ariel Elior <Ariel.Elior@cavium•com> --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index ca4a81d..fefe527 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -1928,8 +1928,8 @@ qed_iwarp_update_fpdu_length(struct qed_hwfn *p_hwfn, /* Missing lower byte is now available */ mpa_len = fpdu->fpdu_length | *mpa_data; fpdu->fpdu_length = QED_IWARP_FPDU_LEN_WITH_PAD(mpa_len); - fpdu->mpa_frag_len = fpdu->fpdu_length; /* one byte of hdr */ + fpdu->mpa_frag_len = 1; fpdu->incomplete_bytes = fpdu->fpdu_length - 1; DP_VERBOSE(p_hwfn, QED_MSG_RDMA, -- 2.9.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection 2018-03-14 12:49 [PATCH net 0/2] qed: iWARP related fixes Michal Kalderon 2018-03-14 12:49 ` [PATCH net 1/2] qed: Fix MPA unalign flow in case header is split across two packets Michal Kalderon @ 2018-03-14 12:49 ` Michal Kalderon 2018-03-14 13:02 ` Joe Perches 2018-03-16 16:14 ` [PATCH net 0/2] qed: iWARP related fixes David Miller 2 siblings, 1 reply; 6+ messages in thread From: Michal Kalderon @ 2018-03-14 12:49 UTC (permalink / raw) To: michal.kalderon, davem Cc: netdev, dledford, jgg, linux-rdma, Michal Kalderon, Ariel Elior FW workaround. The iWARP LL2 connection did not expect TCP packets to arrive on it's connection. The fix drops any non-tcp packets Fixes b5c29ca ("qed: iWARP CM - setup a ll2 connection for handling SYN packets") Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium•com> Signed-off-by: Ariel Elior <Ariel.Elior@cavium•com> --- drivers/net/ethernet/qlogic/qed/qed_iwarp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c index fefe527..d5d02be 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c +++ b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c @@ -1703,6 +1703,13 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn, iph = (struct iphdr *)((u8 *)(ethh) + eth_hlen); if (eth_type == ETH_P_IP) { + if (iph->protocol != IPPROTO_TCP) { + DP_NOTICE(p_hwfn, + "Unexpected ip protocol on ll2 %x\n", + iph->protocol); + return -EINVAL; + } + cm_info->local_ip[0] = ntohl(iph->daddr); cm_info->remote_ip[0] = ntohl(iph->saddr); cm_info->ip_version = TCP_IPV4; @@ -1711,6 +1718,14 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn, *payload_len = ntohs(iph->tot_len) - ip_hlen; } else if (eth_type == ETH_P_IPV6) { ip6h = (struct ipv6hdr *)iph; + + if (ip6h->nexthdr != IPPROTO_TCP) { + DP_NOTICE(p_hwfn, + "Unexpected ip protocol on ll2 %x\n", + iph->protocol); + return -EINVAL; + } + for (i = 0; i < 4; i++) { cm_info->local_ip[i] = ntohl(ip6h->daddr.in6_u.u6_addr32[i]); -- 2.9.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection 2018-03-14 12:49 ` [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection Michal Kalderon @ 2018-03-14 13:02 ` Joe Perches 2018-03-14 13:29 ` Kalderon, Michal 0 siblings, 1 reply; 6+ messages in thread From: Joe Perches @ 2018-03-14 13:02 UTC (permalink / raw) To: Michal Kalderon, davem; +Cc: netdev, dledford, jgg, linux-rdma, Ariel Elior On Wed, 2018-03-14 at 14:49 +0200, Michal Kalderon wrote: > FW workaround. The iWARP LL2 connection did not expect TCP packets > to arrive on it's connection. The fix drops any non-tcp packets [] > diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c [] > @@ -1703,6 +1703,13 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn, > iph = (struct iphdr *)((u8 *)(ethh) + eth_hlen); > > if (eth_type == ETH_P_IP) { > + if (iph->protocol != IPPROTO_TCP) { > + DP_NOTICE(p_hwfn, > + "Unexpected ip protocol on ll2 %x\n", > + iph->protocol); > + return -EINVAL; > + } Perhaps this should be ratelimited. > + > cm_info->local_ip[0] = ntohl(iph->daddr); > cm_info->remote_ip[0] = ntohl(iph->saddr); > cm_info->ip_version = TCP_IPV4; > @@ -1711,6 +1718,14 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn, > *payload_len = ntohs(iph->tot_len) - ip_hlen; > } else if (eth_type == ETH_P_IPV6) { > ip6h = (struct ipv6hdr *)iph; > + > + if (ip6h->nexthdr != IPPROTO_TCP) { > + DP_NOTICE(p_hwfn, > + "Unexpected ip protocol on ll2 %x\n", > + iph->protocol); > + return -EINVAL; here too > + } > + > for (i = 0; i < 4; i++) { > cm_info->local_ip[i] = > ntohl(ip6h->daddr.in6_u.u6_addr32[i]); ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection 2018-03-14 13:02 ` Joe Perches @ 2018-03-14 13:29 ` Kalderon, Michal 0 siblings, 0 replies; 6+ messages in thread From: Kalderon, Michal @ 2018-03-14 13:29 UTC (permalink / raw) To: Joe Perches, davem@davemloft•net Cc: netdev@vger•kernel.org, dledford@redhat•com, jgg@mellanox•com, linux-rdma@vger•kernel.org, Elior, Ariel > From: Joe Perches [mailto:joe@perches•com] > Sent: Wednesday, March 14, 2018 3:03 PM > To: Kalderon, Michal <Michal.Kalderon@cavium•com>; > davem@davemloft•net > Cc: netdev@vger•kernel.org; dledford@redhat•com; jgg@mellanox•com; > linux-rdma@vger•kernel.org; Elior, Ariel <Ariel.Elior@cavium•com> > Subject: Re: [PATCH net 2/2] qed: Fix non TCP packets should be dropped on > iWARP ll2 connection > > [This sender failed our fraud detection checks and may not be who they > appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] > > On Wed, 2018-03-14 at 14:49 +0200, Michal Kalderon wrote: > > FW workaround. The iWARP LL2 connection did not expect TCP packets to > > arrive on it's connection. The fix drops any non-tcp packets > [] > > diff --git a/drivers/net/ethernet/qlogic/qed/qed_iwarp.c > > b/drivers/net/ethernet/qlogic/qed/qed_iwarp.c > [] > > @@ -1703,6 +1703,13 @@ qed_iwarp_parse_rx_pkt(struct qed_hwfn > *p_hwfn, > > iph = (struct iphdr *)((u8 *)(ethh) + eth_hlen); > > > > if (eth_type == ETH_P_IP) { > > + if (iph->protocol != IPPROTO_TCP) { > > + DP_NOTICE(p_hwfn, > > + "Unexpected ip protocol on ll2 %x\n", > > + iph->protocol); > > + return -EINVAL; > > + } > > Perhaps this should be ratelimited. The rate of the packets that could arrive here is very low. It has to do with a corner case Of RoCEv2 packets being sent to a device that was enabled with iWARP. > > > + > > cm_info->local_ip[0] = ntohl(iph->daddr); > > cm_info->remote_ip[0] = ntohl(iph->saddr); > > cm_info->ip_version = TCP_IPV4; @@ -1711,6 +1718,14 @@ > > qed_iwarp_parse_rx_pkt(struct qed_hwfn *p_hwfn, > > *payload_len = ntohs(iph->tot_len) - ip_hlen; > > } else if (eth_type == ETH_P_IPV6) { > > ip6h = (struct ipv6hdr *)iph; > > + > > + if (ip6h->nexthdr != IPPROTO_TCP) { > > + DP_NOTICE(p_hwfn, > > + "Unexpected ip protocol on ll2 %x\n", > > + iph->protocol); > > + return -EINVAL; > > here too > > > + } > > + > > for (i = 0; i < 4; i++) { > > cm_info->local_ip[i] = > > ntohl(ip6h->daddr.in6_u.u6_addr32[i]); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 0/2] qed: iWARP related fixes 2018-03-14 12:49 [PATCH net 0/2] qed: iWARP related fixes Michal Kalderon 2018-03-14 12:49 ` [PATCH net 1/2] qed: Fix MPA unalign flow in case header is split across two packets Michal Kalderon 2018-03-14 12:49 ` [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection Michal Kalderon @ 2018-03-16 16:14 ` David Miller 2 siblings, 0 replies; 6+ messages in thread From: David Miller @ 2018-03-16 16:14 UTC (permalink / raw) To: Michal.Kalderon; +Cc: netdev, dledford, jgg, linux-rdma, Ariel.Elior From: Michal Kalderon <Michal.Kalderon@cavium•com> Date: Wed, 14 Mar 2018 14:49:26 +0200 > This series contains two fixes related to iWARP flow. Series applied, and queued up for -stable. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-03-16 16:14 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-03-14 12:49 [PATCH net 0/2] qed: iWARP related fixes Michal Kalderon 2018-03-14 12:49 ` [PATCH net 1/2] qed: Fix MPA unalign flow in case header is split across two packets Michal Kalderon 2018-03-14 12:49 ` [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection Michal Kalderon 2018-03-14 13:02 ` Joe Perches 2018-03-14 13:29 ` Kalderon, Michal 2018-03-16 16:14 ` [PATCH net 0/2] qed: iWARP related fixes David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox