From patchwork Thu Jun 22 03:01:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hawkins Jiawei X-Patchwork-Id: 13288209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5E558EB64D7 for ; Thu, 22 Jun 2023 03:03:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCAaH-0002T8-88; Wed, 21 Jun 2023 23:02:09 -0400 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 1qCAaF-0002SU-NL for qemu-devel@nongnu.org; Wed, 21 Jun 2023 23:02:07 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCAaE-00016j-5O for qemu-devel@nongnu.org; Wed, 21 Jun 2023 23:02:07 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6687446eaccso3640382b3a.3 for ; Wed, 21 Jun 2023 20:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687402925; x=1689994925; 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=IGgU1VjcNeGya6YM+UOz4L9JIVFCsGHPFNHnhTmf+vc=; b=ogFj0ofnIqiOePL2jtxNmvn9zTLWB6ZH13nuVyHgoNyoMuKkolaapRHxf0e7vsxC55 CTTMDFUoTdJ9gXUWU1fPXBSgCUId8R329h7EVnMhi+RTibOYsqfJi85uBWZLBYC9YlsL M1AzpDKxLha9fv68Ye8jGnBrChnK+LPoTd9Q4Pk5Sgr4RYDbHNqcpbMr+EVCr5kSMO2k TGOxPPkyh3EdV17ATqqcjXsVSpMV42STEO9w5jVLVM9Nzg9hn1EgNncKm7Suys7xItLQ i9NQOavp1UqJannezfRI/u5L/FqzQhu25RZSxvA/sISx6jpSesJ8NFzUVdbsCka8cFKh gKRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687402925; x=1689994925; 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=IGgU1VjcNeGya6YM+UOz4L9JIVFCsGHPFNHnhTmf+vc=; b=hYtyWyIPVcz8FlLOmew0WgvlWM7bAt3OwJq/hP+0bRt0UG5CkG2podFGzqdKAewIBU e+ygUnP5Zs72yI5j6zBbGrWs3KdQNKGS6d4Ya/aKfoh/AwSjKF535YEOJggh3dmbebFt PdyLPuU7YVjY0DWx3brhPcghUC/H28pHkI20nFyHTOvL6tfvGnFonC2XZ5csbWjKWM8r kpkI33EpgmBIuu0jhtSUnmN9GhMI+y0w0JmMehJ6qU85/UZLpoiRP1uZivMr6l1xcGcu IUUQUvofvfYnFF8iFe+4K59FjdZbWtg/Cm/97A7q9sizfZYiiNmCGBY5/w29GevOB9h8 UewA== X-Gm-Message-State: AC+VfDwGBGmD0qYfnn2v77naGXNppksPVLSC++WpjTf0vwVqrYQSg/6Q 1uyYcJWoDRuuTWtu6WX6ydk= X-Google-Smtp-Source: ACHHUZ7eOd+njWzk6twHLJLM6fd6MRF81dXURXpwKpvvkvUPNllE3wYyRmHb7Wem+yFUdyomnv8yVw== X-Received: by 2002:a05:6a00:15ca:b0:66a:4fc7:ad04 with SMTP id o10-20020a056a0015ca00b0066a4fc7ad04mr2629910pfu.14.1687402924541; Wed, 21 Jun 2023 20:02:04 -0700 (PDT) Received: from localhost ([117.136.38.170]) by smtp.gmail.com with ESMTPSA id t9-20020aa79389000000b00643889e30c2sm3517500pfe.180.2023.06.21.20.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 20:02:04 -0700 (PDT) From: Hawkins Jiawei To: jasowang@redhat.com, mst@redhat.com, eperezma@redhat.com Cc: qemu-devel@nongnu.org, yin31149@gmail.com, 18801353760@163.com Subject: [PATCH RFC 1/3] vdpa: Restore MAC address filtering state Date: Thu, 22 Jun 2023 11:01:42 +0800 Message-Id: <00f72fe154a882fd6dc15bc39e3a1ac63f9dadce.1687402580.git.yin31149@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=yin31149@gmail.com; helo=mail-pf1-x42e.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, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This patch refactors vhost_vdpa_net_load_mac() to restore the MAC address filtering state at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index ecfa8852b5..10264d3e96 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -651,8 +651,45 @@ static int vhost_vdpa_net_load_mac(VhostVDPAState *s, const VirtIONet *n) if (unlikely(dev_written < 0)) { return dev_written; } + if (*s->status != VIRTIO_NET_OK) { + return -EINVAL; + } + } + + if (virtio_vdev_has_feature(&n->parent_obj, VIRTIO_NET_F_CTRL_RX)) { + /* Load the MAC address filtering */ + uint32_t uni_entries = n->mac_table.first_multi, + uni_macs_size = uni_entries * ETH_ALEN, + uni_size = sizeof(struct virtio_net_ctrl_mac) + uni_macs_size, + mul_entries = n->mac_table.in_use - uni_entries, + mul_macs_size = mul_entries * ETH_ALEN, + mul_size = sizeof(struct virtio_net_ctrl_mac) + mul_macs_size, + data_size = uni_size + mul_size; + void *data = g_malloc(data_size); + struct virtio_net_ctrl_mac *ctrl_mac; + + /* Pack the non-multicast(unicast) MAC addresses */ + ctrl_mac = data; + ctrl_mac->entries = cpu_to_le32(uni_entries); + memcpy(ctrl_mac->macs, n->mac_table.macs, uni_macs_size); + + /* Pack the multicast MAC addresses */ + ctrl_mac = data + uni_size; + ctrl_mac->entries = cpu_to_le32(mul_entries); + memcpy(ctrl_mac->macs, &n->mac_table.macs[uni_macs_size], + mul_macs_size); + + ssize_t dev_written = vhost_vdpa_net_load_cmd(s, VIRTIO_NET_CTRL_MAC, + VIRTIO_NET_CTRL_MAC_TABLE_SET, + data, data_size); + g_free(data); - return *s->status != VIRTIO_NET_OK; + if (unlikely(dev_written < 0)) { + return dev_written; + } + if (*s->status != VIRTIO_NET_OK) { + return -EINVAL; + } } return 0; From patchwork Thu Jun 22 03:01:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hawkins Jiawei X-Patchwork-Id: 13288208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8C88FEB64D7 for ; Thu, 22 Jun 2023 03:02:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCAaU-0002UB-5A; Wed, 21 Jun 2023 23:02:22 -0400 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 1qCAaN-0002Ta-H0 for qemu-devel@nongnu.org; Wed, 21 Jun 2023 23:02:16 -0400 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCAaL-000191-6Z for qemu-devel@nongnu.org; Wed, 21 Jun 2023 23:02:14 -0400 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-1a28de15c8aso6670382fac.2 for ; Wed, 21 Jun 2023 20:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687402932; x=1689994932; 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=bHV0woOZfxgxwTcmm6qjynWroBSQmAsAohHPX7OsYtI=; b=VHu1lUG+LmlSKM4KcnvjLJgoYHjNei0YakSZRRbhZca1VLLVg+eu6LNXK7aHgkcrXK QObJoR0P4PFyso0KicdIkNYpU4f2SxW2SGHNe66BGtzOaqZ+5BlrPEI3HUcR+1Xfq+f6 kZFAnEja2UCxiX+WwaRKyW/4uXu++jEO/f15RFv8TyKDVPaM6Zf1f9611FHoW3HCl3/l lGaSVPK5GJ8w618kPVsgcy1WfdMqJA4KCbJNn0QnG+BFc9O743Uoc/H2xrcSUhH3oHzl UO9XL6Ju1fIB46lc1d7wAn7vHnXuUGWfycfR8x2XZbXb37HXry/HpYTwJqlH7/ZP/w6m DazA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687402932; x=1689994932; 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=bHV0woOZfxgxwTcmm6qjynWroBSQmAsAohHPX7OsYtI=; b=e8My8zf+peuL2pAnJ0FcQ5deIZpBsr9NQu0d7mJMRo8LoDy7Ia7EoMhZcXDiWQoMC8 I1i6kxFUIg0hzwXuqPFpNyx/wPqdCQ5LouoZe4ohY2IXEjVNqzTyFoiMzSAXy5o4BBI3 YXHN2xAK1IR577dJ4MOArrULsFq8C1QOXU0g7oYhBDHp8t2MSjpks02Pwdy9KP6hyUFn 3IyRSOhRDbp9K98PvkkMO5W4Jtj4v2psYVb7qmhbmPO+17NVb24+ahBKpxZAjt3niOwE Z3pXdZ7g0zXE5Z/LR6vZm0egnD+n2PrXqYB45s71Pcm74SoFo4FWoBR762dHYTNmvdrF 6SmA== X-Gm-Message-State: AC+VfDxxsykbpvXE5HdAPNe19v+gh6Bg4zMSM5aHQPYMo/xlCcBl6Xok RqUG3Bq3/E4ZiGJgGlefenU= X-Google-Smtp-Source: ACHHUZ5jar53Ifmx4hssZqtSflyCvlT0Yxl9ncns/rz6nEoW7/z+mDI5i6UHtfp70t8h9Vuvistpzg== X-Received: by 2002:a05:6870:c799:b0:19f:9f91:fa4a with SMTP id dy25-20020a056870c79900b0019f9f91fa4amr15025080oab.55.1687402931588; Wed, 21 Jun 2023 20:02:11 -0700 (PDT) Received: from localhost ([117.136.38.170]) by smtp.gmail.com with ESMTPSA id d28-20020a630e1c000000b00528da88275bsm3777202pgl.47.2023.06.21.20.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 20:02:11 -0700 (PDT) From: Hawkins Jiawei To: jasowang@redhat.com, mst@redhat.com, eperezma@redhat.com Cc: qemu-devel@nongnu.org, yin31149@gmail.com, 18801353760@163.com Subject: [PATCH RFC 2/3] vdpa: Restore packet receive filtering state relative with _F_CTRL_RX feature Date: Thu, 22 Jun 2023 11:01:43 +0800 Message-Id: <86eeddcd6f6b04e5c1e44e901ddea3b1b8b6c183.1687402580.git.yin31149@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=yin31149@gmail.com; helo=mail-oa1-x36.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, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This patch introduces vhost_vdpa_net_load_rx_mode() and vhost_vdpa_net_load_rx() to restore the packet receive filtering state in relation to VIRTIO_NET_F_CTRL_RX feature at device's startup. Signed-off-by: Hawkins Jiawei --- net/vhost-vdpa.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 10264d3e96..355a6aef15 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -754,6 +754,76 @@ static int vhost_vdpa_net_load_offloads(VhostVDPAState *s, return *s->status != VIRTIO_NET_OK; } +static int vhost_vdpa_net_load_rx_mode(VhostVDPAState *s, + uint8_t cmd, + uint8_t on) +{ + ssize_t dev_written; + dev_written = vhost_vdpa_net_load_cmd(s, VIRTIO_NET_CTRL_RX, + cmd, &on, sizeof(on)); + if (unlikely(dev_written < 0)) { + return dev_written; + } + if (*s->status != VIRTIO_NET_OK) { + return -EINVAL; + } + + return 0; +} + +static int vhost_vdpa_net_load_rx(VhostVDPAState *s, + const VirtIONet *n) +{ + uint8_t on; + int r; + + if (virtio_vdev_has_feature(&n->parent_obj, VIRTIO_NET_F_CTRL_RX)) { + /* Load the promiscous mode */ + if (n->mac_table.uni_overflow) { + /* + * According to VirtIO standard, "Since there are no guarantees, + * it can use a hash filter or silently switch to + * allmulti or promiscuous mode if it is given too many addresses." + * + * QEMU ignores non-multicast(unicast) MAC addresses and + * marks `uni_overflow` for the device internal state + * if guest sets too many non-multicast(unicast) MAC addresses. + * Therefore, we should turn promiscous mode on in this case. + */ + on = 1; + } else { + on = n->promisc; + } + r = vhost_vdpa_net_load_rx_mode(s, VIRTIO_NET_CTRL_RX_PROMISC, on); + if (r < 0) { + return r; + } + + /* Load the all-multicast mode */ + if (n->mac_table.multi_overflow) { + /* + * According to VirtIO standard, "Since there are no guarantees, + * it can use a hash filter or silently switch to + * allmulti or promiscuous mode if it is given too many addresses." + * + * QEMU ignores multicast MAC addresses and + * marks `multi_overflow` for the device internal state + * if guest sets too many multicast MAC addresses. + * Therefore, we should turn all-multicast mode on in this case. + */ + on = 1; + } else { + on = n->allmulti; + } + r = vhost_vdpa_net_load_rx_mode(s, VIRTIO_NET_CTRL_RX_ALLMULTI, on); + if (r < 0) { + return r; + } + } + + return 0; +} + static int vhost_vdpa_net_load(NetClientState *nc) { VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); @@ -780,6 +850,10 @@ static int vhost_vdpa_net_load(NetClientState *nc) if (unlikely(r)) { return r; } + r = vhost_vdpa_net_load_rx(s, n); + if (unlikely(r)) { + return r; + } return 0; } From patchwork Thu Jun 22 03:01:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hawkins Jiawei X-Patchwork-Id: 13288210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5175FEB64D7 for ; Thu, 22 Jun 2023 03:03:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCAaW-0002UT-KT; Wed, 21 Jun 2023 23:02:29 -0400 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 1qCAaS-0002Ty-5I for qemu-devel@nongnu.org; Wed, 21 Jun 2023 23:02:20 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCAaQ-00019q-NZ for qemu-devel@nongnu.org; Wed, 21 Jun 2023 23:02:19 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-666e3b15370so3891302b3a.0 for ; Wed, 21 Jun 2023 20:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687402937; x=1689994937; 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=pBBdrT3dzjnyM/vOnuRuLp8V9vlx6F1I/QOopUv05pQ=; b=VrWPZLpz6LESkCUi6v34LuYCD00nK9y/HPw30a5zrVFdv3pQxkzKHDVR3u8L8PVOxL Xv1CFzk9i1cs4CnxH2B5rBr0MFOzZm5EowVeJQ/NTJBgSVP99vJ2AmWZ+LtZrWq9gFhr /JQLVOcmXRJJk2nskwat8joiSniwUc/V3vEeiiNB0TRVxl/xKGzV0Ko42UdkXFWT1Lmn 30orjFW35Y5qaf1WhuWF2oPvl3OvMbkKWP7mK62W9s2hKylAnpgplFDpwxM13wI8V/3Q pXrVvwDpJZgXZRBcWf+d5ZDGdFwUar+hBp7oB8x8dkmLoaeHYkzbNb8dWYYVodb1nmgN QBxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687402937; x=1689994937; 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=pBBdrT3dzjnyM/vOnuRuLp8V9vlx6F1I/QOopUv05pQ=; b=JlDfj24Ghm2rmeVcJzLlx1uBPXxqnB7JiFB2RJLqZutsHKX0vNtiT6o11DoDFUSxKh tiZ22HcORSjXarsysZbSG3vHI+T8a5nKkkuhBnrqPltpvPu/NsB32/7xJOC79szyJZ4g amQWc+4gHYJS66bJU6T8fXNLWlmUIl4S6bX4FtC4tM1Bbvgt+qcQI7lFK17wngdv87zW mGyTUpAFfTa2Tlmm03pPha32WD469iyd4awm4ntk6FYBIumA73LhXh2ZOqSQKAjZAEJ1 30cgcnU2MbSyXCcVbs9CM0Y1Cp6oImAUr2I94RmdR/5Eni09iWVEvF6pEfe3ZRUAtQhx Cmtw== X-Gm-Message-State: AC+VfDwXec/3xTso4OEQIM5yUzFREPHPNJI30AOcaSq5hbQkNMFI/aN+ ZUSJ+AGMEpYOapfI7Cog9aA= X-Google-Smtp-Source: ACHHUZ6Od9wV4TeX5peftH1CrYnPpfByfG5vYFxuRMIDV24WZOJeXPX+LUhYyYu2LcysWYXLDKjqeQ== X-Received: by 2002:a05:6a20:734e:b0:10c:dd4f:faa7 with SMTP id v14-20020a056a20734e00b0010cdd4ffaa7mr17928622pzc.1.1687402937241; Wed, 21 Jun 2023 20:02:17 -0700 (PDT) Received: from localhost ([117.136.38.170]) by smtp.gmail.com with ESMTPSA id y20-20020a1709027c9400b001a9bcedd598sm4161724pll.11.2023.06.21.20.02.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 20:02:16 -0700 (PDT) From: Hawkins Jiawei To: jasowang@redhat.com, mst@redhat.com, eperezma@redhat.com Cc: qemu-devel@nongnu.org, yin31149@gmail.com, 18801353760@163.com Subject: [PATCH RFC 3/3] vdpa: Allow VIRTIO_NET_F_CTRL_RX in SVQ Date: Thu, 22 Jun 2023 11:01:44 +0800 Message-Id: <32ae7e729449bde7a4252dd354e27d41f7ad1dac.1687402580.git.yin31149@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=yin31149@gmail.com; helo=mail-pf1-x433.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, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Enable SVQ with VIRTIO_NET_F_CTRL_RX feature. Signed-off-by: Hawkins Jiawei Acked-by: Eugenio PĂ©rez --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 355a6aef15..ca800f97e2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -99,6 +99,7 @@ static const uint64_t vdpa_svq_device_features = BIT_ULL(VIRTIO_NET_F_MRG_RXBUF) | BIT_ULL(VIRTIO_NET_F_STATUS) | BIT_ULL(VIRTIO_NET_F_CTRL_VQ) | + BIT_ULL(VIRTIO_NET_F_CTRL_RX) | BIT_ULL(VIRTIO_NET_F_MQ) | BIT_ULL(VIRTIO_F_ANY_LAYOUT) | BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR) |