[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200709000343.k22d2kxaq3ix3o5i@lion.mk-sys.cz>
Date: Thu, 9 Jul 2020 02:03:43 +0200
From: Michal Kubecek <mkubecek@...e.cz>
To: Jakub Kicinski <kuba@...nel.org>
Cc: davem@...emloft.net, netdev@...r.kernel.org, saeedm@...lanox.com,
michael.chan@...adcom.com, edwin.peer@...adcom.com,
emil.s.tantilov@...el.com, alexander.h.duyck@...ux.intel.com,
jeffrey.t.kirsher@...el.com, tariqt@...lanox.com
Subject: Re: [PATCH net-next 4/9] ethtool: add tunnel info interface
On Wed, Jul 08, 2020 at 04:30:49PM -0700, Jakub Kicinski wrote:
> > > + ETHTOOL_A_TUNNEL_UDP_TABLE_ENTRY, /* nest - _UDP_ENTRY_* */
> > > +
> > > + /* add new constants above here */
> > > + __ETHTOOL_A_TUNNEL_UDP_TABLE_CNT,
> > > + ETHTOOL_A_TUNNEL_UDP_TABLE_MAX = (__ETHTOOL_A_TUNNEL_UDP_TABLE_CNT - 1)
> > > +};
> > > +
> > > +enum {
> > > + ETHTOOL_A_TUNNEL_UDP_ENTRY_UNSPEC,
> > > +
> > > + ETHTOOL_A_TUNNEL_UDP_ENTRY_PORT, /* be16 */
> >
> > Do we get some benefit from passing the port in network byte order? It
> > would be helpful if we expected userspace to copy it e.g. into struct
> > sockaddr_in but that doesn't seem to be the case.
Let's leave it as be16 for consistency then.
> > How big can the message get? Can we be sure the information for one
> > device will always fit into a reasonably sized message? Attribute
> > ETHTOOL_A_TUNNEL_INFO_UDP_PORTS is limited by 65535 bytes (attribute
> > size is u16), can we always fit into this size?
>
> I don't think I've seen any driver with more than 2 tables
> or 16 entries total, and they don't seem to be growing in newer
> HW (people tend to use standard ports).
>
> 188B + 16 * 20B = 508B - so we should be pretty safe with 64k.
So we are safe even if things grow by a factor of 100. Sounds good
enough, thanks.
Michal
Powered by blists - more mailing lists