Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1511046ybb; Sat, 11 Apr 2020 05:18:42 -0700 (PDT) X-Google-Smtp-Source: APiQypLAqdzzfhJhVKFCZg4afn2HLBIimyZ6C+b4RrSUz57IYV5SveWBgQRU3PtZYxY75b5gWt+a X-Received: by 2002:ac8:4e81:: with SMTP id 1mr3208603qtp.315.1586607522264; Sat, 11 Apr 2020 05:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586607522; cv=none; d=google.com; s=arc-20160816; b=xR6nfBo0GVofScstjfsvEK0rO1zg0G1o9EMOK+OkFFwYqJEge11ZkQMYyxvNFH5RW3 Hu+E6VoetUO3copBI/TZ2espTCFlfs1GgYwK8ztMXk7s/lLQYn/bSIryKhOUnZMnJmVg SpOTTpb/jmXpEulhBYKE2/akw70KGGNWrVvAkJMTwrHH5/ujtrALUzmPopqg6MozoeyZ rHYjnR+M54+iZ0fjJd/DJFJ6p4SrZ675ONol5mWygdllPxtc/MUzNcV0EXNSH879Ao6G Eine9RZQjifc5aVq1vCyyHBCGf6rK95qKergfu5sc66kdvdyexd99PpLahWh+hzekZvB hBcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uukpkK9TBsuVMv6ylSmKFX9szc+OKlVOKhcv2dbxPPE=; b=HHog7uCKKSqdoBUuLvahpmRBsRLXBWE5ttaHDw21APktShFI0Had9CsedwtLuNPIGp VFHwarkNnqN4uyG//pzBFsPO2dNxXjSRg5Yvz9yqTz19CjLQvw5CbTeuiQ2Wt4R860TG Z4KL3YoK/Kgpf8NKfEae2FEIXYQOY+QGGQmROw957mdYpmEyAThS1019nAyw9yLMl1jR j2r0ffoDZddhD4uyTRjFIDDfOZQAdz2dGvJSOO7Uf0FCQzS4Te9kKs8+kUBw/WP1CfJS NqtdKVN3IR9XITqZ32t7HaZ5FMd0dNGeflqSOu/D7ytFs3oH90AqntThlwiMECdDfEBf GF7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aUW9hxMt; 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 192si1681596qkm.150.2020.04.11.05.18.28; Sat, 11 Apr 2020 05:18:42 -0700 (PDT) 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=@kernel.org header.s=default header.b=aUW9hxMt; 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 S1728281AbgDKMQn (ORCPT + 99 others); Sat, 11 Apr 2020 08:16:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:51018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728277AbgDKMQm (ORCPT ); Sat, 11 Apr 2020 08:16:42 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D35EC20644; Sat, 11 Apr 2020 12:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586607402; bh=zqqPdjzMKrT6Dsh6rmrY0HhxAfJoVgJZbT7J3DgNKKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aUW9hxMtamTf2BgSL8a2OQoOw93nnt9RvTaVhm4mnBdLmCKvq1ddZm8eicIS3uq/h yZcbLmhCjN3tYLNTAiK828BsKESavLQyV/h51rweEysYmEKShlNXJD5Qu0XeW9xQDy NJd7UQqJzJHLFXYE82C93By3eiUqpGWU6n8cOOM8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amritha Nambiar , Alexander Duyck , Sridhar Samudrala , "David S. Miller" Subject: [PATCH 4.19 23/54] net: Fix Tx hash bound checking Date: Sat, 11 Apr 2020 14:09:05 +0200 Message-Id: <20200411115510.815232090@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200411115508.284500414@linuxfoundation.org> References: <20200411115508.284500414@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Amritha Nambiar commit 6e11d1578fba8d09d03a286740ffcf336d53928c upstream. Fixes the lower and upper bounds when there are multiple TCs and traffic is on the the same TC on the same device. The lower bound is represented by 'qoffset' and the upper limit for hash value is 'qcount + qoffset'. This gives a clean Rx to Tx queue mapping when there are multiple TCs, as the queue indices for upper TCs will be offset by 'qoffset'. v2: Fixed commit description based on comments. Fixes: 1b837d489e06 ("net: Revoke export for __skb_tx_hash, update it to just be static skb_tx_hash") Fixes: eadec877ce9c ("net: Add support for subordinate traffic classes to netdev_pick_tx") Signed-off-by: Amritha Nambiar Reviewed-by: Alexander Duyck Reviewed-by: Sridhar Samudrala Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2854,6 +2854,8 @@ static u16 skb_tx_hash(const struct net_ if (skb_rx_queue_recorded(skb)) { hash = skb_get_rx_queue(skb); + if (hash >= qoffset) + hash -= qoffset; while (unlikely(hash >= qcount)) hash -= qcount; return hash + qoffset;