Skip to content

Commit 69cf873

Browse files
committed
Merge branch '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== idpf: XDP chapter I: convert Rx to libeth Alexander Lobakin says: XDP for idpf is currently 5 chapters: * convert Rx to libeth (this); * convert Tx and stats to libeth; * generic XDP and XSk code changes, libeth_xdp; * actual XDP for idpf via libeth_xdp; * XSk for idpf (^). Part I does the following: * splits &idpf_queue into 4 (RQ, SQ, FQ, CQ) and puts them on a diet; * ensures optimal cacheline placement, strictly asserts CL sizes; * moves currently unused/dead singleq mode out of line; * reuses libeth's Rx ptype definitions and helpers; * uses libeth's Rx buffer management for both header and payload; * eliminates memcpy()s and coherent DMA uses on hotpath, uses napi_build_skb() instead of in-place short skb allocation. Most idpf patches, except for the queue split, removes more lines than adds. Expect far better memory utilization and +5-8% on Rx depending on the case (+17% on skb XDP_DROP :>). * '200GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: idpf: use libeth Rx buffer management for payload buffer idpf: convert header split mode to libeth + napi_build_skb() libeth: support different types of buffers for Rx idpf: remove legacy Page Pool Ethtool stats idpf: reuse libeth's definitions of parsed ptype structures idpf: compile singleq code only under default-n CONFIG_IDPF_SINGLEQ idpf: merge singleq and splitq &net_device_ops idpf: strictly assert cachelines of queue and queue vector structures idpf: avoid bloating &idpf_q_vector with big %NR_CPUS idpf: split &idpf_queue into 4 strictly-typed queue structures idpf: stop using macros for accessing queue descriptors libeth: add cacheline / struct layout assertion helpers page_pool: use __cacheline_group_{begin, end}_aligned() cache: add __cacheline_group_{begin, end}_aligned() (+ couple more) ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 26f4531 + 74d1412 commit 69cf873

File tree

18 files changed

+1824
-1403
lines changed

18 files changed

+1824
-1403
lines changed

drivers/net/ethernet/intel/Kconfig

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,6 @@ config IGC_LEDS
384384
Optional support for controlling the NIC LED's with the netdev
385385
LED trigger.
386386

387-
config IDPF
388-
tristate "Intel(R) Infrastructure Data Path Function Support"
389-
depends on PCI_MSI
390-
select DIMLIB
391-
select PAGE_POOL
392-
select PAGE_POOL_STATS
393-
help
394-
This driver supports Intel(R) Infrastructure Data Path Function
395-
devices.
396-
397-
To compile this driver as a module, choose M here. The module
398-
will be called idpf.
387+
source "drivers/net/ethernet/intel/idpf/Kconfig"
399388

400389
endif # NET_VENDOR_INTEL
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# Copyright (C) 2024 Intel Corporation
3+
4+
config IDPF
5+
tristate "Intel(R) Infrastructure Data Path Function Support"
6+
depends on PCI_MSI
7+
select DIMLIB
8+
select LIBETH
9+
help
10+
This driver supports Intel(R) Infrastructure Data Path Function
11+
devices.
12+
13+
To compile this driver as a module, choose M here. The module
14+
will be called idpf.
15+
16+
if IDPF
17+
18+
config IDPF_SINGLEQ
19+
bool "idpf singleq support"
20+
help
21+
This option enables support for legacy single Rx/Tx queues w/no
22+
completion and fill queues. Only enable if you have hardware which
23+
wants to work in this mode as it increases the driver size and adds
24+
runtme checks on hotpath.
25+
26+
endif # IDPF

drivers/net/ethernet/intel/idpf/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ idpf-y := \
1212
idpf_ethtool.o \
1313
idpf_lib.o \
1414
idpf_main.o \
15-
idpf_singleq_txrx.o \
1615
idpf_txrx.o \
1716
idpf_virtchnl.o \
1817
idpf_vf_dev.o
18+
19+
idpf-$(CONFIG_IDPF_SINGLEQ) += idpf_singleq_txrx.o

drivers/net/ethernet/intel/idpf/idpf.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ struct idpf_vport_max_q;
1717
#include <linux/sctp.h>
1818
#include <linux/ethtool_netlink.h>
1919
#include <net/gro.h>
20-
#include <linux/dim.h>
2120

2221
#include "virtchnl2.h"
23-
#include "idpf_lan_txrx.h"
2422
#include "idpf_txrx.h"
2523
#include "idpf_controlq.h"
2624

@@ -266,7 +264,6 @@ struct idpf_port_stats {
266264
* the worst case.
267265
* @num_bufqs_per_qgrp: Buffer queues per RX queue in a given grouping
268266
* @bufq_desc_count: Buffer queue descriptor count
269-
* @bufq_size: Size of buffers in ring (e.g. 2K, 4K, etc)
270267
* @num_rxq_grp: Number of RX queues in a group
271268
* @rxq_grps: Total number of RX groups. Number of groups * number of RX per
272269
* group will yield total number of RX queues.
@@ -302,19 +299,18 @@ struct idpf_vport {
302299
u16 num_txq_grp;
303300
struct idpf_txq_group *txq_grps;
304301
u32 txq_model;
305-
struct idpf_queue **txqs;
302+
struct idpf_tx_queue **txqs;
306303
bool crc_enable;
307304

308305
u16 num_rxq;
309306
u16 num_bufq;
310307
u32 rxq_desc_count;
311308
u8 num_bufqs_per_qgrp;
312309
u32 bufq_desc_count[IDPF_MAX_BUFQS_PER_RXQ_GRP];
313-
u32 bufq_size[IDPF_MAX_BUFQS_PER_RXQ_GRP];
314310
u16 num_rxq_grp;
315311
struct idpf_rxq_group *rxq_grps;
316312
u32 rxq_model;
317-
struct idpf_rx_ptype_decoded rx_ptype_lkup[IDPF_RX_MAX_PTYPE];
313+
struct libeth_rx_pt *rx_ptype_lkup;
318314

319315
struct idpf_adapter *adapter;
320316
struct net_device *netdev;
@@ -601,7 +597,8 @@ struct idpf_adapter {
601597
*/
602598
static inline int idpf_is_queue_model_split(u16 q_model)
603599
{
604-
return q_model == VIRTCHNL2_QUEUE_MODEL_SPLIT;
600+
return !IS_ENABLED(CONFIG_IDPF_SINGLEQ) ||
601+
q_model == VIRTCHNL2_QUEUE_MODEL_SPLIT;
605602
}
606603

607604
#define idpf_is_cap_ena(adapter, field, flag) \

0 commit comments

Comments
 (0)