[dpdk-dev] net/nfp: write PF MAC to config BAR

Message ID 1505336145-41273-1-git-send-email-alejandro.lucero@netronome.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
checkpatch success coding style OK
Intel-compilation success Compilation OK

Commit Message

Alejandro Lucero Sept. 13, 2017, 8:55 p.m.
VFs rely on config BAR for getting the MAC address, although a
random one is created a valid address is not found.

A PF port has a fixed MAC which is currently acquired using the NSPU
interface. Some NFP firmwares require the MAC being writing back
to the config BAR for doing proper MAC filtering.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
 drivers/net/nfp/nfp_net.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Ferruh Yigit Sept. 18, 2017, 7:14 p.m.
On 9/13/2017 9:55 PM, Alejandro Lucero wrote:
> VFs rely on config BAR for getting the MAC address, although a
> random one is created a valid address is not found.
> 
> A PF port has a fixed MAC which is currently acquired using the NSPU
> interface. Some NFP firmwares require the MAC being writing back
> to the config BAR for doing proper MAC filtering.
> 
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>

Applied to dpdk-next-net/master, thanks.

Patch hide | download patch | download mbox

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 000d339..fe41e61 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2810,10 +2810,12 @@  uint32_t nfp_net_txq_full(struct nfp_net_txq *txq)
 		return -ENOMEM;
 	}
 
-	if (hw->is_pf)
+	if (hw->is_pf) {
 		nfp_net_pf_read_mac(hwport0, port);
-	else
+		nfp_net_write_mac(hw, (uint8_t *)&hw->mac_addr);
+	} else {
 		nfp_net_vf_read_mac(hw);
+	}
 
 	if (!is_valid_assigned_ether_addr((struct ether_addr *)&hw->mac_addr)) {
 		/* Using random mac addresses for VFs */