@@ -647,11 +647,13 @@ static void gve_rx_skb_hash(struct sk_buff *skb,
647
647
skb_set_hash (skb , le32_to_cpu (compl_desc -> hash ), hash_type );
648
648
}
649
649
650
- static void gve_rx_free_skb (struct gve_rx_ring * rx )
650
+ static void gve_rx_free_skb (struct napi_struct * napi , struct gve_rx_ring * rx )
651
651
{
652
652
if (!rx -> ctx .skb_head )
653
653
return ;
654
654
655
+ if (rx -> ctx .skb_head == napi -> skb )
656
+ napi -> skb = NULL ;
655
657
dev_kfree_skb_any (rx -> ctx .skb_head );
656
658
rx -> ctx .skb_head = NULL ;
657
659
rx -> ctx .skb_tail = NULL ;
@@ -950,7 +952,7 @@ int gve_rx_poll_dqo(struct gve_notify_block *block, int budget)
950
952
951
953
err = gve_rx_dqo (napi , rx , compl_desc , complq -> head , rx -> q_num );
952
954
if (err < 0 ) {
953
- gve_rx_free_skb (rx );
955
+ gve_rx_free_skb (napi , rx );
954
956
u64_stats_update_begin (& rx -> statss );
955
957
if (err == - ENOMEM )
956
958
rx -> rx_skb_alloc_fail ++ ;
@@ -993,7 +995,7 @@ int gve_rx_poll_dqo(struct gve_notify_block *block, int budget)
993
995
994
996
/* gve_rx_complete_skb() will consume skb if successful */
995
997
if (gve_rx_complete_skb (rx , napi , compl_desc , feat ) != 0 ) {
996
- gve_rx_free_skb (rx );
998
+ gve_rx_free_skb (napi , rx );
997
999
u64_stats_update_begin (& rx -> statss );
998
1000
rx -> rx_desc_err_dropped_pkt ++ ;
999
1001
u64_stats_update_end (& rx -> statss );
0 commit comments