net: ethtool: add helpers for MM fragment size translation
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 19 Jan 2023 12:26:59 +0000 (14:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Jan 2023 12:44:18 +0000 (12:44 +0000)
commitdd1c41645039d3820a7dde40e11f601c56240c40
treebc97d215e571e5b384553b833a64c7fdb7171523
parent449c5459641ad72a504884abb9fb9b19ee31397b
net: ethtool: add helpers for MM fragment size translation

We deliberately make the Linux UAPI pass the minimum fragment size in
octets, even though IEEE 802.3 defines it as discrete values, and
addFragSize is just the multiplier. This is because there is nothing
impossible in operating with an in-between value for the fragment size
of non-final preempted fragments, and there may even appear hardware
which supports the in-between sizes.

For the hardware which just understands the addFragSize multiplier,
create two helpers which translate back and forth the values passed in
octets.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/ethtool.h