Skip to content

Commit

Permalink
Merge branch 'net-next-2025-02-04--06-00' into HEAD
Browse files Browse the repository at this point in the history
# Conflicts:
#	drivers/firmware/cirrus/Kconfig
#	lib/Kconfig.debug
  • Loading branch information
Your Name committed Feb 4, 2025
2 parents ab4839c + 22d9273 commit d13f53a
Show file tree
Hide file tree
Showing 138 changed files with 3,824 additions and 1,286 deletions.
5 changes: 3 additions & 2 deletions Documentation/netlink/genetlink-c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ $defs:
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int or limit based on fixed-width type e.g. u8-min, u16-max, etc.
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[su](8|16|32|64)-(min|max)$
pattern: ^[0-9A-Za-z_-]+$
minimum: 0

# Schema for specs
Expand Down
5 changes: 3 additions & 2 deletions Documentation/netlink/genetlink-legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ $defs:
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int or limit based on fixed-width type e.g. u8-min, u16-max, etc.
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[su](8|16|32|64)-(min|max)$
pattern: ^[0-9A-Za-z_-]+$
minimum: 0

# Schema for specs
Expand Down
5 changes: 3 additions & 2 deletions Documentation/netlink/genetlink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ $defs:
pattern: ^[0-9A-Za-z_-]+( - 1)?$
minimum: 0
len-or-limit:
# literal int or limit based on fixed-width type e.g. u8-min, u16-max, etc.
# literal int, const name, or limit based on fixed-width type
# e.g. u8-min, u16-max, etc.
type: [ string, integer ]
pattern: ^[su](8|16|32|64)-(min|max)$
pattern: ^[0-9A-Za-z_-]+$
minimum: 0

# Schema for specs
Expand Down
12 changes: 12 additions & 0 deletions Documentation/netlink/specs/netdev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,18 @@ operations:
- defer-hard-irqs
- gro-flush-timeout
- irq-suspend-timeout
-
name: bind-tx
doc: Bind dmabuf to netdev for TX
attribute-set: dmabuf
do:
request:
attributes:
- ifindex
- fd
reply:
attributes:
- id

kernel-family:
headers: [ "linux/list.h"]
Expand Down
11 changes: 11 additions & 0 deletions Documentation/networking/devlink/ice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ Parameters

To verify that value has been set:
$ devlink dev param show pci/0000:16:00.0 name tx_scheduling_layers
* - ``msix_vec_per_pf_max``
- driverinit
- Set the max MSI-X that can be used by the PF, rest can be utilized for
SRIOV. The range is from min value set in msix_vec_per_pf_min to
2k/number of ports.
* - ``msix_vec_per_pf_min``
- driverinit
- Set the min MSI-X that will be used by the PF. This value inform how many
MSI-X will be allocated statically. The range is from 2 to value set
in msix_vec_per_pf_max.

.. list-table:: Driver specific parameters implemented
:widths: 5 5 90

Expand Down
144 changes: 140 additions & 4 deletions Documentation/networking/devmem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ More Info
https://lore.kernel.org/netdev/[email protected]/


Interface
=========
RX Interface
============


Example
-------

tools/testing/selftests/net/ncdevmem.c:do_server shows an example of setting up
the RX path of this API.
./tools/testing/selftests/drivers/net/hw/ncdevmem:do_server shows an example of
setting up the RX path of this API.


NIC Setup
Expand Down Expand Up @@ -235,6 +235,142 @@ can be less than the tokens provided by the user in case of:
(a) an internal kernel leak bug.
(b) the user passed more than 1024 frags.

TX Interface
============


Example
-------

./tools/testing/selftests/drivers/net/hw/ncdevmem:do_client shows an example of
setting up the TX path of this API.


NIC Setup
---------

The user must bind a TX dmabuf to a given NIC using the netlink API::

struct netdev_bind_tx_req *req = NULL;
struct netdev_bind_tx_rsp *rsp = NULL;
struct ynl_error yerr;

*ys = ynl_sock_create(&ynl_netdev_family, &yerr);

req = netdev_bind_tx_req_alloc();
netdev_bind_tx_req_set_ifindex(req, ifindex);
netdev_bind_tx_req_set_fd(req, dmabuf_fd);

