hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/net/core/dev.c
....@@ -2635,6 +2635,8 @@
26352635 bool active = false;
26362636 unsigned int nr_ids;
26372637
2638
+ WARN_ON_ONCE(index >= dev->num_tx_queues);
2639
+
26382640 if (dev->num_tc) {
26392641 /* Do not allow XPS on subordinate device directly */
26402642 num_tc = dev->num_tc;
....@@ -3124,8 +3126,10 @@
31243126 {
31253127 if (in_irq() || irqs_disabled())
31263128 __dev_kfree_skb_irq(skb, reason);
3129
+ else if (unlikely(reason == SKB_REASON_DROPPED))
3130
+ kfree_skb(skb);
31273131 else
3128
- dev_kfree_skb(skb);
3132
+ consume_skb(skb);
31293133 }
31303134 EXPORT_SYMBOL(__dev_kfree_skb_any);
31313135
....@@ -3323,7 +3327,7 @@
33233327 type = eth->h_proto;
33243328 }
33253329
3326
- return __vlan_get_protocol(skb, type, depth);
3330
+ return vlan_get_protocol_and_depth(skb, type, depth);
33273331 }
33283332
33293333 /**
....@@ -3636,7 +3640,7 @@
36363640 int skb_csum_hwoffload_help(struct sk_buff *skb,
36373641 const netdev_features_t features)
36383642 {
3639
- if (unlikely(skb->csum_not_inet))
3643
+ if (unlikely(skb_csum_is_sctp(skb)))
36403644 return !!(features & NETIF_F_SCTP_CRC) ? 0 :
36413645 skb_crc32c_csum_help(skb);
36423646
....@@ -4386,8 +4390,10 @@
43864390 u32 next_cpu;
43874391 u32 ident;
43884392
4389
- /* First check into global flow table if there is a match */
4390
- ident = sock_flow_table->ents[hash & sock_flow_table->mask];
4393
+ /* First check into global flow table if there is a match.
4394
+ * This READ_ONCE() pairs with WRITE_ONCE() from rps_record_sock_flow().
4395
+ */
4396
+ ident = READ_ONCE(sock_flow_table->ents[hash & sock_flow_table->mask]);
43914397 if ((ident ^ hash) & ~rps_cpu_mask)
43924398 goto try_rps;
43934399
....@@ -6114,6 +6120,7 @@
61146120
61156121 static void napi_skb_free_stolen_head(struct sk_buff *skb)
61166122 {
6123
+ nf_reset_ct(skb);
61176124 skb_dst_drop(skb);
61186125 skb_ext_put(skb);
61196126 kmem_cache_free(skbuff_head_cache, skb);
....@@ -10298,9 +10305,7 @@
1029810305 BUG_ON(!list_empty(&dev->ptype_specific));
1029910306 WARN_ON(rcu_access_pointer(dev->ip_ptr));
1030010307 WARN_ON(rcu_access_pointer(dev->ip6_ptr));
10301
-#if IS_ENABLED(CONFIG_DECNET)
10302
- WARN_ON(dev->dn_ptr);
10303
-#endif
10308
+
1030410309 if (dev->priv_destructor)
1030510310 dev->priv_destructor(dev);
1030610311 if (dev->needs_free_netdev)