Commit 316c5bb
net: ps3_gelic_net: handle skb allocation failures
Handle skb allocation failures in RX path, to avoid NULL pointer
dereference and RX stalls under memory pressure. If the refill fails
with -ENOMEM, complete napi polling and wake up later to retry via timer.
Also explicitly re-enable RX DMA after oom, so the dmac doesn't remain
stopped in this situation.
Previously, memory pressure could lead to skb allocation failures and
subsequent Oops like:
Oops: Kernel access of bad area, sig: 11 [kernel-patches#2]
Hardware name: SonyPS3 Cell Broadband Engine 0x701000 PS3
NIP [c0003d0000065900] gelic_net_poll+0x6c/0x2d0 [ps3_gelic] (unreliable)
LR [c0003d00000659c4] gelic_net_poll+0x130/0x2d0 [ps3_gelic]
Call Trace:
gelic_net_poll+0x130/0x2d0 [ps3_gelic] (unreliable)
__napi_poll+0x44/0x168
net_rx_action+0x178/0x290
Steps to reproduce the issue:
1. Start a continuous network traffic, like scp of a 20GB file
2. Inject failslab errors using the kernel fault injection:
echo -1 > /sys/kernel/debug/failslab/times
echo 30 > /sys/kernel/debug/failslab/interval
echo 100 > /sys/kernel/debug/failslab/probability
3. After some time, traces start to appear, kernel Oopses
and the system stops
Step 2 is not always necessary, as it is usually already triggered by
the transfer of a big enough file.
Fixes: 02c1889 ("ps3: gigabit ethernet driver for PS3, take3")
Signed-off-by: Florian Fuchs <fuchsfl@gmail.com>
Signed-off-by: NipaLocal <nipa@local>1 parent f4f88d9 commit 316c5bb
File tree
2 files changed
+35
-11
lines changed- drivers/net/ethernet/toshiba
2 files changed
+35
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
| |||
970 | 971 | | |
971 | 972 | | |
972 | 973 | | |
973 | | - | |
| 974 | + | |
| 975 | + | |
974 | 976 | | |
975 | 977 | | |
976 | 978 | | |
| |||
981 | 983 | | |
982 | 984 | | |
983 | 985 | | |
984 | | - | |
| 986 | + | |
| 987 | + | |
985 | 988 | | |
986 | 989 | | |
987 | 990 | | |
988 | 991 | | |
989 | 992 | | |
990 | 993 | | |
991 | | - | |
| 994 | + | |
992 | 995 | | |
993 | | - | |
| 996 | + | |
| 997 | + | |
994 | 998 | | |
995 | 999 | | |
996 | 1000 | | |
| |||
1048 | 1052 | | |
1049 | 1053 | | |
1050 | 1054 | | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1054 | 1059 | | |
1055 | 1060 | | |
1056 | 1061 | | |
| |||
1062 | 1067 | | |
1063 | 1068 | | |
1064 | 1069 | | |
1065 | | - | |
1066 | | - | |
| 1070 | + | |
1067 | 1071 | | |
1068 | | - | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
1069 | 1075 | | |
1070 | 1076 | | |
1071 | 1077 | | |
| |||
1087 | 1093 | | |
1088 | 1094 | | |
1089 | 1095 | | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
1090 | 1103 | | |
1091 | 1104 | | |
1092 | 1105 | | |
| |||
1099 | 1112 | | |
1100 | 1113 | | |
1101 | 1114 | | |
| 1115 | + | |
1102 | 1116 | | |
1103 | 1117 | | |
1104 | | - | |
| 1118 | + | |
| 1119 | + | |
1105 | 1120 | | |
1106 | 1121 | | |
1107 | 1122 | | |
1108 | 1123 | | |
1109 | 1124 | | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1110 | 1131 | | |
1111 | 1132 | | |
1112 | 1133 | | |
| |||
1576 | 1597 | | |
1577 | 1598 | | |
1578 | 1599 | | |
| 1600 | + | |
| 1601 | + | |
1579 | 1602 | | |
1580 | 1603 | | |
1581 | 1604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| |||
0 commit comments