rsp = netdev_bind_tx(*ys, req);

tx_dmabuf_id = rsp->id;


The netlink API returns a dmabuf_id: a unique ID that refers to this dmabuf
that has been bound.

The user can unbind the dmabuf from the netdevice by closing the netlink socket
that established the binding. We do this so that the binding is automatically
unbound even if the userspace process crashes.

Note that any reasonably well-behaved dmabuf from any exporter should work with
devmem TCP, even if the dmabuf is not actually backed by devmem. An example of
this is udmabuf, which wraps user memory (non-devmem) in a dmabuf.

Socket Setup
------------

The user application must use MSG_ZEROCOPY flag when sending devmem TCP. Devmem
cannot be copied by the kernel, so the semantics of the devmem TX are similar
to the semantics of MSG_ZEROCOPY.

ret = setsockopt(socket_fd, SOL_SOCKET, SO_ZEROCOPY, &opt, sizeof(opt));

Sending data
--------------

Devmem data is sent using the SCM_DEVMEM_DMABUF cmsg.

The user should create a msghdr where,

iov_base is set to the offset into the dmabuf to start sending from.
iov_len is set to the number of bytes to be sent from the dmabuf.

The user passes the dma-buf id to send from via the dmabuf_tx_cmsg.dmabuf_id.

The example below sends 1024 bytes from offset 100 into the dmabuf, and 2048
from offset 2000 into the dmabuf. The dmabuf to send from is tx_dmabuf_id::

char ctrl_data[CMSG_SPACE(sizeof(struct dmabuf_tx_cmsg))];
struct dmabuf_tx_cmsg ddmabuf;
struct msghdr msg = {};
struct cmsghdr *cmsg;
struct iovec iov[2];

iov[0].iov_base = (void*)100;
iov[0].iov_len = 1024;
iov[1].iov_base = (void*)2000;
iov[1].iov_len = 2048;

msg.msg_iov = iov;
msg.msg_iovlen = 2;

msg.msg_control = ctrl_data;
msg.msg_controllen = sizeof(ctrl_data);

cmsg = CMSG_FIRSTHDR(&msg);
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_DEVMEM_DMABUF;
cmsg->cmsg_len = CMSG_LEN(sizeof(struct dmabuf_tx_cmsg));

ddmabuf.dmabuf_id = tx_dmabuf_id;

*((struct dmabuf_tx_cmsg *)CMSG_DATA(cmsg)) = ddmabuf;

sendmsg(socket_fd, &msg, MSG_ZEROCOPY);


Reusing TX dmabufs
------------------

Similar to MSG_ZEROCOPY with regular memory, the user should not modify the
contents of the dma-buf while a send operation is in progress. This is because
the kernel does not keep a copy of the dmabuf contents. Instead, the kernel
will pin and send data from the buffer available to the userspace.

Just as in MSG_ZEROCOPY, the kernel notifies the userspace of send completions
using MSG_ERRQUEUE::

int64_t tstop = gettimeofday_ms() + waittime_ms;
char control[CMSG_SPACE(100)] = {};
struct sock_extended_err *serr;
struct msghdr msg = {};
struct cmsghdr *cm;
int retries = 10;
__u32 hi, lo;

msg.msg_control = control;
msg.msg_controllen = sizeof(control);

while (gettimeofday_ms() < tstop) {
if (!do_poll(fd)) continue;

ret = recvmsg(fd, &msg, MSG_ERRQUEUE);

for (cm = CMSG_FIRSTHDR(&msg); cm; cm = CMSG_NXTHDR(&msg, cm)) {
serr = (void *)CMSG_DATA(cm);

hi = serr->ee_data;
lo = serr->ee_info;

fprintf(stdout, "tx complete [%d,%d]\n", lo, hi);
}
}

After the associated sendmsg has been completed, the dmabuf can be reused by
the userspace.


Implementation & Caveats
========================

