cxgb4/cxgb4vf: Program hash region for {t4/t4vf}_change_mac()
Subsystems (4)
PATCH v3 1/1 cxgb4/cxgb4vf: Program hash region for {t4/t4vf}_change_mac()
{t4/t4_vf}_change_mac() API's were only doing additions to MPS_TCAM. This will fail, when the number of tcam entries is limited particularly in vf's.
This fix programs hash region with the mac address, when TCAM addtion fails for {t4/t4vf}_change_mac(). Since the locally maintained driver list for hash entries is shared across mac_{sync/unsync}(), added an extra parameter if_mac to track the address added thorugh {t4/t4vf}_change_mac()
---
v3:
- Missed to remove inline from one more function cxgb4vf_set_addr_hash(). v2:
- Remove inline keyword for functions from {cxgb4/cxgb4vf}_main.c
- Use GFP_KERNEL instead of GFP_ATOMIC for memory allocations.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 3 +- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 71 +++++++++++++--- drivers/net/ethernet/chelsio/cxgb4vf/adapter.h | 3 +- .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 99 ++++++++++++++++------ 4 files changed, 136 insertions(+), 40 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +2 -1
@@ -568,7 +568,7 @@ struct sge_rspq;struct port_info {struct adapter *adapter;u16 viid; -s16 xact_addr_filt;/* index of exact MAC address filter */ +int xact_addr_filt;/* index of exact MAC address filter */ u16 rss_size;/* size of VI's RSS table slice */ s8 mdio_addr;enum fw_port_type port_type;
@@ -860,6 +860,7 @@ struct doorbell_stats {struct hash_mac_addr {struct list_head list;u8 addr[ETH_ALEN ]; +unsigned int iface_mac; };struct uld_msix_bmap {
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +59 -12
89 lines not on this page · raw message
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h +2 -1
@@ -94,7 +94,7 @@ struct port_info {struct adapter *adapter;/* our adapter */ u32 vlan_id;/* vlan id for VST */ u16 viid;/* virtual interface ID */ -s16 xact_addr_filt;/* index of our MAC address filter */ +int xact_addr_filt;/* index of our MAC address filter */ u16 rss_size;/* size of VI's RSS table slice */ u8 pidx;/* index into adapter port[] */ s8 mdio_addr;
@@ -352,6 +352,7 @@ struct sge {struct hash_mac_addr {struct list_head list;u8 addr[ETH_ALEN ]; +unsigned int iface_mac; };struct mbox_list {
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +73 -26
127 lines not on this page · raw message
Signature · 1 line
2.9.5
From: Arjun Vynipadath <[email protected]>
Date: Fri, 1 Feb 2019 17:07:04 +0530
Quoted 10 lines
{t4/t4_vf}_change_mac() API's were only doing additions to
MPS_TCAM. This will fail, when the number of tcam entries is limited particularly in vf's.
This fix programs hash region with the mac address, when TCAM addtion fails for {t4/t4vf}_change_mac(). Since the locally maintained driver list for hash entries is shared across mac_{sync/unsync}(), added an extra parameterif_macto track the address added thorugh {t4/t4vf}_change_mac()Signed-off-by Arjun Vynipadath <[email protected]>
Applied.