Re: [Linuxptp-devel] [PATCH v2] ptp4l: Add profile_id configuration support for G.8275.1 and G.8275.2.

2022-11-02 Thread Izunna Otiji
Hi Maciek,

I can update the identifier for each profile to reflect the changes made in 
amendment 2. I also want to note that the profile identifiers used below are 
not invalid but reflect which edition of the recommendation was used for the 
implementation :
- 00-19-A7-01-02-01 (G.8275.1/Y.1369.1 (03/2020))
- 00-19-A7-02-01-00 (G.8275.2/Y.1369.2 (03/2020))

Thanks,
Izunna

-Original Message-
From: Maciek Machnikowski  
Sent: Wednesday, November 2, 2022 3:51 AM
To: Izunna Otiji 
Cc: linuxptp-devel@lists.sourceforge.net
Subject: Re: [Linuxptp-devel] [PATCH v2] ptp4l: Add profile_id configuration 
support for G.8275.1 and G.8275.2.

On Mon, Oct 31, 2022 at 04:49:57PM -0400, izunna.otiji...@renesas.com wrote:
> From: Izunna Otiji 
> 
> Signed-off-by: Izunna Otiji 
> ---
>  port.c | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/port.c b/port.c
> index 871ad68..34c0c09 100644
> --- a/port.c
> +++ b/port.c
> @@ -831,6 +831,8 @@ static void port_management_send_error(struct port 
> *p, struct port *ingress,
>  
>  static const Octet profile_id_drr[] = {0x00, 0x1B, 0x19, 0x00, 0x01, 
> 0x00};  static const Octet profile_id_p2p[] = {0x00, 0x1B, 0x19, 0x00, 
> 0x02, 0x00};
> +static const Octet profile_id_8275_1[] = {0x00, 0x19, 0xA7, 0x01, 
> +0x02, 0x01}; static const Octet profile_id_8275_2[] = {0x00, 0x19, 
> +0xA7, 0x02, 0x01, 0x00};

NAK.
The values listed here are invalid.
G.8275.1 Amd2: profileIdentifier:
 - 00-19-A7-01-02-02 (for an implementation based on IEEE Std 1588-2008 [IEEE 
1588-2008])
 - 00-19-A7-01-02-03 (for an implementation based on IEEE Std 1588-2019 [IEEE 
1588-2019])

G.8275.2 Amd2: profileIdentifier:
 - 00-19-A7-02-01-01 (for an implementation based on IEEE Std 1588-2008 [IEEE 
1588-2008])
 - 00-19-A7-02-01-02 (for an implementation based on IEEE Std 1588-2019 [IEEE 
1588-2019])

Regards
Maciek


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


Re: [Linuxptp-devel] [PATCH] ptp4l: Add profile_id configuration support for G.8275.1 and G.8275.2.

2022-10-20 Thread Izunna Otiji
Hi Richard,

Yes, the new method to get the configuration instance is unnecessary, thanks 
for the review and comments. 

Regards,
Izunna

-Original Message-
From: Richard Cochran  
Sent: Saturday, October 15, 2022 1:17 AM
To: Izunna Otiji 
Cc: linuxptp-devel@lists.sourceforge.net
Subject: Re: [Linuxptp-devel] [PATCH] ptp4l: Add profile_id configuration 
support for G.8275.1 and G.8275.2.

On Tue, Aug 16, 2022 at 01:08:35PM -0400, izunna.otiji...@renesas.com wrote:
> From: Izunna Otiji 
> 
> Signed-off-by: Izunna Otiji 
> ---
>  port.c  | 13 -
>  transport.c |  5 +
>  transport.h |  5 +
>  3 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/port.c b/port.c
> index 871ad68..acdf1e5 100644
> --- a/port.c
> +++ b/port.c
> @@ -831,6 +831,8 @@ static void port_management_send_error(struct port 
> *p, struct port *ingress,
>  
>  static const Octet profile_id_drr[] = {0x00, 0x1B, 0x19, 0x00, 0x01, 
> 0x00};  static const Octet profile_id_p2p[] = {0x00, 0x1B, 0x19, 0x00, 
> 0x02, 0x00};
> +static const Octet profile_id_8275_1[] = {0x00, 0x19, 0xA7, 0x01, 
> +0x02, 0x01}; static const Octet profile_id_8275_2[] = {0x00, 0x19, 
> +0xA7, 0x02, 0x01, 0x00};
>  
>  static int port_management_fill_response(struct port *target,
>struct ptp_message *rsp, int id) @@ 
> -926,7 +928,16 @@ static 
> int port_management_fill_response(struct port *target,
>   if (target->delayMechanism == DM_P2P) {
>   memcpy(buf, profile_id_p2p, PROFILE_ID_LEN);
>   } else {
> - memcpy(buf, profile_id_drr, PROFILE_ID_LEN);
> + if (config_get_int(transport_config(target->trp), NULL, 
> +"dataset_comparison") ==

Please don't nest function calls in function arguments.

> + DS_CMP_G8275) {
> + if (transport_type(target->trp) == 
> TRANS_IEEE_802_3) {
> + memcpy(buf, profile_id_8275_1, 
> PROFILE_ID_LEN);
> + } else {
> + memcpy(buf, profile_id_8275_2, 
> PROFILE_ID_LEN);
> + }
> + } else {
> + memcpy(buf, profile_id_drr, PROFILE_ID_LEN);
> + }
>   }
>   buf += PROFILE_ID_LEN;
>   datalen = buf - tlv->data;
> diff --git a/transport.c b/transport.c index 9366fbf..41ca999 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -98,6 +98,11 @@ enum transport_type transport_type(struct transport *t)
>   return t->type;
>  }
>  
> +struct config* transport_config(struct transport *t) {
> + return t->cfg;
> +}
> +

This new method is superfluous.

The port instance already has a pointer to the clock instance, and this, in 
turn, stores a pointer to the configuration instance.

So, in the case of port_management_fill_response(), you can do:

struct config *cfg = clock_config(target->clock);

See?

Thanks,
Richard


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