From: Joe Perches <joe@perches•com>
To: Michal Kalderon <Michal.Kalderon@cavium•com>, davem@davemloft•net
Cc: netdev@vger•kernel.org, dledford@redhat•com, jgg@mellanox•com,
linux-rdma@vger•kernel.org, Ariel Elior <Ariel.Elior@cavium•com>
Subject: Re: [PATCH net 2/2] qed: Fix non TCP packets should be dropped on iWARP ll2 connection
Date: Wed, 14 Mar 2018 06:02:45 -0700 [thread overview]
Message-ID: <1521032565.2049.68.camel@perches.com> (raw)
In-Reply-To: <1521031768-19131-3-git-send-email-Michal.Kalderon@cavium.com>
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]);
next prev parent reply other threads:[~2018-03-14 13:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2018-03-14 13:29 ` Kalderon, Michal
2018-03-16 16:14 ` [PATCH net 0/2] qed: iWARP related fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521032565.2049.68.camel@perches.com \
--to=joe@perches$(echo .)com \
--cc=Ariel.Elior@cavium$(echo .)com \
--cc=Michal.Kalderon@cavium$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=dledford@redhat$(echo .)com \
--cc=jgg@mellanox$(echo .)com \
--cc=linux-rdma@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox