Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Merge in late fixes to prepare for the 6.12 net-next PR.

No conflicts or adjacent changes.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+78 -37
+24 -2
drivers/net/bareudp.c
··· 68 68 __be16 proto; 69 69 void *oiph; 70 70 int err; 71 + int nh; 71 72 72 73 bareudp = rcu_dereference_sk_user_data(sk); 73 74 if (!bareudp) ··· 149 148 } 150 149 skb_dst_set(skb, &tun_dst->dst); 151 150 skb->dev = bareudp->dev; 152 - oiph = skb_network_header(skb); 153 - skb_reset_network_header(skb); 154 151 skb_reset_mac_header(skb); 152 + 153 + /* Save offset of outer header relative to skb->head, 154 + * because we are going to reset the network header to the inner header 155 + * and might change skb->head. 156 + */ 157 + nh = skb_network_header(skb) - skb->head; 158 + 159 + skb_reset_network_header(skb); 160 + 161 + if (!pskb_inet_may_pull(skb)) { 162 + DEV_STATS_INC(bareudp->dev, rx_length_errors); 163 + DEV_STATS_INC(bareudp->dev, rx_errors); 164 + goto drop; 165 + } 166 + 167 + /* Get the outer header. */ 168 + oiph = skb->head + nh; 155 169 156 170 if (!ipv6_mod_enabled() || family == AF_INET) 157 171 err = IP_ECN_decapsulate(oiph, skb); ··· 317 301 __be32 saddr; 318 302 int err; 319 303 304 + if (!skb_vlan_inet_prepare(skb, skb->protocol != htons(ETH_P_TEB))) 305 + return -EINVAL; 306 + 320 307 if (!sock) 321 308 return -ESHUTDOWN; 322 309 ··· 386 367 __u8 prio, ttl; 387 368 __be16 sport; 388 369 int err; 370 + 371 + if (!skb_vlan_inet_prepare(skb, skb->protocol != htons(ETH_P_TEB))) 372 + return -EINVAL; 389 373 390 374 if (!sock) 391 375 return -ESHUTDOWN;
+3
drivers/net/can/kvaser_pciefd.c
··· 1104 1104 1105 1105 /* Disable the DMA */ 1106 1106 iowrite32(0, KVASER_PCIEFD_SRB_ADDR(pcie) + KVASER_PCIEFD_SRB_CTRL_REG); 1107 + 1108 + dma_set_mask_and_coherent(&pcie->pci->dev, DMA_BIT_MASK(64)); 1109 + 1107 1110 for (i = 0; i < KVASER_PCIEFD_DMA_COUNT; i++) { 1108 1111 pcie->dma_data[i] = dmam_alloc_coherent(&pcie->pci->dev, 1109 1112 KVASER_PCIEFD_DMA_SIZE,
+7 -7
drivers/net/can/m_can/m_can.c
··· 1764 1764 1765 1765 netif_stop_queue(dev); 1766 1766 1767 - if (!cdev->is_peripheral) 1768 - napi_disable(&cdev->napi); 1769 - 1770 1767 m_can_stop(dev); 1771 - m_can_clk_stop(cdev); 1772 1768 free_irq(dev->irq, dev); 1773 1769 1774 1770 m_can_clean(dev); ··· 1773 1777 destroy_workqueue(cdev->tx_wq); 1774 1778 cdev->tx_wq = NULL; 1775 1779 can_rx_offload_disable(&cdev->offload); 1780 + } else { 1781 + napi_disable(&cdev->napi); 1776 1782 } 1777 1783 1778 1784 close_candev(dev); 1779 1785 1786 + m_can_clk_stop(cdev); 1780 1787 phy_power_off(cdev->transceiver); 1781 1788 1782 1789 return 0; ··· 2030 2031 2031 2032 if (cdev->is_peripheral) 2032 2033 can_rx_offload_enable(&cdev->offload); 2034 + else 2035 + napi_enable(&cdev->napi); 2033 2036 2034 2037 /* register interrupt handler */ 2035 2038 if (cdev->is_peripheral) { ··· 2065 2064 if (err) 2066 2065 goto exit_start_fail; 2067 2066 2068 - if (!cdev->is_peripheral) 2069 - napi_enable(&cdev->napi); 2070 - 2071 2067 netif_start_queue(dev); 2072 2068 2073 2069 return 0; ··· 2078 2080 out_wq_fail: 2079 2081 if (cdev->is_peripheral) 2080 2082 can_rx_offload_disable(&cdev->offload); 2083 + else 2084 + napi_disable(&cdev->napi); 2081 2085 close_candev(dev); 2082 2086 exit_disable_clks: 2083 2087 m_can_clk_stop(cdev);
+1 -5
drivers/net/can/usb/esd_usb.c
··· 3 3 * CAN driver for esd electronics gmbh CAN-USB/2, CAN-USB/3 and CAN-USB/Micro 4 4 * 5 5 * Copyright (C) 2010-2012 esd electronic system design gmbh, Matthias Fuchs <socketcan@esd.eu> 6 - * Copyright (C) 2022-2023 esd electronics gmbh, Frank Jungclaus <frank.jungclaus@esd.eu> 6 + * Copyright (C) 2022-2024 esd electronics gmbh, Frank Jungclaus <frank.jungclaus@esd.eu> 7 7 */ 8 8 9 9 #include <linux/can.h> ··· 1116 1116 if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY) 1117 1117 flags |= ESD_USB_3_BAUDRATE_FLAG_LOM; 1118 1118 1119 - if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) 1120 - flags |= ESD_USB_3_BAUDRATE_FLAG_TRS; 1121 - 1122 1119 baud_x->nom.brp = cpu_to_le16(nom_bt->brp & (nom_btc->brp_max - 1)); 1123 1120 baud_x->nom.sjw = cpu_to_le16(nom_bt->sjw & (nom_btc->sjw_max - 1)); 1124 1121 baud_x->nom.tseg1 = cpu_to_le16((nom_bt->prop_seg + nom_bt->phase_seg1) ··· 1216 1219 switch (le16_to_cpu(dev->udev->descriptor.idProduct)) { 1217 1220 case ESD_USB_CANUSB3_PRODUCT_ID: 1218 1221 priv->can.clock.freq = ESD_USB_3_CAN_CLOCK; 1219 - priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES; 1220 1222 priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD; 1221 1223 priv->can.bittiming_const = &esd_usb_3_nom_bittiming_const; 1222 1224 priv->can.data_bittiming_const = &esd_usb_3_data_bittiming_const;
+4 -4
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
··· 1061 1061 nv->fbd = fbd; 1062 1062 nv->v_idx = v_idx; 1063 1063 1064 - /* Record IRQ to NAPI struct */ 1065 - netif_napi_set_irq(&nv->napi, 1066 - pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx)); 1067 - 1068 1064 /* Tie napi to netdev */ 1069 1065 list_add(&nv->napis, &fbn->napis); 1070 1066 netif_napi_add(fbn->netdev, &nv->napi, fbnic_poll); 1067 + 1068 + /* Record IRQ to NAPI struct */ 1069 + netif_napi_set_irq(&nv->napi, 1070 + pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx)); 1071 1071 1072 1072 /* Tie nv back to PCIe dev */ 1073 1073 nv->dev = fbd->dev;
+2
drivers/net/ethernet/realtek/r8169_phy_config.c
··· 1060 1060 phy_modify_paged(phydev, 0xa86, 0x15, 0x0001, 0x0000); 1061 1061 rtl8168g_enable_gphy_10m(phydev); 1062 1062 1063 + rtl8168g_disable_aldps(phydev); 1063 1064 rtl8125a_config_eee_phy(phydev); 1064 1065 } 1065 1066 ··· 1100 1099 phy_modify_paged(phydev, 0xbf8, 0x12, 0xe000, 0xa000); 1101 1100 1102 1101 rtl8125_legacy_force_mode(phydev); 1102 + rtl8168g_disable_aldps(phydev); 1103 1103 rtl8125b_config_eee_phy(phydev); 1104 1104 } 1105 1105
+3
drivers/net/netkit.c
··· 65 65 66 66 static netdev_tx_t netkit_xmit(struct sk_buff *skb, struct net_device *dev) 67 67 { 68 + struct bpf_net_context __bpf_net_ctx, *bpf_net_ctx; 68 69 struct netkit *nk = netkit_priv(dev); 69 70 enum netkit_action ret = READ_ONCE(nk->policy); 70 71 netdev_tx_t ret_dev = NET_XMIT_SUCCESS; ··· 73 72 struct net_device *peer; 74 73 int len = skb->len; 75 74 75 + bpf_net_ctx = bpf_net_ctx_set(&__bpf_net_ctx); 76 76 rcu_read_lock(); 77 77 peer = rcu_dereference(nk->peer); 78 78 if (unlikely(!peer || !(peer->flags & IFF_UP) || ··· 112 110 break; 113 111 } 114 112 rcu_read_unlock(); 113 + bpf_net_ctx_clear(bpf_net_ctx); 115 114 return ret_dev; 116 115 } 117 116
+3 -1
net/can/bcm.c
··· 1471 1471 /* remove device reference, if this is our bound device */ 1472 1472 if (bo->bound && bo->ifindex == dev->ifindex) { 1473 1473 #if IS_ENABLED(CONFIG_PROC_FS) 1474 - if (sock_net(sk)->can.bcmproc_dir && bo->bcm_proc_read) 1474 + if (sock_net(sk)->can.bcmproc_dir && bo->bcm_proc_read) { 1475 1475 remove_proc_entry(bo->procname, sock_net(sk)->can.bcmproc_dir); 1476 + bo->bcm_proc_read = NULL; 1477 + } 1476 1478 #endif 1477 1479 bo->bound = 0; 1478 1480 bo->ifindex = 0;
+1 -1
net/ipv6/route.c
··· 174 174 struct net_device *rt_dev = rt->dst.dev; 175 175 bool handled = false; 176 176 177 - if (rt_idev->dev == dev) { 177 + if (rt_idev && rt_idev->dev == dev) { 178 178 rt->rt6i_idev = in6_dev_get(blackhole_netdev); 179 179 in6_dev_put(rt_idev); 180 180 handled = true;
+7 -5
net/ipv6/rpl_iptunnel.c
··· 263 263 rlwt = rpl_lwt_lwtunnel(orig_dst->lwtstate); 264 264 265 265 err = rpl_do_srh(skb, rlwt); 266 - if (unlikely(err)) { 267 - kfree_skb(skb); 268 - return err; 269 - } 266 + if (unlikely(err)) 267 + goto drop; 270 268 271 269 local_bh_disable(); 272 270 dst = dst_cache_get(&rlwt->cache); ··· 284 286 285 287 err = skb_cow_head(skb, LL_RESERVED_SPACE(dst->dev)); 286 288 if (unlikely(err)) 287 - return err; 289 + goto drop; 288 290 289 291 return dst_input(skb); 292 + 293 + drop: 294 + kfree_skb(skb); 295 + return err; 290 296 } 291 297 292 298 static int nla_put_rpl_srh(struct sk_buff *skb, int attrtype,
+2 -2
net/netfilter/nft_socket.c
··· 61 61 struct cgroup *cgrp = cgroup_get_from_path("/"); 62 62 int level; 63 63 64 - if (!cgrp) 65 - return -ENOENT; 64 + if (IS_ERR(cgrp)) 65 + return PTR_ERR(cgrp); 66 66 67 67 level = cgrp->level; 68 68
+1 -1
net/tipc/bcast.c
··· 320 320 { 321 321 struct tipc_msg *hdr, *_hdr; 322 322 struct sk_buff_head tmpq; 323 + u16 cong_link_cnt = 0; 323 324 struct sk_buff *_skb; 324 - u16 cong_link_cnt; 325 325 int rc = 0; 326 326 327 327 /* Is a cluster supporting with new capabilities ? */
+20 -9
net/xdp/xsk_buff_pool.c
··· 628 628 return nb_entries; 629 629 } 630 630 631 + static u32 xp_alloc_slow(struct xsk_buff_pool *pool, struct xdp_buff **xdp, 632 + u32 max) 633 + { 634 + int i; 635 + 636 + for (i = 0; i < max; i++) { 637 + struct xdp_buff *buff; 638 + 639 + buff = xp_alloc(pool); 640 + if (unlikely(!buff)) 641 + return i; 642 + *xdp = buff; 643 + xdp++; 644 + } 645 + 646 + return max; 647 + } 648 + 631 649 u32 xp_alloc_batch(struct xsk_buff_pool *pool, struct xdp_buff **xdp, u32 max) 632 650 { 633 651 u32 nb_entries1 = 0, nb_entries2; 634 652 635 - if (unlikely(pool->dev && dma_dev_need_sync(pool->dev))) { 636 - struct xdp_buff *buff; 637 - 638 - /* Slow path */ 639 - buff = xp_alloc(pool); 640 - if (buff) 641 - *xdp = buff; 642 - return !!buff; 643 - } 653 + if (unlikely(pool->dev && dma_dev_need_sync(pool->dev))) 654 + return xp_alloc_slow(pool, xdp, max); 644 655 645 656 if (unlikely(pool->free_list_cnt)) { 646 657 nb_entries1 = xp_alloc_reused(pool, xdp, max);