Expand Down
4 changes: 2 additions & 2 deletions Documentation/networking/iso15765-2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ to their default.
addr.can_family = AF_CAN;
addr.can_ifindex = if_nametoindex("can0");
addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
addr.can_addr.tp.tx_id = 0x18DA42F1 | CAN_EFF_FLAG;
addr.can_addr.tp.rx_id = 0x18DAF142 | CAN_EFF_FLAG;
ret = bind(s, (struct sockaddr *)&addr, sizeof(addr));
if (ret < 0)
Expand Down
43 changes: 43 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -16462,6 +16462,22 @@ F: include/net/dsa.h
F: net/dsa/
F: tools/testing/selftests/drivers/net/dsa/

NETWORKING [ETHTOOL]
M: Andrew Lunn <[email protected]>
M: Jakub Kicinski <[email protected]>
F: Documentation/netlink/specs/ethtool.yaml
F: Documentation/networking/ethtool-netlink.rst
F: include/linux/ethtool*
F: include/uapi/linux/ethtool*
F: net/ethtool/
F: tools/testing/selftests/drivers/net/*/ethtool*

NETWORKING [ETHTOOL CABLE TEST]
M: Andrew Lunn <[email protected]>
F: net/ethtool/cabletest.c
F: tools/testing/selftests/drivers/net/*/ethtool*
K: start_cable_test

NETWORKING [GENERAL]
M: "David S. Miller" <[email protected]>
M: Eric Dumazet <[email protected]>
Expand Down Expand Up @@ -16621,6 +16637,7 @@ F: tools/testing/selftests/net/mptcp/
NETWORKING [TCP]
M: Eric Dumazet <[email protected]>
M: Neal Cardwell <[email protected]>
R: Kuniyuki Iwashima <[email protected]>
L: [email protected]
S: Maintained
F: Documentation/networking/net_cachelines/tcp_sock.rst
Expand Down Expand Up @@ -16648,6 +16665,31 @@ F: include/net/tls.h
F: include/uapi/linux/tls.h
F: net/tls/*

NETWORKING [SOCKETS]
M: Eric Dumazet <[email protected]>
M: Kuniyuki Iwashima <[email protected]>
M: Paolo Abeni <[email protected]>
M: Willem de Bruijn <[email protected]>
S: Maintained
F: include/linux/sock_diag.h
F: include/linux/socket.h
F: include/linux/sockptr.h
F: include/net/sock.h
F: include/net/sock_reuseport.h
F: include/uapi/linux/socket.h
F: net/core/*sock*
F: net/core/scm.c
F: net/socket.c

NETWORKING [UNIX SOCKETS]
M: Kuniyuki Iwashima <[email protected]>
S: Maintained
F: include/net/af_unix.h
F: include/net/netns/unix.h
F: include/uapi/linux/unix_diag.h
F: net/unix/
F: tools/testing/selftests/net/af_unix/

NETXEN (1/10) GbE SUPPORT
M: Manish Chopra <[email protected]>
M: Rahul Verma <[email protected]>
Expand Down Expand Up @@ -17713,6 +17755,7 @@ L: [email protected]
L: [email protected]
S: Maintained
W: http://openvswitch.org
F: Documentation/networking/openvswitch.rst
F: include/uapi/linux/openvswitch.h
F: net/openvswitch/
F: tools/testing/selftests/net/openvswitch/
Expand Down
1 change: 0 additions & 1 deletion drivers/firmware/cirrus/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ config FW_CS_DSP_KUNIT_TEST_UTILS
config FW_CS_DSP_KUNIT_TEST
tristate "KUnit tests for Cirrus Logic cs_dsp" if !KUNIT_ALL_TESTS
depends on KUNIT && REGMAP
default KUNIT_ALL_TESTS
select FW_CS_DSP
select FW_CS_DSP_KUNIT_TEST_UTILS
help
Expand Down
2 changes: 0 additions & 2 deletions drivers/infiniband/hw/irdma/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,6 @@ static int irdma_save_msix_info(struct irdma_pci_f *rf)
iw_qvlist->num_vectors = rf->msix_count;
if (rf->msix_count <= num_online_cpus())
rf->msix_shared = true;
else if (rf->msix_count > num_online_cpus() + 1)
rf->msix_count = num_online_cpus() + 1;

pmsix = rf->msix_entries;
for (i = 0, ceq_idx = 0; i < rf->msix_count; i++, iw_qvinfo++) {
Expand Down
Loading

0 comments on commit d13f53a

Please sign in to comment.