From patchwork Thu Nov 7 08:55:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xuan Zhuo X-Patchwork-Id: 13866016 X-Patchwork-Delegate: kuba@kernel.org Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F5D41DFE30; Thu, 7 Nov 2024 08:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730969722; cv=none; b=i3JfOMu1ij/d8Iag/0jYTf4tB0On9NsQiVLKP1YjxUSf72nDPWlmhpKun0d10yknXfPCu9/nBmD1Wdhcpklh1YbCO5+V8jt7/Epg7CVevd7kCP5srEurl9XsYsFNvTthQQ6jFCLatFLh01qGzMgPglFPw8UiZklSiSHRZbFYSlE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730969722; c=relaxed/simple; bh=zcwV1cbs653FORh8F+uUYyLHezYFoQKvxW5n5jEby2Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sHBmEeJqkb6H/Q6wHB6JubOxYJSiOJiNbotyjyma1bAaTFW8F1LSPM1z0klklUO1dLIqEw5SURakEbrhqabecZwRDefjwcdVhMoIG4rokqaEqHvTx3OW/szkCGb1rcCXKFlcvnX31f3cYv9kD8dLBfwEf3NVl8n6TmqQgaPfnGk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=INc5Imu8; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="INc5Imu8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1730969718; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=DV0mEbsZYImcQa5ZTtKTa8NA7pu7BOGfp6nImSXbi0A=; b=INc5Imu8Yarpf32ANBUIz745IeHAa2aG/h7im8kW8ihC6aSgy0HtwveNEQgI79m1bEQrl2mz2Nby5r5u3SiUq3IZusghwCOcNKtDpmL796cclzfcfgQXoeOzGuxbFxIIwgQyg+mTgpoygko7SIyOHrRhn44frIN7/XpIvBLsdK8= Received: from localhost(mailfrom:xuanzhuo@linux.alibaba.com fp:SMTPD_---0WIv3VWn_1730969716 cluster:ay36) by smtp.aliyun-inc.com; Thu, 07 Nov 2024 16:55:17 +0800 From: Xuan Zhuo To: netdev@vger.kernel.org Cc: "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , virtualization@lists.linux.dev, bpf@vger.kernel.org Subject: [PATCH net-next v3 12/13] virtio_net: update tx timeout record Date: Thu, 7 Nov 2024 16:55:03 +0800 Message-Id: <20241107085504.63131-13-xuanzhuo@linux.alibaba.com> X-Mailer: git-send-email 2.32.0.3.g01195cf9f In-Reply-To: <20241107085504.63131-1-xuanzhuo@linux.alibaba.com> References: <20241107085504.63131-1-xuanzhuo@linux.alibaba.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Git-Hash: 2634baada01d X-Patchwork-Delegate: kuba@kernel.org If send queue sent some packets, we update the tx timeout record to prevent the tx timeout. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/net/virtio_net.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 67d33cc913cc..7cd6f1d74710 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1489,6 +1489,13 @@ static bool virtnet_xsk_xmit(struct send_queue *sq, struct xsk_buff_pool *pool, if (!is_xdp_raw_buffer_queue(vi, sq - vi->sq)) check_sq_full_and_disable(vi, vi->dev, sq); + if (sent) { + struct netdev_queue *txq; + + txq = netdev_get_tx_queue(vi->dev, sq - vi->sq); + txq_trans_cond_update(txq); + } + u64_stats_update_begin(&sq->stats.syncp); u64_stats_add(&sq->stats.packets, stats.packets); u64_stats_add(&sq->stats.bytes, stats.bytes);