From patchwork Tue Jan 30 21:46:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13538097 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E8A514F61 for ; Tue, 30 Jan 2024 21:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651186; cv=none; b=JJzlQD6JH3tYrj0U3WUuMlrabbvbc668Umc+pru6G+CeVMZtPtgDOJLT4/FMbuQJVhrr7AfvU/EJGCnTmgHjc19VnEYrMXJ4TnCwGP+h1fU9+HnI/F8qvuW29aTdKbjl1EP3Bt9ntoxdtBllA6vID9lFD4z/5NN8DWwu6qWfXxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651186; c=relaxed/simple; bh=uRqIih7HbMmsHIZREdM8+dFjPy/z+ERnHQRkPvSv22o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=p+KLicbellbqz68XoGFndUrXnGseyxmvemY5eANs2tIt+DfGEwAjSEYizF7hyUfECTacZhs0Pd0iaMyCZj3svARln5GcEUCtkqfZg6B86yA6dt8w1Nn0U/JV6twd84yFBNLNq0Xuwvd5dni/pHzM4e2w1RjpurruQepCS1Ww14E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=CQR/DxOd; arc=none smtp.client-ip=209.85.160.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="CQR/DxOd" Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-21432e87455so2712001fac.1 for ; Tue, 30 Jan 2024 13:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1706651183; x=1707255983; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LXSlukVqYZVwFSmz/UgYPWSS8sRjQNlTzTCQ7rbEX1U=; b=CQR/DxOdr5SWCjDL9DF6VL8OcIJWWbwppI94I8QJNL8INQd4mE6TZNEhnruCp1h/aT sOFoL1rLilC+YluvvtGroYgQdsp9ycpG/WtPbDwTi7VjphP48Jljpx8aiKvb7NU6Tr90 KiVqzMALAr6vvXCRQjg8hoK7zHD7Nxgq97knFzpK+xWcvBM2/z8GEQ2X2NVWMfQjQV6l V5R4KZSmaahgRoLb898in0FAGSu63F4S1GY9zL56YJMrIf1WFIDUIjGv0SQNE5ysORVC jUYI5ttVrVeh/sCgSZ1erL2llo5k2cCLcK9wrRAAoycVqVqvANn/3jbR5wCG1bgj8n6k 1X5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706651183; x=1707255983; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LXSlukVqYZVwFSmz/UgYPWSS8sRjQNlTzTCQ7rbEX1U=; b=tcmwO0k7x414HkCN4KVDCpZRwqbARiCzartV9n6L42/0j2puyfagdDRwC+nIaEe+Rs g+TSp/k2uBRQshlu+vnamNUkwqRUacGovUIS5VBF1eb4GiJdFHZ4M+jOA7o1r5T861QJ RAWzuvpyuL+Zsh6ayVTqUMQtqna/iDRrCJSOPfAdPYD7faq7EuWqlDAbnLs/8hjsszKh ftxKZ7kzkSXS069ObSfndl0IJQKUKwHig3x0g8XoKf8ecenGc2arDiAb8R+4XUnKxRvP 0XL68Rb/tkwmtB8oRQFKX/Pc3w+ItbS0pS0v5txgyx6yVlpJkDFMqLym+7uq4YVovgo4 vQZw== X-Gm-Message-State: AOJu0Yx0VUC6MXoHXn1WPfLvLOuOoLFCWUdqQJGZbE46/2DmIAPEgg+i Kvd5wLMvPo2uLPgRX6JQQcPGo7z7/o8Yg9DfVcRfxwNlyX2azjXSc6wLUrbQVuA= X-Google-Smtp-Source: AGHT+IEzcUz/R9XiZOyRAtsPE9715/NceNJ+7u0TwNuL4Z+T8TqdnRdhQGfa89kyv7TvfN3PcD+KtQ== X-Received: by 2002:a05:6871:5b0d:b0:218:73ae:30dc with SMTP id op13-20020a0568715b0d00b0021873ae30dcmr486166oac.54.1706651183225; Tue, 30 Jan 2024 13:46:23 -0800 (PST) Received: from localhost (fwdproxy-prn-023.fbsv.net. [2a03:2880:ff:17::face:b00c]) by smtp.gmail.com with ESMTPSA id i17-20020a63e451000000b005d8b8efac4csm6398596pgk.85.2024.01.30.13.46.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 13:46:22 -0800 (PST) From: David Wei To: Jakub Kicinski , Jiri Pirko , Sabrina Dubroca , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni Subject: [PATCH net-next v8 1/4] netdevsim: allow two netdevsim ports to be connected Date: Tue, 30 Jan 2024 13:46:17 -0800 Message-Id: <20240130214620.3722189-2-dw@davidwei.uk> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240130214620.3722189-1-dw@davidwei.uk> References: <20240130214620.3722189-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add two netdevsim bus attribute to sysfs: /sys/bus/netdevsim/link_device /sys/bus/netdevsim/unlink_device Writing "A M B N" to link_device will link netdevsim M in netnsid A with netdevsim N in netnsid B. Writing "A M" to unlink_device will unlink netdevsim M in netnsid A from its peer, if any. rtnl_lock is taken to ensure nothing changes during the linking. Signed-off-by: David Wei --- drivers/net/netdevsim/bus.c | 132 ++++++++++++++++++++++++++++++ drivers/net/netdevsim/netdev.c | 11 +++ drivers/net/netdevsim/netdevsim.h | 2 + 3 files changed, 145 insertions(+) diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c index bcbc1e19edde..57e28801bb51 100644 --- a/drivers/net/netdevsim/bus.c +++ b/drivers/net/netdevsim/bus.c @@ -232,9 +232,141 @@ del_device_store(const struct bus_type *bus, const char *buf, size_t count) } static BUS_ATTR_WO(del_device); +static ssize_t link_device_store(const struct bus_type *bus, const char *buf, size_t count) +{ + unsigned int netnsid_a, netnsid_b, ifidx_a, ifidx_b; + struct netdevsim *nsim_a, *nsim_b, *peer; + struct net_device *dev_a, *dev_b; + struct net *ns_a, *ns_b; + int err; + + err = sscanf(buf, "%u:%u %u:%u", &netnsid_a, &ifidx_a, &netnsid_b, &ifidx_b); + if (err != 4) { + pr_err("Format for linking two devices is \"netnsid_a:ifidx_a netnsid_b:ifidx_b\" (uint uint unit uint).\n"); + return -EINVAL; + } + + err = -EINVAL; + rtnl_lock(); + ns_a = get_net_ns_by_id(current->nsproxy->net_ns, netnsid_a); + if (!ns_a) { + pr_err("Could not find netns with id: %u\n", netnsid_a); + goto out_unlock_rtnl; + } + + dev_a = __dev_get_by_index(ns_a, ifidx_a); + if (!dev_a) { + pr_err("Could not find device with ifindex %u in netnsid %u\n", ifidx_a, netnsid_a); + goto out_put_netns_a; + } + + if (!netdev_is_nsim(dev_a)) { + pr_err("Device with ifindex %u in netnsid %u is not a netdevsim\n", ifidx_a, netnsid_a); + goto out_put_netns_a; + } + + ns_b = get_net_ns_by_id(current->nsproxy->net_ns, netnsid_b); + if (!ns_b) { + pr_err("Could not find netns with id: %u\n", netnsid_b); + goto out_put_netns_a; + } + + dev_b = __dev_get_by_index(ns_b, ifidx_b); + if (!dev_b) { + pr_err("Could not find device with ifindex %u in netnsid %u\n", ifidx_b, netnsid_b); + goto out_put_netns_b; + } + + if (!netdev_is_nsim(dev_b)) { + pr_err("Device with ifindex %u in netnsid %u is not a netdevsim\n", ifidx_b, netnsid_b); + goto out_put_netns_b; + } + + err = 0; + nsim_a = netdev_priv(dev_a); + peer = rtnl_dereference(nsim_a->peer); + if (peer) { + pr_err("Netdevsim %u:%u is already linked\n", netnsid_a, ifidx_a); + goto out_put_netns_b; + } + + nsim_b = netdev_priv(dev_b); + peer = rtnl_dereference(nsim_b->peer); + if (peer) { + pr_err("Netdevsim %u:%u is already linked\n", netnsid_b, ifidx_b); + goto out_put_netns_b; + } + + rcu_assign_pointer(nsim_a->peer, nsim_b); + rcu_assign_pointer(nsim_b->peer, nsim_a); + +out_put_netns_b: + put_net(ns_b); +out_put_netns_a: + put_net(ns_a); +out_unlock_rtnl: + rtnl_unlock(); + + return !err ? count : err; +} +static BUS_ATTR_WO(link_device); + +static ssize_t unlink_device_store(const struct bus_type *bus, const char *buf, size_t count) +{ + struct netdevsim *nsim, *peer; + unsigned int netnsid, ifidx; + struct net_device *dev; + struct net *ns; + int err; + + err = sscanf(buf, "%u:%u", &netnsid, &ifidx); + if (err != 2) { + pr_err("Format for unlinking a device is \"netnsid:ifidx\" (uint uint).\n"); + return -EINVAL; + } + + err = -EINVAL; + rtnl_lock(); + ns = get_net_ns_by_id(current->nsproxy->net_ns, netnsid); + if (!ns) { + pr_err("Could not find netns with id: %u\n", netnsid); + goto out_unlock_rtnl; + } + + dev = __dev_get_by_index(ns, ifidx); + if (!dev) { + pr_err("Could not find device with ifindex %u in netnsid %u\n", ifidx, netnsid); + goto out_put_netns; + } + + if (!netdev_is_nsim(dev)) { + pr_err("Device with ifindex %u in netnsid %u is not a netdevsim\n", ifidx, netnsid); + goto out_put_netns; + } + + err = 0; + nsim = netdev_priv(dev); + peer = rtnl_dereference(nsim->peer); + if (!peer) + goto out_put_netns; + + RCU_INIT_POINTER(nsim->peer, NULL); + RCU_INIT_POINTER(peer->peer, NULL); + +out_put_netns: + put_net(ns); +out_unlock_rtnl: + rtnl_unlock(); + + return !err ? count : err; +} +static BUS_ATTR_WO(unlink_device); + static struct attribute *nsim_bus_attrs[] = { &bus_attr_new_device.attr, &bus_attr_del_device.attr, + &bus_attr_link_device.attr, + &bus_attr_unlink_device.attr, NULL }; ATTRIBUTE_GROUPS(nsim_bus); diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 77e8250282a5..57883773e4fb 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -333,6 +333,7 @@ static int nsim_init_netdevsim(struct netdevsim *ns) goto err_phc_destroy; rtnl_lock(); + RCU_INIT_POINTER(ns->peer, NULL); err = nsim_bpf_init(ns); if (err) goto err_utn_destroy; @@ -413,8 +414,13 @@ nsim_create(struct nsim_dev *nsim_dev, struct nsim_dev_port *nsim_dev_port) void nsim_destroy(struct netdevsim *ns) { struct net_device *dev = ns->netdev; + struct netdevsim *peer; rtnl_lock(); + peer = rtnl_dereference(ns->peer); + if (peer) + RCU_INIT_POINTER(peer->peer, NULL); + RCU_INIT_POINTER(ns->peer, NULL); unregister_netdevice(dev); if (nsim_dev_port_is_pf(ns->nsim_dev_port)) { nsim_macsec_teardown(ns); @@ -427,6 +433,11 @@ void nsim_destroy(struct netdevsim *ns) free_netdev(dev); } +bool netdev_is_nsim(struct net_device *dev) +{ + return dev->netdev_ops == &nsim_netdev_ops; +} + static int nsim_validate(struct nlattr *tb[], struct nlattr *data[], struct netlink_ext_ack *extack) { diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index 028c825b86db..c8b45b0d955e 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -125,11 +125,13 @@ struct netdevsim { } udp_ports; struct nsim_ethtool ethtool; + struct netdevsim __rcu *peer; }; struct netdevsim * nsim_create(struct nsim_dev *nsim_dev, struct nsim_dev_port *nsim_dev_port); void nsim_destroy(struct netdevsim *ns); +bool netdev_is_nsim(struct net_device *dev); void nsim_ethtool_init(struct netdevsim *ns); From patchwork Tue Jan 30 21:46:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13538098 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECF5478B64 for ; Tue, 30 Jan 2024 21:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651186; cv=none; b=NUkyM+rNXa2FsibFljYaSJobP7LQo9A7GPYD2zTYYciEqagFAmSGrvFUfjMtkVN0/w8KjVggFEAcIum0FWU27qrmmf215osvpSKYVDshYnReh1pjt8k0TGT+Gj8bXgfV9dj7cOsQG2+c9cGZ/DWXHaCllmApNuseEZEG1ILzn6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651186; c=relaxed/simple; bh=h51+PMqZFUSDKkzp81ib67kRObLqTDNvlePciKrb3JA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Potlvj01mCeOkxG/Coxvtuhsxe1Un5XSOqhRr+MkgeVdnW4QSn75fNeeaQjj7OeuAnExQUmRxPEa+SUyEye42JwoFxEnQEYJgaBmq0Ui47TKGX/Rwl2YwKABMdW1QRGS3TwTRIkiaH2PKq2mOh6l9xuNLqAO+oW25Cr1trslprQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=UEglOstB; arc=none smtp.client-ip=209.85.215.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="UEglOstB" Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-5d4a1e66750so2533936a12.0 for ; Tue, 30 Jan 2024 13:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1706651184; x=1707255984; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gFu9jZ6gCjRApzlGzx5kepfS3dicxZhx266q2+xXoLY=; b=UEglOstBckEyDgvwPqQbCQTP112y5YGEXyJHLxWBWobyCHxUSbPMvMjQ1k4gOJaipy tAEs0w4nTv2wsTMCr686op5nyQ6M21J2gJJBvU5mlFUtZn2DKR+jkyb1zRVkWbciT833 O2ebaBCiPxEUYRCR7CV7pKiJKhNyz39wBLfLf/AGB5Or+xBYc83N8KV9kYCRtxv8jHJl RzF5xYQltMw8H0MrF561ATPL9EkBnZwKnvBgYgjfZyiaWsgVZ64Dqmivgijt5tAVDN5t Vsp3M7FeOFLxHi9PXdVrswrbc6DfVo3i8QPzkRe63RTkHJgZcd4Plnk1KZP5oXWMvBp6 ePSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706651184; x=1707255984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gFu9jZ6gCjRApzlGzx5kepfS3dicxZhx266q2+xXoLY=; b=ZV8WeeTbgUFJNU3+DDF5erW3EVX1lLzK0nUSbbcaIQbk9fpHtohPxcuxb1JvA1TZmm vRAvPEUP0yFXMpFEIRU4jdGOOzPyvNIwYdGbRylM8jNXZUXzWrqcRy/6AzBmBkDwescx RosupGLs5ECDxfl9I2+jZdGqowBX3DqN1NdLyTaLGKpCFymXfwT9NX84PW8J3dt6vglz llWJ9eGH8lQH1imz2+2lNJzpcuE9LbES8fuME10ppVoikoZh+UGXc+pstYBX4H+A6+Ik gCuqYPqMrsGzpJwIYcQ1mrn2Sv8AiCInHpr0B8kY2ZK7WXgnuLjXf8siZSZefVpZI+Kx dcLw== X-Gm-Message-State: AOJu0YysvgV+Kch2fW+s9rRt/Q+cIA4mY7guyMlK6r8qhWc+VHYYd1UG 5WIGOrJ6M+yMWjjP/Hrmu7JDaY7wXtU6v/+QK3QmBVO/tG0aHPVEuNutRrqDQHtcqp8eUvAZcP4 o X-Google-Smtp-Source: AGHT+IHQCizHs2WqjmUQmbOIag5fWIlf8k5Of3Eq7sH8M9Atk0j5kD4F/ub/7kHHdwtyXRbJNIyekw== X-Received: by 2002:a05:6a21:394b:b0:19c:9f4e:b122 with SMTP id ac11-20020a056a21394b00b0019c9f4eb122mr6352655pzc.20.1706651184304; Tue, 30 Jan 2024 13:46:24 -0800 (PST) Received: from localhost (fwdproxy-prn-116.fbsv.net. [2a03:2880:ff:74::face:b00c]) by smtp.gmail.com with ESMTPSA id t19-20020a62d153000000b006dddd685bbesm8686024pfl.122.2024.01.30.13.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 13:46:24 -0800 (PST) From: David Wei To: Jakub Kicinski , Jiri Pirko , Sabrina Dubroca , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni Subject: [PATCH net-next v8 2/4] netdevsim: forward skbs from one connected port to another Date: Tue, 30 Jan 2024 13:46:18 -0800 Message-Id: <20240130214620.3722189-3-dw@davidwei.uk> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240130214620.3722189-1-dw@davidwei.uk> References: <20240130214620.3722189-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Forward skbs sent from one netdevsim port to its connected netdevsim port using dev_forward_skb, in a spirit similar to veth. Add a tx_dropped variable to struct netdevsim, tracking the number of skbs that could not be forwarded using dev_forward_skb(). The xmit() function accessing the peer ptr is protected by an RCU read critical section. The rcu_read_lock() is functionally redundant as since v5.0 all softirqs are implicitly RCU read critical sections; but it is useful for human readers. If another CPU is concurrently in nsim_destroy(), then it will first set the peer ptr to NULL. This does not affect any existing readers that dereferenced a non-NULL peer. Then, in unregister_netdevice(), there is a synchronize_rcu() before the netdev is actually unregistered and freed. This ensures that any readers i.e. xmit() that got a non-NULL peer will complete before the netdev is freed. Any readers after the RCU_INIT_POINTER() but before synchronize_rcu() will dereference NULL, making it safe. The codepath to nsim_destroy() and nsim_create() takes both the newly added nsim_dev_list_lock and rtnl_lock. This makes it safe with concurrent calls to linking two netdevsims together. Signed-off-by: David Wei --- drivers/net/netdevsim/netdev.c | 28 +++++++++++++++++++++++----- drivers/net/netdevsim/netdevsim.h | 1 + 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 57883773e4fb..fd6bf789ff70 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -29,19 +29,37 @@ static netdev_tx_t nsim_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct netdevsim *ns = netdev_priv(dev); + unsigned int len = skb->len; + struct netdevsim *peer_ns; + int ret = NETDEV_TX_OK; if (!nsim_ipsec_tx(ns, skb)) goto out; + rcu_read_lock(); + peer_ns = rcu_dereference(ns->peer); + if (!peer_ns) + goto out_stats; + + skb_tx_timestamp(skb); + if (unlikely(dev_forward_skb(peer_ns->netdev, skb) == NET_RX_DROP)) + ret = NET_XMIT_DROP; + +out_stats: + rcu_read_unlock(); u64_stats_update_begin(&ns->syncp); - ns->tx_packets++; - ns->tx_bytes += skb->len; + if (ret == NET_XMIT_DROP) { + ns->tx_dropped++; + } else { + ns->tx_packets++; + ns->tx_bytes += len; + } u64_stats_update_end(&ns->syncp); + return ret; out: dev_kfree_skb(skb); - - return NETDEV_TX_OK; + return ret; } static void nsim_set_rx_mode(struct net_device *dev) @@ -70,6 +88,7 @@ nsim_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) start = u64_stats_fetch_begin(&ns->syncp); stats->tx_bytes = ns->tx_bytes; stats->tx_packets = ns->tx_packets; + stats->tx_dropped = ns->tx_dropped; } while (u64_stats_fetch_retry(&ns->syncp, start)); } @@ -302,7 +321,6 @@ static void nsim_setup(struct net_device *dev) eth_hw_addr_random(dev); dev->tx_queue_len = 0; - dev->flags |= IFF_NOARP; dev->flags &= ~IFF_MULTICAST; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE; diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h index c8b45b0d955e..553c4b9b4f63 100644 --- a/drivers/net/netdevsim/netdevsim.h +++ b/drivers/net/netdevsim/netdevsim.h @@ -98,6 +98,7 @@ struct netdevsim { u64 tx_packets; u64 tx_bytes; + u64 tx_dropped; struct u64_stats_sync syncp; struct nsim_bus_dev *nsim_bus_dev; From patchwork Tue Jan 30 21:46:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13538099 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2563C78B4C for ; Tue, 30 Jan 2024 21:46:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651187; cv=none; b=p4MWPqWIqzcEgTucKpMHmSdsvj9RQ8/zPkQxz5YC918HbOLCK5zwVpuP8B4Z1y10AQTlvZR5FZ4qCcYRZqhiIHbP2e78cEEz5OdCGGDEZGxG4fMyTHj9ty7AUl1HmXtgexJaQXjF/gNxaC5vISe71G5WheR+YVNI7kn9bChbrK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651187; c=relaxed/simple; bh=tkY3NSVt4mMMttzbuNQJ18NgnNQXjdNURV2Wno4GCTI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OzA5j5OELkfAhdrSY7175T5MvanyQMpRJ+eFjoofVS4o6twDpDyG5JLxpNg7HgrQFx5YrcURa9M246LuZS+Dl+yuqJGrsSfwfbRbl2TMWP1uJr2Lr414v2KOrM7AYsP9s2aD6IyEAO1lDOQTtZ9UvUfGvcNxL/XtEjgrz3kQfLI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=ThJ3YwR5; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="ThJ3YwR5" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6ddce722576so2286280b3a.1 for ; Tue, 30 Jan 2024 13:46:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1706651185; x=1707255985; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=28btIFDDW89Qzho7Aw2XRXuoWIopwwnt9ux9YmhuDBM=; b=ThJ3YwR5HFEGLhiTknwbT2Y3KYiP2qOFn9sXB5y4tCQ4FehGpW9aUjFYYy3q3P7Mey nBD7UkJNzCuIjqPYHdoeslLr4rkMkJZR1mQ+2sNm0pWBrkrYXn2xhPPIa+tA+BVySY2A VwQhozsyNWb1VMcseQuYTbjplUZ5YSJC2I+IDGDhw2Xlbnz5Ttagep5Hz4IH7hiLZYyE Ra93s/Uelvvf6ABUkc8fmPWkTDlwgW+t7eAFz4TZyDS//EHTwMSvhFHLLHCf4ohquj71 BJHTMCl3mHli+f49k+jpQmeDmcL7K+zhs/dAy227O2x3801a8nEuQietj6xZRpMxa9DF y2wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706651185; x=1707255985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=28btIFDDW89Qzho7Aw2XRXuoWIopwwnt9ux9YmhuDBM=; b=tJ+GBsXVX4gsmUZUa4A/RS6IAdEUG/QthYREkEpqzpfvgHdBU9E+ckxW295DHa1xNy VKoFxyca5cBLK3eF3OP6Vt39OwhUszDXzyrVnZqg2E8nl6Ec2KpyLH8paZenGocazaos VHeRr6dcrp37FUl336TGlgi1Jh0UJu+4O4mHVoJL+KS1SP0xacxvk+zFTFDu2vWHJA1n ytM5HPbhub+9TQ05DfAFiAedGQ6j1doxV5W1wqbejXJlQg4u5e2Wk2rdiZaz8mTesu0U Exjx2qX4uTg184YBJANYGIFlNRJrWT9vzeXxYRGho+AdW8kiQVAgwl8o3fnamuXddfIE 9SlQ== X-Gm-Message-State: AOJu0Yy4T99aF7Sn/mmhUfbe+pvBAANAm9vfUVnzRuG4QLdmOG+UUQPo KxMSwozlfjQm31Og8oMJZSBOhDn+P0KCw7JiwxlwoZjVVc1GTdsn2jh/JTGiWmM= X-Google-Smtp-Source: AGHT+IHv9bp/PyvD5OfCuogtR9+V0aYjGAO2wMZo+fqFStjj4/Hi3md9gAHWHkLxAXY9+Sw1Q1Fqqg== X-Received: by 2002:aa7:8886:0:b0:6db:de89:d0f1 with SMTP id z6-20020aa78886000000b006dbde89d0f1mr6150636pfe.28.1706651185323; Tue, 30 Jan 2024 13:46:25 -0800 (PST) Received: from localhost (fwdproxy-prn-027.fbsv.net. [2a03:2880:ff:1b::face:b00c]) by smtp.gmail.com with ESMTPSA id d10-20020a63fd0a000000b005cf450e91d2sm8980727pgh.52.2024.01.30.13.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 13:46:25 -0800 (PST) From: David Wei To: Jakub Kicinski , Jiri Pirko , Sabrina Dubroca , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni Subject: [PATCH net-next v8 3/4] netdevsim: add selftest for forwarding skb between connected ports Date: Tue, 30 Jan 2024 13:46:19 -0800 Message-Id: <20240130214620.3722189-4-dw@davidwei.uk> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240130214620.3722189-1-dw@davidwei.uk> References: <20240130214620.3722189-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Connect two netdevsim ports in different namespaces together, then send packets between them using socat. Signed-off-by: David Wei --- .../selftests/drivers/net/netdevsim/peer.sh | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100755 tools/testing/selftests/drivers/net/netdevsim/peer.sh diff --git a/tools/testing/selftests/drivers/net/netdevsim/peer.sh b/tools/testing/selftests/drivers/net/netdevsim/peer.sh new file mode 100755 index 000000000000..9d232fc50d69 --- /dev/null +++ b/tools/testing/selftests/drivers/net/netdevsim/peer.sh @@ -0,0 +1,125 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only + +NSIM_DEV_1_ID=$((RANDOM % 1024)) +NSIM_DEV_1_SYS=/sys/bus/netdevsim/devices/netdevsim$NSIM_DEV_1_ID +NSIM_DEV_2_ID=$((RANDOM % 1024)) +NSIM_DEV_2_SYS=/sys/bus/netdevsim/devices/netdevsim$NSIM_DEV_2_ID + +NSIM_DEV_SYS_NEW=/sys/bus/netdevsim/new_device +NSIM_DEV_SYS_DEL=/sys/bus/netdevsim/del_device +NSIM_DEV_SYS_LINK=/sys/bus/netdevsim/link_device +NSIM_DEV_SYS_UNLINK=/sys/bus/netdevsim/unlink_device + +socat_check() +{ + if [ ! -x "$(command -v socat)" ]; then + echo "socat command not found. Skipping test" + return 1 + fi + + return 0 +} + +setup_ns() +{ + set -e + ip netns add nssv + ip netns add nscl + + NSIM_DEV_1_NAME=$(find $NSIM_DEV_1_SYS/net -maxdepth 1 -type d ! \ + -path $NSIM_DEV_1_SYS/net -exec basename {} \;) + NSIM_DEV_2_NAME=$(find $NSIM_DEV_2_SYS/net -maxdepth 1 -type d ! \ + -path $NSIM_DEV_2_SYS/net -exec basename {} \;) + + ip link set $NSIM_DEV_1_NAME netns nssv + ip link set $NSIM_DEV_2_NAME netns nscl + + ip netns exec nssv ip addr add '192.168.1.1/24' dev $NSIM_DEV_1_NAME + ip netns exec nscl ip addr add '192.168.1.2/24' dev $NSIM_DEV_2_NAME + + ip netns exec nssv ip link set dev $NSIM_DEV_1_NAME up + ip netns exec nscl ip link set dev $NSIM_DEV_2_NAME up + set +e +} + +cleanup_ns() +{ + ip netns del nscl + ip netns del nssv +} + +### +### Code start +### + +modprobe netdevsim + +# linking + +echo $NSIM_DEV_1_ID > $NSIM_DEV_SYS_NEW +echo $NSIM_DEV_2_ID > $NSIM_DEV_SYS_NEW + +setup_ns + +NSIM_DEV_1_NETNSID=$(ip netns list-id | grep nssv | awk '{print $2}') +NSIM_DEV_1_IFIDX=$(ip netns exec nssv cat /sys/class/net/$NSIM_DEV_1_NAME/ifindex) + +NSIM_DEV_2_NETNSID=$(ip netns list-id | grep nscl | awk '{print $2}') +NSIM_DEV_2_IFIDX=$(ip netns exec nscl cat /sys/class/net/$NSIM_DEV_2_NAME/ifindex) + +echo "$NSIM_DEV_1_NETNSID:$NSIM_DEV_1_IFIDX $NSIM_DEV_2_NETNSID:20" > $NSIM_DEV_SYS_LINK 2>/dev/null +if [ $? -eq 0 ]; then + echo "linking with non-existent netdevsim should fail" + exit 1 +fi + +echo "$NSIM_DEV_1_NETNSID:$NSIM_DEV_1_IFIDX 20:$NSIM_DEV_2_IFIDX" > $NSIM_DEV_SYS_LINK 2>/dev/null +if [ $? -eq 0 ]; then + echo "linking with non-existent netnsid should fail" + exit 1 +fi + +echo "$NSIM_DEV_1_NETNSID:$NSIM_DEV_1_IFIDX $NSIM_DEV_2_NETNSID:$NSIM_DEV_2_IFIDX" > $NSIM_DEV_SYS_LINK +if [ $? -ne 0 ]; then + echo "linking netdevsim1 with netdevsim2 should succeed" + exit 1 +fi + +# argument error checking + +echo "$NSIM_DEV_1_NETNSID:$NSIM_DEV_1_IFIDX $NSIM_DEV_2_NETNSID:a" > $NSIM_DEV_SYS_LINK 2>/dev/null +if [ $? -eq 0 ]; then + echo "invalid arg should fail" + exit 1 +fi + +# send/recv packets + +socat_check || exit 4 + +tmp_file=$(mktemp) +ip netns exec nssv socat TCP-LISTEN:1234,fork $tmp_file & +pid=$! +res=0 + +echo "HI" | ip netns exec nscl socat STDIN TCP:192.168.1.1:1234 + +count=$(cat $tmp_file | wc -c) +if [[ $count -ne 3 ]]; then + echo "expected 3 bytes, got $count" + res=1 +fi + +echo "$NSIM_DEV_1_NETNSID:$NSIM_DEV_1_IFIDX" > $NSIM_DEV_SYS_UNLINK + +echo $NSIM_DEV_2_ID > $NSIM_DEV_SYS_DEL + +kill $pid +echo $NSIM_DEV_1_ID > $NSIM_DEV_SYS_DEL + +cleanup_ns + +modprobe -r netdevsim + +exit $res From patchwork Tue Jan 30 21:46:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13538100 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9AC87993B for ; Tue, 30 Jan 2024 21:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651189; cv=none; b=Fzgp6NXLZpuxsn3VTywoqTWC9WAfbTYfJGkmCKiFmf7m8rNbhJbdP6oH4dw+YOui5wCW3MAoGgFgqJtoDOFr/NiFt5w4dq31B9sgpl8vjGLJnR2kP7vPxfmHq1nJ7YbGJ/m/Q6AOh0x6cwxO9ZKwWxVbfasEh/HqoSWht4V7Gq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706651189; c=relaxed/simple; bh=cLYPdbxUBtT+KaYS866D/Xt5LNCttNpkpzpgDQmmdw4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KSn0iAvAVKcMCg5ydI/PzMQZrl773Xze4LzqXi6v/sO3k/lxsZEsoqbUSwUc01/cNOktm8FifUZIdCOUEAnH24zS1PAb790Pylw7s7nNdVCLvHHQBzKpBGaFOD86xctCRtZrScp7hdmI2Vzh6l8qQqoSCCK6eDCxPcEqhYR7JcE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=snZA+9ML; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="snZA+9ML" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6df60be4a1dso709141b3a.3 for ; Tue, 30 Jan 2024 13:46:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1706651186; x=1707255986; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HipVj3jFa++EzsAXPaItSnaAVQdrvEwwkSfJxQxVOsU=; b=snZA+9ML1C2kyDq3fahN6ZHUBLjueI+TenkBeh8FCqleP7evHloKyUI50aZQipA2h1 /PBjdJJpozpLUrzq4ohJ/M06vtELJSlxoORU6QT8x83esAMnbySb/pTtCL6VL534Sd1B SX58eo/Oyndw51cRpRKRgK5+97AROfVkp5BsV2KIHcfmPZYmUVAQUoqIm0/pCVoDZNEE k3uggtDsNnvQuwBldcmDee+5FfqKTZyM0EBbmRSg+qPNRIk+3iL5zLSpoOoAMgj9wvU7 +mhcZX7uPI8/n6DSDCIysrq/ynH0V3wOF8jx2hXVe4DgLgnatDtU43nfzugA+DkXex7Z vXXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706651186; x=1707255986; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HipVj3jFa++EzsAXPaItSnaAVQdrvEwwkSfJxQxVOsU=; b=MdWXegSZgkqZaEftXIsDwjMvZrHXWxVflaQKNgCcsW1wmXD0XOE/HAzcQ+2WJIzEwB 6JaMsEP9UG0roBG5nOUVvcQCWudRyrmh6PjP4iYe+An5YSIiqAQ6GGziPMFcRcnzQ1zw PSHF7KjFdj0hkSJgg3wpoht3BWXtaV+mq7uSdGvcsqaUeyMrEbtiaxjYS2e3IN2hniDz sZZbYvaEESkSz2Pc8cJ2e66X+VnfKEFUlyGYq4/M33AryyiCgf4nSk7W9HBBQTwvbPnK iXSdpwpxclkw2vEY9vPqBOYf2a/XfgWUinEqHouOT/wTyXclq8RKtWSAFOBf9QXEdlRp ncGA== X-Gm-Message-State: AOJu0YxVL3mQtNzkPMap2rdZp3X+Y1bGoqb7ARlL7RM4XSJAKhoAgGki FZnN4T9bPqP05azd1bTzgnG7sB/PyGVZLc/yDvNklcKUjKakgCxWCFIBDxXH5Qg= X-Google-Smtp-Source: AGHT+IH/gFJ3PxYb9SCiVLexn2uUO20IXnX5UZVjj09Z+NoLqllBibFeoy7zdNw/8CbnqqI0mKJ93A== X-Received: by 2002:a05:6a00:1c85:b0:6de:25e6:f6ca with SMTP id y5-20020a056a001c8500b006de25e6f6camr6502899pfw.11.1706651186247; Tue, 30 Jan 2024 13:46:26 -0800 (PST) Received: from localhost (fwdproxy-prn-000.fbsv.net. [2a03:2880:ff::face:b00c]) by smtp.gmail.com with ESMTPSA id p51-20020a056a0026f300b006dde10a12b6sm8268231pfw.211.2024.01.30.13.46.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 13:46:25 -0800 (PST) From: David Wei To: Jakub Kicinski , Jiri Pirko , Sabrina Dubroca , netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni Subject: [PATCH net-next v8 4/4] netdevsim: add Makefile for selftests Date: Tue, 30 Jan 2024 13:46:20 -0800 Message-Id: <20240130214620.3722189-5-dw@davidwei.uk> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240130214620.3722189-1-dw@davidwei.uk> References: <20240130214620.3722189-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add a Makefile for netdevsim selftests and add selftests path to MAINTAINERS Signed-off-by: David Wei --- MAINTAINERS | 1 + .../selftests/drivers/net/netdevsim/Makefile | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tools/testing/selftests/drivers/net/netdevsim/Makefile diff --git a/MAINTAINERS b/MAINTAINERS index 92152ac346c8..562af3dfd2d0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15082,6 +15082,7 @@ NETDEVSIM M: Jakub Kicinski S: Maintained F: drivers/net/netdevsim/* +F: tools/testing/selftests/drivers/net/netdevsim/* NETEM NETWORK EMULATOR M: Stephen Hemminger diff --git a/tools/testing/selftests/drivers/net/netdevsim/Makefile b/tools/testing/selftests/drivers/net/netdevsim/Makefile new file mode 100644 index 000000000000..5bace0b7fb57 --- /dev/null +++ b/tools/testing/selftests/drivers/net/netdevsim/Makefile @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: GPL-2.0+ OR MIT + +TEST_PROGS = devlink.sh \ + devlink_in_netns.sh \ + devlink_trap.sh \ + ethtool-coalesce.sh \ + ethtool-fec.sh \ + ethtool-pause.sh \ + ethtool-ring.sh \ + fib.sh \ + hw_stats_l3.sh \ + nexthop.sh \ + peer.sh \ + psample.sh \ + tc-mq-visibility.sh \ + udp_tunnel_nic.sh \ + +include ../../../lib.mk