Lines 1236-1245
tcp_lro_ack_valid(struct mbuf *m, struct tcphdr *th, uint32_t **ppts, bool *othe
Link Here
|
1236 |
static int |
1236 |
static int |
1237 |
tcp_lro_flush_tcphpts(struct lro_ctrl *lc, struct lro_entry *le) |
1237 |
tcp_lro_flush_tcphpts(struct lro_ctrl *lc, struct lro_entry *le) |
1238 |
{ |
1238 |
{ |
|
|
1239 |
struct epoch_tracker et; |
1239 |
struct inpcb *inp; |
1240 |
struct inpcb *inp; |
1240 |
struct tcpcb *tp; |
1241 |
struct tcpcb *tp; |
1241 |
struct mbuf **pp, *cmp, *mv_to; |
1242 |
struct mbuf **pp, *cmp, *mv_to; |
1242 |
bool bpf_req, should_wake; |
1243 |
bool bpf_req, should_wake, needs_epoch; |
1243 |
|
1244 |
|
1244 |
/* Check if packet doesn't belongs to our network interface. */ |
1245 |
/* Check if packet doesn't belongs to our network interface. */ |
1245 |
if ((tcplro_stacks_wanting_mbufq == 0) || |
1246 |
if ((tcplro_stacks_wanting_mbufq == 0) || |
Lines 1264-1274
tcp_lro_flush_tcphpts(struct lro_ctrl *lc, struct lro_entry *le)
Link Here
|
1264 |
IN6_IS_ADDR_UNSPECIFIED(&le->inner.data.s_addr.v6))) |
1265 |
IN6_IS_ADDR_UNSPECIFIED(&le->inner.data.s_addr.v6))) |
1265 |
return (TCP_LRO_CANNOT); |
1266 |
return (TCP_LRO_CANNOT); |
1266 |
#endif |
1267 |
#endif |
|
|
1268 |
needs_epoch = !(lc->ifp->if_flags & IFF_KNOWSEPOCH); |
1269 |
if (needs_epoch) |
1270 |
NET_EPOCH_ENTER(et); |
1267 |
/* Lookup inp, if any. */ |
1271 |
/* Lookup inp, if any. */ |
1268 |
inp = tcp_lro_lookup(lc->ifp, |
1272 |
inp = tcp_lro_lookup(lc->ifp, |
1269 |
(le->inner.data.lro_type == LRO_TYPE_NONE) ? &le->outer : &le->inner); |
1273 |
(le->inner.data.lro_type == LRO_TYPE_NONE) ? &le->outer : &le->inner); |
1270 |
if (inp == NULL) |
1274 |
if (inp == NULL) { |
|
|
1275 |
if (needs_epoch) |
1276 |
NET_EPOCH_EXIT(et); |
1271 |
return (TCP_LRO_CANNOT); |
1277 |
return (TCP_LRO_CANNOT); |
|
|
1278 |
} |
1272 |
|
1279 |
|
1273 |
counter_u64_add(tcp_inp_lro_locks_taken, 1); |
1280 |
counter_u64_add(tcp_inp_lro_locks_taken, 1); |
1274 |
|
1281 |
|
Lines 1280-1285
tcp_lro_flush_tcphpts(struct lro_ctrl *lc, struct lro_entry *le)
Link Here
|
1280 |
(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) || |
1287 |
(inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) || |
1281 |
(inp->inp_flags2 & INP_FREED)) { |
1288 |
(inp->inp_flags2 & INP_FREED)) { |
1282 |
INP_WUNLOCK(inp); |
1289 |
INP_WUNLOCK(inp); |
|
|
1290 |
if (needs_epoch) |
1291 |
NET_EPOCH_EXIT(et); |
1283 |
return (TCP_LRO_CANNOT); |
1292 |
return (TCP_LRO_CANNOT); |
1284 |
} |
1293 |
} |
1285 |
if ((inp->inp_irq_cpu_set == 0) && (lc->lro_cpu_is_set == 1)) { |
1294 |
if ((inp->inp_irq_cpu_set == 0) && (lc->lro_cpu_is_set == 1)) { |
Lines 1289-1294
tcp_lro_flush_tcphpts(struct lro_ctrl *lc, struct lro_entry *le)
Link Here
|
1289 |
/* Check if the transport doesn't support the needed optimizations. */ |
1298 |
/* Check if the transport doesn't support the needed optimizations. */ |
1290 |
if ((inp->inp_flags2 & (INP_SUPPORTS_MBUFQ | INP_MBUF_ACKCMP)) == 0) { |
1299 |
if ((inp->inp_flags2 & (INP_SUPPORTS_MBUFQ | INP_MBUF_ACKCMP)) == 0) { |
1291 |
INP_WUNLOCK(inp); |
1300 |
INP_WUNLOCK(inp); |
|
|
1301 |
if (needs_epoch) |
1302 |
NET_EPOCH_EXIT(et); |
1292 |
return (TCP_LRO_CANNOT); |
1303 |
return (TCP_LRO_CANNOT); |
1293 |
} |
1304 |
} |
1294 |
|
1305 |
|
Lines 1333-1338
tcp_lro_flush_tcphpts(struct lro_ctrl *lc, struct lro_entry *le)
Link Here
|
1333 |
} |
1344 |
} |
1334 |
if (inp != NULL) |
1345 |
if (inp != NULL) |
1335 |
INP_WUNLOCK(inp); |
1346 |
INP_WUNLOCK(inp); |
|
|
1347 |
if (needs_epoch) |
1348 |
NET_EPOCH_EXIT(et); |
1336 |
return (0); /* Success. */ |
1349 |
return (0); /* Success. */ |
1337 |
} |
1350 |
} |
1338 |
#endif |
1351 |
#endif |