From patchwork Mon Jan 13 09:31:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 13937060 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 50BBF22C35A for ; Mon, 13 Jan 2025 09:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736760700; cv=none; b=PHklsJ3FTRFOjJKtD52kAxGr4Lx0SsX/DmrzuRDXaQIQ41nREyfrts+AmZSVw6LYMgIfvBiR1xgl6Vfp1xF0Cuu2Mxmp2403kbtD/745aIyp9YGFO0agRTvGDVPWfonhCFa3YG44kPfTPxtDwjS/NicQPcwxBFidvgGqAbtuOWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736760700; c=relaxed/simple; bh=lH+70+vbb8mzsnWhRaq1p07+gp3g/U0ZT6i44uGNdws=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=icuifSTBmDIsqrNa3F6PSD4pzYNjpJeY4xcnZxOTul1ih7Ve1PxeB+eWje8nRFyuJZ+HU2VKdJbl+RnEDLs46tdLLyx3DYPRaU4JJmAjxSta9VwdkTkS1hxA/S63iirsUjA/WaFmQiwhX06S17HiWASVb8RJsljCkGiYt69FBoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=openvpn.net; spf=pass smtp.mailfrom=openvpn.com; dkim=pass (2048-bit key) header.d=openvpn.net header.i=@openvpn.net header.b=QSUlFATt; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=openvpn.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=openvpn.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=openvpn.net header.i=@openvpn.net header.b="QSUlFATt" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3862d161947so2021802f8f.3 for ; Mon, 13 Jan 2025 01:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1736760695; x=1737365495; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/6fd/nqlYwcpFBbPM1ixmIIbdfkkly/YsiIhiew+A3k=; b=QSUlFATtDuFS01k50TzXy/2VcOAohtTD9JJuhcyHKGNhMR9k4wObQb1jE/+n409qnq TVaPSu64zXws756g4q6Kcjy20UBqDItA2XLkx2ulB8bQZWn/qwyU0SY4UMahFjXLTHzT 5JWAxJrIaWygTFFcgmsk2yi7TV+kpa729tlIUTjiAm122iyaI6G58YuvsXyuBfzvorGC LnMU+mGNve7EYA1nGNFhmVG5ijtYrwSylWQnI8kkZ2s/FMIpnY4HXEJ+WKp22HT7x+6q UNuGjpGw8tJOKx6XwKGbL7ogxb8Zw+u/FS23FQMVXeMa5hWOVIzj/JixHRKbsxEC/pws rwBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736760695; x=1737365495; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/6fd/nqlYwcpFBbPM1ixmIIbdfkkly/YsiIhiew+A3k=; b=nNffqxF962uoizdjlK8aRKhTzSyXPb6CQ+ngplqNYaM55015GP2u603uqIhm51/Wzt NCaPtRxT9KbTZ3aEI6Wt1RztNKvqlcuudXhnX97nPEYIP753rT40j+KUx1KM6iVF4h9L +BOfcsqzqI6fWGhc9oaWdzdddMpFyEnVTYiZxYjA3eEtxuutyV/g/zNywTzL6DTcwUi4 onWCjNDq7KC4x5JeD6Yn5YrFCoL8jZJ2wHZCTMUNph/Q5zXPLLdx02s20Hpr7ceo0UJx rDZ3/GAiyBfBGXdAh8TYtpeCZPVec4TosrRrL9rxUEBEN5otB0yBIBjiDeE56uWYHTyJ pHEQ== X-Gm-Message-State: AOJu0YxiG+79RYF6p2MV7uNa0tjCgJ/NxU40wryzyFu6AjWG7HLxXEi8 Srq+sIZnceCYsDYeYdm/qaz+FvVmSafsd+aXOIT4wQ2RASDWQPf00J6eXDwzbbo= X-Gm-Gg: ASbGnctyXA2sY9ii5a1ZzayvOmJ6oEOuoTIpOChu8wER8z62xRckqhh1kNIUtmpRPNT IaZq1FzMXkFXKBzWu7kIh1imXBKMHVnzm3TbMfl9b0bvgQgpd1v9qZFpEnWTJB17jX8/LhsttOd ezz3dr6KpD6AQWMqlxITA+vn3CWPNB8J6VIwxNZQWfiPPeLkvOFB9rtHAEZbL3L+Z4jLXPtXiam OejohcgLB7oW5bdoaHqlhwxEj4LB2GXNHWWPuLv1O7M6DqLgoDYdNJktOF72j4lCmXB X-Google-Smtp-Source: AGHT+IFnYuKATGDzk/g0tVvJCIp+jLG0KysffWvfrovAEC12PuWQhJ6r4TjXquD8tk0L7eso3bk3Jg== X-Received: by 2002:a5d:6c68:0:b0:385:f9db:3c4c with SMTP id ffacd0b85a97d-38a872f6cf9mr13568917f8f.9.1736760695459; Mon, 13 Jan 2025 01:31:35 -0800 (PST) Received: from serenity.mandelbit.com ([2001:67c:2fbc:1:8305:bf37:3bbd:ed1d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b8124sm11528446f8f.81.2025.01.13.01.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2025 01:31:35 -0800 (PST) From: Antonio Quartulli Date: Mon, 13 Jan 2025 10:31:43 +0100 Subject: [PATCH net-next v18 24/25] ovpn: add basic ethtool support Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250113-b4-ovpn-v18-24-1f00db9c2bd6@openvpn.net> References: <20250113-b4-ovpn-v18-0-1f00db9c2bd6@openvpn.net> In-Reply-To: <20250113-b4-ovpn-v18-0-1f00db9c2bd6@openvpn.net> To: netdev@vger.kernel.org, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Donald Hunter , Antonio Quartulli , Shuah Khan , sd@queasysnail.net, ryazanov.s.a@gmail.com, Andrew Lunn Cc: Simon Horman , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Xiao Liang , Andrew Lunn X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1699; i=antonio@openvpn.net; h=from:subject:message-id; bh=lH+70+vbb8mzsnWhRaq1p07+gp3g/U0ZT6i44uGNdws=; b=owEBbQGS/pANAwAIAQtw5TqgONWHAcsmYgBnhN2IMz2/OcAGDKnr4nEpPW364OOcoWb8fP9aM viBw0xdiqWJATMEAAEIAB0WIQSZq9xs+NQS5N5fwPwLcOU6oDjVhwUCZ4TdiAAKCRALcOU6oDjV hw6aB/953d61YEoandxz7mwYMWzGnSzy7mFQ1nJFYqVidQs2YGfYAi3KlCATiXrzfiPRoUSfGEv P5Gb5Yx5rpcz4YcOrbdKBiEMQuS8Yq7XatELtwfRYOONvjxSN1e2NDahneAzpdgey42T2PFrGD/ un8gL05jFE74zqY1DtV0m/9uSTp58OA7OeFiRQMUDmY6Y8pzwcAuOMGx0BkLKPagKnQBhCJpYxZ 8Zr/hiM3CD6MuE5mjclbT/nNHCoIgosCr8hegYMky016EUXchllMMBcqwhvif2UiD184KpE9jJE bTkB2tB1QP1sSdZcK8oH1xGuFEET54Tw8smJ/AFPgpT36ILk X-Developer-Key: i=antonio@openvpn.net; a=openpgp; fpr=CABDA1282017C267219885C748F0CCB68F59D14C X-Patchwork-Delegate: kuba@kernel.org Implement support for basic ethtool functionality. Note that ovpn is a virtual device driver, therefore various ethtool APIs are just not meaningful and thus not implemented. Signed-off-by: Antonio Quartulli Reviewed-by: Andrew Lunn --- drivers/net/ovpn/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c index c7299a4334b6d50fb1596bab0af41323ed09edd0..2de1070f0188078418c14f332dba35d98bb1dbb0 100644 --- a/drivers/net/ovpn/main.c +++ b/drivers/net/ovpn/main.c @@ -7,6 +7,7 @@ * James Yonan */ +#include #include #include #include @@ -94,6 +95,19 @@ bool ovpn_dev_is_valid(const struct net_device *dev) return dev->netdev_ops == &ovpn_netdev_ops; } +static void ovpn_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + strscpy(info->driver, "ovpn", sizeof(info->driver)); + strscpy(info->bus_info, "ovpn", sizeof(info->bus_info)); +} + +static const struct ethtool_ops ovpn_ethtool_ops = { + .get_drvinfo = ovpn_get_drvinfo, + .get_link = ethtool_op_get_link, + .get_ts_info = ethtool_op_get_ts_info, +}; + static void ovpn_setup(struct net_device *dev) { netdev_features_t feat = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM | @@ -104,6 +118,7 @@ static void ovpn_setup(struct net_device *dev) dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS; + dev->ethtool_ops = &ovpn_ethtool_ops; dev->netdev_ops = &ovpn_netdev_ops; dev->priv_destructor = ovpn_priv_free;