[PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()

Subsystems: hyper-v/azure core and drivers, networking drivers, the rest

STALE1784d LANDED

Landed in mainline as 78e0a006914b on 2021-10-15.

3 messages, 3 authors, 2021-10-15 · open the first message on its own page

[PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()

From: Jiasheng Jiang <hidden>
Date: 2021-10-14 01:26:57

Adding comment to avoid the misusing of netvsc_xdp_xmit().
Otherwise the value of skb->queue_mapping could be 0 and
then the return value of skb_get_rx_queue() could be MAX_U16
cause by overflow.

Fixes: 351e158 ("hv_netvsc: Add XDP support")
Signed-off-by: Jiasheng Jiang <redacted>
---
 drivers/net/hyperv/netvsc_drv.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index f682a55..ac9529c 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -803,6 +803,7 @@ void netvsc_linkstatus_callback(struct net_device *net,
 	schedule_delayed_work(&ndev_ctx->dwork, 0);
 }
 
+/* This function should only be called after skb_record_rx_queue() */
 static void netvsc_xdp_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
 	int rc;
-- 
2.7.4

RE: [PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2021-10-14 12:51:52

quoted hunk
-----Original Message-----
From: Jiasheng Jiang <redacted>
Sent: Wednesday, October 13, 2021 9:26 PM
To: KY Srinivasan <kys@microsoft.com>; Haiyang Zhang
[off-list ref]; Stephen Hemminger [off-list ref];
wei.liu@kernel.org; Dexuan Cui [off-list ref];
davem@davemloft.net; kuba@kernel.org
Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-
kernel@vger.kernel.org; bpf@vger.kernel.org; Jiasheng Jiang
[off-list ref]
Subject: [PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()

Adding comment to avoid the misusing of netvsc_xdp_xmit().
Otherwise the value of skb->queue_mapping could be 0 and
then the return value of skb_get_rx_queue() could be MAX_U16
cause by overflow.

Fixes: 351e158 ("hv_netvsc: Add XDP support")
Signed-off-by: Jiasheng Jiang <redacted>
---
 drivers/net/hyperv/netvsc_drv.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/hyperv/netvsc_drv.c
b/drivers/net/hyperv/netvsc_drv.c
index f682a55..ac9529c 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -803,6 +803,7 @@ void netvsc_linkstatus_callback(struct net_device
*net,
 	schedule_delayed_work(&ndev_ctx->dwork, 0);
 }

+/* This function should only be called after skb_record_rx_queue() */
 static void netvsc_xdp_xmit(struct sk_buff *skb, struct net_device
*ndev)
 {
Thanks.

Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>

Re: [PATCH] hv_netvsc: Add comment of netvsc_xdp_xmit()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-15 02:30:14

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski [off-list ref]:

On Thu, 14 Oct 2021 01:26:26 +0000 you wrote:
Adding comment to avoid the misusing of netvsc_xdp_xmit().
Otherwise the value of skb->queue_mapping could be 0 and
then the return value of skb_get_rx_queue() could be MAX_U16
cause by overflow.

Fixes: 351e158 ("hv_netvsc: Add XDP support")
Signed-off-by: Jiasheng Jiang <redacted>

[...]
Here is the summary with links:
  - hv_netvsc: Add comment of netvsc_xdp_xmit()
    https://git.kernel.org/netdev/net-next/c/78e0a006914b

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help