Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1419530pxu; Thu, 17 Dec 2020 09:29:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+BriQE/8EvUBg5a7bOIIhulokQhVjeBxm6lz/8uesGLYUb/fKC9KMWc0evUjDYqdaKrW5 X-Received: by 2002:a17:906:8152:: with SMTP id z18mr15495ejw.317.1608226183531; Thu, 17 Dec 2020 09:29:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608226183; cv=none; d=google.com; s=arc-20160816; b=VlSo/rqak8CHzs3zye2Y57coi7VoNniCtokgjRnrIL158sEFAHJi3BtrRexVF/zXlt IGn/cL1s6oiTydmOPFNfBGRQmWy/yBykn4GL98vFJhTkv0RZrpAyV1ynCrWxit05bWjF s+XrJ/kPi4X7oUrE7wl2Uz5PluGrnRRH16gimo970eyTSx6ngiTaUYuuBGQnfaXXgPbN dw+/9TIB+Nl5pUj7zV3eIDh7SJxnHb2JPL2M/gxn5xHtGvQnQ2yZJvv6YNiN8Ljy+0/g wS18xFrBE3IloZvkWYSgyAvE0vVBBOrMSe/53qjvKF11fTYdWMCkwmKCa8RqZ+mD2idT WdcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=xV3PQej53DHScga/o3zNGKC62Rcf9XvEpfu0uG8/7Jg=; b=C7ZI6pje+VByGaeQA+Vl1MKDwYM8q39XAFcXSdN54vvlQnl7rX6kw9gv1OpDIOVSUq 48dk559Yb5r8l9i4KL6SaWCjMLbWZ+V/lfp9lXVR7XPfBs+SbaGHhbQgBj/rbPDErDvc 6vfnzhrZvpT3Z4dsi6afFvQsZp9LiPEnqXG2gHePH+QILF9voQ07UtcYz+r1UhgCev4r m8gs9g1O10PCURT1QvkQ18zZvQreMI0ZlbqR8BwO3NOFnWlcVluDUhoPsB9DlrmVpvOC naQMBqeoYd6Naa2fwmhBulrGDu9g2wgUzqfHDpiyCM6+eAzxRcsx9Q3g1uQ2kAOPfXao IVyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gCxRd4r7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id si15si3086257ejb.394.2020.12.17.09.29.19; Thu, 17 Dec 2020 09:29:43 -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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gCxRd4r7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729113AbgLQR1j (ORCPT + 99 others); Thu, 17 Dec 2020 12:27:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38336 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727723AbgLQR1i (ORCPT ); Thu, 17 Dec 2020 12:27:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608225971; 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: in-reply-to:in-reply-to:references:references; bh=xV3PQej53DHScga/o3zNGKC62Rcf9XvEpfu0uG8/7Jg=; b=gCxRd4r7+ssKi69t5WWcI4k+y4Pgca/Yg9uD+sQW5BcLStF2o6K2kjZZpx3mkE6TvJ9Xz2 8XkxLZpzLf/3mqe2EsFMjN+JMQ0XE24QXx49uPlLe+SpRa3c41nWR1bts2xCbq2/YpgqFB s5kE3HvT90kW5aPC+tOkbDAKUysEkGY= 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-165-IO-T6wMvNxqAP1iYXgnA5Q-1; Thu, 17 Dec 2020 12:26:09 -0500 X-MC-Unique: IO-T6wMvNxqAP1iYXgnA5Q-1 Received: by mail-ed1-f69.google.com with SMTP id bo22so13666684edb.15 for ; Thu, 17 Dec 2020 09:26:09 -0800 (PST) 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:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=xV3PQej53DHScga/o3zNGKC62Rcf9XvEpfu0uG8/7Jg=; b=WN427r/S3hvC92jHyhJoAK7HrFYX2yG8z2MQMLcnxjrh1iJ6IodXTHRS9DQwkt9f4w vd+W+oLON5kn6MHtTq6MYOi/EJpXBgUiohJd8cBR/wjmoIHCsZwvtGH8HsVCe50Szt3k H7kMKQNEiEYb8JfDWtZHsYQnQhPJhg7eTiWQUKNvvtMOR3upW20F9K2Q3mZLOyLgVdH0 t6543yV1F9s3euKl6oby5ZR41hJ2xEwTCIgmys8U1XCSJ3Y3IJ+9anqHRbGqklALWRwy 3oUlZVC/xLdSWnvvCFGNm4eB8NsiG4TFcNdcJ5ImVQqy+y57kgfb3lmaaB2UTUXU5pzx tb4w== X-Gm-Message-State: AOAM533IFpm2iH6C6o2vTzSlT50US77HOSjYXhPDOVq5y1Fupz/VT1Wu zpuIk3pe9tv1HaW90bZNz/16OonytZySrF8ZSerBMOgJCFK5fB3rzlov46sq3zV4Zfd0qW+gUBX 9eEnnxrRYwrN2GPr3gid03zy0Q3Y= X-Received: by 2002:a17:906:da08:: with SMTP id fi8mr35878776ejb.517.1608225967685; Thu, 17 Dec 2020 09:26:07 -0800 (PST) X-Received: by 2002:a17:906:da08:: with SMTP id fi8mr35878746ejb.517.1608225967257; Thu, 17 Dec 2020 09:26:07 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id h15sm23776051edz.95.2020.12.17.09.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 09:26:06 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 4C8701802A7; Thu, 17 Dec 2020 18:26:06 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Felix Fietkau , linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: Re: [PATCH 2/7] mac80211: force calculation of software hash for tx fair queueing In-Reply-To: <07ad2533-b477-abf1-5176-0521ca9ddf82@nbd.name> References: <20201216204316.44498-1-nbd@nbd.name> <20201216204316.44498-2-nbd@nbd.name> <87czz8bqbj.fsf@toke.dk> <871rfobn8w.fsf@toke.dk> <07ad2533-b477-abf1-5176-0521ca9ddf82@nbd.name> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 17 Dec 2020 18:26:06 +0100 Message-ID: <874kkk9wep.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Felix Fietkau writes: > On 2020-12-17 14:01, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> Felix Fietkau writes: >>=20 >>> On 2020-12-17 12:54, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >>>> Felix Fietkau writes: >>>>=20 >>>>> Depending on the source, a hardware calculated hash may not provide t= he >>>>> same level of collision resistance. >>>>=20 >>>> This seems like it would have performance implications? >>>>=20 >>>> 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. >>=20 >> Yeah, but I was thinking something like: >>=20 >> 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. But then we'd need to go around adding this to all the places that uses the hash just to work around a particular piece of broken(ish) hardware. And we're hard-coding a behaviour in mac80211 that means we'll *always* recompute the hash, even for hardware that's not similarly broken. > 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. So wouldn't the right thing to do here be to put a flag into the RX device that makes the stack clear the hash after using it for GRO? -Toke