From nobody Wed Nov 27 07:44:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1700299649; cv=none; d=zohomail.com; s=zohoarc; b=ce+UT5dbDlK/sH45Hxt77GQdLBZZRo7KtaHe+fsaHXypQkFiVogwshkG2SrLiYNSlleovVNfAiBsgXQus6ER/zr+cqD9b2kaQczMw4kGf1CGEmsSd3oD89my7BhfjmMTPT8JbD6EKTpBdOrFV0Lg7zl5XmsqS8YioE5biu47+pM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700299649; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:Message-Id:Reply-To:To; bh=J5wyeqYXcQDwTZvEoKw+MitriEMPjK7MymLG1yKa5N8=; b=fFQDg+Yby+NkLYO6AeukJaXFypPbqssm8Tg4n/y/Eg0dq0VaVcB1At03wW3qygoNZjPf17EOOB7LSZ/XnJvSJPNhPhePrdkTn2r9zinqByfvrAQOeqackY8LVUkf6aZ/IfEJKyd8JXoagcmqhXLHnKheXmfxMy2HsGimgHcz2Lg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700299649829816.2379721143835; Sat, 18 Nov 2023 01:27:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4HbE-0006YO-E6; Sat, 18 Nov 2023 04:26:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4HbC-0006To-6F for qemu-devel@nongnu.org; Sat, 18 Nov 2023 04:26:46 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r4HbA-0003jL-Kr for qemu-devel@nongnu.org; Sat, 18 Nov 2023 04:26:45 -0500 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso2075102b3a.1 for ; Sat, 18 Nov 2023 01:26:44 -0800 (PST) Received: from localhost ([157.82.205.15]) by smtp.gmail.com with UTF8SMTPSA id k9-20020aa788c9000000b006c4d371ef7csm2726832pff.14.2023.11.18.01.26.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Nov 2023 01:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1700299603; x=1700904403; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J5wyeqYXcQDwTZvEoKw+MitriEMPjK7MymLG1yKa5N8=; b=GTJsKqPuK8d4u9NDKiS34TjLh4U9MJruBBjJOjf4bo+T+Zv7B/MwAYVMBcfl17q0Fl IOeYT/shw+oWYkftS1zfsG4P4JBgR86OLasF1/yn8BkBSnbPzurAMk/8u+dL7+l66qpi OQaMJt7XnyjD832Bvif1IIlN/yGhL/5jGyX2uXTyTB8OfSlTZH1+A7GZoyFyL9AWhyr8 CcGRjoVU7TWCmcDK+EKfjRNFHtN45Mx82P8BO1/Ql5ohiJfhmFio+6NoQkhTq4NuHjqh 2+OTv6M/XlNnkcSWO2dQV0Cno+uS0lLQcUyxUHGlhC5Jz/0ajktv6SAD711/XVGwtDm8 BW2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700299603; x=1700904403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J5wyeqYXcQDwTZvEoKw+MitriEMPjK7MymLG1yKa5N8=; b=fzd9k2aJUAXiVKHMVcE4msZvLLRYyK+oMek3aJcPrhqBVs1jtwOlZcjb4ayyq+rC6S qgK138r+bpYqYEZRwB68ztPiM3RdQBLFqsfQT5oQHV3M5VjSuv5WXHOLRZXvS8O9VjoP PDE0QbdkbetzLEF7na3rFa0VsJcqUuKLraczjk7dGbKCblVfJIdB9T5AxWGC61CUSL9/ wNy3V/HZowA6witPjy/vuO0PHfrq+RFVl3AaH6v2y/qX3VVej1dBA3bCE9ehIQ+H3bTc I0kkmpj9dl3C7nDpHUK7ZgNibDp8eBL0F4XXni9W70GumPC1MEJoC83Ze4Afc76LfNiu spjw== X-Gm-Message-State: AOJu0YxSshy6JdSjXvdt4nYcKBoi0ocnsGmJBhU9N7UQ9d6DIFY1qj5d MJe1ue+OoVDTPB2WOPVe13NmEh0v+DLzaFEvAEo= X-Google-Smtp-Source: AGHT+IEg4xLOQpU7jTDBgASJ//FoBP4OdTnv4a+U+XJqy+aYlPy8QmxWxFDHGXZNQcLZoNh6vjGZ+g== X-Received: by 2002:a05:6a00:f0e:b0:6cb:440c:1f60 with SMTP id cr14-20020a056a000f0e00b006cb440c1f60mr2683313pfb.13.1700299603288; Sat, 18 Nov 2023 01:26:43 -0800 (PST) From: Akihiko Odaki To: Cc: qemu-devel@nongnu.org, Yuri Benditovich , Andrew Melnychenko , "Michael S . Tsirkin" , Jason Wang , "Zhang, Chen" , Akihiko Odaki , Michael Tokarev Subject: [PATCH RESEND v7 08/19] virtio-net: Disable RSS on reset Date: Sat, 18 Nov 2023 18:25:48 +0900 Message-ID: <20231118092601.7132-9-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20231118092601.7132-1-akihiko.odaki@daynix.com> References: <20231118092601.7132-1-akihiko.odaki@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=2607:f8b0:4864:20::42f; envelope-from=akihiko.odaki@daynix.com; helo=mail-pf1-x42f.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1700299651662100007 Content-Type: text/plain; charset="utf-8" RSS is disabled by default. Fixes: 590790297c ("virtio-net: implement RSS configuration command") Signed-off-by: Akihiko Odaki Reviewed-by: Michael Tokarev --- hw/net/virtio-net.c | 70 +++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index b6223031e1..4c528baad9 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -599,40 +599,6 @@ static void virtio_net_queue_enable(VirtIODevice *vdev= , uint32_t queue_index) } } =20 -static void virtio_net_reset(VirtIODevice *vdev) -{ - VirtIONet *n =3D VIRTIO_NET(vdev); - int i; - - /* Reset back to compatibility mode */ - n->promisc =3D 1; - n->allmulti =3D 0; - n->alluni =3D 0; - n->nomulti =3D 0; - n->nouni =3D 0; - n->nobcast =3D 0; - /* multiqueue is disabled by default */ - n->curr_queue_pairs =3D 1; - timer_del(n->announce_timer.tm); - n->announce_timer.round =3D 0; - n->status &=3D ~VIRTIO_NET_S_ANNOUNCE; - - /* Flush any MAC and VLAN filter table state */ - n->mac_table.in_use =3D 0; - n->mac_table.first_multi =3D 0; - n->mac_table.multi_overflow =3D 0; - n->mac_table.uni_overflow =3D 0; - memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN); - memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac)); - qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac); - memset(n->vlans, 0, MAX_VLAN >> 3); - - /* Flush any async TX */ - for (i =3D 0; i < n->max_queue_pairs; i++) { - flush_or_purge_queued_packets(qemu_get_subqueue(n->nic, i)); - } -} - static void peer_test_vnet_hdr(VirtIONet *n) { NetClientState *nc =3D qemu_get_queue(n->nic); @@ -3805,6 +3771,42 @@ static void virtio_net_device_unrealize(DeviceState = *dev) virtio_cleanup(vdev); } =20 +static void virtio_net_reset(VirtIODevice *vdev) +{ + VirtIONet *n =3D VIRTIO_NET(vdev); + int i; + + /* Reset back to compatibility mode */ + n->promisc =3D 1; + n->allmulti =3D 0; + n->alluni =3D 0; + n->nomulti =3D 0; + n->nouni =3D 0; + n->nobcast =3D 0; + /* multiqueue is disabled by default */ + n->curr_queue_pairs =3D 1; + timer_del(n->announce_timer.tm); + n->announce_timer.round =3D 0; + n->status &=3D ~VIRTIO_NET_S_ANNOUNCE; + + /* Flush any MAC and VLAN filter table state */ + n->mac_table.in_use =3D 0; + n->mac_table.first_multi =3D 0; + n->mac_table.multi_overflow =3D 0; + n->mac_table.uni_overflow =3D 0; + memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN); + memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac)); + qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac); + memset(n->vlans, 0, MAX_VLAN >> 3); + + /* Flush any async TX */ + for (i =3D 0; i < n->max_queue_pairs; i++) { + flush_or_purge_queued_packets(qemu_get_subqueue(n->nic, i)); + } + + virtio_net_disable_rss(n); +} + static void virtio_net_instance_init(Object *obj) { VirtIONet *n =3D VIRTIO_NET(obj); --=20 2.42.1