On 9/30/2024 9:42 AM, Mingjin Ye wrote: > This patch adds PI servo algorithm to support frequency > adjustment API for IEEE1588 PTP. > > For example, the command for starting ptpclient with PI algorithm is: > ./build/examples/dpdk-ptpclient -a 0000:81:00.0 -c 1 -n 3 -- -T 0 -p 0x1 > --controller=pi > > Signed-off-by: Simei Su <simei...@intel.com> > Signed-off-by: Wenjun Wu <wenjun1...@intel.com> > Signed-off-by: Mingjin Ye <mingjinx...@intel.com> > --- > examples/ptpclient/ptpclient.c | 303 +++++++++++++++++++++++++++++---- > 1 file changed, 268 insertions(+), 35 deletions(-) >
It can be good to update the sample application document for this update. Also can you please provide more information how this sample can be used to test the application. What is the environment, how to verify the function is working etc.. This can be documented in the sample application document if makes sense, if not in the commit log. <...> > @@ -724,6 +941,11 @@ ptp_parse_args(int argc, char **argv) > > ptp_data.kernel_time_set = ret; > break; > + case 0: > + if (!strcmp(lgopts[option_index].name, "controller")) > + if (!strcmp(optarg, "pi")) > + mode = MODE_PI; > Please use "struct option lgopts" for the return values of 'getopt_long()', instead of strcmp. 'l2fwd' (l2fwd_parse_args()) has sample usage.