Skip to contentSkip to conversation

net: aquantia: vlan unicast address list correct handling

PATCH In review Igor Russkikh 2 participants 2 messages Jul 5, 2018 – Jul 6, 2018 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 net: aquantia: vlan unicast address list correct handling

Setting up macvlan/macvtap networks over atlantic NIC results in no traffic over these networks because ndo_set_rx_mode did not listed UC MACs as registered in unicast filter.

Here we fix that taking into account maximum number of UC filters supported by hardware. If more than MAX addresses were registered, we just enable promisc and/or allmulti to pass the traffic in.

We also remove MULTICAST_ADDRESS_MAX constant from aq_cfg since thats not a configurable parameter at all.

Fixes b21f502 ("net:ethernet:aquantia: Fix for multicast filter handling.")
---
 drivers/net/ethernet/aquantia/atlantic/aq_cfg.h    |  2 -
 drivers/net/ethernet/aquantia/atlantic/aq_hw.h     |  4 +-
 drivers/net/ethernet/aquantia/atlantic/aq_main.c   | 11 +----
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c    | 47 +++++++++++++---------
 drivers/net/ethernet/aquantia/atlantic/aq_nic.h    |  2 +-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c  |  2 +-
 .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c  |  4 +-
 7 files changed, 36 insertions(+), 36 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_cfg.h +0 -2
index fc73831..91eb891 100644
@@ -63,8 +63,6 @@
 
 #define AQ_CFG_NAPI_WEIGHT     64U
 
-#define AQ_CFG_MULTICAST_ADDRESS_MAX     32U
-
 /*#define AQ_CFG_MAC_ADDR_PERMANENT {0x30, 0x0E, 0xE3, 0x12, 0x34, 0x56}*/
 
 #define AQ_NIC_FC_OFF    0U
drivers/net/ethernet/aquantia/atlantic/aq_hw.h +3 -1
index a2d416b..2c6ebd9 100644
@@ -98,6 +98,8 @@ struct aq_stats_s {
 #define AQ_HW_MEDIA_TYPE_TP    1U
 #define AQ_HW_MEDIA_TYPE_FIBRE 2U
 
+#define AQ_HW_MULTICAST_ADDRESS_MAX     32U
+
 struct aq_hw_s {
 	atomic_t flags;
 	u8 rbl_enabled:1;
@@ -177,7 +179,7 @@ struct aq_hw_ops {
 				    unsigned int packet_filter);
 
 	int (*hw_multicast_list_set)(struct aq_hw_s *self,
-				     u8 ar_mac[AQ_CFG_MULTICAST_ADDRESS_MAX]
+				     u8 ar_mac[AQ_HW_MULTICAST_ADDRESS_MAX]
 				     [ETH_ALEN],
 				     u32 count);
 
drivers/net/ethernet/aquantia/atlantic/aq_main.c +2 -9
index ba5fe8c..e3ae29e 100644
@@ -135,17 +135,10 @@ static int aq_ndev_set_mac_address(struct net_device *ndev, void *addr)
 static void aq_ndev_set_multicast_settings(struct net_device *ndev)
 {
 	struct aq_nic_s *aq_nic = netdev_priv(ndev);
-	int err = 0;
 
-	err = aq_nic_set_packet_filter(aq_nic, ndev->flags);
-	if (err < 0)
-		return;
+	aq_nic_set_packet_filter(aq_nic, ndev->flags);
 
-	if (netdev_mc_count(ndev)) {
-		err = aq_nic_set_multicast_list(aq_nic, ndev);
-		if (err < 0)
-			return;
-	}
+	aq_nic_set_multicast_list(aq_nic, ndev);
 }
 
 static const struct net_device_ops aq_ndev_ops = {
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +27 -20

61 lines not on this page · raw message

drivers/net/ethernet/aquantia/atlantic/aq_nic.h +1 -1
index faa533a..fecfc40 100644
@@ -75,7 +75,7 @@ struct aq_nic_s {
 	struct aq_hw_link_status_s link_status;
 	struct {
 		u32 count;
-		u8 ar[AQ_CFG_MULTICAST_ADDRESS_MAX][ETH_ALEN];
+		u8 ar[AQ_HW_MULTICAST_ADDRESS_MAX][ETH_ALEN];
 	} mc_list;
 
 	struct pci_dev *pdev;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +1 -1
index 67e2f9f..8cc6aba 100644
@@ -765,7 +765,7 @@ static int hw_atl_a0_hw_packet_filter_set(struct aq_hw_s *self,
 
 static int hw_atl_a0_hw_multicast_list_set(struct aq_hw_s *self,
 					   u8 ar_mac
-					   [AQ_CFG_MULTICAST_ADDRESS_MAX]
+					   [AQ_HW_MULTICAST_ADDRESS_MAX]
 					   [ETH_ALEN],
 					   u32 count)
 {
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +2 -2
index 819f6bc..956860a 100644
@@ -784,7 +784,7 @@ static int hw_atl_b0_hw_packet_filter_set(struct aq_hw_s *self,
 
 static int hw_atl_b0_hw_multicast_list_set(struct aq_hw_s *self,
 					   u8 ar_mac
-					   [AQ_CFG_MULTICAST_ADDRESS_MAX]
+					   [AQ_HW_MULTICAST_ADDRESS_MAX]
 					   [ETH_ALEN],
 					   u32 count)
 {
@@ -812,7 +812,7 @@ static int hw_atl_b0_hw_multicast_list_set(struct aq_hw_s *self,
 
 		hw_atl_rpfl2_uc_flr_en_set(self,
 					   (self->aq_nic_cfg->is_mc_list_enabled),
-				    HW_ATL_B0_MAC_MIN + i);
+					   HW_ATL_B0_MAC_MIN + i);
 	}
 
 	err = aq_hw_err_from_flags(self);
Signature · 1 line
2.7.4
maintainer
#2 lore raw

From: Igor Russkikh <[email protected]>
Date: Thu, 5 Jul 2018 17:01:09 +0300

Quoted 9 lines

Setting up macvlan/macvtap networks over atlantic NIC results in no traffic over these networks because ndo_set_rx_mode did not listed UC MACs as registered in unicast filter.

Here we fix that taking into account maximum number of UC filters supported by hardware. If more than MAX addresses were registered, we just enable promisc and/or allmulti to pass the traffic in.

Quoted 5 lines

We also remove MULTICAST_ADDRESS_MAX constant from aq_cfg since thats not a configurable parameter at all.

Fixes b21f502 ("net:ethernet:aquantia: Fix for multicast filter handling.")

Applied and queued up for -stable.

Thanks!