Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1683350ybl; Sat, 7 Dec 2019 00:11:55 -0800 (PST) X-Google-Smtp-Source: APXvYqw5CFhDj9Ntfed+zawhZpth2IyQk8i8gvkWM758iHvSAJ6P/j/8DF99a+KJKTx17EiIzmRv X-Received: by 2002:a54:4807:: with SMTP id j7mr16554644oij.179.1575706315577; Sat, 07 Dec 2019 00:11:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575706315; cv=none; d=google.com; s=arc-20160816; b=BUtclxd02H8LM3YFCuUBjjLlHYOODRsztKhCj0KdFIiLHAZ6BB2gseaF9cbBp4cL58 d6wKihZ9qfKWQ/vzyRgGp4cDAe0VO3D5X/PDaMTFZ8M5bSj+SiTEuYJTdrTckTqHMNZa MGB3aXyE5eNAQdEwDFqUqTG5vO5qboUeRL/VMKonJ2wamrTgXtUPGNmZaUtpstKyt7TY G/tikfz20o1386EFzDYD/yKFLZr70ML/uwXjbDFabiWpIhT1+wHbXtsEstqu5qN3xIZl YG3nKYANIyJZCgbfey2InXXodD2jb3iGAh4xyU6KVlDLTBng91adpZQrPty/WhZVzrxK +REA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-filter:dkim-signature:dkim-filter; bh=MwiVH3xMX5haMC7XNC4MSDAegTxuMS0AOkP8FjLDZuw=; b=V5hv68sXCIE7eSCRSMYL/io/HJcHD20m7gyfZ+4I67/fjKMqaWQ7G9vxw3VYxIm23n K9OklPNx5VzkOAcQJ4iPL5eabErfZ2KaG1ocuwPe7nRytc2xwZIMQXz0vxrf9SPU2oVl qiSZcfUEfJ6DIEZjDI/K7F/K1oQJv2R8b6V2AjmHFwlTaylTq/cqLAvNLLvrzQd3PasG b3XrXDqE2v6mDuqjEXcLQOwLLuqUCAcM9FH03MQdyTTkluvrxFVn/3aWxsypWexTqUdL MGKZXZJpsWP5UtCpJYYNyrH43kgWoJF0ta/2a7A4Er1MVS4sRxDH8znTEdb540uhEBdh b/EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dlink.ru header.s=mail header.b=btS2l1nM; 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 123si8431691oif.177.2019.12.07.00.11.43; Sat, 07 Dec 2019 00:11:55 -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=pass header.i=@dlink.ru header.s=mail header.b=btS2l1nM; 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 S1726640AbfLGILS (ORCPT + 99 others); Sat, 7 Dec 2019 03:11:18 -0500 Received: from fd.dlink.ru ([178.170.168.18]:56400 "EHLO fd.dlink.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbfLGILR (ORCPT ); Sat, 7 Dec 2019 03:11:17 -0500 Received: by fd.dlink.ru (Postfix, from userid 5000) id 2847D1B20271; Sat, 7 Dec 2019 11:11:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru 2847D1B20271 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dlink.ru; s=mail; t=1575706274; bh=MwiVH3xMX5haMC7XNC4MSDAegTxuMS0AOkP8FjLDZuw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=btS2l1nMTqfftVIMfPv2mIMOy2CCtx4Vg5aeHm2i9IGPAiK/dYAc5xCbz+Kh6m4lB i3IM+0Zqa6HysRzYwiNZbOAGDcdFfwLLrXpXiuoKOK6UquPv/SGDxfITrKfilKMvcN pktCHSBAY7q7U7dexqYIh98R9w5twe5UfdZjRsVA= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.dlink.ru X-Spam-Level: X-Spam-Status: No, score=-99.2 required=7.5 tests=BAYES_50,URIBL_BLOCKED, USER_IN_WHITELIST autolearn=disabled version=3.4.2 Received: from mail.rzn.dlink.ru (mail.rzn.dlink.ru [178.170.168.13]) by fd.dlink.ru (Postfix) with ESMTP id 520AF1B20271; Sat, 7 Dec 2019 11:10:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 fd.dlink.ru 520AF1B20271 Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTP id C372F1B203C6; Sat, 7 Dec 2019 11:10:58 +0300 (MSK) Received: from mail.rzn.dlink.ru (localhost [127.0.0.1]) by mail.rzn.dlink.ru (Postfix) with ESMTPA; Sat, 7 Dec 2019 11:10:58 +0300 (MSK) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Sat, 07 Dec 2019 11:10:58 +0300 From: Alexander Lobakin To: David Miller Cc: rainersickinger.official@gmail.com, shashidhar.lakkavalli@openmesh.com, john@phrozen.org, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, sdf@google.com, daniel@iogearbox.net, songliubraving@fb.com, ast@kernel.org, mcroce@redhat.com, jakub@cloudflare.com, edumazet@google.com, paulb@mellanox.com, komachi.yoshiki@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: fix flow dissection on Tx path In-Reply-To: <20191206.201950.100960973648804142.davem@davemloft.net> References: <20191205100235.14195-1-alobakin@dlink.ru> <20191206.201950.100960973648804142.davem@davemloft.net> User-Agent: Roundcube Webmail/1.4.0 Message-ID: X-Sender: alobakin@dlink.ru Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Miller wrote 07.12.2019 07:19: > From: Alexander Lobakin > Date: Thu, 5 Dec 2019 13:02:35 +0300 > >> 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. >> >> This can be observed by adding debug prints just before and right >> after >> tag_ops->flow_dissect() call to the related block of code: > ... >> In order to fix that we can add the check 'proto == htons(ETH_P_XDSA)' >> to prevent code from calling tag_ops->flow_dissect() on Tx. >> I also decided to initialize 'offset' variable so tagger callbacks can >> now safely leave it untouched without provoking a chaos. >> >> Fixes: 43e665287f93 ("net-next: dsa: fix flow dissection") >> Signed-off-by: Alexander Lobakin > > Applied and queued up for -stable. David, Andrew, Florian, Rainer, Thank you! Regards, ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