From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DFD6C433DB for ; Mon, 18 Jan 2021 03:17:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCF8B224B1 for ; Mon, 18 Jan 2021 03:17:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCF8B224B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:51510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1L2Z-0003RC-LE for qemu-devel@archiver.kernel.org; Sun, 17 Jan 2021 22:17:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1L1i-00030B-6O for qemu-devel@nongnu.org; Sun, 17 Jan 2021 22:16:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1l1L1f-0006BR-Tp for qemu-devel@nongnu.org; Sun, 17 Jan 2021 22:16:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610939778; 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=tWd48Y4luDpOU9+1Gb8wQ592W51KmqxN9aUnA89hxLU=; b=Ys9vBeH5TNvLudvI103DuoFfk93gTd+Xel8rLt96rwaIJKkVISXVtGAJdBkxMd2XrS7jsf fsXFOxVvNKEZvYdjO4aQJtjOERofPSWeUuTOGHKy552pyqnyCb6VyA3Ndj90KFVWQq2Ial JpXS8Aa6j/jX0PbezmxHTkH9ei8vyCY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-2pHrUbRrM4aODkwP7z9hnw-1; Sun, 17 Jan 2021 22:16:16 -0500 X-MC-Unique: 2pHrUbRrM4aODkwP7z9hnw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5D8E0107ACE3; Mon, 18 Jan 2021 03:16:15 +0000 (UTC) Received: from [10.72.13.12] (ovpn-13-12.pek2.redhat.com [10.72.13.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 681395D723; Mon, 18 Jan 2021 03:16:10 +0000 (UTC) Subject: Re: [RFC PATCH v3 5/6] virtio-net: Added eBPF RSS to virtio-net. To: Yuri Benditovich References: <20210114211612.387052-1-andrew@daynix.com> <20210114211612.387052-6-andrew@daynix.com> <266f9040-542e-199e-1903-fb871ae3ad81@redhat.com> From: Jason Wang Message-ID: <21d802e9-b8d9-61b0-b966-0843df2364e1@redhat.com> Date: Mon, 18 Jan 2021 11:16:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.189, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.252, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yan Vugenfirer , Andrew Melnychenko , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , qemu-devel@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 2021/1/17 下午5:04, Yuri Benditovich wrote: > On Fri, Jan 15, 2021 at 9:20 AM Jason Wang wrote: >> On 2021/1/15 上午5:16, Andrew Melnychenko wrote: >>> From: Andrew >>> >>> When RSS is enabled the device tries to load the eBPF program >>> to select RX virtqueue in the TUN. If eBPF can be loaded >>> the RSS will function also with vhost (works with kernel 5.8 and later). >>> Software RSS is used as a fallback with vhost=off when eBPF can't be loaded >>> or when hash population requested by the guest. >>> >>> Signed-off-by: Yuri Benditovich >>> Signed-off-by: Andrew Melnychenko >>> --- >>> hw/net/vhost_net.c | 2 + >>> hw/net/virtio-net.c | 125 +++++++++++++++++++++++++++++++-- >>> include/hw/virtio/virtio-net.h | 4 ++ >>> net/vhost-vdpa.c | 2 + >>> 4 files changed, 129 insertions(+), 4 deletions(-) >>> >>> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c >>> index 24d555e764..16124f99c3 100644 >>> --- a/hw/net/vhost_net.c >>> +++ b/hw/net/vhost_net.c >>> @@ -71,6 +71,8 @@ static const int user_feature_bits[] = { >>> VIRTIO_NET_F_MTU, >>> VIRTIO_F_IOMMU_PLATFORM, >>> VIRTIO_F_RING_PACKED, >>> + VIRTIO_NET_F_RSS, >>> + VIRTIO_NET_F_HASH_REPORT, >>> >>> /* This bit implies RARP isn't sent by QEMU out of band */ >>> VIRTIO_NET_F_GUEST_ANNOUNCE, >>> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c >>> index 09ceb02c9d..37016fc73a 100644 >>> --- a/hw/net/virtio-net.c >>> +++ b/hw/net/virtio-net.c >>> @@ -691,6 +691,19 @@ static void virtio_net_set_queues(VirtIONet *n) >>> >>> static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue); >>> >>> +static uint64_t fix_ebpf_vhost_features(uint64_t features) >>> +{ >>> + /* If vhost=on & CONFIG_EBPF doesn't set - disable RSS feature */ >> I still think we should not clear feature silently. This may break >> migraiton if the feature is cleared on destination. > Do I understand it correctly that if we do not clear features silently > and implement a graceful drop to vhost=off when we can't do what we > need with vhost - then we do not need to add any migration blocker? Yes. I think we won't go with migration blocker since we need support migration in the end. Thanks >