From patchwork Fri Feb 3 11:54:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 723588 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vFFfc1kgBz9s75 for ; Fri, 3 Feb 2017 22:55:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752124AbdBCLzB (ORCPT ); Fri, 3 Feb 2017 06:55:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52388 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbdBCLzA (ORCPT ); Fri, 3 Feb 2017 06:55:00 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BDAF483F40; Fri, 3 Feb 2017 11:55:00 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-121.rdu2.redhat.com [10.10.120.121] (may be forged)) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id v13BswnA024513; Fri, 3 Feb 2017 06:54:59 -0500 Date: Fri, 3 Feb 2017 09:54:57 -0200 From: Marcelo Ricardo Leitner To: Eric Dumazet Cc: Markus Trippelsdorf , netdev@vger.kernel.org Subject: Re: "TCP: eth0: Driver has suspect GRO implementation, TCP performance may be compromised." message with "ethtool -K eth0 gro off" Message-ID: <20170203115457.GA5296@localhost.localdomain> References: <20170202115240.GH17590@x4> <1486038733.13103.21.camel@edumazet-glaptop3.roam.corp.google.com> <20170202123427.GA7212@x4> <1486042270.13103.26.camel@edumazet-glaptop3.roam.corp.google.com> <1486043964.13103.33.camel@edumazet-glaptop3.roam.corp.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1486043964.13103.33.camel@edumazet-glaptop3.roam.corp.google.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 03 Feb 2017 11:55:01 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Feb 02, 2017 at 05:59:24AM -0800, Eric Dumazet wrote: > On Thu, 2017-02-02 at 05:31 -0800, Eric Dumazet wrote: > > > Anyway, I suspect the test is simply buggy ;) > > > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > > index 41dcbd568cbe2403f2a9e659669afe462a42e228..5394a39fcce964a7fe7075b1531a8a1e05550a54 100644 > > --- a/net/ipv4/tcp_input.c > > +++ b/net/ipv4/tcp_input.c > > @@ -164,7 +164,7 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb) > > if (len >= icsk->icsk_ack.rcv_mss) { > > icsk->icsk_ack.rcv_mss = min_t(unsigned int, len, > > tcp_sk(sk)->advmss); > > - if (unlikely(icsk->icsk_ack.rcv_mss != len)) > > + if (unlikely(icsk->icsk_ack.rcv_mss != len && skb_is_gso(skb))) > > tcp_gro_dev_warn(sk, skb); > > } else { > > /* Otherwise, we make more careful check taking into account, > > This wont really help. > > Our tcp_sk(sk)->advmss can be lower than the MSS used by the remote > peer. > > ip ro add .... advmss 512 I don't follow. With a good driver, how can advmss be smaller than the MSS used by the remote peer? Even with the route entry above, I get segments just up to advmss, and no warning. Though yeah, interesting that this driver doesn't even support GRO. FCS perhaps? Markus, do you have other interfaces in your system? Which MTU do you use, and please try the (untested) patch below, to gather more debug info: ---8<--- diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index bfa165cc455a..eddd5b6a28b1 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -128,6 +128,7 @@ int sysctl_tcp_invalid_ratelimit __read_mostly = HZ/2; static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb) { + struct inet_connection_sock *icsk = inet_csk(sk); static bool __once __read_mostly; if (!__once) { @@ -137,8 +138,9 @@ static void tcp_gro_dev_warn(struct sock *sk, const struct sk_buff *skb) rcu_read_lock(); dev = dev_get_by_index_rcu(sock_net(sk), skb->skb_iif); - pr_warn("%s: Driver has suspect GRO implementation, TCP performance may be compromised.\n", - dev ? dev->name : "Unknown driver"); + pr_warn("%s: Driver has suspect GRO implementation, TCP performance may be compromised. rcv_mss:%u advmss:%u len:%u\n", + dev ? dev->name : "Unknown driver", + icsk->icsk_ack.rcv_mss, tcp_sk(sk)->advmss, skb->len); rcu_read_unlock(); } }