diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-11-14 01:36:35 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-11-14 01:36:35 +0300 |
| commit | d6b9ce75e87c5f4bfbc0f7bba4f4f7cbf942f98a (patch) | |
| tree | 0b052e77f632b0cd080ffc5da3b5525e676f05f4 /net/core/devmem.c | |
| parent | 8d422b8beb76bfc57f0fe4b03082f3823eccd150 (diff) | |
| parent | d0fcf70c680e4d1669fcb3a8632f41400b9a73c2 (diff) | |
| download | linux-d6b9ce75e87c5f4bfbc0f7bba4f4f7cbf942f98a.tar.xz | |
Merge tag 'stratix10_svc_fix_v6.18' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into char-misc-linus
Dinh writes:
firmware: stratix10-svc: fix saving contoller data for v6.18
- Fix the incorrect use of platform_set_drvdata and dev_set_drvdata
* tag 'stratix10_svc_fix_v6.18' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: (237 commits)
firmware: stratix10-svc: fix bug in saving controller data
Linux 6.18-rc4
objtool: Fix skip_alt_group() for non-alternative STAC/CLAC
kconfig/nconf: Initialize the default locale at startup
kconfig/mconf: Initialize the default locale at startup
x86/mm: Ensure clear_page() variants always have __kcfi_typeid_ symbols
PCI: Do not size non-existing prefetchable window
Revert "PCI: qcom: Remove custom ASPM enablement code"
bpf/arm64: Fix BPF_ST into arena memory
bpf: Make migrate_disable always inline to avoid partial inlining
null_blk: set dma alignment to logical block size
xfs: document another racy GC case in xfs_zoned_map_extent
xfs: prevent gc from picking the same zone twice
drm/ast: Clear preserved bits from register output value
s390: Disable ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP
drm/imx: parallel-display: add the bridge before attaching it
drm/imx: parallel-display: convert to devm_drm_bridge_alloc() API
blk-crypto: use BLK_STS_INVAL for alignment errors
regulator: bd718x7: Fix voltages scaled by resistor divider
x86/cpu: Add/fix core comments for {Panther,Nova} Lake
...
Diffstat (limited to 'net/core/devmem.c')
| -rw-r--r-- | net/core/devmem.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/net/core/devmem.c b/net/core/devmem.c index d9de31a6cc7f..1d04754bc756 100644 --- a/net/core/devmem.c +++ b/net/core/devmem.c @@ -17,6 +17,7 @@ #include <net/page_pool/helpers.h> #include <net/page_pool/memory_provider.h> #include <net/sock.h> +#include <net/tcp.h> #include <trace/events/page_pool.h> #include "devmem.h" @@ -357,7 +358,8 @@ struct net_devmem_dmabuf_binding *net_devmem_get_binding(struct sock *sk, unsigned int dmabuf_id) { struct net_devmem_dmabuf_binding *binding; - struct dst_entry *dst = __sk_dst_get(sk); + struct net_device *dst_dev; + struct dst_entry *dst; int err = 0; binding = net_devmem_lookup_dmabuf(dmabuf_id); @@ -366,16 +368,35 @@ struct net_devmem_dmabuf_binding *net_devmem_get_binding(struct sock *sk, goto out_err; } + rcu_read_lock(); + dst = __sk_dst_get(sk); + /* If dst is NULL (route expired), attempt to rebuild it. */ + if (unlikely(!dst)) { + if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk)) { + err = -EHOSTUNREACH; + goto out_unlock; + } + dst = __sk_dst_get(sk); + if (unlikely(!dst)) { + err = -ENODEV; + goto out_unlock; + } + } + /* The dma-addrs in this binding are only reachable to the corresponding * net_device. */ - if (!dst || !dst->dev || dst->dev->ifindex != binding->dev->ifindex) { + dst_dev = dst_dev_rcu(dst); + if (unlikely(!dst_dev) || unlikely(dst_dev != binding->dev)) { err = -ENODEV; - goto out_err; + goto out_unlock; } + rcu_read_unlock(); return binding; +out_unlock: + rcu_read_unlock(); out_err: if (binding) net_devmem_dmabuf_binding_put(binding); |
