Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5611182pxb; Mon, 28 Mar 2022 14:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJiTHlqSsVAHwHmMorKC1Tx+WJNrM4U+X850vVPgnFu7g3Sj4HEfmvRuRHMTVLSZzyUldh X-Received: by 2002:a63:6c4:0:b0:382:8506:c127 with SMTP id 187-20020a6306c4000000b003828506c127mr11598805pgg.279.1648504658827; Mon, 28 Mar 2022 14:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648504658; cv=none; d=google.com; s=arc-20160816; b=NGWyncvGoCBO528xigfSzbPPeAJR8rsc3yJ4gaH8A5jpZuqy8ELMo4ESuNoJlmnoyy oo0SwKOBVLBF2MiiGlAd8bECs37t8n2cq8NAFudcUVmTnTheGJ8dSRQgRy3PUyFdllXh nkHYlKxB2PpIc+ONyGFT6MxRVk7+ZU6wIeThzjDGJuEOXNsH+JXkIHXxjImeeNHLUCuj u7yChX9vyYFVzgKFW6I1pUfh3kAkeVyoLeDAJWZFAzbud3ApdS/KkTGTtEcyCf6+zWyR jDw9CFJ0vWrkrE+MUbfMnCw380s2dGSe2gTWVz8bVEd8vNGSZP39fXvMtSwyP7/+5qCr SwOQ== 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:subject:cc:to:from:dkim-signature; bh=uuYv067X4kT+NOzbPXQ219scQGqPB4cAH5gxcRBn5ME=; b=xgtEsGn7iYA0W7SFIn88awJ3b4ermQta1fThFz5wOtyVfBWemRRYpbdhzwCcTuR0L7 Mo46uzVioJvOm/dWi+CbBY6OY6AzaL1zqzsxNePF140soUXk2xZiMEucSjX1JHy/hx8Y 3cOiXd4k0qJzq4dz+EVBGW1iucApqdmBZFGJ6io05CkzwGAh/UV6ICelaQg5Zr43UGrr GbTOtYeycrZRDgWLH3agHtZeu4nkKK/udCoONAn4J8DNw5tpCSWkLn50ya70u0jThGCv /MuKanZJOoTRAiiXzlEQw8JmQj9DcIQVam9NePTm6Wk+ur57VZ23H4Z89d/NwrFFoZSG YA+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=RyjbhIYZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f2-20020a17090274c200b00153b2d165f7si14048287plt.511.2022.03.28.14.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=RyjbhIYZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BA0B4245A7; Mon, 28 Mar 2022 14:23:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244904AbiC1SEE (ORCPT + 99 others); Mon, 28 Mar 2022 14:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245146AbiC1SDX (ORCPT ); Mon, 28 Mar 2022 14:03:23 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1601A47380 for ; Mon, 28 Mar 2022 11:01:42 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id u3so20356499ljd.0 for ; Mon, 28 Mar 2022 11:01:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uuYv067X4kT+NOzbPXQ219scQGqPB4cAH5gxcRBn5ME=; b=RyjbhIYZZ7QEgJfc3+9Bvvfbd8rZqEPj/OObh6rKDftThCHs1swjSvwR2LsVN2SMXn ACeJlGqAX0jZU6F0xlnzpYw7hbagCAR/zZLV+JNklkWGwSwvEW1KcmO7l78PUUW1OZgs wLtAHxeU1GiXwYZ5dlr2HBceQA4EVjrnVyjsofmW1YxlcOPqS8S+n+0/Cybudrx+USc7 rYeomXkg6+VSjJSzSesLobXvpvMInAmwMTitRxEfPaI0eQ/8COOsr21qosO8ck+XJ7zq UJEaVw4GqdoS/oHfy7t42zHNWpI34jr4HGSu20CZOZJk3tulDkJdnNzdjdbaxmRyiwFS UPWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=uuYv067X4kT+NOzbPXQ219scQGqPB4cAH5gxcRBn5ME=; b=wFUl/r7hzEy7ITCpF/STTMzUZOa4aCB7pJ6rmmvednBimsmw0K3cZvu7+hT3rZZbvo KSnN4cX2WDO0bZKMaP9F4C6PhlqEKSuOg3kwDWp2GudWnV+deu0bRH+c3IfvkELKgsTS XCeN0QeNVsZzplNgCpXTx37owYNF6HjIfej8UQooe4cSCRm5mtLSbL2GRv/pzZQC2JWD El8XCqu6BgsMlQepXD9G03UgNt4ftB/fgM7fOpYYJXaxem6UeQRpykS/nk2ZDkW3EViu aH4wLF8B5rtPjYd9mWyGLnd8FUoTtVjhm16lAar60vr72TK9Hz96tedxv0hPzMvSPWJe Ms+Q== X-Gm-Message-State: AOAM532dozkxDeTPN2wDGjkj0/j1g9Ysu2CC12IVRlp5Z6WRsAWypeXk WI5XdTpa14+KNOKytEFkvcEecw== X-Received: by 2002:a05:651c:17a3:b0:245:f39e:f2d2 with SMTP id bn35-20020a05651c17a300b00245f39ef2d2mr22295503ljb.490.1648490500316; Mon, 28 Mar 2022 11:01:40 -0700 (PDT) Received: from localhost.localdomain (host-188-190-49-235.la.net.ua. [188.190.49.235]) by smtp.gmail.com with ESMTPSA id a4-20020a2eb164000000b0024988e1cfb6sm1801559ljm.94.2022.03.28.11.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 11:01:39 -0700 (PDT) From: Andrew Melnychenko To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Cc: kuba@kernel.org, davem@davemloft.net, jasowang@redhat.com, mst@redhat.com, yan@daynix.com, yuri.benditovich@daynix.com Subject: [PATCH v5 0/4] RSS support for VirtioNet. Date: Mon, 28 Mar 2022 20:53:32 +0300 Message-Id: <20220328175336.10802-1-andrew@daynix.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Virtio-net supports "hardware" RSS with toeplitz key. Also, it allows receiving calculated hash in vheader that may be used with RPS. Added ethtools callbacks to manipulate RSS. Technically hash calculation may be set only for SRC+DST and SRC+DST+PORTSRC+PORTDST hashflows. The completely disabling hash calculation for TCP or UDP would disable hash calculation for IP. RSS/RXHASH is disabled by default. Changes since v4: * Refactored code. * Fixed sparse warnings, there would be warnings for using restricted fields in vnet header structure. Changes since v3: * Moved hunks a bit. * Added indirection table zero size check for hash report only feature. * Added virtio_skb_set_hash() helper instead of in-place routine. Changes since v2: * Fixed issue with calculating padded header length. During review/tests, there was found an issue that will crash the kernel if VIRTIO_NET_F_MRG_RXBUF was not set. (thx to Jason Wang ) * Refactored the code according to review. Changes since v1: * Refactored virtnet_set_hashflow. * Refactored virtio_net_ctrl_rss. * Moved hunks between patches a bit. Changes since rfc: * Code refactored. * Patches reformatted. * Added feature validation. Andrew (1): drivers/net/virtio_net: Added RSS hash report control. Andrew Melnychenko (3): drivers/net/virtio_net: Fixed padded vheader to use v1 with hash. drivers/net/virtio_net: Added basic RSS support. drivers/net/virtio_net: Added RSS hash report. drivers/net/virtio_net.c | 389 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 376 insertions(+), 13 deletions(-) -- 2.35.1