@@ -1923,10 +1923,6 @@ bool ixgbe_cleanup_headers(struct ixgbe_ring *rx_ring,
1923
1923
{
1924
1924
struct net_device * netdev = rx_ring -> netdev ;
1925
1925
1926
- /* XDP packets use error pointer so abort at this point */
1927
- if (IS_ERR (skb ))
1928
- return true;
1929
-
1930
1926
/* Verify netdev is present, and that packet does not have any
1931
1927
* errors that would be unacceptable to the netdev.
1932
1928
*/
@@ -2234,9 +2230,9 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring,
2234
2230
return skb ;
2235
2231
}
2236
2232
2237
- static struct sk_buff * ixgbe_run_xdp (struct ixgbe_adapter * adapter ,
2238
- struct ixgbe_ring * rx_ring ,
2239
- struct xdp_buff * xdp )
2233
+ static int ixgbe_run_xdp (struct ixgbe_adapter * adapter ,
2234
+ struct ixgbe_ring * rx_ring ,
2235
+ struct xdp_buff * xdp )
2240
2236
{
2241
2237
int err , result = IXGBE_XDP_PASS ;
2242
2238
struct bpf_prog * xdp_prog ;
@@ -2286,7 +2282,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,
2286
2282
break ;
2287
2283
}
2288
2284
xdp_out :
2289
- return ERR_PTR ( - result ) ;
2285
+ return result ;
2290
2286
}
2291
2287
2292
2288
static unsigned int ixgbe_rx_frame_truesize (struct ixgbe_ring * rx_ring ,
@@ -2344,6 +2340,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
2344
2340
unsigned int offset = rx_ring -> rx_offset ;
2345
2341
unsigned int xdp_xmit = 0 ;
2346
2342
struct xdp_buff xdp ;
2343
+ int xdp_res = 0 ;
2347
2344
2348
2345
/* Frame size depend on rx_ring setup when PAGE_SIZE=4K */
2349
2346
#if (PAGE_SIZE < 8192 )
@@ -2389,12 +2386,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
2389
2386
/* At larger PAGE_SIZE, frame_sz depend on len size */
2390
2387
xdp .frame_sz = ixgbe_rx_frame_truesize (rx_ring , size );
2391
2388
#endif
2392
- skb = ixgbe_run_xdp (adapter , rx_ring , & xdp );
2389
+ xdp_res = ixgbe_run_xdp (adapter , rx_ring , & xdp );
2393
2390
}
2394
2391
2395
- if (IS_ERR (skb )) {
2396
- unsigned int xdp_res = - PTR_ERR (skb );
2397
-
2392
+ if (xdp_res ) {
2398
2393
if (xdp_res & (IXGBE_XDP_TX | IXGBE_XDP_REDIR )) {
2399
2394
xdp_xmit |= xdp_res ;
2400
2395
ixgbe_rx_buffer_flip (rx_ring , rx_buffer , size );
@@ -2414,7 +2409,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
2414
2409
}
2415
2410
2416
2411
/* exit if we failed to retrieve a buffer */
2417
- if (!skb ) {
2412
+ if (!xdp_res && ! skb ) {
2418
2413
rx_ring -> rx_stats .alloc_rx_buff_failed ++ ;
2419
2414
rx_buffer -> pagecnt_bias ++ ;
2420
2415
break ;
@@ -2428,7 +2423,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
2428
2423
continue ;
2429
2424
2430
2425
/* verify the packet layout is correct */
2431
- if (ixgbe_cleanup_headers (rx_ring , rx_desc , skb ))
2426
+ if (xdp_res || ixgbe_cleanup_headers (rx_ring , rx_desc , skb ))
2432
2427
continue ;
2433
2428
2434
2429
/* probably a little skewed due to removing CRC */
0 commit comments