All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 12/13] mlx5: Reject requests to enable time stamping on both edges.
@ 2019-11-14 18:45 ` Richard Cochran
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Cochran @ 2019-11-14 18:45 UTC (permalink / raw)
  To: netdev
  Cc: intel-wired-lan, David Miller, Brandon Streiff, Christopher Hall,
	Eugenia Emantayev, Felipe Balbi, Feras Daoud, Jacob Keller,
	Jeffrey Kirsher, Sergei Shtylyov, Stefan Sorensen

This driver enables rising edge or falling edge, but not both, and so
this patch validates that the request contains only one of the two
edges.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index 819097d9b583..43f97601b500 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -243,6 +243,12 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
 				PTP_STRICT_FLAGS))
 		return -EOPNOTSUPP;
 
+	/* Reject requests to enable time stamping on both edges. */
+	if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
+	    (rq->extts.flags & PTP_ENABLE_FEATURE) &&
+	    (rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
+		return -EOPNOTSUPP;
+
 	if (rq->extts.index >= clock->ptp_info.n_pins)
 		return -EINVAL;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] [PATCH net 12/13] mlx5: Reject requests to enable time stamping on both edges.
@ 2019-11-14 18:45 ` Richard Cochran
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Cochran @ 2019-11-14 18:45 UTC (permalink / raw)
  To: intel-wired-lan

This driver enables rising edge or falling edge, but not both, and so
this patch validates that the request contains only one of the two
edges.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
index 819097d9b583..43f97601b500 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
@@ -243,6 +243,12 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
 				PTP_STRICT_FLAGS))
 		return -EOPNOTSUPP;
 
+	/* Reject requests to enable time stamping on both edges. */
+	if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
+	    (rq->extts.flags & PTP_ENABLE_FEATURE) &&
+	    (rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
+		return -EOPNOTSUPP;
+
 	if (rq->extts.index >= clock->ptp_info.n_pins)
 		return -EINVAL;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 12/13] mlx5: Reject requests to enable time stamping on both edges.
  2019-11-14 18:45 ` [Intel-wired-lan] " Richard Cochran
@ 2019-11-15  0:04   ` Saeed Mahameed
  -1 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-11-15  0:04 UTC (permalink / raw)
  To: richardcochran, netdev
  Cc: christopher.s.hall, Eugenia Emantayev, davem, sergei.shtylyov,
	Feras Daoud, stefan.sorensen, brandon.streiff, jacob.e.keller,
	jeffrey.t.kirsher, intel-wired-lan, felipe.balbi

On Thu, 2019-11-14 at 10:45 -0800, Richard Cochran wrote:
> This driver enables rising edge or falling edge, but not both, and so
> this patch validates that the request contains only one of the two
> edges.
> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> index 819097d9b583..43f97601b500 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> @@ -243,6 +243,12 @@ static int mlx5_extts_configure(struct
> ptp_clock_info *ptp,
>  				PTP_STRICT_FLAGS))
>  		return -EOPNOTSUPP;
>  
> +	/* Reject requests to enable time stamping on both edges. */
> +	if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
> +	    (rq->extts.flags & PTP_ENABLE_FEATURE) &&
> +	    (rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
> +		return -EOPNOTSUPP;
> +
>  	if (rq->extts.index >= clock->ptp_info.n_pins)
>  		return -EINVAL;
>  


Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] [PATCH net 12/13] mlx5: Reject requests to enable time stamping on both edges.
@ 2019-11-15  0:04   ` Saeed Mahameed
  0 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2019-11-15  0:04 UTC (permalink / raw)
  To: intel-wired-lan

On Thu, 2019-11-14 at 10:45 -0800, Richard Cochran wrote:
> This driver enables rising edge or falling edge, but not both, and so
> this patch validates that the request contains only one of the two
> edges.
> 
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> index 819097d9b583..43f97601b500 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
> @@ -243,6 +243,12 @@ static int mlx5_extts_configure(struct
> ptp_clock_info *ptp,
>  				PTP_STRICT_FLAGS))
>  		return -EOPNOTSUPP;
>  
> +	/* Reject requests to enable time stamping on both edges. */
> +	if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
> +	    (rq->extts.flags & PTP_ENABLE_FEATURE) &&
> +	    (rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
> +		return -EOPNOTSUPP;
> +
>  	if (rq->extts.index >= clock->ptp_info.n_pins)
>  		return -EINVAL;
>  


Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-15  0:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 18:45 [PATCH net 12/13] mlx5: Reject requests to enable time stamping on both edges Richard Cochran
2019-11-14 18:45 ` [Intel-wired-lan] " Richard Cochran
2019-11-15  0:04 ` Saeed Mahameed
2019-11-15  0:04   ` [Intel-wired-lan] " Saeed Mahameed

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.