Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp339502ybg; Sun, 26 Jul 2020 06:17:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyw+WmTNkui8GnhNHfbccpfB2kaT8hdvi8WOPJ/nGf53yeWWZFUn5Eeoj0OMCHUtZ9k2zR X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr15912496ejb.230.1595769419851; Sun, 26 Jul 2020 06:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595769419; cv=none; d=google.com; s=arc-20160816; b=fZlHalXBgwPeG1f5S/sW1hWeYzt+o8P6ToV3VZNol1t5cYBQIpx+VL3PDmnEaqWZKp LrR5Ny1+3pbghziPv5toYfO+XOyvszXJdexJ0Al5FE2Hb5oKJhpkUl6H/Fjxov6xWeeX 6eM6U8n7zi2qcGP1R3DWUcl11sJUaH8QOECMz1kjfv1ggcWOYekkWdBpgsZBm16jr3XS 7oYodkJAyePRR8GO16GFect96BJGaE8ASHeGIIpLGqWrinfn21iFX3Vnj4aptruAuC0W 7hS3fcyjfx7IO6FhRj7LSGIPPKFMw5yK7Luo5Xv6mFB8kH2lgrVJ8OsNO/8wboI4EY// n4Mg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=KxARJkb0hRPwKgClAui5vNEwjfRs8wKEUr9ny2/B3hY=; b=s/A2F38veOqB1GPROjs6nXdgXZ81u0qOfeLMXM1E7ewJnbQQdJ1TPwBVBNzPfusOw0 pAmuWABcHmtMIgPeIehuo9TjkLU3DUdiUAIp7ujlFsYZ2sklJZ84294bN6f6G2ERp7v9 nFRnDGlyB8FBTn24MH+BDNJjKwIpHu8EVt2IOziFGHC/16dxP9f6O75sk4VEIng/fXP9 mVCMyXhrY3g6kUx7OzPs3JHKVVvNDElVUEG+EzvQUaBGvEalTaNEEtDsvfGQkCppJZef o/FRBAS12SF8r8One701DYZpJUEeLAZpKrMLy+5bNXHj4KdNvopCiBpfVNwbd6tjeW+f RBpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=ga0Gs1xK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id be1si1036470edb.53.2020.07.26.06.16.35; Sun, 26 Jul 2020 06:16:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=ga0Gs1xK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727108AbgGZNJv (ORCPT + 99 others); Sun, 26 Jul 2020 09:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbgGZNJv (ORCPT ); Sun, 26 Jul 2020 09:09:51 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13620C0619D2 for ; Sun, 26 Jul 2020 06:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=KxARJkb0hRPwKgClAui5vNEwjfRs8wKEUr9ny2/B3hY=; b=ga0Gs1xK00SF2G+ULuJ55A/fCH T2YZy3a5DLU9Qq/iyI/n5Nf4zPFejgC0gNCxroBopdOZ17PxBwNHjdpzRAV9JGWe7rRQzcG2BRU7+ Oc6hf/TPe9xYEyTLrvxy6p9huSC/IphnT41axAXcqP74Nwdy8vooTvdT+RsS33M6pWck=; Received: from p5b206d80.dip0.t-ipconnect.de ([91.32.109.128] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1jzgPU-0000J8-Pd; Sun, 26 Jul 2020 15:09:48 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH 1/2] net/fq_impl: use skb_get_hash instead of skb_get_hash_perturb Date: Sun, 26 Jul 2020 15:09:46 +0200 Message-Id: <20200726130947.88145-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This avoids unnecessary regenerating of the skb flow hash Signed-off-by: Felix Fietkau --- include/net/fq.h | 1 - include/net/fq_impl.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/include/net/fq.h b/include/net/fq.h index 2ad85e683041..e39f3f8d5f8a 100644 --- a/include/net/fq.h +++ b/include/net/fq.h @@ -69,7 +69,6 @@ struct fq { struct list_head backlogs; spinlock_t lock; u32 flows_cnt; - siphash_key_t perturbation; u32 limit; u32 memory_limit; u32 memory_usage; diff --git a/include/net/fq_impl.h b/include/net/fq_impl.h index 38a9a3d1222b..e73d74d2fabf 100644 --- a/include/net/fq_impl.h +++ b/include/net/fq_impl.h @@ -108,7 +108,7 @@ static struct sk_buff *fq_tin_dequeue(struct fq *fq, static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb) { - u32 hash = skb_get_hash_perturb(skb, &fq->perturbation); + u32 hash = skb_get_hash(skb); return reciprocal_scale(hash, fq->flows_cnt); } @@ -308,7 +308,6 @@ static int fq_init(struct fq *fq, int flows_cnt) INIT_LIST_HEAD(&fq->backlogs); spin_lock_init(&fq->lock); fq->flows_cnt = max_t(u32, flows_cnt, 1); - get_random_bytes(&fq->perturbation, sizeof(fq->perturbation)); fq->quantum = 300; fq->limit = 8192; fq->memory_limit = 16 << 20; /* 16 MBytes */ -- 2.24.0