Skip to content

Commit

Permalink
SWPTP-1535: inhibit sync flag setting with avoid_efx_ioctl
Browse files Browse the repository at this point in the history
  • Loading branch information
abower-amd committed Nov 18, 2024
1 parent eb0c605 commit 8d64147
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Added

- Add `avoid_efx_ioctl` option to avoid sfc proprietary ioctl(). (SWPTP-1535)
- This prevents setting of the sync flags optionally used by Onload.

### Fixed

- Issue SWPTP-1506
Expand Down
5 changes: 2 additions & 3 deletions src/sfptpd_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ static int renew_clock(struct sfptpd_clock *clock)
/* Set the primary interface for the clock and get the PHC
* supported flag and device index. */
clock->u.nic.primary_if = primary;
clock->u.nic.supports_sync_status_reporting = true;
clock->u.nic.supports_sync_status_reporting = !clock->cfg_avoid_efx;
clock->u.nic.device_idx = phc_idx;
clock->u.nic.supports_efx = supports_efx;

Expand Down Expand Up @@ -2219,8 +2219,7 @@ int sfptpd_clock_set_sync_status(struct sfptpd_clock *clock, bool in_sync,
goto finish;
}

/* Update the sync status via a private IOCTL.
Ignore clock->cfg_avoid_efx because there is no alternative mechanism. */
/* Update the sync status via a private IOCTL unless inhibited. */
memset(&sfc_req, 0, sizeof(sfc_req));
sfc_req.cmd = EFX_TS_SET_SYNC_STATUS;
sfc_req.u.ts_set_sync_status.in_sync = in_sync? 1: 0;
Expand Down
6 changes: 3 additions & 3 deletions src/sfptpd_general_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ static const sfptpd_config_option_t config_general_options[] =
parse_assume_one_phc_per_nic,
.dfl = SFPTPD_CONFIG_DFL_BOOL(SFPTPD_DEFAULT_ASSUME_ONE_PHC_PER_NIC)},
{"avoid_efx_ioctl", "<off | on>",
"Specify whether to avoid private SIOCEFX ioctl for Solarflare "
"adapters where possible",
"Specify whether to avoid private SIOCEFX ioctl for Solarflare adapters. "
"This prevents use of the sync flag via Onload",
1, SFPTPD_CONFIG_SCOPE_GLOBAL,
parse_avoid_efx_ioctl,
.dfl = SFPTPD_CONFIG_DFL_BOOL(false),
.hidden = true},
},
{"phc_diff_methods", "<sys-offset-precise | efx | pps | sys-offset-ext | sys-offset | read-time>*",
"Define the list of PHC diff methods used",
~1, SFPTPD_CONFIG_SCOPE_GLOBAL,
Expand Down

0 comments on commit 8d64147

Please sign in to comment.