Merge branch 'upstream-16.11-stable' into 16.11.x
[deb_dpdk.git] / drivers / net / qede / base / bcm_osal.c
index 28be958..b9dc1d6 100644 (file)
@@ -98,9 +98,7 @@ inline u32 qede_find_first_zero_bit(unsigned long *addr, u32 limit)
        u32 nwords = 0;
        OSAL_BUILD_BUG_ON(!limit);
        nwords = (limit - 1) / OSAL_BITS_PER_UL + 1;
-       for (i = 0; i < nwords; i++)
-               if (~(addr[i] != 0))
-                       break;
+       for (i = 0; i < nwords && ~(addr[i]) == 0; i++);
        return (i == nwords) ? limit : i * OSAL_BITS_PER_UL + qede_ffz(addr[i]);
 }
 
@@ -124,7 +122,7 @@ void *osal_dma_alloc_coherent(struct ecore_dev *p_dev,
        snprintf(mz_name, sizeof(mz_name) - 1, "%lx",
                                        (unsigned long)rte_get_timer_cycles());
        if (core_id == (unsigned int)LCORE_ID_ANY)
-               core_id = 0;
+               core_id = rte_get_master_lcore();
        socket_id = rte_lcore_to_socket_id(core_id);
        mz = rte_memzone_reserve_aligned(mz_name, size,
                                         socket_id, 0, RTE_CACHE_LINE_SIZE);
@@ -154,7 +152,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
        snprintf(mz_name, sizeof(mz_name) - 1, "%lx",
                                        (unsigned long)rte_get_timer_cycles());
        if (core_id == (unsigned int)LCORE_ID_ANY)
-               core_id = 0;
+               core_id = rte_get_master_lcore();
        socket_id = rte_lcore_to_socket_id(core_id);
        mz = rte_memzone_reserve_aligned(mz_name, size, socket_id, 0, align);
        if (!mz) {