@@ -171,7 +171,10 @@ struct nfp_net_tx_desc {
171
171
* on the head's buffer). Equal to skb->len for non-TSO packets.
172
172
*/
173
173
struct nfp_net_tx_buf {
174
- struct sk_buff * skb ;
174
+ union {
175
+ struct sk_buff * skb ;
176
+ void * frag ;
177
+ };
175
178
dma_addr_t dma_addr ;
176
179
short int fidx ;
177
180
u16 pkt_cnt ;
@@ -341,6 +344,7 @@ struct nfp_net_rx_ring {
341
344
* @napi: NAPI structure for this ring vec
342
345
* @tx_ring: Pointer to TX ring
343
346
* @rx_ring: Pointer to RX ring
347
+ * @xdp_ring: Pointer to an extra TX ring for XDP
344
348
* @irq_idx: Index into MSI-X table
345
349
* @rx_sync: Seqlock for atomic updates of RX stats
346
350
* @rx_pkts: Number of received packets
@@ -384,6 +388,8 @@ struct nfp_net_r_vector {
384
388
u64 hw_csum_rx_inner_ok ;
385
389
u64 hw_csum_rx_error ;
386
390
391
+ struct nfp_net_tx_ring * xdp_ring ;
392
+
387
393
struct u64_stats_sync tx_sync ;
388
394
u64 tx_pkts ;
389
395
u64 tx_bytes ;
@@ -432,6 +438,7 @@ struct nfp_stat_pair {
432
438
* @ctrl: Local copy of the control register/word.
433
439
* @fl_bufsz: Currently configured size of the freelist buffers
434
440
* @rx_offset: Offset in the RX buffers where packet data starts
441
+ * @xdp_prog: Installed XDP program
435
442
* @cpp: Pointer to the CPP handle
436
443
* @nfp_dev_cpp: Pointer to the NFP Device handle
437
444
* @ctrl_area: Pointer to the CPP area for the control BAR
@@ -451,6 +458,7 @@ struct nfp_stat_pair {
451
458
* @max_tx_rings: Maximum number of TX rings supported by the Firmware
452
459
* @max_rx_rings: Maximum number of RX rings supported by the Firmware
453
460
* @num_tx_rings: Currently configured number of TX rings
461
+ * @num_stack_tx_rings: Number of TX rings used by the stack (not XDP)
454
462
* @num_rx_rings: Currently configured number of RX rings
455
463
* @txd_cnt: Size of the TX ring in number of descriptors
456
464
* @rxd_cnt: Size of the RX ring in number of descriptors
@@ -500,6 +508,8 @@ struct nfp_net {
500
508
501
509
u32 rx_offset ;
502
510
511
+ struct bpf_prog * xdp_prog ;
512
+
503
513
struct nfp_net_tx_ring * tx_rings ;
504
514
struct nfp_net_rx_ring * rx_rings ;
505
515
@@ -532,6 +542,7 @@ struct nfp_net {
532
542
unsigned int max_rx_rings ;
533
543
534
544
unsigned int num_tx_rings ;
545
+ unsigned int num_stack_tx_rings ;
535
546
unsigned int num_rx_rings ;
536
547
537
548
int stride_tx ;
@@ -779,8 +790,8 @@ void nfp_net_coalesce_write_cfg(struct nfp_net *nn);
779
790
int nfp_net_irqs_alloc (struct nfp_net * nn );
780
791
void nfp_net_irqs_disable (struct nfp_net * nn );
781
792
int
782
- nfp_net_ring_reconfig (struct nfp_net * nn , struct nfp_net_ring_set * rx ,
783
- struct nfp_net_ring_set * tx );
793
+ nfp_net_ring_reconfig (struct nfp_net * nn , struct bpf_prog * * xdp_prog ,
794
+ struct nfp_net_ring_set * rx , struct nfp_net_ring_set * tx );
784
795
785
796
#ifdef CONFIG_NFP_NET_DEBUG
786
797
void nfp_net_debugfs_create (void );
0 commit comments