]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
sfc: Move last mc_promisc flag to EF10 filter table state
authorAndrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru>
Wed, 15 Jun 2016 16:43:00 +0000 (17:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jun 2016 05:26:24 +0000 (22:26 -0700)
It is used for EF10 only and logically belongs to EF10 filter table state.
It is OK that it is reset to false on filter table recreation since all
filters are removed on destruction.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10.c
drivers/net/ethernet/sfc/net_driver.h

index 89c88ca22457aa34862580eb3daad4099ed760a9..ebe35496b29489b3899bdb66c204ff61a13d68b6 100644 (file)
@@ -83,6 +83,8 @@ struct efx_ef10_filter_table {
        u16 ucdef_id;
        u16 bcast_id;
        u16 mcdef_id;
+/* Whether in multicast promiscuous mode when last changed */
+       bool mc_promisc_last;
 };
 
 /* An arbitrary search limit for the software hash table */
@@ -3778,6 +3780,7 @@ static int efx_ef10_filter_table_probe(struct efx_nic *efx)
        table->ucdef_id = EFX_EF10_FILTER_ID_INVALID;
        table->bcast_id = EFX_EF10_FILTER_ID_INVALID;
        table->mcdef_id = EFX_EF10_FILTER_ID_INVALID;
+       table->mc_promisc_last = false;
 
        efx->filter_state = table;
        init_waitqueue_head(&table->waitq);
@@ -4243,7 +4246,7 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx)
        /* If changing promiscuous state with cascaded multicast filters, remove
         * old filters first, so that packets are dropped rather than duplicated
         */
-       if (nic_data->workaround_26807 && efx->mc_promisc != mc_promisc)
+       if (nic_data->workaround_26807 && table->mc_promisc_last != mc_promisc)
                efx_ef10_filter_remove_old(efx);
        if (mc_promisc) {
                if (nic_data->workaround_26807) {
@@ -4278,7 +4281,7 @@ static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx)
        }
 
        efx_ef10_filter_remove_old(efx);
-       efx->mc_promisc = mc_promisc;
+       table->mc_promisc_last = mc_promisc;
 }
 
 static int efx_ef10_set_mac_address(struct efx_nic *efx)
index d13ddf9703ff3a220a2d1e7bb5505741eccb8e8c..77cd23cda3f3bcef385ecc2a920245816c261020 100644 (file)
@@ -916,7 +916,6 @@ struct vfdi_status;
  * @stats_lock: Statistics update lock. Must be held when calling
  *     efx_nic_type::{update,start,stop}_stats.
  * @n_rx_noskb_drops: Count of RX packets dropped due to failure to allocate an skb
- * @mc_promisc: Whether in multicast promiscuous mode when last changed
  *
  * This is stored in the private area of the &struct net_device.
  */
@@ -1065,7 +1064,6 @@ struct efx_nic {
        int last_irq_cpu;
        spinlock_t stats_lock;
        atomic_t n_rx_noskb_drops;
-       bool mc_promisc;
 };
 
 static inline int efx_dev_registered(struct efx_nic *efx)