From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D121BC43603 for ; Thu, 5 Dec 2019 14:01:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4D8D21823 for ; Thu, 5 Dec 2019 14:01:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="NfTY6uPL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729605AbfLEOBv (ORCPT ); Thu, 5 Dec 2019 09:01:51 -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