forked from mirrors/linux
		
	Rather tiny PR, mostly so that we can get into our trees your fix
to the x86 Makefile.
 
 Current release - regressions:
 
  - Revert "tcp: avoid atomic operations on sk->sk_rmem_alloc",
    error queue accounting was missed
 
 Current release - new code bugs:
 
  - 5 fixes for the netdevice instance locking work
 
 Previous releases - regressions:
 
  - usbnet: restore usb%d name exception for local mac addresses
 
 Previous releases - always broken:
 
  - rtnetlink: allocate vfinfo size for VF GUIDs when supported,
    avoid spurious GET_LINK failures
 
  - eth: mana: Switch to page pool for jumbo frames
 
  - phy: broadcom: Correct BCM5221 PHY model detection
 
 Misc:
 
  - selftests: drv-net: replace helpers for referring to other files
 
 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE6jPA+I1ugmIBA4hXMUZtbf5SIrsFAmfrLiQACgkQMUZtbf5S
 IrvDsg//VH5VmkMau/TUF1WpwA03Wb/X0UqtM72lufVCMGYCogqjHZzs9popfhuu
 CCi4ZiBofEJHfN9WYJoumUL8aOdux0Q875o7h5gvfqKCokkUbJDk3W32QiLj1RqZ
 L14TorNOyS9Tg9m60pLa/6H3WS0kduhUGLuLzgTmOtT/YVJrOGmBtk/tRXFAKclH
 f3CPucvZGS5Fr4HfUc3yWXiocjibDJnv+jE+xW6S6YHpghvsK7anUvqIGTqQV8Vp
 s6AuvFULGO00968hFHcO0N8f8MnaCCJr2bcHCOXyjssdEbdvDOqzhFN4KhxWEPbK
 kCl3rLkPdkXo+ekOC7gIxXXaKVz3IVm28pegtEws8fda/iLuqZTp+BKo7kdrf3Iy
 br0rP/iK3eFN0M1XpVUIbmEuJ6VamztCzK88uvDKdI+Ol3GLAfy9v5NmkbzJI+aE
 cw+SyE6NgbeDeHBxvOu2F7G2sWMBkTEGaHMNXCv7I/VAvQsbk48onTVnpA+GlFD5
 vFqMxiZHLBUfFOfUcHxmw8KAkZ44pc1xEkpw/4s8GZOfq+1oWz2LrSQ8M8Hjs2VN
 NTuE44OOsBDPOJ54iDAIOr5jyF+ZDeWEuPbvWbHGri80gII+2iF2788N2ToyAkyR
 R0t4VtJwXF+8D6IxTG41OIvAuq9Zc8AqM6O7VnOyFhZtKqezBTI=
 =BDoM
 -----END PGP SIGNATURE-----
Merge tag 'net-6.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski:
 "Rather tiny pull request, mostly so that we can get into our trees
  your fix to the x86 Makefile.
  Current release - regressions:
   - Revert "tcp: avoid atomic operations on sk->sk_rmem_alloc", error
     queue accounting was missed
  Current release - new code bugs:
   - 5 fixes for the netdevice instance locking work
  Previous releases - regressions:
   - usbnet: restore usb%d name exception for local mac addresses
  Previous releases - always broken:
   - rtnetlink: allocate vfinfo size for VF GUIDs when supported, avoid
     spurious GET_LINK failures
   - eth: mana: Switch to page pool for jumbo frames
   - phy: broadcom: Correct BCM5221 PHY model detection
  Misc:
   - selftests: drv-net: replace helpers for referring to other files"
* tag 'net-6.15-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (22 commits)
  Revert "tcp: avoid atomic operations on sk->sk_rmem_alloc"
  bnxt_en: bring back rtnl lock in bnxt_shutdown
  eth: gve: add missing netdev locks on reset and shutdown paths
  selftests: mptcp: ignore mptcp_diag binary
  selftests: mptcp: close fd_in before returning in main_loop
  selftests: mptcp: fix incorrect fd checks in main_loop
  mptcp: fix NULL pointer in can_accept_new_subflow
  octeontx2-af: Free NIX_AF_INT_VEC_GEN irq
  octeontx2-af: Fix mbox INTR handler when num VFs > 64
  net: fix use-after-free in the netdev_nl_sock_priv_destroy()
  selftests: net: use Path helpers in ping
  selftests: net: use the dummy bpf from net/lib
  selftests: drv-net: replace the rpath helper with Path objects
  net: lapbether: use netdev_lockdep_set_classes() helper
  net: phy: broadcom: Correct BCM5221 PHY model detection
  net: usb: usbnet: restore usb%d name exception for local mac addresses
  net/mlx5e: SHAMPO, Make reserved size independent of page size
  net: mana: Switch to page pool for jumbo frames
  MAINTAINERS: Add dedicated entries for phy_link_topology
  net: move replay logic to tc_modify_qdisc
  ...
			
			
This commit is contained in:
		
						commit
						acc4d5ff0b
					
				
					 33 changed files with 141 additions and 205 deletions
				
			
		|  | @ -16806,6 +16806,13 @@ F:	net/ethtool/mm.c | |||
| F:	tools/testing/selftests/drivers/net/hw/ethtool_mm.sh | ||||
| K:	ethtool_mm | ||||
| 
 | ||||
| NETWORKING [ETHTOOL PHY TOPOLOGY] | ||||
| M:	Maxime Chevallier <maxime.chevallier@bootlin.com> | ||||
| F:	Documentation/networking/phy-link-topology.rst | ||||
| F:	drivers/net/phy/phy_link_topology.c | ||||
| F:	include/linux/phy_link_topology.h | ||||
| F:	net/ethtool/phy.c | ||||
| 
 | ||||
| NETWORKING [GENERAL] | ||||
| M:	"David S. Miller" <davem@davemloft.net> | ||||
| M:	Eric Dumazet <edumazet@google.com> | ||||
|  |  | |||
|  | @ -16698,6 +16698,7 @@ static void bnxt_shutdown(struct pci_dev *pdev) | |||
| 	if (!dev) | ||||
| 		return; | ||||
| 
 | ||||
| 	rtnl_lock(); | ||||
| 	netdev_lock(dev); | ||||
| 	bp = netdev_priv(dev); | ||||
| 	if (!bp) | ||||
|  | @ -16717,6 +16718,7 @@ static void bnxt_shutdown(struct pci_dev *pdev) | |||
| 
 | ||||
