hv_netvsc: Add comment of netvsc_xdp_xmit()
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 14 Oct 2021 01:26:26 +0000 (01:26 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Oct 2021 02:17:57 +0000 (19:17 -0700)
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.

Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1634174786-1810351-1-git-send-email-jiasheng@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/hyperv/netvsc_drv.c

index 65850ea8a92427525985f729352550f7fbdd87a0..7e66ae1d2a59bf706bfc8ddf3bc62b6c813ca123 100644 (file)
@@ -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;