cxgb4: use port number to set mac addr
Subsystems (3)
PATCH v2 1/1 cxgb4: use port number to set mac addr
t4_set_vf_mac_acl() uses pf to set mac addr, but t4vf_get_vf_mac_acl() uses port number to get mac addr, this leads to error when an attempt to set MAC address on VF's of PF2 and PF3.
This patch fixes the issue by using port number to set mac address.
---
Changes since v1:
Addressed previous review comments
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 2 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +1 -1
@@ -2076,7 +2076,7 @@ void t4_idma_monitor(struct adapter *adapter,struct sge_idma_monitor_state *idma, int hz, int ticks);int t4_set_vf_mac_acl (struct adapter *adapter,unsigned int vf, -unsigned int naddr,u8 *addr); +u8 start,unsigned int naddr,u8 *addr);void t4_tp_pio_read (struct adapter *adap,u32 *buff,u32 nregs,u32 start_index,bool sleep_ok); void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -3234,7 +3234,7 @@ static int cxgb4_mgmt_set_vf_mac(struct net_device *dev, int vf, u8 *mac)dev_info (pi->adapter->pdev_dev,"Setting MAC %pM on VF %d\n" , mac, vf); - ret =t4_set_vf_mac_acl (adap, vf +1 ,1 , mac); + ret =t4_set_vf_mac_acl (adap, vf +1 , pi->lport,1 , mac);if (!ret)ether_addr_copy (adap->vfinfo[vf].vf_mac_addr, mac);return ret;
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +3 -2
@@ -10215,11 +10215,12 @@ int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size)* t4_set_vf_mac_acl - Set MAC address for the specified VF * @adapter: The adapter * @vf: one of the VFs instantiated by the specified PF +* @start: The start port id associated with specified VF * @naddr: the number of MAC addresses * @addr: the MAC address(es) to be set to the specified VF */ int t4_set_vf_mac_acl (struct adapter *adapter,unsigned int vf, -unsigned int naddr,u8 *addr) +u8 start,unsigned int naddr,u8 *addr) {struct fw_acl_mac_cmd cmd;
@@ -10234,7 +10235,7 @@ int t4_set_vf_mac_acl(struct adapter *adapter, unsigned int vf, cmd.en_to_len16 =cpu_to_be32 ((unsigned int )FW_LEN16 (cmd)); cmd.nmac = naddr; -switch (adapter->pf) { +switch (start) {case 3 :memcpy (cmd.macaddr3, addr,sizeof (cmd.macaddr3));break ;
Signature · 1 line
2.39.3
Quoted 11 lines · Anumula Murali Mohan Reddy
t4_set_vf_mac_acl()uses pf to set mac addr, butt4vf_get_vf_mac_acl()uses port number to get mac addr, this leads to error when an attempt to set MAC address on VF's of PF2 and PF3.
This patch fixes the issue by using port number to set mac address.Fixes e0cdac65ba26 ("cxgb4vf: configure ports accessible by the VF")Signed-off-by Anumula Murali Mohan Reddy <[email protected]>Signed-off-by Potnuri Bharat Teja <[email protected]>---
Changes since v1:
Addressed previous review comments
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Fri, 6 Dec 2024 11:50:14 +0530 you wrote:
t4_set_vf_mac_acl()uses pf to set mac addr, butt4vf_get_vf_mac_acl()uses port number to get mac addr, this leads to error when an attempt to set MAC address on VF's of PF2 and PF3.
This patch fixes the issue by using port number to set mac address.Fixes e0cdac65ba26 ("cxgb4vf: configure ports accessible by the VF")Signed-off-by Anumula Murali Mohan Reddy <[email protected]>Signed-off-by Potnuri Bharat Teja <[email protected]>[...]
Here is the summary with links:
- [net,v2] cxgb4: use port number to set mac addr
https://git.kernel.org/netdev/net/c/356983f569c1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html