From nobody Sun May 19 16:58:49 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614146252; cv=none; d=zohomail.com; s=zohoarc; b=QCPWHwR7of1hvHceHkB3t5l5FoVLcdTE1sCE6hlazUjA9oEW8DoI279b/9kKT8OY34HXny2gwIbawKH7bqZdnxkd1CWEqbJMAAzPnMipg0z4B1tp5VAWZx9m4Jz4+8UupqoYt+VU1IyxQtTV+/0uzMqutkGOY2rIgZfNRN6n6Ik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614146252; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IfWm4PdhuA9QiJZbIsDcCk59KKFR9wnSNUKDqARuyJk=; b=J0yYyW/cUyYSVxUCj5ZXy5+wXQjj6RmuCnG1IK+41jhk73d7XtN7fQ6hla5Ja8RMX1t+xh7Xh+dq60wBmqwvQNtNKCySdV61aSIaJ8mKFUcIx01ySfcrMU3Oj7KHz5u1tuX8Ze583yXa7y6TSH/IlR0dqBMtxabEu/6riCkDY5k= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614146252004582.1292314638812; Tue, 23 Feb 2021 21:57:32 -0800 (PST) Received: from localhost ([::1]:56688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEnAw-0005hK-Qo for importer@patchew.org; Wed, 24 Feb 2021 00:57:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEn7m-0001au-5M for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lEn7k-0003rh-8k for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:13 -0500 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-423-Yq38fqbPO9uFhLBEN7HZlA-1; Wed, 24 Feb 2021 00:54:09 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 667E251D9 for ; Wed, 24 Feb 2021 05:54:08 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D3706061F; Wed, 24 Feb 2021 05:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614146051; 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=IfWm4PdhuA9QiJZbIsDcCk59KKFR9wnSNUKDqARuyJk=; b=hWXcr6pI1F1kvgOH9V+PqaWXf/LMaJ1ySUU3Gb9Rh9ZUCElGR48N7fWK/t6jciyeMF4sgq ZvVBAqaFnHtxM2I9R8n3YA7jnmeJvywarISxysf2XiTJC5v1e+dL8JGhRZca1DEFNecgl8 LYMtmKsx+e/vik1ydL8+aYXsVzVIBzY= X-MC-Unique: Yq38fqbPO9uFhLBEN7HZlA-1 From: Jason Wang To: jasowang@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 1/6] net: introduce qemu_receive_packet() Date: Wed, 24 Feb 2021 13:53:56 +0800 Message-Id: <20210224055401.492407-2-jasowang@redhat.com> In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-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: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Some NIC supports loopback mode and this is done by calling nc->info->receive() directly which in fact suppresses the effort of reentrancy check that is done in qemu_net_queue_send(). Unfortunately we can use qemu_net_queue_send() here since for loop back there's no sender as peer, so this patch introduce a qemu_receive_packet() which is used for implementing loopback mode for a NIC with this check. NIC that supports loopback mode will be converted to this helper. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/net/net.h | 5 +++++ include/net/queue.h | 8 ++++++++ net/net.c | 38 +++++++++++++++++++++++++++++++------- net/queue.c | 22 ++++++++++++++++++++++ 4 files changed, 66 insertions(+), 7 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 919facaad2..65eb8a58c5 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -144,12 +144,17 @@ void *qemu_get_nic_opaque(NetClientState *nc); void qemu_del_net_client(NetClientState *nc); typedef void (*qemu_nic_foreach)(NICState *nic, void *opaque); void qemu_foreach_nic(qemu_nic_foreach func, void *opaque); +int qemu_can_receive_packet(NetClientState *nc); int qemu_can_send_packet(NetClientState *nc); ssize_t qemu_sendv_packet(NetClientState *nc, const struct iovec *iov, int iovcnt); ssize_t qemu_sendv_packet_async(NetClientState *nc, const struct iovec *io= v, int iovcnt, NetPacketSent *sent_cb); ssize_t qemu_send_packet(NetClientState *nc, const uint8_t *buf, int size); +ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf,int siz= e); +ssize_t qemu_receive_packet_iov(NetClientState *nc, + const struct iovec *iov, + int iovcnt); ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int s= ize); ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf, int size, NetPacketSent *sent_cb); diff --git a/include/net/queue.h b/include/net/queue.h index c0269bb1dc..9f2f289d77 100644 --- a/include/net/queue.h +++ b/include/net/queue.h @@ -55,6 +55,14 @@ void qemu_net_queue_append_iov(NetQueue *queue, =20 void qemu_del_net_queue(NetQueue *queue); =20 +ssize_t qemu_net_queue_receive(NetQueue *queue, + const uint8_t *data, + size_t size); + +ssize_t qemu_net_queue_receive_iov(NetQueue *queue, + const struct iovec *iov, + int iovcnt); + ssize_t qemu_net_queue_send(NetQueue *queue, NetClientState *sender, unsigned flags, diff --git a/net/net.c b/net/net.c index e1035f21d1..6e470133ad 100644 --- a/net/net.c +++ b/net/net.c @@ -528,6 +528,17 @@ int qemu_set_vnet_be(NetClientState *nc, bool is_be) #endif } =20 +int qemu_can_receive_packet(NetClientState *nc) +{ + if (nc->receive_disabled) { + return 0; + } else if (nc->info->can_receive && + !nc->info->can_receive(nc)) { + return 0; + } + return 1; +} + int qemu_can_send_packet(NetClientState *sender) { int vm_running =3D runstate_is_running(); @@ -540,13 +551,7 @@ int qemu_can_send_packet(NetClientState *sender) return 1; } =20 - if (sender->peer->receive_disabled) { - return 0; - } else if (sender->peer->info->can_receive && - !sender->peer->info->can_receive(sender->peer)) { - return 0; - } - return 1; + return qemu_can_receive_packet(sender->peer); } =20 static ssize_t filter_receive_iov(NetClientState *nc, @@ -679,6 +684,25 @@ ssize_t qemu_send_packet(NetClientState *nc, const uin= t8_t *buf, int size) return qemu_send_packet_async(nc, buf, size, NULL); } =20 +ssize_t qemu_receive_packet(NetClientState *nc, const uint8_t *buf, int si= ze) +{ + if (!qemu_can_receive_packet(nc)) { + return 0; + } + + return qemu_net_queue_receive(nc->incoming_queue, buf, size); +} + +ssize_t qemu_receive_packet_iov(NetClientState *nc, const struct iovec *io= v, + int iovcnt) +{ + if (!qemu_can_receive_packet(nc)) { + return 0; + } + + return qemu_net_queue_receive_iov(nc->incoming_queue, iov, iovcnt); +} + ssize_t qemu_send_packet_raw(NetClientState *nc, const uint8_t *buf, int s= ize) { return qemu_send_packet_async_with_flags(nc, QEMU_NET_PACKET_FLAG_RAW, diff --git a/net/queue.c b/net/queue.c index 19e32c80fd..c872d51df8 100644 --- a/net/queue.c +++ b/net/queue.c @@ -182,6 +182,28 @@ static ssize_t qemu_net_queue_deliver_iov(NetQueue *qu= eue, return ret; } =20 +ssize_t qemu_net_queue_receive(NetQueue *queue, + const uint8_t *data, + size_t size) +{ + if (queue->delivering) { + return 0; + } + + return qemu_net_queue_deliver(queue, NULL, 0, data, size); +} + +ssize_t qemu_net_queue_receive_iov(NetQueue *queue, + const struct iovec *iov, + int iovcnt) +{ + if (queue->delivering) { + return 0; + } + + return qemu_net_queue_deliver_iov(queue, NULL, 0, iov, iovcnt); +} + ssize_t qemu_net_queue_send(NetQueue *queue, NetClientState *sender, unsigned flags, --=20 2.25.1 From nobody Sun May 19 16:58:49 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614146158; cv=none; d=zohomail.com; s=zohoarc; b=EvztOVoTOBUwr+ogID3wAhpiB99Ul1W2FytoC1fbluIkLTbGNGPD9nw8CBqf6z1oBYeHY1L0SrRC9rdVgnfVki4XcmHBf0aURLaZg116Cs9ftYYTjM8z62e2C3WIrWW0Lh+ixOFzOVNhQlnjOZ1oMqr4ZOJK35BltalwzD89F04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614146158; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KvzW3hi6AkgmHpL+ByRcVl4gnkpCMuhT9e/4F1tN/rs=; b=Z2RSB9CkHkBJiiMhbOJSkwb1iMYnnGfmdLZLfoQGOxI2mR4WtUe24SBQp39TvBlnVgRCjgkVRkXc2ONODPi3YweFXgjq+qbngoug0op74AQi6KCnuDXdH44V+UnEYR/dUSXCywbM+OH99bk1QWUHNqhtdkjxxM60xIOeHLbJzJ8= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161414615797745.27736780371367; Tue, 23 Feb 2021 21:55:57 -0800 (PST) Received: from localhost ([::1]:50772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEn9O-0003Ff-Ji for importer@patchew.org; Wed, 24 Feb 2021 00:55:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEn7o-0001bs-AZ for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24813) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lEn7m-0003sw-9a for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:16 -0500 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-44-cB8ZLYwUNJOf0DqBRfWoBg-1; Wed, 24 Feb 2021 00:54:11 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 49FCD1020C21 for ; Wed, 24 Feb 2021 05:54:10 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id E5BE66F971; Wed, 24 Feb 2021 05:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614146053; 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=KvzW3hi6AkgmHpL+ByRcVl4gnkpCMuhT9e/4F1tN/rs=; b=b2ZhCjEekXTaDhtvFYTQT9D6RSOms2Ee8z1SkuUb713nFjcZEJldwIYw7gEzKkqlIYy+xA 7+nl1CThpIstNe/k0wh7PJzqdR1gKeGkRxWHlQEy4Kl+8efV1LeUjcSrYFZ9I3SqNUB0sA 8TLeocEdNzsT6kmbGhpoqks8ufNj8GA= X-MC-Unique: cB8ZLYwUNJOf0DqBRfWoBg-1 From: Jason Wang To: jasowang@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 2/6] e1000: switch to use qemu_receive_packet() for loopback Date: Wed, 24 Feb 2021 13:53:57 +0800 Message-Id: <20210224055401.492407-3-jasowang@redhat.com> In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-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: pass client-ip=170.10.133.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/e1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 4345d863e6..4f75b44cfc 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -546,7 +546,7 @@ e1000_send_packet(E1000State *s, const uint8_t *buf, in= t size) =20 NetClientState *nc =3D qemu_get_queue(s->nic); if (s->phy_reg[PHY_CTRL] & MII_CR_LOOPBACK) { - nc->info->receive(nc, buf, size); + qemu_receive_packet(nc, buf, size); } else { qemu_send_packet(nc, buf, size); } --=20 2.25.1 From nobody Sun May 19 16:58:49 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614146172; cv=none; d=zohomail.com; s=zohoarc; b=TNOuPEh4p7JdWO3V23YxHPQHiYzKBkB4GkGEbVa346wyjgqC/iOnW/MfcTtEt6jTjpUlgOWBYQ9crTwBd/OFqjvkFGhigNlUTp/7u0+okzBcPWkjBbUX56k7Ek4Mr/JOxmSyj2VNce94mgquVC51PHgAxs5gt2g6Gusd5MIDsgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614146172; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cy4bKniJw4V0UemaAFV1tBIj3D8/xKN8G+jpRvaBAZo=; b=GtGV8y9pi62oShv1JGNxjfqg488DS7hkaD9Ms0EHl37E5n0+quqsqMT32RpGn9edfa9WSdnLIgUfbrovDzxeNYk7PmTZaD2qyPx+euXYbgdkqLcQMXLHWTux1YtPjlP8f+ahh3aMbP939MldKv/7psx/6eV9EyZtVvKbKP8NKqM= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614146172123432.91246657118336; Tue, 23 Feb 2021 21:56:12 -0800 (PST) Received: from localhost ([::1]:51304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEn9e-0003T1-VZ for importer@patchew.org; Wed, 24 Feb 2021 00:56:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEn7u-0001jB-NG for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lEn7r-0003we-8g for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:20 -0500 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-398-AoBD0BC0MRK-97YfnekURg-1; Wed, 24 Feb 2021 00:54:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE69A107ACE3 for ; Wed, 24 Feb 2021 05:54:14 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id C9B225C675; Wed, 24 Feb 2021 05:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614146057; 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=cy4bKniJw4V0UemaAFV1tBIj3D8/xKN8G+jpRvaBAZo=; b=iO6aLx4ZMCDzUavMs7WAUzyf9/bEs8c/pVz0Ovmk+hVadW38FRpO7Cf08CdCNmd79yoGrJ EOH1mYoPfQgG98lOK2P1srsttWc8UbxmbBVSn9peWrlx3a9NbdWXs8L4zS1dephgI2RBpq qWFmGU/YiyPVaWN3L+SuODgB/uDKaxU= X-MC-Unique: AoBD0BC0MRK-97YfnekURg-1 From: Jason Wang To: jasowang@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 3/6] dp8393x: switch to use qemu_receive_packet() for loopback packet Date: Wed, 24 Feb 2021 13:53:58 +0800 Message-Id: <20210224055401.492407-4-jasowang@redhat.com> In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-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: pass client-ip=63.128.21.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/dp8393x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 205c0decc5..019d4fe435 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -506,7 +506,7 @@ static void dp8393x_do_transmit_packets(dp8393xState *s) s->regs[SONIC_TCR] |=3D SONIC_TCR_CRSL; if (nc->info->can_receive(nc)) { s->loopback_packet =3D 1; - nc->info->receive(nc, s->tx_buffer, tx_len); + qemu_receice_packet(nc, s->tx_buffer, tx_Len); } } else { /* Transmit packet */ --=20 2.25.1 From nobody Sun May 19 16:58:49 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614146327; cv=none; d=zohomail.com; s=zohoarc; b=Q3b+v4iBS5fjZrmETVd1Emn1mfdhBj/0SIqS3K1NGIiSKz4vO7y/oiHXiiWmgBywLKw8QRQvizO87dg6N7RJtYIC0HMFxyFYN84VEhLYkLUcFMVrM4Ptr74gtoDOr/4fQay00ZFMnd7sWAXMgsxy9DmcfaKBzND2yRszb1GrwQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614146327; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lm+a4178H+3hkO+VnoW4j/iVA9y5OThloemwpEoGRfA=; b=Wqg6sMVClaZOmXNAsoiEUEW3MkZ1T15joXycZHVFVCal/nOje5yW5H4eODJSIPSyrhdENAmVacC+/AKvyULm74glfqR0c3/PnRRqdhA3IUqRbwSbiginQDAk4PpelAbiijzKaH7cVWsS+tn1avtlud7ZUfXgMuiEPkqvvhfjJEM= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614146327348853.6268337570781; Tue, 23 Feb 2021 21:58:47 -0800 (PST) Received: from localhost ([::1]:58882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEnCA-0006dT-AI for importer@patchew.org; Wed, 24 Feb 2021 00:58:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEn81-0001oJ-B0 for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lEn7y-0003zP-9p for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:28 -0500 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-209-kHFYM4oiNwOgdjQRSMMUAA-1; Wed, 24 Feb 2021 00:54:21 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3196801975 for ; Wed, 24 Feb 2021 05:54:20 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id E67D5709B8; Wed, 24 Feb 2021 05:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614146063; 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=lm+a4178H+3hkO+VnoW4j/iVA9y5OThloemwpEoGRfA=; b=M6qZko8NQQfMknLPtW6SV4zUiAnwCkLN0jYT3YVFmGjeUhogMxV/IAEVUOEs97j+jAR7Cy Uof8OZ9XcPHGvXIudzQrGUYlqO6cWCJH86KHw1Qb+PIuPTOeiCZWBGGojggPkRjHTHF/bz 5ipjswqtJfgjA3831Ao9xuL+h9rFHWU= X-MC-Unique: kHFYM4oiNwOgdjQRSMMUAA-1 From: Jason Wang To: jasowang@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 4/6] msf2-mac: switch to use qemu_receive_packet() for loopback Date: Wed, 24 Feb 2021 13:53:59 +0800 Message-Id: <20210224055401.492407-5-jasowang@redhat.com> In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-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: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/msf2-emac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/msf2-emac.c b/hw/net/msf2-emac.c index 32ba9e8412..3e6206044f 100644 --- a/hw/net/msf2-emac.c +++ b/hw/net/msf2-emac.c @@ -158,7 +158,7 @@ static void msf2_dma_tx(MSF2EmacState *s) * R_CFG1 bit 0 is set. */ if (s->regs[R_CFG1] & R_CFG1_LB_EN_MASK) { - nc->info->receive(nc, buf, size); + qemu_receive_packet(nc, buf, size); } else { qemu_send_packet(nc, buf, size); } --=20 2.25.1 From nobody Sun May 19 16:58:49 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614146419; cv=none; d=zohomail.com; s=zohoarc; b=V4eIG5xYe9leJxQSY/nA6GOgyX2lSXCSiKfHLm8JZxg6hDjx44rgLkALxCUzy/CmeB3Nj/VwPed3NIngzJrFWvt3b7/kHLZQ7irj9eui0hGfRYf471uJ5ktP6LxplXk9Po57STEfymvWIfzNEGPQTgwxBWx0TCxz5g0yJE5wYLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614146419; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X3SFibeVIgv2nFTvQXoFQwlNZ3BmixaEpRoucdc6PUw=; b=Yqx1kAEm/AmB9B1qeKsrUGIsV+B9FKWBNy4cca6qxjx9ZsYnF9gUiI/ppQ083iKdFr4VQyhY/jSsrbdn5hk9sNRRsNZfnKafLeWHBQS7gv2UDTONGmKZunUbSZN4B7OmiLuyAMueumVLpVYgM9oMuo+E74hyf7Ib7WFXMsAh62g= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614146419260606.2158248408415; Tue, 23 Feb 2021 22:00:19 -0800 (PST) Received: from localhost ([::1]:32806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEnDe-0007XB-0S for importer@patchew.org; Wed, 24 Feb 2021 01:00:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEn86-0001sG-Jb for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lEn83-00043r-Ve for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:34 -0500 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-319-yxyyXZb9PBmUuhvIQ5wzPw-1; Wed, 24 Feb 2021 00:54:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE46D1020C21 for ; Wed, 24 Feb 2021 05:54:27 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id E389A5C675; Wed, 24 Feb 2021 05:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614146071; 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=X3SFibeVIgv2nFTvQXoFQwlNZ3BmixaEpRoucdc6PUw=; b=SL0cHfHfz+6MCtwrY+4Bpm85XT9A4hZHbJS/zXqBej15fX6uJNBYdHXJEX9IeaOZjpPTGX ePZfHOwsyFetrp3IqfCKCZWLm8vI3BfnThFmLmakI6D0UJEqAPq3Aiy8uAe7e5OUTk5GBn uyDUAmZmEWdlr5rYKt3N7bbqhTVp0PQ= X-MC-Unique: yxyyXZb9PBmUuhvIQ5wzPw-1 From: Jason Wang To: jasowang@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 5/6] sungem: switch to use qemu_receive_packet() for loopback Date: Wed, 24 Feb 2021 13:54:00 +0800 Message-Id: <20210224055401.492407-6-jasowang@redhat.com> In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-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: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/sungem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/sungem.c b/hw/net/sungem.c index 33c3722df6..3684a4d733 100644 --- a/hw/net/sungem.c +++ b/hw/net/sungem.c @@ -306,7 +306,7 @@ static void sungem_send_packet(SunGEMState *s, const ui= nt8_t *buf, NetClientState *nc =3D qemu_get_queue(s->nic); =20 if (s->macregs[MAC_XIFCFG >> 2] & MAC_XIFCFG_LBCK) { - nc->info->receive(nc, buf, size); + qemu_receive_packet(nc, buf, size); } else { qemu_send_packet(nc, buf, size); } --=20 2.25.1 From nobody Sun May 19 16:58:49 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614146183; cv=none; d=zohomail.com; s=zohoarc; b=nS0soQntL9p029kcoH004Fe/QwrrqOUiOXRvbyNbz3UIsVng00+NJJkk7dTXDj6weOAdJZX2I+2Of/j7CIN1Og7LifVepWhOMkGoyfLoAkAbpmD0v/xhCiLGux2MplRAfSwTBuBJJxBsxa4cembBZHQGTVsH/jdyWsM4nrVTwyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614146183; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DaqSA7gOY6IcoJBLakceTp/PPrLZ/lIRFijQ1wer3Gs=; b=Rw/vlE1btrTu8ClScDK5Wl1Ed4Uy3KmlFI4kE/SsMEBbn2QoH3VYjqTWkodF08Tviu6kNfMx2c+Eeisvtn9QXAFzZWLiXY6Jau1fVJTEVjUrgQf9FwJ/aTk4eGWnwZkveguKGjMbTuT/sd6XJZBjljsdinO8HxtlpLmhsBX2X/I= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614146183380501.7100123673781; Tue, 23 Feb 2021 21:56:23 -0800 (PST) Received: from localhost ([::1]:51842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEn9p-0003gT-I7 for importer@patchew.org; Wed, 24 Feb 2021 00:56:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEn88-0001tB-IQ for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53353) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lEn86-00044y-Ba for qemu-devel@nongnu.org; Wed, 24 Feb 2021 00:54:36 -0500 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-339-77CCxkpRO4GOZBQ0--tXAg-1; Wed, 24 Feb 2021 00:54:30 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D6313803F49 for ; Wed, 24 Feb 2021 05:54:29 +0000 (UTC) Received: from jason-ThinkPad-X1-Carbon-6th.redhat.com (ovpn-13-164.pek2.redhat.com [10.72.13.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B4026061F; Wed, 24 Feb 2021 05:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614146073; 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=DaqSA7gOY6IcoJBLakceTp/PPrLZ/lIRFijQ1wer3Gs=; b=PylnAYNe1xSJdsvUGUGFO3AMHKnpG1QODGrB/UgM+trZWaw1wM9HlVajVLXUyBUiVQ5xey BFBeFQY+e/gImDm+8hFEfmhiIte09q/gxe4lfgx4BuEuqc3JT0S5Y8EF/H9rX9CL78295m mOkklv5UHWg5hgR7xFA08oK1V6fwSnw= X-MC-Unique: 77CCxkpRO4GOZBQ0--tXAg-1 From: Jason Wang To: jasowang@redhat.com, qemu-devel@nongnu.org Subject: [PATCH 6/6] tx_pkt: switch to use qemu_receive_packet_iov() for loopback Date: Wed, 24 Feb 2021 13:54:01 +0800 Message-Id: <20210224055401.492407-7-jasowang@redhat.com> In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-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: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_receive_iov() which can detect reentrancy and return early. Signed-off-by: Jason Wang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/net_tx_pkt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index da262edc3e..1f9aa59eca 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -553,7 +553,7 @@ static inline void net_tx_pkt_sendv(struct NetTxPkt *pk= t, NetClientState *nc, const struct iovec *iov, int iov_cnt) { if (pkt->is_loopback) { - nc->info->receive_iov(nc, iov, iov_cnt); + qemu_receive_packet_iov(nc, iov, iov_cnt); } else { qemu_sendv_packet(nc, iov, iov_cnt); } --=20 2.25.1 From nobody Sun May 19 16:58:49 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=pass (i=1dmarc=pass fromdomain=bu.edu) ARC-Seal: i=2; a=rsa-sha256; t=1614366274; cv=pass; d=zohomail.com; s=zohoarc; b=Ux3Gg6re+7zP9IcRTwYrzGUxCB6D50XWT4kOcAOEYVJnxj/OPp7bnvu89+0ckQReLgmi9X8ne1ZSVbIb8I2bwkuKbv3hLnLz6Wd+4zEU0gvu1+TjuxB51dj/TOLPMUPfy7Elnd6ACcMMC7MGertRV2GwW/1ju4ZoI8cmK7Gs9bE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614366274; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fffgq5EkJEzx7wyq7nAE4Nb3vpKkX6pCFFo2RUcYPr8=; b=Sg31CZlvl1bO+5DkH3DxIhnrKPNH3uqpjztcrNNohe21sXPX0r+3P/W8N8ZXj2CRUKdt6o0l4oTDbrLyjqq5tq2xRM/jksEWc7DXGDK4MVEHFx2sUiCWL86uPOpQwmC0HUtzfdZzBkW+HEt7UZNyXLhbqtf9KkkHDLG6KKsIZqA= ARC-Authentication-Results: i=2; 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=pass (i=1dmarc=pass fromdomain=bu.edu) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614366274693478.1766982500453; Fri, 26 Feb 2021 11:04:34 -0800 (PST) Received: from localhost ([::1]:58980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFiPf-0005bn-Gr for importer@patchew.org; Fri, 26 Feb 2021 14:04:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFiOY-0004rZ-DN for qemu-devel@nongnu.org; Fri, 26 Feb 2021 14:03:22 -0500 Received: from mail-co1nam11on2108.outbound.protection.outlook.com ([40.107.220.108]:62816 helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFiOW-0007iu-8m for qemu-devel@nongnu.org; Fri, 26 Feb 2021 14:03:21 -0500 Received: from SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) by SN6PR03MB3485.namprd03.prod.outlook.com (2603:10b6:805:49::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19; Fri, 26 Feb 2021 18:48:13 +0000 Received: from SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::1ed:b27e:19a1:5bfc]) by SN6PR03MB3871.namprd03.prod.outlook.com ([fe80::1ed:b27e:19a1:5bfc%4]) with mapi id 15.20.3868.034; Fri, 26 Feb 2021 18:48:13 +0000 Received: from stormtrooper.vrmnet (72.74.210.193) by MN2PR16CA0036.namprd16.prod.outlook.com (2603:10b6:208:134::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Fri, 26 Feb 2021 18:48:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mEqwxzwCjfJzCuxjDtiERAqb3C8B9ilyFyLjUEplmeKEJut/BrFxnGp1O2orX/0dVfo3c/wnMClOlT2ygDP+B2KpgoiRk4JunCVSO+PofciycoybzV/vqeHA4gZ8TvNSTxZXPBVoF+THUg1NGUJr5RVbAOqdmmiOA9EO+6iZ9rJkJP1FOL0bPPRIj8B1OVD/QuN4VYSOHzaigvkAc4crRQpR9s3GcH9K+VU21k0lriQDo9q91CaTvJDgrp8cPRexC/GQdyI+3V3WCIT3Of1PUQaELHCwApRU0X0dwe+p95rzfvS6X/PG3rirJYkUQcWDnAM8VM0/QmYB2IkOQELl2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fffgq5EkJEzx7wyq7nAE4Nb3vpKkX6pCFFo2RUcYPr8=; b=UPuf4/VBQaVe0tmgLJAIc5Qj3bh/rq2GwMgDSTYg4QvrqCzQTCn9MLDhpvGtI2XJ34/09Odh/0ddmiv7Y/Auv0hYSTGCIQZPuaVTRa6vZduX4gRUxJ1foFbZLcOtkqIycaqgu1FPjUPPKmCm3ffumCDVIW0WIUJTLe46HWUQZjB68cspaCrsazJlGhbjtDE2zrft3ckW+1Z5tehEnoGZ+86XAGTQM7nw+YZ0s4aLExG51dnfL0AVLUnW6B+zRDEwMmWkE0a7hBi243IytkDM0SnBrJp9X9KoK5Tw7cSMhad5IS8RWltZGBjsbjcarEDSyZJ2T/D84qOz7sTucRtGmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bu.edu; dmarc=pass action=none header.from=bu.edu; dkim=pass header.d=bu.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bushare.onmicrosoft.com; s=selector2-bushare-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Fffgq5EkJEzx7wyq7nAE4Nb3vpKkX6pCFFo2RUcYPr8=; b=HRnJB3gyoinuwdmO2QJk7MeUvzwEvRlml+9s4WIR0nRrzhHU/cCLM9nyctS9kFeGqP/js7KwxIyZUEUUUNfj+NgcPZcVSp9ppzp4c+FPdrP9K8CA2O5CGU/eSkuvp8rrR7CXkqqaKdWEeb1fIviuX4IueRPqNNQ0oukGd1MZdqA= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=bu.edu; From: Alexander Bulekov To: jasowang@redhat.com Subject: [PATCH] rtl8193: switch to use qemu_receive_packet() for loopback Date: Fri, 26 Feb 2021 13:47:53 -0500 Message-Id: <20210226184753.230037-1-alxndr@bu.edu> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210224055401.492407-1-jasowang@redhat.com> References: <20210224055401.492407-1-jasowang@redhat.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [72.74.210.193] X-ClientProxiedBy: MN2PR16CA0036.namprd16.prod.outlook.com (2603:10b6:208:134::49) To SN6PR03MB3871.namprd03.prod.outlook.com (2603:10b6:805:6d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4607fe66-16da-489e-f446-08d8da8711e0 X-MS-TrafficTypeDiagnostic: SN6PR03MB3485: X-MS-Exchange-MinimumUrlDomainAge: launchpad.net#6241 X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:268; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bk1Mg9vxhsfgjVLLL4s4zmVIkewH5aeE1HXYzzUiv1hfT8J8i6S3inMqQfgR/AkJiWD9s2fsmVy/RJA+nyxNxQx/+1udVyV87MDMfRcrSCTCeFw2ikf+0KmEmQFXYoWDHc2brEsHaSzex36OSYy7cpW7xyIorlsjGihGWgX84N4tw/4gqmyXPL4LC/mTOo+onCRv/p+y97Lb/BKrEoxrN1vx4caw5h6JJA/J21bQcFkm+bylnIQR7+WfBiXx1zx9sWDt91cBKQVSvk5kynmoA8f9s+xZx4ger/NG2hatS/2IGhm7Td7A6uxXw4arEl3RgdU8YvNGcM2DLhEYshnEqLfSJLYSiLfx4lPHg4INfvrf8O9UuGpFqLbyBYI5LL7/AoV+3/H+vOX62BtivRCG19jsWuRQB92TzbKvlyFbuNKKRDrXNpGlP5B3N6+X3t9LzK55s1JdxZtqYF4dmgE1G9uEtx1qGCNRjoZ69AFydweCsQIl4p6LKmqQKHdxHVzyrKigB4N661J6zo31G1nX2fYvg8UfXbFB/KoSojn4Vc8bBXtG3hW215iVdMxuJ6PWNpvufNCs0zSDoqzNR2fN2/jBBSyW02dEUTVFqGLD1Gs= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR03MB3871.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(136003)(39860400002)(376002)(346002)(966005)(4744005)(186003)(316002)(6486002)(8936002)(1076003)(786003)(6512007)(26005)(2906002)(16526019)(478600001)(6916009)(5660300002)(75432002)(956004)(52116002)(86362001)(6666004)(6506007)(66476007)(66946007)(36756003)(8676002)(66556008)(4326008)(2616005)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?yH86jwksz/IKmdHhd/LtKJcNDlf2KcH2vGG1rbweupYLDJk80/yPtscKpdKz?= =?us-ascii?Q?Jw7mHlpQ6o2Erq+EudvK4ekN2VUAGFUrQ4U/ch6M6Hldo7SC8pYAuaYn289r?= =?us-ascii?Q?prjZgy8YmHQNlVCxcHIFYkZKrfc0k0/F2+wACecvrY6KbCYsd7DLhzCShInF?= =?us-ascii?Q?+ZeDHQAfBV8i9CTema7l7XQuj3i0tdXF9N4EYEJt0U+aU+MVKfqv5UTIF3fu?= =?us-ascii?Q?K3HZydieu3Wglg1MvgMDiDLo1W/7aDHatHRhYEQFoxhNO/2YAp0G3Q0vN9/e?= =?us-ascii?Q?MSYTo5D6KTCodHDEcBmWLUDiz6uLxLSbAiB8eZ1u0hpSqdZHHU4p4rTm+4tc?= =?us-ascii?Q?hf+EgsNbyyGaY2ZNJFLob3X0SwHhYY7gGlpchWT+vxyJyLgDEtJXYoGpOkDe?= =?us-ascii?Q?HDhn0aLVKs9LiNAAkGciIO0kX1BXbKD2jMggPFtYft6H4gWFc9LA5I2HOTQ1?= =?us-ascii?Q?jUWHWFSjbfVMUQXxocBXJ8i6IHDiLpv90gTxgsNFWE8X38654q/+wds8KY3T?= =?us-ascii?Q?NuXIAcuuz1OyL2IObDAKbjeQt8rno+9iNPkmkl1Zelwi4afkQQiUt08Ggvt3?= =?us-ascii?Q?2g/uAndHCSe2K7HVLAeITDWNqF5LDGLeU6QeKV85PjOI3A25PChPJrBtLt3e?= =?us-ascii?Q?8eI1ITRwxr7TAoX7SDZMQ2+1I6FWLxxUptFAl9ISphtFZybp8MPortFoeaQ+?= =?us-ascii?Q?BzA4aDiENTxDAnz4jCRcRoADud87T3ansgVb7De63P2/joIuSaC3KUmotfLl?= =?us-ascii?Q?YttTpNou1jO8eczj4BEVKG+yNbe1HOFBPITPXkaWfyBYfJc9U7cNzN9lyk7n?= =?us-ascii?Q?qfGIrPWYvq+HD6um6ollnHNlrYcmmILspt0J1r7cO7A+n0Rxv4LJ7eXct5Qs?= =?us-ascii?Q?wisDlAo7wskvihEUDC41uVBvBssQgUKBo8O5STvaw80Pt/TjP0fpdWVk/Hpy?= =?us-ascii?Q?BLjjJ6HwjtgSsQ06q6LyErxykemFe/2dcryrgilJ7ub1dVv6oxax2NjP9cg4?= =?us-ascii?Q?XEBl4rb1LoNmyoh7JCkaDFCCe1o864AiepQA57mTedEDcTJSm/Sn7Vwx8VBa?= =?us-ascii?Q?pdy+ffO/qhLc3BAzdRAQZ1HE2BxtBnZlOrsxecIG+ojh2b4mB2IW/Ylmk4aC?= =?us-ascii?Q?oVCouhhTI8mqsNFNTqGYftx/zJNBMWR1hGNkBr2tDSXdg/Co8DPu6eQgm1Pu?= =?us-ascii?Q?5V1lsZwISKAD20H8pIe3sKbKgeKjDRBZ2FR/sBS26cJR+FYoGPsI59iPduDj?= =?us-ascii?Q?LapKQcxEER8eWkwbzMKY58QwzAWzzY1C0Jm5lCNGBSKWR/+J1IvGRo5qD3cz?= =?us-ascii?Q?tGvpBzZpnIyp/qienHs1HvsR?= X-OriginatorOrg: bu.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 4607fe66-16da-489e-f446-08d8da8711e0 X-MS-Exchange-CrossTenant-AuthSource: SN6PR03MB3871.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2021 18:48:13.6685 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d57d32cc-c121-488f-b07b-dfe705680c71 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y5ttuWOOYl25yuroYH6Aa31nhhwuWQz2GKDTiYXP9KWpuRBU6+y7JA2kpO5OUUzz X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR03MB3485 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: pass client-ip=40.107.220.108; envelope-from=alxndr@bu.edu; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HK_RANDOM_ENVFROM=0.001, HK_RANDOM_FROM=1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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: Alexander Bulekov , "open list:All patches CC here" , ppandit@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @bushare.onmicrosoft.com) Content-Type: text/plain; charset="utf-8" This patch switches to use qemu_receive_packet() which can detect reentrancy and return early. Buglink: https://bugs.launchpad.net/qemu/+bug/1910826 Signed-off-by: Alexander Bulekov --- Although it's not a nc->info->receive() call, maybe this can also go in this series? -Alex hw/net/rtl8139.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 4675ac878e..90b4fc63ce 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -1795,7 +1795,7 @@ static void rtl8139_transfer_frame(RTL8139State *s, u= int8_t *buf, int size, } =20 DPRINTF("+++ transmit loopback mode\n"); - rtl8139_do_receive(qemu_get_queue(s->nic), buf, size, do_interrupt= ); + qemu_receive_packet(qemu_get_queue(s->nic), buf, size); =20 if (iov) { g_free(buf2); --=20 2.28.0