Skip to contentSkip to conversation

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

net-next Arjun Vynipadath 2 participants 2 messages Jan 29, 2019

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

{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()

---
 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    | 100 +++++++++++++++------
 4 files changed, 137 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 +74 -26

128 lines not on this page · raw message

Signature · 1 line
2.9.5
maintainer
#1 lore raw

From: Arjun Vynipadath <[email protected]>
Date: Tue, 29 Jan 2019 15:18:50 +0530

Quoted 9 lines
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 -0
index 2fab87e..a8f78ea 100644
@@ -236,6 +236,74 @@ void t4vf_os_portmod_changed(struct adapter *adapter, int pidx)
 			 "inserted\n", dev->name, pi->mod_type);
 }
 
+static inline int cxgb4vf_set_addr_hash(struct port_info *pi)

...

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c void t4vf_os_portmod_changed(struct adapter *adapter, int pidx) · line 273

Quoted 3 lines
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +3 -0
+static inline int cxgb4vf_change_mac(struct port_info *pi, unsigned int viid,
+				     int *tcam_idx, const u8 *addr,
+				     bool persistent)

Please do not use the inline keyword in foo.c files.

Thank you.