linux/drivers/net/ethernet/intel/ice
Jacob Keller d9f3e9ecc4 net: ptp: introduce .supported_perout_flags to ptp_clock_info
The PTP_PEROUT_REQUEST2 ioctl has gained support for flags specifying
specific output behavior including PTP_PEROUT_ONE_SHOT,
PTP_PEROUT_DUTY_CYCLE, PTP_PEROUT_PHASE.

Driver authors are notorious for not checking the flags of the request.
This results in misinterpreting the request, generating an output signal
that does not match the requested value. It is anticipated that even more
flags will be added in the future, resulting in even more broken requests.

Expecting these issues to be caught during review or playing whack-a-mole
after the fact is not a great solution.

Instead, introduce the supported_perout_flags field in the ptp_clock_info
structure. Update the core character device logic to explicitly reject any
request which has a flag not on this list.

This ensures that drivers must 'opt in' to the flags they support. Drivers
which don't set the .supported_perout_flags field will not need to check
that unsupported flags aren't passed, as the core takes care of this.

Update the drivers which do support flags to set this new field.

Note the following driver files set n_per_out to a non-zero value but did
not check the flags at all:

 • drivers/ptp/ptp_clockmatrix.c
 • drivers/ptp/ptp_idt82p33.c
 • drivers/ptp/ptp_fc3.c
 • drivers/net/ethernet/ti/am65-cpts.c
 • drivers/net/ethernet/aquantia/atlantic/aq_ptp.c
 • drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
 • drivers/net/dsa/sja1105/sja1105_ptp.c
 • drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
 • drivers/net/ethernet/mscc/ocelot_vsc7514.c
 • drivers/net/ethernet/intel/i40e/i40e_ptp.c

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20250414-jk-supported-perout-flags-v2-2-f6b17d15475c@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-04-15 20:20:58 -07:00
..
devlink Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-26 09:32:10 -07:00
Makefile ice: add Tx hang devlink health reporter 2024-12-17 11:32:46 -08:00
ice.h ice: enable timesync operation on 2xNAC E825 devices 2025-04-11 10:46:37 -07:00
ice_adapter.c ice: Use ice_adapter for PTP shared data instead of auxdev 2024-10-01 11:11:38 -07:00
ice_adapter.h ice: Use ice_adapter for PTP shared data instead of auxdev 2024-10-01 11:11:38 -07:00
ice_adminq_cmd.h ice: remove invalid parameter of equalizer 2025-01-24 10:49:42 -08:00
ice_arfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-03-13 23:08:11 +01:00
ice_arfs.h ice: use napi's irq affinity and rmap IRQ notifiers 2025-02-26 19:51:37 -08:00
ice_base.c ice: use napi's irq affinity and rmap IRQ notifiers 2025-02-26 19:51:37 -08:00
ice_base.h
ice_cgu_regs.h
ice_common.c ice: enable timesync operation on 2xNAC E825 devices 2025-04-11 10:46:37 -07:00
ice_common.h ice: do not add LLDP-specific filter if not necessary 2025-04-11 09:44:26 -07:00
ice_controlq.c ice: Report NVM version numbers on mismatch during load 2024-08-26 09:47:13 -07:00
ice_controlq.h ice: remove unnecessary control queue cmd_buf arrays 2024-08-26 09:46:14 -07:00
ice_dcb.c
ice_dcb.h
ice_dcb_lib.c ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_dcb_lib.h
ice_dcb_nl.c
ice_dcb_nl.h
ice_ddp.c ice: Remove unnecessary ice_is_e8xx() functions 2025-02-10 10:43:36 -08:00
ice_ddp.h ice: support optional flags in signature segment header 2024-11-13 10:30:09 -08:00
ice_debugfs.c
ice_devids.h
ice_dpll.c ice: dpll: Remove newline at the end of a netlink error message 2025-02-27 18:11:38 -08:00
ice_dpll.h ice: add callbacks for Embedded SYNC enablement on dpll pins 2024-08-26 19:21:14 -07:00
ice_eswitch.c ice: enable LLDP TX for VFs through tc 2025-04-11 10:45:52 -07:00
ice_eswitch.h ice: rename devlink_port.[ch] to port.[ch] 2024-12-17 09:32:08 -08:00
ice_eswitch_br.c ice: Flush FDB entries before reset 2024-10-08 14:08:19 -07:00
ice_eswitch_br.h ice: Flush FDB entries before reset 2024-10-08 14:08:19 -07:00
ice_ethtool.c ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_ethtool.h ice: remove invalid parameter of equalizer 2025-01-24 10:49:42 -08:00
ice_ethtool_fdir.c ice: make const read-only array dflt_rules static 2025-04-11 11:58:57 -07:00
ice_fdir.c
ice_fdir.h ice: change q_index variable type to s16 to store -1 value 2024-11-04 13:09:33 -08:00
ice_flex_pipe.c
ice_flex_pipe.h ice: Cleanup unused declarations 2024-10-08 15:22:32 -07:00
ice_flex_type.h
ice_flow.c
ice_flow.h
ice_fltr.c
ice_fltr.h
ice_fw_update.c ice: support FW Recovery Mode 2025-01-16 13:05:06 -08:00
ice_fw_update.h
ice_fwlog.c
ice_fwlog.h
ice_gnss.c ice: Don't check device type when checking GNSS presence 2025-02-10 08:52:04 -08:00
ice_gnss.h ice: Don't check device type when checking GNSS presence 2025-02-10 08:52:04 -08:00
ice_hw_autogen.h ice: Implement PTP support for E830 devices 2025-02-10 10:43:48 -08:00
ice_hwmon.c
ice_hwmon.h
ice_idc.c ice, irdma: move interrupts code to irdma 2025-02-05 09:04:57 -08:00
ice_idc_int.h
ice_irq.c ice: Fix signedness bug in ice_init_interrupt_scheme() 2025-02-14 17:18:00 -08:00
ice_irq.h ice: simplify VF MSI-X managing 2025-02-05 09:04:57 -08:00
ice_lag.c ice: Fix switchdev slow-path in LAG 2025-03-05 08:43:05 -08:00
ice_lag.h
ice_lan_tx_rx.h ice: Add E830 checksum offload support 2025-03-18 10:15:49 +01:00
ice_lib.c ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_lib.h ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_main.c ice: support egress drop rules on PF 2025-04-11 09:47:43 -07:00
ice_nvm.c
ice_nvm.h
ice_osdep.h
ice_parser.c
ice_parser.h ice: fix ice_parser_rt::bst_key array size 2025-01-24 10:49:30 -08:00
ice_parser_rt.c ice: fix ice_parser_rt::bst_key array size 2025-01-24 10:49:30 -08:00
ice_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h
ice_ptp.c net: ptp: introduce .supported_perout_flags to ptp_clock_info 2025-04-15 20:20:58 -07:00
ice_ptp.h ice: support Rx timestamp on flex descriptor 2025-02-14 10:57:45 -08:00
ice_ptp_consts.h ice: Refactor E825C PHY registers info struct 2025-03-18 10:15:49 +01:00
ice_ptp_hw.c ice: enable timesync operation on 2xNAC E825 devices 2025-04-11 10:46:37 -07:00
ice_ptp_hw.h ice: enable timesync operation on 2xNAC E825 devices 2025-04-11 10:46:37 -07:00
ice_repr.c ice: enable LLDP TX for VFs through tc 2025-04-11 10:45:52 -07:00
ice_repr.h ice: check if SF is ready in ethtool ops 2024-09-06 11:01:24 -07:00
ice_sbq_cmd.h ice: refactor ice_sbq_msg_dev enum 2025-04-11 10:46:37 -07:00
ice_sched.c ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node() 2024-08-26 09:49:57 -07:00
ice_sched.h
ice_sf_eth.c ice: rename devlink_port.[ch] to port.[ch] 2024-12-17 09:32:08 -08:00
ice_sf_eth.h ice: subfunction activation and base devlink ops 2024-09-06 11:01:24 -07:00
ice_sf_vsi_vlan_ops.c ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00
ice_sf_vsi_vlan_ops.h ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00
ice_sriov.c ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_sriov.h
ice_switch.c ice: fix check for existing switch rule 2025-04-11 09:32:31 -07:00
ice_switch.h
ice_tc_lib.c ice: improve error message for insufficient filter space 2025-04-11 11:58:57 -07:00
ice_tc_lib.h ice: enable LLDP TX for VFs through tc 2025-04-11 10:45:52 -07:00
ice_trace.h
ice_txrx.c ice: support egress drop rules on PF 2025-04-11 09:47:43 -07:00
ice_txrx.h ice: Add E830 checksum offload support 2025-03-18 10:15:49 +01:00
ice_txrx_lib.c ice: Add E830 checksum offload support 2025-03-18 10:15:49 +01:00
ice_txrx_lib.h ice: stop storing XDP verdict within ice_rx_buf 2025-01-31 10:07:46 -08:00
ice_type.h ice: enable timesync operation on 2xNAC E825 devices 2025-04-11 10:46:37 -07:00
ice_vf_lib.c ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_vf_lib.h ice: enable LLDP TX for VFs through tc 2025-04-11 10:45:52 -07:00
ice_vf_lib_private.h ice: Fix deinitializing VF in error path 2025-02-25 19:09:36 -08:00
ice_vf_mbx.c ice: add E830 HW VF mailbox message limit support 2024-10-08 14:37:15 -07:00
ice_vf_mbx.h ice: add E830 HW VF mailbox message limit support 2024-10-08 14:37:15 -07:00
ice_vf_vsi_vlan_ops.c
ice_vf_vsi_vlan_ops.h
ice_virtchnl.c ice: receive LLDP on trusted VFs 2025-04-11 09:45:30 -07:00
ice_virtchnl.h ice: support Rx timestamp on flex descriptor 2025-02-14 10:57:45 -08:00
ice_virtchnl_allowlist.c ice: support Rx timestamp on flex descriptor 2025-02-14 10:57:45 -08:00
ice_virtchnl_allowlist.h
ice_virtchnl_fdir.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ice_virtchnl_fdir.h
ice_vlan.h
ice_vlan_mode.c
ice_vlan_mode.h
ice_vsi_vlan_lib.c ice: clear port vlan config during reset 2024-09-30 14:23:31 -07:00
ice_vsi_vlan_lib.h ice: clear port vlan config during reset 2024-09-30 14:23:31 -07:00
ice_vsi_vlan_ops.c ice: basic support for VLAN in subfunctions 2024-09-06 11:01:24 -07:00
ice_vsi_vlan_ops.h
ice_xsk.c ice: use generic unrolled_count() macro 2025-02-10 17:54:43 -08:00
ice_xsk.h ice: use generic unrolled_count() macro 2025-02-10 17:54:43 -08:00