Commit 7c079e6
committed
[sparx5] Use SKB reference counting for PTP tx path
There is a race condition in the TX path of PTP event packets.
When the packet is transmitted, DMA is kicked off and then SKB is freed.
However, in case of PTP packet, SKB is queued for timestamping, and is
freed in the interrupt handler.
If PTP IRQ arrives before the call to sparx5_consume_skb(), it will free
the packet, and then sparx5_consume_skb() will cause Oops, when testing
whether SKB is PTP or not.
This change uses SKB reference counting to ensure SKB is freed regardless
of order of events, and no crash occurs.1 parent e0e964b commit 7c079e6
File tree
4 files changed
+9
-15
lines changed- drivers/net/ethernet/microchip/sparx5
4 files changed
+9
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
1085 | 1084 | | |
1086 | 1085 | | |
1087 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | 451 | | |
464 | 452 | | |
465 | 453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
571 | 578 | | |
572 | 579 | | |
573 | 580 | | |
| |||
0 commit comments