If you ask to stamp all packets with HWTSTAMP_FILTER_ALL, then you can not get 
a reply of "plus some others". 
You ask for all, which more do you think you can get?

It does make sense as a reply in case of HWTS_FILTER_FULL.

enum hwtstamp_rx_filters {
        /* time stamp any incoming packet */
        HWTSTAMP_FILTER_ALL,

As of HWTS_FILTER_NORMAL case, your patch make sense.

Thanks
   Erez


________________________________________
From: Petr Machata [pe...@mellanox.com]
Sent: 11 June 2019 16:22
To: Geva, Erez (ext) (DI PA CI R&D 3)
Cc: linuxptp-devel@lists.sourceforge.net
Subject: Re: [PATCH v2] sk: Recognize HWTSTAMP_FILTER_SOME

Geva, Erez <erez.geva....@siemens.com> writes:

> Hi,
>
> The "cfg.rx_filter != HWTSTAMP_FILTER_ALL)) { "
>   line catch both filter mode is "HWTS_FILTER_FULL, and the fact that the 
> filter could is in a higher state for both HWTS_FILTER_NORMAL, 
> HWTS_FILTER_CHECK.
>
> Could you be more specific what does the HWTSTAMP_FILTER_SOME means?

>From net_tstamp.h:

/* possible values for hwtstamp_config->rx_filter */
enum hwtstamp_rx_filters {
        ...
        /* return value: time stamp all packets requested plus some others */
        HWTSTAMP_FILTER_SOME,
};

> For me, the HWTSTAMP_FILTER_SOME might be good when using filter mode
> "HWTS_FILTER_NORMAL".
>
> But when filter mode is "HWTS_FILTER_FULL" I would accept that the flag will 
> be HWTSTAMP_FILTER_ALL only.

If you make ALL acceptable, why not SOME? Both mean that the driver will
timestamp everything requested and more.

> What would you accept on filter mode HWTS_FILTER_CHECK?

I agree that for HWTS_FILTER_CHECK, SOME is not acceptable, which is why
I respun v3 of my patch.

> Full state machine:
>
> HWTS_FILTER_CHECK
>     get config
>     check if RX filter one of Rx filter 1, Rx filter 2, HWTSTAMP_FILTER_ALL
>     As HWTSTAMP_FILTER_ALL is a higher state
>
> HWTS_FILTER_NORMAL
>     set Rx filter 1
>     if fail set Rx filter 2
>     check if RX filter one of Rx filter 1, Rx filter 2, HWTSTAMP_FILTER_ALL
>     As HWTSTAMP_FILTER_ALL is a higher state
>
> HWTS_FILTER_FULL
>     set Rx filter HWTSTAMP_FILTER_ALL
>     check if RX filter one of Rx filter 1, Rx filter 2, HWTSTAMP_FILTER_ALL
>     Filter should be HWTSTAMP_FILTER_ALL,
>      but if NIc driver only set filter to be one of Rx filter 1, Rx filter 2 
> then the PTP daemon may proceed normally.
>
> Erez
>
> ________________________________________
> From: Petr Machata [pe...@mellanox.com]
> Sent: 10 June 2019 15:56
> To: linuxptp-devel@lists.sourceforge.net
> Subject: [Linuxptp-devel] [PATCH v2] sk: Recognize HWTSTAMP_FILTER_SOME
>
> struct hwtstamp_config.rx_filter passed to SIOCSHWTSTAMP can be updated by
> the kernel with the value of HWTSTAMP_FILTER_SOME. That indicates that all
> requested packets will be timestamped, and some others as well.
>
> Update hwts_init() to recognize this as a valid response, instead of
> rejecting it as mismatch.
>
> Signed-off-by: Petr Machata <pe...@mellanox.com>
> ---
>
> Notes:
>     v2: Fix whitespace.
>
>  sk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sk.c b/sk.c
> index 93ba77a..416d784 100644
> --- a/sk.c
> +++ b/sk.c
> @@ -105,7 +105,8 @@ static int hwts_init(int fd, const char *device, int 
> rx_filter,
>         if (cfg.tx_type != tx_type ||
>             (cfg.rx_filter != rx_filter &&
>              cfg.rx_filter != rx_filter2 &&
> -            cfg.rx_filter != HWTSTAMP_FILTER_ALL)) {
> +            cfg.rx_filter != HWTSTAMP_FILTER_ALL &&
> +            cfg.rx_filter != HWTSTAMP_FILTER_SOME)) {
>                 pr_debug("tx_type   %d not %d", cfg.tx_type, tx_type);
>                 pr_debug("rx_filter %d not %d or %d", cfg.rx_filter, 
> rx_filter,
>                          rx_filter2);


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to