| shutdown_exit: | ||||
| 	netdev_unlock(dev); | ||||
| 	rtnl_unlock(); | ||||
| } | ||||
| 
 | ||||
| #ifdef CONFIG_PM_SLEEP | ||||
|  |  | |||
|  | @ -2077,7 +2077,9 @@ static void gve_handle_reset(struct gve_priv *priv) | |||
| 
 | ||||
| 	if (gve_get_do_reset(priv)) { | ||||
| 		rtnl_lock(); | ||||
| 		netdev_lock(priv->dev); | ||||
| 		gve_reset(priv, false); | ||||
| 		netdev_unlock(priv->dev); | ||||
| 		rtnl_unlock(); | ||||
| 	} | ||||
| } | ||||
|  | @ -2714,6 +2716,7 @@ static void gve_shutdown(struct pci_dev *pdev) | |||
| 	bool was_up = netif_running(priv->dev); | ||||
| 
 | ||||
| 	rtnl_lock(); | ||||
| 	netdev_lock(netdev); | ||||
| 	if (was_up && gve_close(priv->dev)) { | ||||
| 		/* If the dev was up, attempt to close, if close fails, reset */ | ||||
| 		gve_reset_and_teardown(priv, was_up); | ||||
|  | @ -2721,6 +2724,7 @@ static void gve_shutdown(struct pci_dev *pdev) | |||
| 		/* If the dev wasn't up or close worked, finish tearing down */ | ||||
| 		gve_teardown_priv_resources(priv); | ||||
| 	} | ||||
| 	netdev_unlock(netdev); | ||||
| 	rtnl_unlock(); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -2634,7 +2634,7 @@ static irqreturn_t rvu_mbox_intr_handler(int irq, void *rvu_irq) | |||
| 		rvupf_write64(rvu, RVU_PF_VFPF_MBOX_INTX(1), intr); | ||||
| 
 | ||||
| 		rvu_queue_work(&rvu->afvf_wq_info, 64, vfs, intr); | ||||
| 		vfs -= 64; | ||||
| 		vfs = 64; | ||||
| 	} | ||||
| 
 | ||||
| 	intr = rvupf_read64(rvu, RVU_PF_VFPF_MBOX_INTX(0)); | ||||
|  |  | |||
|  | @ -207,7 +207,7 @@ static void rvu_nix_unregister_interrupts(struct rvu *rvu) | |||
| 		rvu->irq_allocated[offs + NIX_AF_INT_VEC_RVU] = false; | ||||
| 	} | ||||
| 
 | ||||
