On 01-Jul-20 9:23 PM, Stephen Hemminger wrote:
> Replace rte_get_master_lcore() with rte_get_initial_lcore().
> Replace RTE_LCORE_FOREACH_SLAVE with RTE_LCORE_FOREACH_WORKER
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Comments in pci_common_uio.c:54 and vmbus_common_uio.c:88 refers to
secondary process as "slave", should probably fix that too.
You mentioned "bonding" driver as needing work but there's actually a
whole bunch of instances of such terminology being used internally in
other drivers as well (e.g. cryptodev scheduler). A quick grep on
"master|slave" gives us a huge list of files, and while some of them are
spec terms (e.g. PCI bus mastering), a lot of them aren't. I'm of course
not suggesting it all should be done in this patch, just noting that
bonding isn't the only driver needing work :)
As for contents of this patch (provided the corrections mentioned above
are done),
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
@@ -260,7 +260,7 @@ int rte_dpaa_portal_init(void *arg)
BUS_INIT_FUNC_TRACE();
if ((size_t)arg == 1 || lcore == LCORE_ID_ANY)
- lcore = rte_get_master_lcore();
+ lcore = rte_get_initial_lcore();
else
if (lcore >= RTE_MAX_LCORE)
return -1;
@@ -195,7 +195,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int lcoreid)
/* Set the Stashing Destination */
if (lcoreid < 0) {
- lcoreid = rte_get_master_lcore();
+ lcoreid = rte_get_initial_lcore();
if (lcoreid < 0) {
DPAA2_BUS_ERR("Getting CPU Index failed");
return -1;
@@ -259,7 +259,7 @@ dpaa2_affine_qbman_swp(void)
uint64_t tid = syscall(SYS_gettid);
if (lcore_id == LCORE_ID_ANY)
- lcore_id = rte_get_master_lcore();
+ lcore_id = rte_get_initial_lcore();
/* if the core id is not supported */
else if (lcore_id >= RTE_MAX_LCORE)
return -1;
@@ -307,7 +307,7 @@ dpaa2_affine_qbman_ethrx_swp(void)
uint64_t tid = syscall(SYS_gettid);
if (lcore_id == LCORE_ID_ANY)
- lcore_id = rte_get_master_lcore();
+ lcore_id = rte_get_initial_lcore();
/* if the core id is not supported */
else if (lcore_id >= RTE_MAX_LCORE)
return -1;
@@ -429,7 +429,7 @@ int bnxt_alloc_rxtx_nq_ring(struct bnxt *bp)
if (!BNXT_HAS_NQ(bp) || bp->rxtx_nq_ring)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_initial_lcore());
nqr = rte_zmalloc_socket("nqr",
sizeof(struct bnxt_cp_ring_info),
@@ -819,7 +819,7 @@ int bnxt_alloc_async_ring_struct(struct bnxt *bp)
if (BNXT_NUM_ASYNC_CPR(bp) == 0)
return 0;
- socket_id = rte_lcore_to_socket_id(rte_get_master_lcore());
+ socket_id = rte_lcore_to_socket_id(rte_get_initial_lcore());
cpr = rte_zmalloc_socket("cpr",
sizeof(struct bnxt_cp_ring_info),
@@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_initial_lcore();
hif = mrvl_get_hif(priv, core_id);
@@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_initial_lcore();
hif = mrvl_get_hif(rxq->priv, core_id);
if (!hif)
@@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq)
unsigned int core_id = rte_lcore_id();
if (core_id == LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_initial_lcore();
if (!q)
return;
@@ -112,7 +112,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_initial_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, RTE_CACHE_LINE_SIZE);
@@ -151,7 +151,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
snprintf(mz_name, sizeof(mz_name), "%lx",
(unsigned long)rte_get_timer_cycles());
if (core_id == (unsigned int)LCORE_ID_ANY)
- core_id = rte_get_master_lcore();
+ core_id = rte_get_initial_lcore();
socket_id = rte_lcore_to_socket_id(core_id);
mz = rte_memzone_reserve_aligned(mz_name, size, socket_id,
RTE_MEMZONE_IOVA_CONTIG, align);
@@ -25,7 +25,7 @@ softnic_thread_free(struct pmd_internals *softnic)
{
uint32_t i;
- RTE_LCORE_FOREACH_SLAVE(i) {
+ RTE_LCORE_FOREACH_WORKER(i) {
struct softnic_thread *t = &softnic->thread[i];
/* MSGQs */
@@ -99,7 +99,7 @@ softnic_thread_init(struct pmd_internals *softnic)
static inline int
thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id)
{
- if (thread_id == rte_get_master_lcore())
+ if (thread_id == rte_get_initial_lcore())
return 0; /* FALSE */
if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE))