[dpdk-dev] [PATCH 1/2] timer: use rte_mp_msg to pass TSC hz to secondary procs

Harris, James R james.r.harris at intel.com
Fri Aug 16 21:01:39 CEST 2019



On 8/16/19, 12:56 AM, "Burakov, Anatoly" <anatoly.burakov at intel.com> wrote:

    
    <snip>
    
    > @@ -89,6 +96,65 @@ set_tsc_freq(void)
    >   	eal_tsc_resolution_hz = freq;
    >   }
    >   
    > +static void
    > +set_tsc_freq_secondary(void)
    > +{
    > +	struct rte_mp_msg mp_req;
    > +	struct rte_mp_reply mp_reply;
    > +	struct timer_mp_param *r;
    > +	struct timespec ts = {.tv_sec = 1, .tv_nsec = 0};
    > +
    > +	memset(&mp_req, 0, sizeof(mp_req));
    > +	strcpy(mp_req.name, EAL_TIMER_MP);
    > +	if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) || mp_reply.nb_received != 1) {
    
    If rte_mp_request_sync returns 0 but mp_reply.nb_receieved isn't set to 
    1, you'll be leaking mp_reply.msgs.


Ha - of course you're right.  I didn't notice this when using the VFIO code as a reference for
how to code this.  I'll respin this patch and then push patches to fix the VFIO code separately.

Thanks,

-Jim



More information about the dev mailing list