| 	for (i = NIX_AF_INT_VEC_AF_ERR; i < NIX_AF_INT_VEC_CNT; i++) | ||||
| 	for (i = NIX_AF_INT_VEC_GEN; i < NIX_AF_INT_VEC_CNT; i++) | ||||
| 		if (rvu->irq_allocated[offs + i]) { | ||||
| 			free_irq(pci_irq_vector(rvu->pdev, offs + i), rvu_dl); | ||||
| 			rvu->irq_allocated[offs + i] = false; | ||||
|  |  | |||
|  | @ -430,7 +430,7 @@ u8 mlx5e_shampo_get_log_pkt_per_rsrv(struct mlx5_core_dev *mdev, | |||
| 				     struct mlx5e_params *params) | ||||
| { | ||||
| 	u32 resrv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * | ||||
| 			 PAGE_SIZE; | ||||
| 			 MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE; | ||||
| 
 | ||||
| 	return order_base_2(DIV_ROUND_UP(resrv_size, params->sw_mtu)); | ||||
| } | ||||
|  | @ -834,7 +834,8 @@ static u32 mlx5e_shampo_get_log_cq_size(struct mlx5_core_dev *mdev, | |||
| 					struct mlx5e_params *params, | ||||
| 					struct mlx5e_xsk_param *xsk) | ||||
| { | ||||
| 	int rsrv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * PAGE_SIZE; | ||||
| 	int rsrv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * | ||||
| 		MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE; | ||||
| 	u16 num_strides = BIT(mlx5e_mpwqe_get_log_num_strides(mdev, params, xsk)); | ||||
| 	int pkt_per_rsrv = BIT(mlx5e_shampo_get_log_pkt_per_rsrv(mdev, params)); | ||||
| 	u8 log_stride_sz = mlx5e_mpwqe_get_log_stride_size(mdev, params, xsk); | ||||
|  | @ -1043,7 +1044,8 @@ u32 mlx5e_shampo_hd_per_wqe(struct mlx5_core_dev *mdev, | |||
| 			    struct mlx5e_params *params, | ||||
| 			    struct mlx5e_rq_param *rq_param) | ||||
| { | ||||
| 	int resv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * PAGE_SIZE; | ||||
| 	int resv_size = BIT(mlx5e_shampo_get_log_rsrv_size(mdev, params)) * | ||||
| 		MLX5E_SHAMPO_WQ_BASE_RESRV_SIZE; | ||||
| 	u16 num_strides = BIT(mlx5e_mpwqe_get_log_num_strides(mdev, params, NULL)); | ||||
| 	int pkt_per_resv = BIT(mlx5e_shampo_get_log_pkt_per_rsrv(mdev, params)); | ||||
| 	u8 log_stride_sz = mlx5e_mpwqe_get_log_stride_size(mdev, params, NULL); | ||||
|  |  | |||
|  | @ -661,30 +661,16 @@ int mana_pre_alloc_rxbufs(struct mana_port_context *mpc, int new_mtu, int num_qu | |||
| 	mpc->rxbpre_total = 0; | ||||
| 
 | ||||
| 	for (i = 0; i < num_rxb; i++) { | ||||
| 		if (mpc->rxbpre_alloc_size > PAGE_SIZE) { | ||||
| 			va = netdev_alloc_frag(mpc->rxbpre_alloc_size); | ||||
| 			if (!va) | ||||
| 				goto error; | ||||
| 		page = dev_alloc_pages(get_order(mpc->rxbpre_alloc_size)); | ||||
| 		if (!page) | ||||
| 			goto error; | ||||
| 
 | ||||
| 			page = virt_to_head_page(va); | ||||
| 			/* Check if the frag falls back to single page */ | ||||
| 			if (compound_order(page) < | ||||
| 			    get_order(mpc->rxbpre_alloc_size)) { | ||||
| 				put_page(page); | ||||
| 				goto error; | ||||
| 			} | ||||
| 		} else { | ||||
| 			page = dev_alloc_page(); | ||||
| 			if (!page) | ||||
| 				goto error; | ||||
| 
 | ||||
| 			va = page_to_virt(page); | ||||
| 		} | ||||
| 		va = page_to_virt(page); | ||||
| 
 | ||||
| 		da = dma_map_single(dev, va + mpc->rxbpre_headroom, | ||||
| 				    mpc->rxbpre_datasize, DMA_FROM_DEVICE); | ||||
| 		if (dma_mapping_error(dev, da)) { | ||||
| 			put_page(virt_to_head_page(va)); | ||||
| 			put_page(page); | ||||
| 			goto error; | ||||
| 		} | ||||
| 
 | ||||
|  | @ -1676,7 +1662,7 @@ static void mana_rx_skb(void *buf_va, bool from_pool, | |||
| } | ||||
| 
 | ||||
| static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev, | ||||
| 			     dma_addr_t *da, bool *from_pool, bool is_napi) | ||||
| 			     dma_addr_t *da, bool *from_pool) | ||||
| { | ||||
| 	struct page *page; | ||||
| 	void *va; | ||||
|  | @ -1687,21 +1673,6 @@ static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev, | |||
| 	if (rxq->xdp_save_va) { | ||||
| 		va = rxq->xdp_save_va; | ||||
| 		rxq->xdp_save_va = NULL; | ||||
| 	} else if (rxq->alloc_size > PAGE_SIZE) { | ||||
| 		if (is_napi) | ||||
| 			va = napi_alloc_frag(rxq->alloc_size); | ||||
| 		else | ||||
| 			va = netdev_alloc_frag(rxq->alloc_size); | ||||
| 
 | ||||
| 		if (!va) | ||||
| 			return NULL; | ||||
| 
 | ||||
| 		page = virt_to_head_page(va); | ||||
| 		/* Check if the frag falls back to single page */ | ||||
| 		if (compound_order(page) < get_order(rxq->alloc_size)) { | ||||
| 			put_page(page); | ||||
| 			return NULL; | ||||
| 		} | ||||
| 	} else { | ||||
| 		page = page_pool_dev_alloc_pages(rxq->page_pool); | ||||
| 		if (!page) | ||||
|  | @ -1734,7 +1705,7 @@ static void mana_refill_rx_oob(struct device *dev, struct mana_rxq *rxq, | |||
| 	dma_addr_t da; | ||||
| 	void *va; | ||||
| 
 | ||||
| 	va = mana_get_rxfrag(rxq, dev, &da, &from_pool, true); | ||||
| 	va = mana_get_rxfrag(rxq, dev, &da, &from_pool); | ||||
| 	if (!va) | ||||
| 		return; | ||||
| 
 | ||||
|  | @ -2176,7 +2147,7 @@ static int mana_fill_rx_oob(struct mana_recv_buf_oob *rx_oob, u32 mem_key, | |||
| 	if (mpc->rxbufs_pre) | ||||
| 		va = mana_get_rxbuf_pre(rxq, &da); | ||||
| 	else | ||||
| 		va = mana_get_rxfrag(rxq, dev, &da, &from_pool, false); | ||||
| 		va = mana_get_rxfrag(rxq, dev, &da, &from_pool); | ||||
| 
 | ||||
| 	if (!va) | ||||
| 		return -ENOMEM; | ||||
|  | @ -2262,6 +2233,7 @@ static int mana_create_page_pool(struct mana_rxq *rxq, struct gdma_context *gc) | |||
| 	pprm.nid = gc->numa_node; | ||||
| 	pprm.napi = &rxq->rx_cq.napi; | ||||
| 	pprm.netdev = rxq->ndev; | ||||
| 	pprm.order = get_order(rxq->alloc_size); | ||||
| 
 | ||||
| 	rxq->page_pool = page_pool_create(&pprm); | ||||
| 
 | ||||
|  |  | |||
|  | @ -859,7 +859,7 @@ static int brcm_fet_config_init(struct phy_device *phydev) | |||
| 		return reg; | ||||
| 
 | ||||
| 	/* Unmask events we are interested in and mask interrupts globally. */ | ||||
| 	if (phydev->phy_id == PHY_ID_BCM5221) | ||||
| 	if (phydev->drv->phy_id == PHY_ID_BCM5221) | ||||
| 		reg = MII_BRCM_FET_IR_ENABLE | | ||||
| 		      MII_BRCM_FET_IR_MASK; | ||||
| 	else | ||||
|  | @ -888,7 +888,7 @@ static int brcm_fet_config_init(struct phy_device *phydev) | |||
| 		return err; | ||||
| 	} | ||||
| 
 | ||||
| 	if (phydev->phy_id != PHY_ID_BCM5221) { | ||||
| 	if (phydev->drv->phy_id != PHY_ID_BCM5221) { | ||||
| 		/* Set the LED mode */ | ||||
| 		reg = __phy_read(phydev, MII_BRCM_FET_SHDW_AUXMODE4); | ||||
| 		if (reg < 0) { | ||||
|  | @ -1009,7 +1009,7 @@ static int brcm_fet_suspend(struct phy_device *phydev) | |||
| 		return err; | ||||
| 	} | ||||
| 
 | ||||
| 	if (phydev->phy_id == PHY_ID_BCM5221) | ||||
| 	if (phydev->drv->phy_id == PHY_ID_BCM5221) | ||||
| 		/* Force Low Power Mode with clock enabled */ | ||||
| 		reg = BCM5221_SHDW_AM4_EN_CLK_LPM | BCM5221_SHDW_AM4_FORCE_LPM; | ||||
| 	else | ||||
|  |  | |||
|  | @ -630,6 +630,16 @@ static const struct driver_info	zte_rndis_info = { | |||
| 	.tx_fixup =	rndis_tx_fixup, | ||||
| }; | ||||
| 
 | ||||
| static const struct driver_info	wwan_rndis_info = { | ||||
| 	.description =	"Mobile Broadband RNDIS device", | ||||
| 	.flags =	FLAG_WWAN | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT, | ||||
| 	.bind =		rndis_bind, | ||||
| 	.unbind =	rndis_unbind, | ||||
| 	.status =	rndis_status, | ||||
| 	.rx_fixup =	rndis_rx_fixup, | ||||
| 	.tx_fixup =	rndis_tx_fixup, | ||||
| }; | ||||
| 
 | ||||
| /*-------------------------------------------------------------------------*/ | ||||
| 
 | ||||
| static const struct usb_device_id	products [] = { | ||||
|  | @ -666,9 +676,11 @@ static const struct usb_device_id	products [] = { | |||
| 	USB_INTERFACE_INFO(USB_CLASS_WIRELESS_CONTROLLER, 1, 3), | ||||
| 	.driver_info = (unsigned long) &rndis_info, | ||||
| }, { | ||||
| 	/* Novatel Verizon USB730L */ | ||||
| 	/* Mobile Broadband Modem, seen in Novatel Verizon USB730L and
 | ||||
| 	 * Telit FN990A (RNDIS) | ||||
| 	 */ | ||||
| 	USB_INTERFACE_INFO(USB_CLASS_MISC, 4, 1), | ||||
| 	.driver_info = (unsigned long) &rndis_info, | ||||
| 	.driver_info = (unsigned long)&wwan_rndis_info, | ||||
| }, | ||||
| 	{ },		// END
 | ||||
| }; | ||||
|  |  | |||
|  | @ -178,6 +178,17 @@ int usbnet_get_ethernet_addr(struct usbnet *dev, int iMACAddress) | |||
| } | ||||
| EXPORT_SYMBOL_GPL(usbnet_get_ethernet_addr); | ||||
| 
 | ||||
| static bool usbnet_needs_usb_name_format(struct usbnet *dev, struct net_device *net) | ||||
| { | ||||
| 	/* Point to point devices which don't have a real MAC address
 | ||||
| 	 * (or report a fake local one) have historically used the usb%d | ||||
| 	 * naming. Preserve this.. | ||||
| 	 */ | ||||
| 	return (dev->driver_info->flags & FLAG_POINTTOPOINT) != 0 && | ||||
| 		(is_zero_ether_addr(net->dev_addr) || | ||||
| 		 is_local_ether_addr(net->dev_addr)); | ||||
| } | ||||
| 
 | ||||
| static void intr_complete (struct urb *urb) | ||||
| { | ||||
| 	struct usbnet	*dev = urb->context; | ||||
|  | @ -1762,13 +1773,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
| 		if (status < 0) | ||||
| 			goto out1; | ||||
| 
 | ||||
| 		// heuristic:  "usb%d" for links we know are two-host,
 | ||||
| 		// else "eth%d" when there's reasonable doubt.  userspace
 | ||||
| 		// can rename the link if it knows better.
 | ||||
| 		/* heuristic: rename to "eth%d" if we are not sure this link
 | ||||
| 		 * is two-host (these links keep "usb%d") | ||||
| 		 */ | ||||
| 		if ((dev->driver_info->flags & FLAG_ETHER) != 0 && | ||||
| 		    ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 || | ||||
| 		     /* somebody touched it*/ | ||||
| 		     !is_zero_ether_addr(net->dev_addr))) | ||||
| 		    !usbnet_needs_usb_name_format(dev, net)) | ||||
| 			strscpy(net->name, "eth%d", sizeof(net->name)); | ||||
| 		/* WLAN devices should always be named "wlan%d" */ | ||||
| 		if ((dev->driver_info->flags & FLAG_WLAN) != 0) | ||||
|  |  | |||
|  | @ -39,6 +39,7 @@ | |||
| #include <linux/lapb.h> | ||||
| #include <linux/init.h> | ||||
| 
 | ||||
| #include <net/netdev_lock.h> | ||||
| #include <net/x25device.h> | ||||
| 
 | ||||
| static const u8 bcast_addr[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | ||||
|  | @ -366,6 +367,7 @@ static const struct net_device_ops lapbeth_netdev_ops = { | |||
| 
 | ||||
| static void lapbeth_setup(struct net_device *dev) | ||||
| { | ||||
| 	netdev_lockdep_set_classes(dev); | ||||
| 	dev->netdev_ops	     = &lapbeth_netdev_ops; | ||||
| 	dev->needs_free_netdev = true; | ||||
| 	dev->type            = ARPHRD_X25; | ||||
|  |  | |||
|  | @ -779,7 +779,6 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | |||
| 
 | ||||
| /* tcp.c */ | ||||
| void tcp_get_info(struct sock *, struct tcp_info *); | ||||
| void tcp_sock_rfree(struct sk_buff *skb); | ||||
| 
 | ||||
| /* Read 'sendfile()'-style from a TCP socket */ | ||||
| int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | ||||
|  | @ -2899,18 +2898,4 @@ enum skb_drop_reason tcp_inbound_hash(struct sock *sk, | |||
| 		const void *saddr, const void *daddr, | ||||
| 		int family, int dif, int sdif); | ||||
| 
 | ||||
| /* version of skb_set_owner_r() avoiding one atomic_add() */ | ||||
| static inline void tcp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | ||||
| { | ||||
| 	skb_orphan(skb); | ||||
| 	skb->sk = sk; | ||||
| 	skb->destructor = tcp_sock_rfree; | ||||
| 
 | ||||
| 	sock_owned_by_me(sk); | ||||
| 	atomic_set(&sk->sk_rmem_alloc, | ||||
| 		   atomic_read(&sk->sk_rmem_alloc) + skb->truesize); | ||||
| 
 | ||||
| 	sk_forward_alloc_add(sk, -skb->truesize); | ||||
| } | ||||
| 
 | ||||
| #endif	/* _TCP_H */ | ||||
|  |  | |||
|  | @ -951,12 +951,14 @@ void netdev_nl_sock_priv_destroy(struct netdev_nl_sock *priv) | |||
| { | ||||
| 	struct net_devmem_dmabuf_binding *binding; | ||||
| 	struct net_devmem_dmabuf_binding *temp; | ||||
| 	struct net_device *dev; | ||||
| 
 | ||||
| 	mutex_lock(&priv->lock); | ||||
| 	list_for_each_entry_safe(binding, temp, &priv->bindings, list) { | ||||
| 		netdev_lock(binding->dev); | ||||
| 		dev = binding->dev; | ||||
| 		netdev_lock(dev); | ||||
| 		net_devmem_unbind_dmabuf(binding); | ||||
| 		netdev_unlock(binding->dev); | ||||
| 		netdev_unlock(dev); | ||||
| 	} | ||||
| 	mutex_unlock(&priv->lock); | ||||
| } | ||||
|  |  | |||
|  | @ -1177,6 +1177,9 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev, | |||
| 				 /* IFLA_VF_STATS_TX_DROPPED */ | ||||
| 				 nla_total_size_64bit(sizeof(__u64))); | ||||
| 		} | ||||
| 		if (dev->netdev_ops->ndo_get_vf_guid) | ||||
| 			size += num_vfs * 2 * | ||||
| 				nla_total_size(sizeof(struct ifla_vf_guid)); | ||||
| 		return size; | ||||
| 	} else | ||||
| 		return 0; | ||||
|  |  | |||
|  | @ -1525,25 +1525,11 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied) | |||
| 	__tcp_cleanup_rbuf(sk, copied); | ||||
| } | ||||
| 
 | ||||
| /* private version of sock_rfree() avoiding one atomic_sub() */ | ||||
| void tcp_sock_rfree(struct sk_buff *skb) | ||||
| { | ||||
| 	struct sock *sk = skb->sk; | ||||
| 	unsigned int len = skb->truesize; | ||||
| 
 | ||||
| 	sock_owned_by_me(sk); | ||||
| 	atomic_set(&sk->sk_rmem_alloc, | ||||
| 		   atomic_read(&sk->sk_rmem_alloc) - len); | ||||
| 
 | ||||
| 	sk_forward_alloc_add(sk, len); | ||||
| 	sk_mem_reclaim(sk); | ||||
| } | ||||
| 
 | ||||
| static void tcp_eat_recv_skb(struct sock *sk, struct sk_buff *skb) | ||||
| { | ||||
| 	__skb_unlink(skb, &sk->sk_receive_queue); | ||||
| 	if (likely(skb->destructor == tcp_sock_rfree)) { | ||||
| 		tcp_sock_rfree(skb); | ||||
| 	if (likely(skb->destructor == sock_rfree)) { | ||||
| 		sock_rfree(skb); | ||||
| 		skb->destructor = NULL; | ||||
| 		skb->sk = NULL; | ||||
| 		return skb_attempt_defer_free(skb); | ||||
|  |  | |||
|  | @ -189,7 +189,7 @@ void tcp_fastopen_add_skb(struct sock *sk, struct sk_buff *skb) | |||
| 	tcp_segs_in(tp, skb); | ||||
| 	__skb_pull(skb, tcp_hdrlen(skb)); | ||||
| 	sk_forced_mem_schedule(sk, skb->truesize); | ||||
| 	tcp_skb_set_owner_r(skb, sk); | ||||
| 	skb_set_owner_r(skb, sk); | ||||
| 
 | ||||
| 	TCP_SKB_CB(skb)->seq++; | ||||
| 	TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_SYN; | ||||
|  |  | |||
|  | @ -5171,7 +5171,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) | |||
| 		if (tcp_is_sack(tp)) | ||||
| 			tcp_grow_window(sk, skb, false); | ||||
| 		skb_condense(skb); | ||||
| 		tcp_skb_set_owner_r(skb, sk); | ||||
| 		skb_set_owner_r(skb, sk); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | @ -5187,7 +5187,7 @@ static int __must_check tcp_queue_rcv(struct sock *sk, struct sk_buff *skb, | |||
| 	tcp_rcv_nxt_update(tcp_sk(sk), TCP_SKB_CB(skb)->end_seq); | ||||
| 	if (!eaten) { | ||||
| 		tcp_add_receive_queue(sk, skb); | ||||
| 		tcp_skb_set_owner_r(skb, sk); | ||||
| 		skb_set_owner_r(skb, sk); | ||||
| 	} | ||||
| 	return eaten; | ||||
| } | ||||
|  | @ -5504,7 +5504,7 @@ tcp_collapse(struct sock *sk, struct sk_buff_head *list, struct rb_root *root, | |||
| 			__skb_queue_before(list, skb, nskb); | ||||
| 		else | ||||
| 			__skb_queue_tail(&tmp, nskb); /* defer rbtree insertion */ | ||||
| 		tcp_skb_set_owner_r(nskb, sk); | ||||
| 		skb_set_owner_r(nskb, sk); | ||||
| 		mptcp_skb_ext_move(nskb, skb); | ||||
| 
 | ||||
| 		/* Copy data, releasing collapsed skbs. */ | ||||
|  |  | |||
|  | @ -754,8 +754,6 @@ static bool subflow_hmac_valid(const struct request_sock *req, | |||
| 
 | ||||
| 	subflow_req = mptcp_subflow_rsk(req); | ||||
| 	msk = subflow_req->msk; | ||||
| 	if (!msk) | ||||
| 		return false; | ||||
| 
 | ||||
| 	subflow_generate_hmac(READ_ONCE(msk->remote_key), | ||||
| 			      READ_ONCE(msk->local_key), | ||||
|  | @ -850,12 +848,8 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, | |||
| 
 | ||||
| 	} else if (subflow_req->mp_join) { | ||||
| 		mptcp_get_options(skb, &mp_opt); | ||||
| 		if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK) || | ||||
| 		    !subflow_hmac_valid(req, &mp_opt) || | ||||
| 		    !mptcp_can_accept_new_subflow(subflow_req->msk)) { | ||||
| 			SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC); | ||||
| 		if (!(mp_opt.suboptions & OPTION_MPTCP_MPJ_ACK)) | ||||
| 			fallback = true; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| create_child: | ||||
|  | @ -905,6 +899,13 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, | |||
| 				goto dispose_child; | ||||
| 			} | ||||
| 
 | ||||
| 			if (!subflow_hmac_valid(req, &mp_opt) || | ||||
| 			    !mptcp_can_accept_new_subflow(subflow_req->msk)) { | ||||
| 				SUBFLOW_REQ_INC_STATS(req, MPTCP_MIB_JOINACKMAC); | ||||
| 				subflow_add_reset_reason(skb, MPTCP_RST_EPROHIBIT); | ||||
| 				goto dispose_child; | ||||
| 			} | ||||
| 
 | ||||
| 			/* move the msk reference ownership to the subflow */ | ||||
| 			subflow_req->msk = NULL; | ||||
| 			ctx->conn = (struct sock *)owner; | ||||
|  |  | |||
|  | @ -1267,38 +1267,8 @@ static struct Qdisc *qdisc_create(struct net_device *dev, | |||
| 	struct qdisc_size_table *stab; | ||||
| 
 | ||||
| 	ops = qdisc_lookup_ops(kind); | ||||
| #ifdef CONFIG_MODULES | ||||
| 	if (ops == NULL && kind != NULL) { | ||||
| 		char name[IFNAMSIZ]; | ||||
| 		if (nla_strscpy(name, kind, IFNAMSIZ) >= 0) { | ||||
| 			/* We dropped the RTNL semaphore in order to
 | ||||
| 			 * perform the module load.  So, even if we | ||||
| 			 * succeeded in loading the module we have to | ||||
| 			 * tell the caller to replay the request.  We | ||||
| 			 * indicate this using -EAGAIN. | ||||
| 			 * We replay the request because the device may | ||||
| 			 * go away in the mean time. | ||||
| 			 */ | ||||
| 			netdev_unlock_ops(dev); | ||||
| 			rtnl_unlock(); | ||||
| 			request_module(NET_SCH_ALIAS_PREFIX "%s", name); | ||||
| 			rtnl_lock(); | ||||
| 			netdev_lock_ops(dev); | ||||
| 			ops = qdisc_lookup_ops(kind); | ||||
| 			if (ops != NULL) { | ||||
| 				/* We will try again qdisc_lookup_ops,
 | ||||
| 				 * so don't keep a reference. | ||||
| 				 */ | ||||
| 				module_put(ops->owner); | ||||
| 				err = -EAGAIN; | ||||
| 				goto err_out; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| #endif | ||||
| 
 | ||||
| 	err = -ENOENT; | ||||
| 	if (!ops) { | ||||
| 		err = -ENOENT; | ||||
| 		NL_SET_ERR_MSG(extack, "Specified qdisc kind is unknown"); | ||||
| 		goto err_out; | ||||
| 	} | ||||
|  | @ -1623,8 +1593,7 @@ static int __tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 			     struct netlink_ext_ack *extack, | ||||
| 			     struct net_device *dev, | ||||
| 			     struct nlattr *tca[TCA_MAX + 1], | ||||
| 			     struct tcmsg *tcm, | ||||
| 			     bool *replay) | ||||
| 			     struct tcmsg *tcm) | ||||
| { | ||||
| 	struct Qdisc *q = NULL; | ||||
| 	struct Qdisc *p = NULL; | ||||
|  | @ -1789,13 +1758,8 @@ static int __tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 				 tcm->tcm_parent, tcm->tcm_handle, | ||||
| 				 tca, &err, extack); | ||||
| 	} | ||||
| 	if (q == NULL) { | ||||
| 		if (err == -EAGAIN) { | ||||
| 			*replay = true; | ||||
| 			return 0; | ||||
| 		} | ||||
| 	if (!q) | ||||
| 		return err; | ||||
| 	} | ||||
| 
 | ||||
| graft: | ||||
| 	err = qdisc_graft(dev, p, skb, n, clid, q, NULL, extack); | ||||
|  | @ -1808,6 +1772,27 @@ static int __tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
| static void request_qdisc_module(struct nlattr *kind) | ||||
| { | ||||
| 	struct Qdisc_ops *ops; | ||||
| 	char name[IFNAMSIZ]; | ||||
| 
 | ||||
| 	if (!kind) | ||||
| 		return; | ||||
| 
 | ||||
| 	ops = qdisc_lookup_ops(kind); | ||||
| 	if (ops) { | ||||
| 		module_put(ops->owner); | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	if (nla_strscpy(name, kind, IFNAMSIZ) >= 0) { | ||||
| 		rtnl_unlock(); | ||||
| 		request_module(NET_SCH_ALIAS_PREFIX "%s", name); | ||||
| 		rtnl_lock(); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| /*
 | ||||
|  * Create/change qdisc. | ||||
|  */ | ||||
|  | @ -1818,27 +1803,23 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, | |||
| 	struct nlattr *tca[TCA_MAX + 1]; | ||||
| 	struct net_device *dev; | ||||
| 	struct tcmsg *tcm; | ||||
| 	bool replay; | ||||
| 	int err; | ||||
| 
 | ||||
| replay: | ||||
| 	/* Reinit, just in case something touches this. */ | ||||
| 	err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX, | ||||
| 				     rtm_tca_policy, extack); | ||||
| 	if (err < 0) | ||||
| 		return err; | ||||
| 
 | ||||
| 	request_qdisc_module(tca[TCA_KIND]); | ||||
| 
 | ||||
| 	tcm = nlmsg_data(n); | ||||
| 	dev = __dev_get_by_index(net, tcm->tcm_ifindex); | ||||
| 	if (!dev) | ||||
| 		return -ENODEV; | ||||
| 
 | ||||
| 	replay = false; | ||||
| 	netdev_lock_ops(dev); | ||||
| 	err = __tc_modify_qdisc(skb, n, extack, dev, tca, tcm, &replay); | ||||
| 	err = __tc_modify_qdisc(skb, n, extack, dev, tca, tcm); | ||||
| 	netdev_unlock_ops(dev); | ||||
| 	if (replay) | ||||
| 		goto replay; | ||||
| 
 | ||||
| 	return err; | ||||
| } | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ def _get_hds_mode(cfg, netnl) -> str: | |||
| 
 | ||||
| 
 | ||||
| def _xdp_onoff(cfg): | ||||
|     prog = cfg.rpath("../../net/lib/xdp_dummy.bpf.o") | ||||
|     prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" | ||||
|     ip("link set dev %s xdp obj %s sec xdp" % | ||||
|        (cfg.ifname, prog)) | ||||
|     ip("link set dev %s xdp off" % cfg.ifname) | ||||
|  |  | |||
|  | @ -88,7 +88,7 @@ def main() -> None: | |||
|     with NetDrvEpEnv(__file__, nsim_test=False) as cfg: | ||||
|         check_nic_features(cfg) | ||||
| 
 | ||||
|         cfg.bin_local = cfg.rpath("../../../net/lib/csum") | ||||
|         cfg.bin_local = cfg.net_lib_dir / "csum" | ||||
|         cfg.bin_remote = cfg.remote.deploy(cfg.bin_local) | ||||
| 
 | ||||
|         cases = [] | ||||
|  |  | |||
|  | @ -69,7 +69,7 @@ def check_reconfig_queues(cfg) -> None: | |||
| def check_reconfig_xdp(cfg) -> None: | ||||
|     def reconfig(cfg) -> None: | ||||
|         ip(f"link set dev %s xdp obj %s sec xdp" % | ||||
|             (cfg.ifname, cfg.rpath("xdp_dummy.bpf.o"))) | ||||
|            (cfg.ifname, cfg.net_lib_dir / "xdp_dummy.bpf.o")) | ||||
|         ip(f"link set dev %s xdp off" % cfg.ifname) | ||||
| 
 | ||||
|     _check_reconfig(cfg, reconfig) | ||||
|  |  | |||
|  | @ -1,13 +0,0 @@ | |||
| // SPDX-License-Identifier: GPL-2.0
 | ||||
| 
 | ||||
| #define KBUILD_MODNAME "xdp_dummy" | ||||
| #include <linux/bpf.h> | ||||
| #include <bpf/bpf_helpers.h> | ||||
| 
 | ||||
| SEC("xdp") | ||||
| int xdp_dummy_prog(struct xdp_md *ctx) | ||||
| { | ||||
| 	return XDP_PASS; | ||||
| } | ||||
| 
 | ||||
| char _license[] SEC("license") = "GPL"; | ||||
|  | @ -13,23 +13,18 @@ from .remote import Remote | |||
| class NetDrvEnvBase: | ||||
|     """ | ||||
|     Base class for a NIC / host envirnoments | ||||
| 
 | ||||
|     Attributes: | ||||
|       test_dir: Path to the source directory of the test | ||||
|       net_lib_dir: Path to the net/lib directory | ||||
|     """ | ||||
|     def __init__(self, src_path): | ||||
|         self.src_path = src_path | ||||
|         self.src_path = Path(src_path) | ||||
|         self.test_dir = self.src_path.parent.resolve() | ||||
|         self.net_lib_dir = (Path(__file__).parent / "../../../../net/lib").resolve() | ||||
| 
 | ||||
|         self.env = self._load_env_file() | ||||
| 
 | ||||
|     def rpath(self, path): | ||||
|         """ | ||||
|         Get an absolute path to a file based on a path relative to the directory | ||||
|         containing the test which constructed env. | ||||
| 
 | ||||
|         For example, if the test.py is in the same directory as | ||||
|         a binary (built from helper.c), the test can use env.rpath("helper") | ||||
|         to get the absolute path to the binary | ||||
|         """ | ||||
|         src_dir = Path(self.src_path).parent.resolve() | ||||
|         return (src_dir / path).as_posix() | ||||
| 
 | ||||
|     def _load_env_file(self): | ||||
|         env = os.environ.copy() | ||||
| 
 | ||||
|  |  | |||
|  | @ -56,8 +56,7 @@ def _set_offload_checksum(cfg, netnl, on) -> None: | |||
|         return | ||||
| 
 | ||||
| def _set_xdp_generic_sb_on(cfg) -> None: | ||||
|     test_dir = os.path.dirname(os.path.realpath(__file__)) | ||||
|     prog = test_dir + "/../../net/lib/xdp_dummy.bpf.o" | ||||
|     prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" | ||||
|     cmd(f"ip link set dev {remote_ifname} mtu 1500", shell=True, host=cfg.remote) | ||||
|     cmd(f"ip link set dev {cfg.ifname} mtu 1500 xdpgeneric obj {prog} sec xdp", shell=True) | ||||
|     defer(cmd, f"ip link set dev {cfg.ifname} xdpgeneric off") | ||||
|  | @ -66,8 +65,7 @@ def _set_xdp_generic_sb_on(cfg) -> None: | |||
|         time.sleep(10) | ||||
| 
 | ||||
| def _set_xdp_generic_mb_on(cfg) -> None: | ||||
|     test_dir = os.path.dirname(os.path.realpath(__file__)) | ||||
|     prog = test_dir + "/../../net/lib/xdp_dummy.bpf.o" | ||||
|     prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" | ||||
|     cmd(f"ip link set dev {remote_ifname} mtu 9000", shell=True, host=cfg.remote) | ||||
|     defer(ip, f"link set dev {remote_ifname} mtu 1500", host=cfg.remote) | ||||
|     ip("link set dev %s mtu 9000 xdpgeneric obj %s sec xdp.frags" % (cfg.ifname, prog)) | ||||
|  | @ -77,8 +75,7 @@ def _set_xdp_generic_mb_on(cfg) -> None: | |||
|         time.sleep(10) | ||||
| 
 | ||||
| def _set_xdp_native_sb_on(cfg) -> None: | ||||
|     test_dir = os.path.dirname(os.path.realpath(__file__)) | ||||
|     prog = test_dir + "/../../net/lib/xdp_dummy.bpf.o" | ||||
|     prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" | ||||
|     cmd(f"ip link set dev {remote_ifname} mtu 1500", shell=True, host=cfg.remote) | ||||
|     cmd(f"ip -j link set dev {cfg.ifname} mtu 1500 xdp obj {prog} sec xdp", shell=True) | ||||
|     defer(ip, f"link set dev {cfg.ifname} mtu 1500 xdp off") | ||||
|  | @ -95,8 +92,7 @@ def _set_xdp_native_sb_on(cfg) -> None: | |||
|         time.sleep(10) | ||||
| 
 | ||||
| def _set_xdp_native_mb_on(cfg) -> None: | ||||
|     test_dir = os.path.dirname(os.path.realpath(__file__)) | ||||
|     prog = test_dir + "/../../net/lib/xdp_dummy.bpf.o" | ||||
|     prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" | ||||
|     cmd(f"ip link set dev {remote_ifname} mtu 9000", shell=True, host=cfg.remote) | ||||
|     defer(ip, f"link set dev {remote_ifname} mtu 1500", host=cfg.remote) | ||||
|     try: | ||||
|  | @ -109,8 +105,7 @@ def _set_xdp_native_mb_on(cfg) -> None: | |||
|         time.sleep(10) | ||||
| 
 | ||||
| def _set_xdp_offload_on(cfg) -> None: | ||||
|     test_dir = os.path.dirname(os.path.realpath(__file__)) | ||||
|     prog = test_dir + "/../../net/lib/xdp_dummy.bpf.o" | ||||
|     prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" | ||||
|     cmd(f"ip link set dev {cfg.ifname} mtu 1500", shell=True) | ||||
|     try: | ||||
|         cmd(f"ip link set dev {cfg.ifname} xdpoffload obj {prog} sec xdp", shell=True) | ||||
|  |  | |||
|  | @ -26,13 +26,13 @@ def nl_get_queues(cfg, nl, qtype='rx'): | |||
| 
 | ||||
| def check_xsk(cfg, nl, xdp_queue_id=0) -> None: | ||||
|     # Probe for support | ||||
|     xdp = cmd(cfg.rpath("xdp_helper") + ' - -', fail=False) | ||||
|     xdp = cmd(f'{cfg.test_dir / "xdp_helper"} - -', fail=False) | ||||
|     if xdp.ret == 255: | ||||
|         raise KsftSkipEx('AF_XDP unsupported') | ||||
|     elif xdp.ret > 0: | ||||
|         raise KsftFailEx('unable to create AF_XDP socket') | ||||
| 
 | ||||
|     with bkg(f'{cfg.rpath("xdp_helper")} {cfg.ifindex} {xdp_queue_id}', | ||||
|     with bkg(f'{cfg.test_dir / "xdp_helper"} {cfg.ifindex} {xdp_queue_id}', | ||||
|              ksft_wait=3): | ||||
| 
 | ||||
|         rx = tx = False | ||||
|  |  | |||
							
								
								
									
										1
									
								
								tools/testing/selftests/net/mptcp/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								tools/testing/selftests/net/mptcp/.gitignore
									
									
									
									
										vendored
									
									
								
							|  | @ -1,5 +1,6 @@ | |||
| # SPDX-License-Identifier: GPL-2.0-only | ||||
| mptcp_connect | ||||
| mptcp_diag | ||||
| mptcp_inq | ||||
| mptcp_sockopt | ||||
| pm_nl_ctl | ||||
|  |  | |||
|  | @ -1270,7 +1270,7 @@ int main_loop(void) | |||
| 
 | ||||
| 	if (cfg_input && cfg_sockopt_types.mptfo) { | ||||
| 		fd_in = open(cfg_input, O_RDONLY); | ||||
| 		if (fd < 0) | ||||
| 		if (fd_in < 0) | ||||
| 			xerror("can't open %s:%d", cfg_input, errno); | ||||
| 	} | ||||
| 
 | ||||
|  | @ -1293,13 +1293,13 @@ int main_loop(void) | |||
| 
 | ||||
| 	if (cfg_input && !cfg_sockopt_types.mptfo) { | ||||
| 		fd_in = open(cfg_input, O_RDONLY); | ||||
| 		if (fd < 0) | ||||
| 		if (fd_in < 0) | ||||
| 			xerror("can't open %s:%d", cfg_input, errno); | ||||
| 	} | ||||
| 
 | ||||
| 	ret = copyfd_io(fd_in, fd, 1, 0, &winfo); | ||||
| 	if (ret) | ||||
| 		return ret; | ||||
| 		goto out; | ||||
| 
 | ||||
| 	if (cfg_truncate > 0) { | ||||
| 		shutdown(fd, SHUT_WR); | ||||
|  | @ -1320,7 +1320,10 @@ int main_loop(void) | |||
| 		close(fd); | ||||
| 	} | ||||
| 
 | ||||
| 	return 0; | ||||
| out: | ||||
| 	if (cfg_input) | ||||
| 		close(fd_in); | ||||
| 	return ret; | ||||
| } | ||||
| 
 | ||||
| int parse_proto(const char *proto) | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ source net_helper.sh | |||
| 
 | ||||
| readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" | ||||
| 
 | ||||
| BPF_FILE="xdp_dummy.bpf.o" | ||||
| BPF_FILE="lib/xdp_dummy.bpf.o" | ||||
| 
 | ||||
| cleanup() { | ||||
| 	local -r jobs="$(jobs -p)" | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ source net_helper.sh | |||
| 
 | ||||
| readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)" | ||||
| 
 | ||||
| BPF_FILE="xdp_dummy.bpf.o" | ||||
| BPF_FILE="lib/xdp_dummy.bpf.o" | ||||
| 
 | ||||
| cleanup() { | ||||
| 	local -r jobs="$(jobs -p)" | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ | |||
| 
 | ||||
| source net_helper.sh | ||||
| 
 | ||||
| BPF_FILE="xdp_dummy.bpf.o" | ||||
| BPF_FILE="lib/xdp_dummy.bpf.o" | ||||
| readonly BASE="ns-$(mktemp -u XXXXXX)" | ||||
| readonly SRC=2 | ||||
| readonly DST=1 | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| #!/bin/sh | ||||
| # SPDX-License-Identifier: GPL-2.0 | ||||
| 
 | ||||
| BPF_FILE="xdp_dummy.bpf.o" | ||||
| BPF_FILE="lib/xdp_dummy.bpf.o" | ||||
| readonly STATS="$(mktemp -p /tmp ns-XXXXXX)" | ||||
| readonly BASE=`basename $STATS` | ||||
| readonly SRC=2 | ||||
|  |  | |||
|  | @ -1,13 +0,0 @@ | |||
| // SPDX-License-Identifier: GPL-2.0
 | ||||
| 
 | ||||
| #define KBUILD_MODNAME "xdp_dummy" | ||||
| #include <linux/bpf.h> | ||||
| #include <bpf/bpf_helpers.h> | ||||
| 
 | ||||
| SEC("xdp") | ||||
| int xdp_dummy_prog(struct xdp_md *ctx) | ||||
| { | ||||
| 	return XDP_PASS; | ||||
| } | ||||
| 
 | ||||
| char _license[] SEC("license") = "GPL"; | ||||
		Loading…
	
		Reference in a new issue
	
	 Linus Torvalds
						Linus Torvalds