Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1340897pxu; Thu, 17 Dec 2020 07:49:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBc3opZsy088AwHG9IkS3IkH8NuJjQtSDoqjqeFEM+Uob/+6K6uLrRwT8RwSofYYpuKDg/ X-Received: by 2002:a17:906:3553:: with SMTP id s19mr34788404eja.95.1608220193142; Thu, 17 Dec 2020 07:49:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608220193; cv=none; d=google.com; s=arc-20160816; b=lkPX5tUdlYq0oUvj6zc6+84BX7x7F8M3hPD4qZoSxeQymKJFeoOdaqSoxNROn6c6n6 2u5RDPVRSsxvfMQVSQz8Fxf+QV/cEiug0gbjwZHBHXHnf+3GmrACHvzZjQ8/c9TA6WYd YRXBe+FDRRUhoEIhhIYujjSBW30zdF6HNVf3MvUpxZVMeyT+1W3xRmRj8uKdV7VLWcW1 lMZzr+vw5n7m36mELV+GpD2lJoMQvMcbuFS83z2agMj6OCMyYaGWWn2AD5LqLk1OmAh5 rVX7W3VBICVfgk5Ty+MExhGRhBlmI+IHlKYm6lE8/HYIs/Z5EXKdo3aEG+xsZUDNq/DM q9YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=kLRlpJ2TWLDPPAbeHaEFlx9t97OCc2bBAhpKSZjJPI0=; b=NvcMN03wNSbPnOpEeDua1O0qnv7JxCrvav53ysx9WjD2+/to3htHM54LHk5Oia6SDz 6ybQS2YpMJarGSVdliaJocDpKKNJkQTX0fwk/RULtoyJkE3WysygrYQD9Oy8ORAVj1W2 MtSQbDgnde7GElkOpBQacNC5mrcXehtQZ9xfU8TRMPO2U9kSP3eNtHBN5vwC3XFROYSy 0gAzMTDj2mEoOBwFURjoP4lWt1MlssJ1G5JEwAnBa1LNLfu58ib4lj68zIe7rSQ1TD2V b8J0l9OTJqYUQaPhtiNEv03qOmFQPfbr+EHbtFn3l5zfaEO3+Tx8y3oB+wY7IkYs7nGu HUQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=EfekbltB; 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 c9si4633439edr.4.2020.12.17.07.49.21; Thu, 17 Dec 2020 07:49:53 -0800 (PST) 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=EfekbltB; 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 S1727253AbgLQPtR (ORCPT + 99 others); Thu, 17 Dec 2020 10:49:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbgLQPtQ (ORCPT ); Thu, 17 Dec 2020 10:49:16 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC34FC0617A7 for ; Thu, 17 Dec 2020 07:48:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Subject:From:References:Cc:To:Sender:Reply-To: 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=kLRlpJ2TWLDPPAbeHaEFlx9t97OCc2bBAhpKSZjJPI0=; b=EfekbltB2eoVvC+9T8yVXdtZt1 STQVDTg8G4oa+U1+cfZJPnItVDlkSKjXiSXuV1kVoyzSxHxGodDxj1VQ/f1kosFJ4FbCQszRtvs3N QE8n9W482xtl4m5jUC0M08CkGMwbHXZA3IlkSDA1CtQsJf2HbI7g+GiKGoSk/K8Z5/y0=; Received: from p4ff13815.dip0.t-ipconnect.de ([79.241.56.21] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kpvVo-0003um-Sd; Thu, 17 Dec 2020 16:48:16 +0100 To: =?UTF-8?Q?Toke_H=c3=b8iland-J=c3=b8rgensen?= , linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net References: <20201216204316.44498-1-nbd@nbd.name> <20201216204316.44498-2-nbd@nbd.name> <87czz8bqbj.fsf@toke.dk> <871rfobn8w.fsf@toke.dk> From: Felix Fietkau Subject: Re: [PATCH 2/7] mac80211: force calculation of software hash for tx fair queueing Message-ID: <07ad2533-b477-abf1-5176-0521ca9ddf82@nbd.name> Date: Thu, 17 Dec 2020 16:48:15 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <871rfobn8w.fsf@toke.dk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-12-17 14:01, Toke Høiland-Jørgensen wrote: > Felix Fietkau writes: > >> On 2020-12-17 12:54, Toke Høiland-Jørgensen wrote: >>> Felix Fietkau writes: >>> >>>> Depending on the source, a hardware calculated hash may not provide the >>>> same level of collision resistance. >>> >>> This seems like it would have performance implications? >>> >>> Also, this can potentially discard information from tunnels that >>> preserve the hash before encapsulation (we added support for this to >>> Wireguard which had some nice effects on queueing of encapsulated >>> traffic). >> If the hash was calculated in software using the flow dissector, it will >> be preserved, even if it went through a few virtual interfaces. >> The only hashes discarded are hardware generated ones. > > Yeah, but I was thinking something like: > > Packet comes in with HW hash -> gets encapsulated (preserving the hash) > -> gets to mac80211 which discards the HW hash. So now you're replacing > a (possibly bad-quality) HW hash with a software hash of the *outer* > encapsulation header... If this becomes a problem, I think we should add a similar patch to wireguard, which already calls skb_get_hash before encapsulating. Other regular tunnels should already get a proper hash, since the flow dissector will take care of it. The reason I did this patch is because I have a patch to set the hw flow hash in the skb on mtk_eth_soc, which does help GRO, but leads to collisions on mac80211 fq. - Felix