From: Antonio Quartulli <antonio@openvpn.net>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net-next v2 22/22] ovpn: add basic ethtool support
Date: Fri, 8 Mar 2024 01:21:01 +0100 [thread overview]
Message-ID: <97577da6-ab0d-474c-ab43-60958287d1e4@openvpn.net> (raw)
In-Reply-To: <01adab06-78c9-421e-bd3f-453e948f5bbb@lunn.ch>
On 06/03/2024 20:40, Andrew Lunn wrote:
> On Wed, Mar 06, 2024 at 04:42:03PM +0100, Antonio Quartulli wrote:
>> On 05/03/2024 00:04, Andrew Lunn wrote:
>>> On Mon, Mar 04, 2024 at 04:09:13PM +0100, Antonio Quartulli wrote:
>>>> Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
>>>> ---
>>>> drivers/net/ovpn/main.c | 32 ++++++++++++++++++++++++++++++++
>>>> 1 file changed, 32 insertions(+)
>>>>
>>>> diff --git a/drivers/net/ovpn/main.c b/drivers/net/ovpn/main.c
>>>> index 95a94ccc99c1..9dfcf2580659 100644
>>>> --- a/drivers/net/ovpn/main.c
>>>> +++ b/drivers/net/ovpn/main.c
>>>> @@ -13,6 +13,7 @@
>>>> #include "ovpnstruct.h"
>>>> #include "packet.h"
>>>> +#include <linux/ethtool.h>
>>>> #include <linux/genetlink.h>
>>>> #include <linux/module.h>
>>>> #include <linux/moduleparam.h>
>>>> @@ -83,6 +84,36 @@ static const struct net_device_ops ovpn_netdev_ops = {
>>>> .ndo_get_stats64 = dev_get_tstats64,
>>>> };
>>>> +static int ovpn_get_link_ksettings(struct net_device *dev,
>>>> + struct ethtool_link_ksettings *cmd)
>>>> +{
>>>> + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, 0);
>>>> + ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, 0);
>>>> + cmd->base.speed = SPEED_1000;
>>>> + cmd->base.duplex = DUPLEX_FULL;
>>>> + cmd->base.port = PORT_TP;
>>>> + cmd->base.phy_address = 0;
>>>> + cmd->base.transceiver = XCVR_INTERNAL;
>>>> + cmd->base.autoneg = AUTONEG_DISABLE;
>>>
>>> Why? It is a virtual device. Speed and duplex is meaningless. You
>>> could run this over FDDI, HIPPI, or RFC 1149? So why PORT_TP?
>>
>> To be honest, I couldn't find any description to help me with deciding what
>> to set there and I just used a value I saw in other Ethernet drivers.
>>
>> Do you have any recommendation?
>> For the other fields: do you think they make sense? The speed value is
>> always debatable...The actual speed depends on the transport interface and
>> there might be multiple involved. Maybe SPEED_UNKNOWN is more appropriate?
>
> Turn it around. What is your use case? What is using this information?
> I would just not implement this function. But maybe you know of
> something which actually requires it?
At the moment there is nothing on my side requiring this function.
I thought it was recommended to provide an implementation so that any
potential user would be happy (some monitoring tool? some other module
in the kernel?)
But if you think there is no meaningful use case for it, then I think it
makes sense to just drop it, as we are filling it with random/virtual
values.
>
>>>> + strscpy(info->bus_info, "ovpn", sizeof(info->bus_info));
>>>
>>> This is also not accurate. There is no bus involved.
>>
>> Should I just leave it empty then?
>>
>> My concern is that a user expects $something and it will crash on my empty
>> string. But if empty is allowed, I will just go with it.
>
> Empty is allowed. The bridge uses "N/A", which i would say is also
> correct. tun/tap does however use "tun", so "ovpn" is not that
> different i supposes.
I just grepped through the kernel and I can see various patterns.
I also found:
899 strscpy(info->bus_info, "batman", sizeof(info->bus_info));
:-)
All in all, I agree we can sick to "ovpn".
Regards,
>
> Andrew
>
--
Antonio Quartulli
OpenVPN Inc.
next prev parent reply other threads:[~2024-03-08 0:20 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 15:08 [PATCH net-next v2 00/22] Introducing OpenVPN Data Channel Offload Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 01/22] netlink: add NLA_POLICY_MAX_LEN macro Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 02/22] net: introduce OpenVPN Data Channel Offload (ovpn) Antonio Quartulli
2024-03-04 20:47 ` Andrew Lunn
2024-03-04 21:30 ` Antonio Quartulli
2024-03-04 22:46 ` Andrew Lunn
2024-03-05 12:29 ` Antonio Quartulli
2024-03-06 15:51 ` Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 03/22] ovpn: add basic netlink support Antonio Quartulli
2024-03-04 21:20 ` Andrew Lunn
2024-03-05 15:47 ` Antonio Quartulli
2024-03-05 16:23 ` Andrew Lunn
2024-03-05 19:39 ` Jakub Kicinski
2024-03-06 14:46 ` Antonio Quartulli
2024-03-06 19:10 ` Andrew Lunn
2024-03-08 0:01 ` Antonio Quartulli
2024-03-05 10:49 ` kernel test robot
2024-03-26 11:43 ` Esben Haabendal
2024-03-26 21:39 ` Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 04/22] ovpn: add basic interface creation/destruction/management routines Antonio Quartulli
2024-03-04 21:33 ` Andrew Lunn
2024-03-05 15:51 ` Antonio Quartulli
2024-03-05 16:27 ` Andrew Lunn
2024-03-06 14:49 ` Antonio Quartulli
2024-03-06 19:31 ` Andrew Lunn
2024-03-08 0:08 ` Antonio Quartulli
2024-03-08 13:13 ` Andrew Lunn
2024-03-08 14:21 ` Antonio Quartulli
2024-03-05 19:40 ` Jakub Kicinski
2024-03-06 14:59 ` Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 05/22] ovpn: implement interface creation/destruction via netlink Antonio Quartulli
2024-03-05 14:51 ` Simon Horman
2024-03-06 15:01 ` Antonio Quartulli
2024-03-25 15:01 ` Esben Haabendal
2024-03-26 21:44 ` Antonio Quartulli
2024-04-02 6:48 ` Esben Haabendal
2024-03-04 15:08 ` [PATCH net-next v2 06/22] ovpn: introduce the ovpn_peer object Antonio Quartulli
2024-03-04 21:52 ` Andrew Lunn
2024-03-05 15:52 ` Antonio Quartulli
2024-03-04 22:56 ` Andrew Lunn
2024-03-06 16:03 ` Antonio Quartulli
2024-03-06 19:23 ` Andrew Lunn
2024-03-08 0:12 ` Antonio Quartulli
2024-03-08 2:04 ` Andrew Lunn
2024-03-08 11:00 ` Antonio Quartulli
2024-03-26 10:34 ` Esben Haabendal
2024-03-26 21:45 ` Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 07/22] ovpn: introduce the ovpn_socket object Antonio Quartulli
2024-03-05 14:59 ` Simon Horman
2024-03-06 15:08 ` Antonio Quartulli
2024-03-04 15:08 ` [PATCH net-next v2 08/22] ovpn: implement basic TX path (UDP) Antonio Quartulli
2024-03-05 19:47 ` Jakub Kicinski
2024-03-06 15:18 ` Antonio Quartulli
2024-03-08 15:31 ` Toke Høiland-Jørgensen
2024-03-08 15:44 ` Antonio Quartulli
2024-03-11 15:19 ` Toke Høiland-Jørgensen
2024-03-11 16:28 ` Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 09/22] ovpn: implement basic RX " Antonio Quartulli
2024-03-05 15:04 ` Simon Horman
2024-03-06 15:29 ` Antonio Quartulli
2024-03-08 2:17 ` Andrew Lunn
2024-03-08 11:07 ` Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 10/22] ovpn: implement packet processing Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 11/22] ovpn: store tunnel and transport statistics Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 12/22] ovpn: implement TCP transport Antonio Quartulli
2024-03-05 15:12 ` Simon Horman
2024-03-06 15:31 ` Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 13/22] ovpn: implement multi-peer support Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 14/22] ovpn: implement peer lookup logic Antonio Quartulli
2024-03-05 15:16 ` Simon Horman
2024-03-06 15:33 ` Antonio Quartulli
2024-03-06 0:11 ` kernel test robot
2024-03-09 10:16 ` kernel test robot
2024-03-04 15:09 ` [PATCH net-next v2 15/22] ovpn: implement keepalive mechanism Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 16/22] ovpn: add support for updating local UDP endpoint Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 17/22] ovpn: add support for peer floating Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 18/22] ovpn: implement peer add/dump/delete via netlink Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 19/22] ovpn: implement key add/del/swap " Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 20/22] ovpn: kill key and notify userspace in case of IV exhaustion Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 21/22] ovpn: notify userspace when a peer is deleted Antonio Quartulli
2024-03-04 15:09 ` [PATCH net-next v2 22/22] ovpn: add basic ethtool support Antonio Quartulli
2024-03-04 23:04 ` Andrew Lunn
2024-03-06 15:42 ` Antonio Quartulli
2024-03-06 19:40 ` Andrew Lunn
2024-03-08 0:21 ` Antonio Quartulli [this message]
2024-03-04 21:07 ` [PATCH net-next v2 00/22] Introducing OpenVPN Data Channel Offload Sergey Ryazanov
2024-03-05 19:30 ` Jakub Kicinski
2024-03-06 15:44 ` Antonio Quartulli
2024-03-06 16:13 ` Jakub Kicinski
2024-03-08 0:21 ` Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=97577da6-ab0d-474c-ab43-60958287d1e4@openvpn.net \
--to=antonio@openvpn.net \
--cc=andrew@lunn.ch \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).