lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230309074952.975-1-angus.chen@jaguarmicro.com>
Date:   Thu,  9 Mar 2023 15:49:52 +0800
From:   Angus Chen <angus.chen@...uarmicro.com>
To:     mst@...hat.com, jasowang@...hat.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        ast@...nel.org, daniel@...earbox.net, hawk@...nel.org,
        john.fastabend@...il.com
Cc:     virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, bpf@...r.kernel.org,
        Angus Chen <angus.chen@...uarmicro.com>
Subject: [PATCH] virtio_net: Use NETDEV_TX_BUSY when has no buf to send

Don't consume skb if virtqueue_add return -ENOSPC.

Signed-off-by: Angus Chen <angus.chen@...uarmicro.com>
---
 drivers/net/virtio_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index fb5e68ed3ec2..4096ea3d2eb6 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -1980,7 +1980,7 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
 				 qnum, err);
 		dev->stats.tx_dropped++;
 		dev_kfree_skb_any(skb);
-		return NETDEV_TX_OK;
+		return (err == -ENOSPC) ? NETDEV_TX_BUSY : NETDEV_TX_OK;
 	}
 
 	/* Don't wait up for transmitted skbs to be freed. */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