* [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups
@ 2021-03-26 20:22 Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved Jakub Kicinski
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Jakub Kicinski @ 2021-03-26 20:22 UTC (permalink / raw)
To: davem; +Cc: netdev, andrew, mkubecek, Jakub Kicinski
A few touch ups from v1 review.
Jakub Kicinski (3):
ethtool: fec: add note about reuse of reserved
ethtool: fec: fix FEC_NONE check
ethtool: document the enum values not defines
include/uapi/linux/ethtool.h | 24 ++++++++++++++----------
net/ethtool/ioctl.c | 2 +-
2 files changed, 15 insertions(+), 11 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved
2021-03-26 20:22 [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups Jakub Kicinski
@ 2021-03-26 20:22 ` Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 2/3] ethtool: fec: fix FEC_NONE check Jakub Kicinski
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2021-03-26 20:22 UTC (permalink / raw)
To: davem; +Cc: netdev, andrew, mkubecek, Jakub Kicinski
struct ethtool_fecparam::reserved can't be used in SET, because
ethtool user space doesn't zero-initialize the structure.
Make this clear.
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/uapi/linux/ethtool.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index f6ef7d42c7a1..9a47c3efd8ca 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1382,6 +1382,10 @@ struct ethtool_per_queue_op {
* @fec: Bitmask of configured FEC modes.
* @reserved: Reserved for future extensions, ignore on GET, write 0 for SET.
*
+ * Note that @reserved was never validated on input and ethtool user space
+ * left it uninitialized when calling SET. Hence going forward it can only be
+ * used to return a value to userspace with GET.
+ *
* FEC modes supported by the device can be read via %ETHTOOL_GLINKSETTINGS.
* FEC settings are configured by link autonegotiation whenever it's enabled.
* With autoneg on %ETHTOOL_GFECPARAM can be used to read the current mode.
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 2/3] ethtool: fec: fix FEC_NONE check
2021-03-26 20:22 [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved Jakub Kicinski
@ 2021-03-26 20:22 ` Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 3/3] ethtool: document the enum values not defines Jakub Kicinski
2021-03-26 23:00 ` [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2021-03-26 20:22 UTC (permalink / raw)
To: davem
Cc: netdev, andrew, mkubecek, Jakub Kicinski, kernel test robot,
Dan Carpenter
Dan points out we need to use the mask not the bit (which is 0).
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 42ce127d9864 ("ethtool: fec: sanitize ethtool_fecparam->fec")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/ethtool/ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 8797533ddc4b..26b3e7086075 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -2586,7 +2586,7 @@ static int ethtool_set_fecparam(struct net_device *dev, void __user *useraddr)
if (copy_from_user(&fecparam, useraddr, sizeof(fecparam)))
return -EFAULT;
- if (!fecparam.fec || fecparam.fec & ETHTOOL_FEC_NONE_BIT)
+ if (!fecparam.fec || fecparam.fec & ETHTOOL_FEC_NONE)
return -EINVAL;
fecparam.active_fec = 0;
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next 3/3] ethtool: document the enum values not defines
2021-03-26 20:22 [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 2/3] ethtool: fec: fix FEC_NONE check Jakub Kicinski
@ 2021-03-26 20:22 ` Jakub Kicinski
2021-03-26 23:00 ` [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2021-03-26 20:22 UTC (permalink / raw)
To: davem; +Cc: netdev, andrew, mkubecek, Jakub Kicinski
kdoc does not have good support for documenting defines,
and we can't abuse the enum documentation because it
generates warnings.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
include/uapi/linux/ethtool.h | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 9a47c3efd8ca..868b513d4f54 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1414,16 +1414,16 @@ struct ethtool_fecparam {
/**
* enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration
- * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported. Should not
- * be used together with other bits. GET only.
- * @ETHTOOL_FEC_AUTO: Select default/best FEC mode automatically, usually based
- * link mode and SFP parameters read from module's EEPROM.
- * This bit does _not_ mean autonegotiation.
- * @ETHTOOL_FEC_OFF: No FEC Mode
- * @ETHTOOL_FEC_RS: Reed-Solomon FEC Mode
- * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon FEC Mode
- * @ETHTOOL_FEC_LLRS: Low Latency Reed Solomon FEC Mode (25G/50G Ethernet
- * Consortium)
+ * @ETHTOOL_FEC_NONE_BIT: FEC mode configuration is not supported. Should not
+ * be used together with other bits. GET only.
+ * @ETHTOOL_FEC_AUTO_BIT: Select default/best FEC mode automatically, usually
+ * based link mode and SFP parameters read from module's
+ * EEPROM. This bit does _not_ mean autonegotiation.
+ * @ETHTOOL_FEC_OFF_BIT: No FEC Mode
+ * @ETHTOOL_FEC_RS_BIT: Reed-Solomon FEC Mode
+ * @ETHTOOL_FEC_BASER_BIT: Base-R/Reed-Solomon FEC Mode
+ * @ETHTOOL_FEC_LLRS_BIT: Low Latency Reed Solomon FEC Mode (25G/50G Ethernet
+ * Consortium)
*/
enum ethtool_fec_config_bits {
ETHTOOL_FEC_NONE_BIT,
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups
2021-03-26 20:22 [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups Jakub Kicinski
` (2 preceding siblings ...)
2021-03-26 20:22 ` [PATCH net-next 3/3] ethtool: document the enum values not defines Jakub Kicinski
@ 2021-03-26 23:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-26 23:00 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, andrew, mkubecek
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
On Fri, 26 Mar 2021 13:22:20 -0700 you wrote:
> A few touch ups from v1 review.
>
> Jakub Kicinski (3):
> ethtool: fec: add note about reuse of reserved
> ethtool: fec: fix FEC_NONE check
> ethtool: document the enum values not defines
>
> [...]
Here is the summary with links:
- [net-next,1/3] ethtool: fec: add note about reuse of reserved
https://git.kernel.org/netdev/net-next/c/ad1cd7856d87
- [net-next,2/3] ethtool: fec: fix FEC_NONE check
https://git.kernel.org/netdev/net-next/c/cf2cc0bf4fde
- [net-next,3/3] ethtool: document the enum values not defines
https://git.kernel.org/netdev/net-next/c/d04feecaf154
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-26 23:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-26 20:22 [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 1/3] ethtool: fec: add note about reuse of reserved Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 2/3] ethtool: fec: fix FEC_NONE check Jakub Kicinski
2021-03-26 20:22 ` [PATCH net-next 3/3] ethtool: document the enum values not defines Jakub Kicinski
2021-03-26 23:00 ` [PATCH net-next 0/3] ethtool: fec: ioctl kdoc touch ups patchwork-bot+netdevbpf
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).