Skip to content

Commit aa2c6ba

Browse files
author
CKI KWF Bot
committed
Merge: cxgb4: unable to set MAC address on VF's of PF2 and PF3 using "ip link" command
MR: https://gitlab.com/redhat/rhel/src/kernel/rhel-9/-/merge_requests/3387 JIRA: https://issues.redhat.com/browse/RHEL-75514 commit 356983f Author: Anumula Murali Mohan Reddy <[email protected]> Date: Fri Dec 6 11:50:14 2024 +0530 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. Fixes: e0cdac6 ("cxgb4vf: configure ports accessible by the VF") Signed-off-by: Anumula Murali Mohan Reddy <[email protected]> Signed-off-by: Potnuri Bharat Teja <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Michal Schmidt <[email protected]> Approved-by: Kamal Heib <[email protected]> Approved-by: José Ignacio Tornos Martínez <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: CKI KWF Bot <[email protected]>
2 parents c0218fe + 172ec83 commit aa2c6ba

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ void t4_idma_monitor(struct adapter *adapter,
20822082
struct sge_idma_monitor_state *idma,
20832083
int hz, int ticks);
20842084
int t4_set_vf_mac_acl(struct adapter *adapter, unsigned int vf,
2085-
unsigned int naddr, u8 *addr);
2085+
u8 start, unsigned int naddr, u8 *addr);
20862086
void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
20872087
u32 start_index, bool sleep_ok);
20882088
void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs,

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3246,7 +3246,7 @@ static int cxgb4_mgmt_set_vf_mac(struct net_device *dev, int vf, u8 *mac)
32463246

32473247
dev_info(pi->adapter->pdev_dev,
32483248
"Setting MAC %pM on VF %d\n", mac, vf);
3249-
ret = t4_set_vf_mac_acl(adap, vf + 1, 1, mac);
3249+
ret = t4_set_vf_mac_acl(adap, vf + 1, pi->lport, 1, mac);
32503250
if (!ret)
32513251
ether_addr_copy(adap->vfinfo[vf].vf_mac_addr, mac);
32523252
return ret;

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10215,11 +10215,12 @@ int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size)
1021510215
* t4_set_vf_mac_acl - Set MAC address for the specified VF
1021610216
* @adapter: The adapter
1021710217
* @vf: one of the VFs instantiated by the specified PF
10218+
* @start: The start port id associated with specified VF
1021810219
* @naddr: the number of MAC addresses
1021910220
* @addr: the MAC address(es) to be set to the specified VF
1022010221
*/
1022110222
int t4_set_vf_mac_acl(struct adapter *adapter, unsigned int vf,
10222-
unsigned int naddr, u8 *addr)
10223+
u8 start, unsigned int naddr, u8 *addr)
1022310224
{
1022410225
struct fw_acl_mac_cmd cmd;
1022510226

@@ -10234,7 +10235,7 @@ int t4_set_vf_mac_acl(struct adapter *adapter, unsigned int vf,
1023410235
cmd.en_to_len16 = cpu_to_be32((unsigned int)FW_LEN16(cmd));
1023510236
cmd.nmac = naddr;
1023610237

10237-
switch (adapter->pf) {
10238+
switch (start) {
1023810239
case 3:
1023910240
memcpy(cmd.macaddr3, addr, sizeof(cmd.macaddr3));
1024010241
break;

0 commit comments

Comments
 (0)