net/qede: fix alloc from socket 0
authorPascal Mazon <pascal.mazon@6wind.com>
Mon, 26 Feb 2018 08:01:10 +0000 (09:01 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:43 +0000 (14:08 +0200)
commit368b11185c8c35f95c6b4db1b24fa7757e5678f9
tree242119411f945e570536797f4fc5331de651471c
parent0b598c9c69ec29f088b3b5e455494df6db5a2a72
net/qede: fix alloc from socket 0

In case osal_dma_alloc_coherent() or osal_dma_alloc_coherent_aligned() are
called from a management thread, core_id turn out to be LCORE_ID_ANY, and
the resulting socket for alloc will be socket 0.

This is not desirable when using a NIC from socket 1 which might very
likely be configured to use memory from that socket only.
In that case, allocation will fail.

To address this, use master lcore instead when called from mgmt thread.
The associated socket should have memory available.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
Acked-by: Harish Patil <harish.patil@cavium.com>
Acked-by: Harish Patil <harish.patil@cavium.com>
drivers/net/qede/base/bcm_osal.c