Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1716910ybl; Thu, 5 Dec 2019 06:02:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwdesvULXQ8aBdOYLudW9NFNbMHSbLUYWef4S5RWtiilaM+kmhBXyvPYF8SdxU0WJa+Chd9 X-Received: by 2002:aca:b10b:: with SMTP id a11mr1467359oif.138.1575554568782; Thu, 05 Dec 2019 06:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575554568; cv=none; d=google.com; s=arc-20160816; b=A4DO1uLT/Q5OiL4h/5NL/DcdKl5oWhukPgULCHBh1SmVF6KdTPcIemSZYCtD7YZBIX 2P9IdmyD+sajJhxOsswtc1xWVYwWMAR/MwpIbpoNN3vBu5lqw399rW0DMe+aYRmSYdmB iEXRXO6QLEksrNrscRzCJbsVdNd/M5KWieqa6EVGoNu59dMHxdOIz/JaPbHWotb+jx+H Km7+ejuxApn7BWfPhfQPV9EH46oASp+HkfHLZ9nQvZCcS9+DtJ3ei7n2FkMbUTfBPOL3 zbIg5lu5N/IIDgtaDJXPG31di4lyZ6XkO6y1+ivGchOhcBRFetr0RihiMsgvi98tWKay tZdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RJnmT508lemxn3jZi6MdCEa9v5+oeCEtGVN1/x2fxsI=; b=LMyuwls4Um4af9uRwSJ6PEDRXc/7zcJpRf7VjQdna2YNA0icnsbLY5t9m56dNuPi3t pbAOcqfPe7LxxsVn/TQT5T35HpdFsRkPpn2v5G+K1PDUo4vWzdEU92Gk1eAmk0FvHXAN k6/o0KQij21bYq5dMtNOyJFK1nxlIDnWJ6graNB7UBfXd7ZybNoeY1B2Qe4v2gooiyfu 3wvsF47QAh4TYiqDIn6dse5gEsVUBglE/2Aj0pmk/w1+PyydYa7LQ/Zi0ctInM/8hrc7 Qgk+lEZYh0AVl/JgUPe+dp9y293E4Hlc3yJiWvGJb4OHHLTuk23gQehIN/qEvG6wTGRR z9gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=NfTY6uPL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si4278809otg.273.2019.12.05.06.02.25; Thu, 05 Dec 2019 06:02:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=NfTY6uPL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729588AbfLEOBu (ORCPT + 99 others); Thu, 5 Dec 2019 09:01:50 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:38166 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729236AbfLEOBt (ORCPT ); Thu, 5 Dec 2019 09:01:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=RJnmT508lemxn3jZi6MdCEa9v5+oeCEtGVN1/x2fxsI=; b=NfTY6uPLTCxtmjnAZ0CO2N5bAN +1UtQ6loR8ACDhPxgRwvAHil2EQmV9qO/dcNEdIwWgivM94RWLlV6B+o3gKJYTEfPeEql0cS4j8rp lT0sTUgHgepN5Eov3d+zdpuBcrSwPp/YIiM5IRS2m9CIUeM/yywtXKEIKtgEQzl5Js9E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.92.2) (envelope-from ) id 1icrhE-0007fM-6f; Thu, 05 Dec 2019 15:01:32 +0100 Date: Thu, 5 Dec 2019 15:01:32 +0100 From: Andrew Lunn To: Alexander Lobakin Cc: "David S. Miller" , Muciri Gatimu , Shashidhar Lakkavalli , John Crispin , Vivien Didelot , Florian Fainelli , Stanislav Fomichev , Daniel Borkmann , Song Liu , Alexei Starovoitov , Matteo Croce , Jakub Sitnicki , Eric Dumazet , Paul Blakey , Yoshiki Komachi , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: fix flow dissection on Tx path Message-ID: <20191205140132.GD28269@lunn.ch> References: <20191205100235.14195-1-alobakin@dlink.ru> <20191205125827.GA28269@lunn.ch> <2e03b82a8ec999fade26253ff35077c6@dlink.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2e03b82a8ec999fade26253ff35077c6@dlink.ru> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi, > > > What i'm missing here is an explanation why the flow dissector is > > called here if the protocol is already set? It suggests there is a > > case when the protocol is not correctly set, and we do need to look > > into the frame? > > If we have a device with multiple Tx queues, but XPS is not configured > or system is running on uniprocessor system, then networking core code > selects Tx queue depending on the flow to utilize as much Tx queues as > possible but without breaking frames order. > This selection happens in net/core/dev.c:skb_tx_hash() as: > > reciprocal_scale(skb_get_hash(skb), qcount) > > where 'qcount' is the total number of Tx queues on the network device. > > If skb has not been hashed prior to this line, then skb_get_hash() will > call flow dissector to generate a new hash. That's why flow dissection > can occur on Tx path. Hi Alexander So it looks like you are now skipping this hash. Which in your testing, give better results, because the protocol is already set correctly. But are there cases when the protocol is not set correctly? We really do need to look into the frame? How about when an outer header has just been removed? The frame was received on a GRE tunnel, the GRE header has just been removed, and now the frame is on its way out? Is the protocol still GRE, and we should look into the frame to determine if it is IPv4, ARP etc? Your patch looks to improve things for the cases you have tested, but i'm wondering if there are other use cases where we really do need to look into the frame? In which case, your fix is doing the wrong thing. Should we be extending the tagger to handle the TX case as well as the RX case? Andrew