Skip to content

Commit 3ca3f39

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== 1GbE Intel Wired LAN Driver Updates 2021-03-29 This series contains updates to igc driver only. Andre Guedes says: Add XDP support for the igc driver. The approach implemented by this series follows the same approach implemented in other Intel drivers as much as possible for the sake of consistency. The series is organized in two parts. In the first part, i.e. patches from 1 to 4, igc_main.c and igc_ptp.c code is refactored in preparation for landing the XDP support, which is introduced in the second part (patches from 5 to 8). As far as code organization is concerned, XDP-related helpers are defined in a new file, igc_xdp.c, and are called by igc_main.c. The features added by this series have been tested with the samples provided in samples/bpf/: xdp1, xdp2, xdp_redirect_cpu, and xdp_redirect_map. Upcoming series will add support of UMEM and zero-copy features from AF_XDP. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 3af562a + 4ff3203 commit 3ca3f39

6 files changed

Lines changed: 496 additions & 80 deletions

File tree

‎drivers/net/ethernet/intel/igc/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
obj-$(CONFIG_IGC) += igc.o
99

1010
igc-objs := igc_main.o igc_mac.o igc_i225.o igc_base.o igc_nvm.o igc_phy.o \
11-
igc_diag.o igc_ethtool.o igc_ptp.o igc_dump.o igc_tsn.o
11+
igc_diag.o igc_ethtool.o igc_ptp.o igc_dump.o igc_tsn.o igc_xdp.o

‎drivers/net/ethernet/intel/igc/igc.h‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ struct igc_ring {
111111
struct sk_buff *skb;
112112
};
113113
};
114+
115+
struct xdp_rxq_info xdp_rxq;
114116
} ____cacheline_internodealigned_in_smp;
115117

116118
/* Board specific private data structure */
@@ -219,6 +221,8 @@ struct igc_adapter {
219221
ktime_t ptp_reset_start; /* Reset time in clock mono */
220222

221223
char fw_version[32];
224+
225+
struct bpf_prog *xdp_prog;
222226
};
223227

224228
void igc_up(struct igc_adapter *adapter);
@@ -373,6 +377,8 @@ enum igc_tx_flags {
373377
/* olinfo flags */
374378
IGC_TX_FLAGS_IPV4 = 0x10,
375379
IGC_TX_FLAGS_CSUM = 0x20,
380+
381+
IGC_TX_FLAGS_XDP = 0x100,
376382
};
377383

378384
enum igc_boards {
@@ -395,7 +401,10 @@ enum igc_boards {
395401
struct igc_tx_buffer {
396402
union igc_adv_tx_desc *next_to_watch;
397403
unsigned long time_stamp;
398-
struct sk_buff *skb;
404+
union {
405+
struct sk_buff *skb;
406+
struct xdp_frame *xdpf;
407+
};
399408
unsigned int bytecount;
400409
u16 gso_segs;
401410
__be16 protocol;
@@ -504,6 +513,10 @@ enum igc_ring_flags_t {
504513

505514
#define ring_uses_large_buffer(ring) \
506515
test_bit(IGC_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
516+
#define set_ring_uses_large_buffer(ring) \
517+
set_bit(IGC_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
518+
#define clear_ring_uses_large_buffer(ring) \
519+
clear_bit(IGC_RING_FLAG_RX_3K_BUFFER, &(ring)->flags)
507520

508521
#define ring_uses_build_skb(ring) \
509522
test_bit(IGC_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags)
@@ -547,8 +560,7 @@ void igc_ptp_init(struct igc_adapter *adapter);
547560
void igc_ptp_reset(struct igc_adapter *adapter);
548561
void igc_ptp_suspend(struct igc_adapter *adapter);
549562
void igc_ptp_stop(struct igc_adapter *adapter);
550-
void igc_ptp_rx_pktstamp(struct igc_q_vector *q_vector, __le32 *va,
551-
struct sk_buff *skb);
563+
ktime_t igc_ptp_rx_pktstamp(struct igc_adapter *adapter, __le32 *buf);
552564
int igc_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
553565
int igc_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr);
554566
void igc_ptp_tx_hang(struct igc_adapter *adapter);

0 commit comments

Comments
 (0)