From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id C15683B29D for ; Mon, 16 Aug 2021 07:59:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629115178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JnuIBapx/DIqUD04cPgw31GDRqK+09qdpfB7ZewdXOc=; b=VSJAcvEmCYoEo8JIzg80wxhJYWMA3tqFCJ5kAbT+G7x+d9CNHNgPBwLCfzKMptLmwIfxWG yo6m53I4j6NJpr6VEh2cTU5n8tJUo04jJetV7aVODWgHXt3T9nZLBk4os3x6naOxOhNtZ9 A4omtPGokq3INkqZWSPRdhLO6HN92Cg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-55-3LmBgvAxNKuf-rpYIxVnAA-1; Mon, 16 Aug 2021 07:59:37 -0400 X-MC-Unique: 3LmBgvAxNKuf-rpYIxVnAA-1 Received: by mail-ed1-f69.google.com with SMTP id ec47-20020a0564020d6fb02903be5e0a8cd2so8742191edb.0 for ; Mon, 16 Aug 2021 04:59:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JnuIBapx/DIqUD04cPgw31GDRqK+09qdpfB7ZewdXOc=; b=D74kJ89kdhZvCE8+hi4KiZfuPqHg6/GyK9jm05+h7PeX0kHqwAqU0olYSqorJi+RKw Qrsj1ZnIJpcrvlEtUbh5lOxoB0y35zXPvoq5wwTdKnUu//5o0bhFZgC0PJNmN+9l3bgU sd2nLc0WBU8q2b/zTlI03M6StYz/3Dit6xixadXytTtVULBfMjeFkLYRR00/F6s3i3qf J4jfWNMUrfvr3W9+p8D0sHqW0elKA+uqaHB6d/kL58ZNymHnsNJ9kPZ/WnMdfZozLGnu WhTv/idQQU7al5hj+zE3Q2UIoAgGAwE7zi2uATQ8um6aNR5Ubauuyll6Wix/Wp+Jnxq8 c1qQ== X-Gm-Message-State: AOAM532sUQ/kPid54bHEVouZ0i+hTVnkgGpnNnJmjjylsKIJSayL2zM2 J5f7icBwhanz4jiyYT19qn5f3RHKPpqyRtrqzE6A9sDDFwvlr8pIy7vmu0cvO5uVfHpHlS0tUcb SAP3z+y1llQVG8eTb1fjYyw== X-Received: by 2002:a17:906:f8d5:: with SMTP id lh21mr15409868ejb.6.1629115175643; Mon, 16 Aug 2021 04:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3hyTtQS+QPnGyvy7sgct91YG8I8LsQGaYkTACmr0cG34RW2EcT8JUcuLHqeiSdRvz+t1/MA== X-Received: by 2002:a17:906:f8d5:: with SMTP id lh21mr15409848ejb.6.1629115175326; Mon, 16 Aug 2021 04:59:35 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id c28sm3595681ejc.102.2021.08.16.04.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 04:59:34 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 59D04180185; Mon, 16 Aug 2021 13:59:34 +0200 (CEST) From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= To: netdev@vger.kernel.org Cc: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , cake@lists.bufferbloat.net, Pete Heist Date: Mon, 16 Aug 2021 13:59:17 +0200 Message-Id: <20210816115917.16800-1-toke@redhat.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=toke@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Cake] [PATCH net] sch_cake: fix srchost/dsthost hashing mode X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 11:59:38 -0000 When adding support for using the skb->hash value as the flow hash in CAKE, I accidentally introduced a logic error that broke the host-only isolation modes of CAKE (srchost and dsthost keywords). Specifically, the flow_hash variable should stay initialised to 0 in cake_hash() in pure host-based hashing mode. Add a check for this before using the skb->hash value as flow_hash. Fixes: b0c19ed6088a ("sch_cake: Take advantage of skb->hash where appropriate") Reported-by: Pete Heist Tested-by: Pete Heist Signed-off-by: Toke Høiland-Jørgensen --- net/sched/sch_cake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c index 951542843cab..28af8b1e1bb1 100644 --- a/net/sched/sch_cake.c +++ b/net/sched/sch_cake.c @@ -720,7 +720,7 @@ static u32 cake_hash(struct cake_tin_data *q, const struct sk_buff *skb, skip_hash: if (flow_override) flow_hash = flow_override - 1; - else if (use_skbhash) + else if (use_skbhash && (flow_mode & CAKE_FLOW_FLOWS)) flow_hash = skb->hash; if (host_override) { dsthost_hash = host_override - 1; -- 2.32.0