Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2188985pxv; Sun, 11 Jul 2021 05:34:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVBcN3ZjX68CzSftQ9fHBPiCU8VBisNNWPPJGKQiSsVPwHLw5XXHofHGaqSJgRTLAaDXtG X-Received: by 2002:a05:6638:328e:: with SMTP id f14mr9447995jav.41.1626006859539; Sun, 11 Jul 2021 05:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626006859; cv=none; d=google.com; s=arc-20160816; b=lA6WpJ42lvxXx5bbJPyrkzUvdk9muruWRrrJkQd+daOzMBVfM0ciDG9a0JLzD42vvw BoP0hjfH7DrjjvAtFdqUA3LmaiN6xDA83MJ5En3gnt3bQCmnwJ9PMnaVC7WXS5mmJ7pa 7ZMNFgAOflyuF32CiC+WmwOKnQ+B+VeFVhPMbbNA3Fi9poV+evo05C5H6wXx08s31ZFx LTei1lg++5f4/SfsMy4OO4uoMuwe00jcIji3zT4W7gwnyLMIs3J8zaxujDGd9vsU+ayU BxCUF44dgg9MOz1guqp+W+hEYdA1SiUhYW75tbDciAPchYW7g/KfldRhoJoYK47D/5Ro Qvdw== 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:from:references :cc:to:subject:dkim-signature; bh=yGD3+h86TDL0Au0dytegwySUcFcEQ6eQwHK3EqtKFOE=; b=0FChU+97DcnSMt+sBXRxyHstzv5DyvywVzkA057G4ZHHEJeydTG6k5m+7DWGbEzoTj zpC6/arkLbtnbsPpWhXzrCeTYzb+113F4nBzJUBQdxmN0v8jotxPkjks4dPSgd4Sl1mT tabab/91oas5a4rp8+QddZasqWrpFjJCZ8YbgUqIKn9ciVpVmATwi/ECXn1E2LNM93CM MAfMnMlQcx3p45OCyV2HBtpPVcNq+Fs/fLwSiL6h63Nl022znQl8aJ6KVY/wCJf30mZm VD29QOl/mOHSqdsdnck6Em6p8jylOan4Nn7rkMd16J5JCJ3P93ba8BjAG0Q9BN93T5Dt V6Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=gQ7B3LwZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si13517615ioj.78.2021.07.11.05.34.06; Sun, 11 Jul 2021 05:34:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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 (test mode) header.i=@wp.pl header.s=1024a header.b=gQ7B3LwZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232768AbhGKMgX (ORCPT + 99 others); Sun, 11 Jul 2021 08:36:23 -0400 Received: from mx4.wp.pl ([212.77.101.11]:25728 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232554AbhGKMgX (ORCPT ); Sun, 11 Jul 2021 08:36:23 -0400 Received: (wp-smtpd smtp.wp.pl 30827 invoked from network); 11 Jul 2021 14:33:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1626006814; bh=yGD3+h86TDL0Au0dytegwySUcFcEQ6eQwHK3EqtKFOE=; h=Subject:To:Cc:From; b=gQ7B3LwZBxyuYVWozeXPPeSje5qiyZJsCYPaZKt9h1uec5e4nz6md1NPA8uvQiWb4 Bq3cm7MrtltPqrGRw5dqPKxHJKn3b0nzf4/ufsBztz9L+Awlk4p/NFOl0evqJxYDaz w6nEcPteqrPN9RSdJT5jNCsNSPuvSjl9qOH4PDUQ= Received: from ip-5-172-255-228.free.aero2.net.pl (HELO [100.82.33.98]) (olek2@wp.pl@[5.172.255.228]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 11 Jul 2021 14:33:34 +0200 Subject: Re: [PATCH nf] Revert "netfilter: flowtable: Remove redundant hw refresh bit" To: Martin Blumenstingl , pablo@netfilter.org Cc: nbd@nbd.name, coreteam@netfilter.org, davem@davemloft.net, fw@strlen.de, kadlec@netfilter.org, kuba@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, roid@nvidia.com References: <20210614215351.GA734@salvia> <20210711010244.1709329-1-martin.blumenstingl@googlemail.com> From: Aleksander Bajkowski Message-ID: <74c866f1-48e6-eccc-5bde-e9051f1c51cb@wp.pl> Date: Sun, 11 Jul 2021 14:33:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210711010244.1709329-1-martin.blumenstingl@googlemail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-WP-MailID: 87004a05ed87b34b5ad386b03fa5ffb3 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000005 [AQbA] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, Thanks for the IRC log. Today I repeated my previous tests. I think I had to have Hardware flow offloading enabled before, even though Lantiq xRX200 doesn't support it. With only the software flow offloading turned on, I do not see a significant performance drop. Today's results (IPv6 routing with DSA driver and Burst Length Patch): Device Kernel Flow offload Upload Download HH5A 5.4.128 Disabled 101 170 HH5A 5.10.46 Disabled 95.4 159 HH5A 5.10.42 Disabled 96.6 165 HH5A 5.10.41 Disabled 101 165 HH5A 5.4.128 Soft 471 463 HH5A 5.10.46 Soft 553 472 HH5A 5.10.42 Soft 556 468 HH5A 5.10.41 Soft 558 492 HH5A 5.4.128 Soft+Hard 434 460 HH5A 5.10.46 Soft+Hard 229 181 HH5A 5.10.42 Soft+Hard 228 177 HH5A 5.10.41 Soft+Hard 577 482 It seems my workaround is unnecessary. Best regards, Aleksander Jan Bajkowski On 7/11/21 3:02 AM, Martin Blumenstingl wrote: > Hi Aleksander, > >> The xt_flowoffload module is inconditionally setting on the hardware >> offload flag: > [...] >> >> which is triggering the slow down because packet path is allocating >> work to offload the entry to hardware, however, this driver does not >> support for hardware offload. >> >> Probably this module can be updated to unset the flowtable flag if the >> harware does not support hardware offload. > > yesterday there was a discussion about this on the #openwrt-devel IRC > channel. I am adding the IRC log to the end of this email because I am > not sure if you're using IRC. > > I typically don't test with flow offloading enabled (I am testing with > OpenWrt's "default" network configuration, where flow offloading is > disabled by default). Also I am not familiar with the flow offloading > code at all and reading the xt_FLOWOFFLOAD code just raised more > questions for me. > > Maybe you can share some info whether your workaround from [0] "fixes" > this issue. I am aware that it will probably break other devices. But > maybe it helps Pablo to confirm whether it's really an xt_FLOWOFFLOAD > bug or rather some generic flow offload issue (as Felix suggested on > IRC). > > > Best regards, > Martin > > > [0] https://github.com/abajk/openwrt/commit/ee4d790574c0edd170e1710d7cd4819727b23721 > > > nbd: I saw your flow offloading updates. Just to make sure, this issue hasn't been addressed yet, has it? https://lore.kernel.org/netdev/20210614215351.GA734@salvia/ > i don't think so > can you reproduce it? > nbd: Not really, I don't have the hardware. > It's lantiq, I think (bthh5a). > However, I believe dwmw2_gone has one, iirc. > nbd: I also have a HH5A. if you have any patch ready you can also send it as RFC on the mailing list and Cc Aleksander > xdarklight: Have you been able to reproduce the flow offloading regression? > I can try (typically I test with a "default" network configuration, where flow offloading is disabled) > xdarklight: I don't have a lot of details, only this thread: https://github.com/openwrt/openwrt/pull/4225#issuecomment-855454607 > rsalvaterra: this is the workaround that Aleksander has in his tree: https://github.com/abajk/openwrt/commit/ee4d790574c0edd170e1710d7cd4819727b23721 > xdarklight: Well, but that basically breaks hw flow offloading everywhere else, if I'm reading correctly. :) > rsalvaterra: I am not arguing with that :). I wanted to point out that Pablo's finding on the netfilter mailing list seems to be correct > xdarklight: Sure, which is why I pinged nbd, since he's the original author of the xt_FLOWOFFLOAD target. > What it seems is that it isn't such trivial fix. :) > I looked at the xt_FLOWOFFLOAD code myself and it raised more questions than I had before looking at the code. so I decided to wait for someone with better knowledge to look into that issue :) > Same here. I just went "oh, this requires divine intervention" and set it aside. :P > xdarklight: which finding did you mean? > nbd: "The xt_flowoffload module is inconditionally setting on the hardware offload flag" [...] flowtable[1].ft.flags = NF_FLOWTABLE_HW_OFFLOAD; > nbd: from this email: https://lore.kernel.org/netdev/20210614215351.GA734@salvia/ > i actually think that finding is wrong > xt_FLOWOFFLOAD registers two flowtables > one with hw offload, one without > the target code does this: > table = &flowtable[!!(info->flags & XT_FLOWOFFLOAD_HW)]; > so it selects flowtable[1] only if info->flags has XT_FLOWOFFLOAD_HW set > nbd: That's between you and Pablo, I mustn't interfere. :) > i did reply to pablo, but never heard back from him > nbd: The merge window is still open, he's probably busy at the moment… maybe ping him on Monday? > nbd: it seems that your mail also didn't make it to the netdev mailing list (at least I can't find it) > xdarklight: Now that you mention it, neither do I. > he wrote to me in private for some reason > oh okay. so for me to summarize: you're saying that the xt_FLOWOFFLOAD code should be fine. in that case Aleksander's workaround (https://github.com/abajk/openwrt/commit/ee4d790574c0edd170e1710d7cd4819727b23721) is also a no-op and the original problem would still be seen > xdarklight: I don't think it's a no-op, otherwise he wouldn't carry it in his tree… maybe something's wrong in the table selection? table = &flowtable[!!(info->flags & XT_FLOWOFFLOAD_HW)]; does look correct, though. > xdarklight: well, it's not a no-op if the issue was reproduced with option flow_offloading_hw 1 in the config > nbd: Uh… If he has option flow_offloading_hw '1' on a system which doesn't support hw flow offloading… he gets to keep the pieces, right? > it shouldn't break > and normally i'd expect the generic flow offload api to be able to deal with it without attempting to re-enable hw offload over and over again >