[dpdk-dev] [PATCH v3 4/7] ethdev: synchronize port allocation
Matan Azrad
matan at mellanox.com
Thu Jan 18 21:52:13 CET 2018
From: Thomas Monjalon, Thursday, January 18, 2018 10:44 PM
> 18/01/2018 17:35, Matan Azrad:
> > rte_eth_dev_allocate(const char *name) {
> > uint16_t port_id;
> > - struct rte_eth_dev *eth_dev;
> > + struct rte_eth_dev *eth_dev = NULL;
> > +
> > + /* Synchronize share data one time allocation between local
> > + threads. */
>
> I don't understand the "one time" part of this comment.
> Please could you try to rephrase it?
>
One-time means this allocation will run only 1 time.
After the first allocation the pointer is not null, so no calling anymore to this function.
> > + rte_spinlock_lock(&rte_eth_share_data_alloc);
> > + if (rte_eth_dev_share_data == NULL)
> > + rte_eth_dev_share_data_alloc();
> > + rte_spinlock_unlock(&rte_eth_share_data_alloc);
>
> I think the correct wording is "shared data", instead of "share data".
Yes you right - will change it.
More information about the dev
mailing list