Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1649315ybl; Thu, 5 Dec 2019 04:59:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxcI2b1uU5RNPbypM/zkT963pRA2F1kq5dRHUCIUAeNctOmbJY9jMFyrL0e047Sb1+MmYMQ X-Received: by 2002:aca:2817:: with SMTP id 23mr1274147oix.133.1575550787896; Thu, 05 Dec 2019 04:59:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575550787; cv=none; d=google.com; s=arc-20160816; b=dIsyfOvwulQy3naVZW0Ngc/NppYjJb/6vP/NND6xQydq2CP0FCmwBfV6UZCxEa+nA5 oIz+nyFXfjtF8lrfxh0gaQQrBpLb6z1X7ik7ohNHR4jS0WjW9pSkEE8H+pl70MXJjS+8 YFyD+ErDo+Bnkpy7wLzfIsNCmlEpW133CetDWHiG13aasLyImKRVgR7Y6mbD0FTwnya5 4R7tOeTQZ/cNi/FLhqZ5sCKoPrpeWfQTmKDYjY5j3aNi+1N//t4viuoRxaQ6h6JETQoS 38EU4JCs/7pEoR+VSn3Q9hLLUKWTYSKofxkhXRWssGQvTnxLnsgRoyweA8D+pBGwDTHq ZQgg== 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=Re18R+zvHW22gTZUWM5G+y1mglFdF33WZZhd8u13ENU=; b=R3GWm0xUMLyTfw3piqWhW18NutRMu+dm7P+dKSnWP9xJFYumxxH1KahL0TY9Iw6pq7 rJIz9sp6j5/Qh6qk5rNJyJaxVjKUcolrvjsMfaRZxPI2aNVOzZ+N93tPd4fCh4DL7mRI QBv8zwYwd+ztpvNlrQcbfKghCQ17gMVm9ypVPsz/E4J0QoCIx5KzbbKeYYFn+v9Jbgw8 uIYT4C8enO5HFagvLcMk9EDiPWt5P2Atu3810HHGO9ap7FdekbGghaupszsVVf9MiUIE 7+cF/6QE6uL7+vlPX/Un6msu0nkRITtPBwg0PM7qMqpWV4zdWXMpyXtvhvN5YnVqjd2P zHzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=ISS+iwm4; 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 v141si4909856oif.161.2019.12.05.04.59.36; Thu, 05 Dec 2019 04:59:47 -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=ISS+iwm4; 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 S1729474AbfLEM6u (ORCPT + 99 others); Thu, 5 Dec 2019 07:58:50 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:38046 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729099AbfLEM6u (ORCPT ); Thu, 5 Dec 2019 07:58:50 -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=Re18R+zvHW22gTZUWM5G+y1mglFdF33WZZhd8u13ENU=; b=ISS+iwm4GEajcnWmdI+CAx1dLq /pA0TK0twSbpVXEiHZUfMswjcFncqO8a+fpeQuEx9p4FYARYyLozq/Jtwd5/XCSxYyY67Jk/7Sl7I hxY5Z3ZwD+8yUG/F1DJbo/zGql4/FJ/wj0M/YlPTTIBK/g0KfqVbGKLSUWXZF7RifIJE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.92.2) (envelope-from ) id 1icqiB-0007OM-Fl; Thu, 05 Dec 2019 13:58:27 +0100 Date: Thu, 5 Dec 2019 13:58:27 +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: <20191205125827.GA28269@lunn.ch> References: <20191205100235.14195-1-alobakin@dlink.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205100235.14195-1-alobakin@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 On Thu, Dec 05, 2019 at 01:02:35PM +0300, Alexander Lobakin wrote: > Commit 43e665287f93 ("net-next: dsa: fix flow dissection") added an > ability to override protocol and network offset during flow dissection > for DSA-enabled devices (i.e. controllers shipped as switch CPU ports) > in order to fix skb hashing for RPS on Rx path. > > However, skb_hash() and added part of code can be invoked not only on > Rx, but also on Tx path if we have a multi-queued device and: > - kernel is running on UP system or > - XPS is not configured. > > The call stack in this two cases will be like: dev_queue_xmit() -> > __dev_queue_xmit() -> netdev_core_pick_tx() -> netdev_pick_tx() -> > skb_tx_hash() -> skb_get_hash(). > > The problem is that skbs queued for Tx have both network offset and > correct protocol already set up even after inserting a CPU tag by DSA > tagger, so calling tag_ops->flow_dissect() on this path actually only > breaks flow dissection and hashing. Hi Alexander 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? Andrew