Skip to contentSkip to conversation

cxgb4/cxgb4vf: Program hash region for {t4/t4vf}_change_mac()

PATCH Applied Arjun Vynipadath 2 participants 2 messages Feb 1, 2019 – Feb 3, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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
index 2d1ca92..568715a 100644
@@ -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
index 5883f09..26f48a1 100644
@@ -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
maintainer Applied
#1 lore raw

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 parameter if_mac to track the address added thorugh {t4/t4vf}_change_mac()

Applied.