Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1522375rdb; Sun, 8 Oct 2023 11:37:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6EG8N/JFCjpIKNz4CtYN/EnyBB5ZXhbALho5+pitEuO/Tc98U6OKl3d333AwftC8TJlGM X-Received: by 2002:a05:6a20:5485:b0:136:e26b:6401 with SMTP id i5-20020a056a20548500b00136e26b6401mr18014110pzk.16.1696790259188; Sun, 08 Oct 2023 11:37:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696790259; cv=none; d=google.com; s=arc-20160816; b=Vd3FucaOH2JSEqw+NpPrq7bCZbCplC4WYRaoF7z5JawfdHljjzgmdMP3VmAHRe7X8X YQXOF0v651gFWLADCh+o+tzHHifk54PReoLIj3KJ4F8fIeNwIWw+vUqyjKuiWauD3rGG vJI+0RE46Zm2e2G3436N9ZilGV1OSSbuftvVd36O77m1CEG+NvkaOKUHbtgFOqiBDI4g vziSabIrvY2fC9g7asBWbqQqwMKV+r2hSsKDi1hP3ZIKwgslu6bqn3bB6vwC4QtACL9x wfVD3aP5hCiI8y5thwv5DLi3lOkMFwuPF7o3OvAnRTuwASeO5fGX5xzNEExZA6uapj7p BVog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XeJ1AX0Emm0B1MNXW9ufDQ+zSWl6WDvAagaRLQUTatk=; fh=aeUE1vhIzgES3jiV/KeS+NvJyPFZAHKLI4bkTDWUfZ0=; b=HTSks9PRkfjl1xTgr9DQa9hnjwZFckz/2WDQc65YZiEiEWX1j7V777q75xwJp0GODP 9oZPHAQYe+ypSRInHtlyNw1YjCK3imiu2ltq7fFqMAJZVSCnIvumSZLMPowgGMdQD2kl YvkeIC28KxmQOWVdE4Bcdy6irV2MKYbpUoDJgcl4MAg/iKHJASiBL+EoZqeCpMbWFf+X +6RkhSV4Ocfdq7hX3Fen0wJkL/ly2WuxCuagkGdRPLf2mhlN20+CUDOJP2j2RrYsGCw7 RzLKbf2Z9LzqzVLFfix8gMyF3FEXbJDWU6y87l7loHOVHE1LXSwDq71i4LkIaZVzkT99 dmHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bw2CaHJV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x3-20020a056a00188300b0068fb8fa1e71si6213269pfh.207.2023.10.08.11.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 11:37:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bw2CaHJV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5142B80ACB70; Sun, 8 Oct 2023 11:37:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344443AbjJHShg (ORCPT + 99 others); Sun, 8 Oct 2023 14:37:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbjJHShf (ORCPT ); Sun, 8 Oct 2023 14:37:35 -0400 Received: from mail-vk1-xa29.google.com (mail-vk1-xa29.google.com [IPv6:2607:f8b0:4864:20::a29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6230AC; Sun, 8 Oct 2023 11:37:33 -0700 (PDT) Received: by mail-vk1-xa29.google.com with SMTP id 71dfb90a1353d-49618e09f16so1256513e0c.2; Sun, 08 Oct 2023 11:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696790253; x=1697395053; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XeJ1AX0Emm0B1MNXW9ufDQ+zSWl6WDvAagaRLQUTatk=; b=bw2CaHJV30W1P8hD9Sxix6Raciuwqe4hW0Uk0mlEYlzd4OnuO5uc7GuIHkz0hbHfTK RQNJ7ycAjlpUYPmJ7Zp4Vo6l/OEQfi1YZkMhxrDvsNUL6B5C6GdunbC/oAcekOHT/AIO RT+yUssx6Vta3fHXs+lPFlhJ5PIZtHmw7Fj7/hicQDhLH7xSJyLZXBX7Twj2ZIzm08Xp XvnSmZZG5yoXH+BiOry4Pzc/k1Dq3tdrCIm21aw4kTB7pR1B91fzk/s9sUZGhDtoUVre i3g8QculUQYsY7ufD/DfMtzkzPBGw3IMo9OKizsufXdIasJuD8Z0y1K0EzMp/PQrhNuH ziGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696790253; x=1697395053; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XeJ1AX0Emm0B1MNXW9ufDQ+zSWl6WDvAagaRLQUTatk=; b=wD3nZzd6qpSJKuO+gHs5SSVQPdeZLT8WTQRqz57JgzF3OkHlXF2tJZS4DPDBbAAn6N lshIHjgGFM6mU9ol6e0j7S0wO27xQQ7xPAx3iwkb3+Zj0nWfbmV6jLXk0FI6aWfaAQZ4 WhtnG4+IIQpxe0tMlv4V/E1vE+QJ/0ryp+XOctTn2vxf2AOcnpzK4F5AJMuXG24DQga/ /hQRx3P8LyaE0+qQ/rIDGAYaWXDpmfSnzpyAoIgORaVUY57LKpOulF46onLPniZvoDYj vy1XKWwMxBQM3zbY2eGOHMlkJjfJ4e5SEQ0eCyh8Az3QIfnmFD38YLExsmie7SDWaX8E cHIA== X-Gm-Message-State: AOJu0Yy6D2HJI+U6iNnEEBUaFx6vEJV446fVJ30B9k5ikROq8oJBMw8r 240EpahogR6axyPvsHI7f/2yo91KyMbGyc0kg/U= X-Received: by 2002:a1f:e641:0:b0:48f:8891:29d9 with SMTP id d62-20020a1fe641000000b0048f889129d9mr10186430vkh.13.1696790252736; Sun, 08 Oct 2023 11:37:32 -0700 (PDT) MIME-Version: 1.0 References: <20231008052101.144422-1-akihiko.odaki@daynix.com> In-Reply-To: <20231008052101.144422-1-akihiko.odaki@daynix.com> From: Willem de Bruijn Date: Sun, 8 Oct 2023 20:36:56 +0200 Message-ID: Subject: Re: [RFC PATCH 0/7] tun: Introduce virtio-net hashing feature To: Akihiko Odaki Cc: Jason Wang , "Michael S. Tsirkin" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, rdunlap@infradead.org, willemb@google.com, gustavoars@kernel.org, herbert@gondor.apana.org.au, steffen.klassert@secunet.com, nogikh@google.com, pablo@netfilter.org, decui@microsoft.com, cai@lca.pw, jakub@cloudflare.com, elver@google.com, pabeni@redhat.com, Yuri Benditovich Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 08 Oct 2023 11:37:38 -0700 (PDT) On Sun, Oct 8, 2023 at 7:21=E2=80=AFAM Akihiko Odaki wrote: > > virtio-net have two usage of hashes: one is RSS and another is hash > reporting. Conventionally the hash calculation was done by the VMM. > However, computing the hash after the queue was chosen defeats the > purpose of RSS. > > Another approach is to use eBPF steering program. This approach has > another downside: it cannot report the calculated hash due to the > restrictive nature of eBPF. > > Introduce the code to compute hashes to the kernel in order to overcome > thse challenges. > > An alternative solution is to extend the eBPF steering program so that it > will be able to report to the userspace, but it makes little sense to > allow to implement different hashing algorithms with eBPF since the hash > value reported by virtio-net is strictly defined by the specification. But using the existing BPF steering may have the benefit of requiring a lot less new code. There is ample precedence for BPF programs that work this way. The flow dissector comes to mind.