]> www.infradead.org Git - users/hch/misc.git/commitdiff
fbnic: Pass fbnic_dev instead of netdev to __fbnic_set/clear_rx_mode
authorAlexander Duyck <alexanderduyck@fb.com>
Tue, 26 Aug 2025 19:44:54 +0000 (12:44 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Aug 2025 12:51:07 +0000 (14:51 +0200)
To make the __fbnic_set_rx_mode and __fbnic_clear_rx_mode calls usable by
more points in the code we can make to that they expect a fbnic_dev pointer
instead of a netdev pointer.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/175623749436.2246365.6068665520216196789.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
drivers/net/ethernet/meta/fbnic/fbnic_netdev.h
drivers/net/ethernet/meta/fbnic/fbnic_pci.c

index 24c256ac03302cdd7c9a7547b6f96334d5ef2798..0cf1ea927cc0cacd7bf4a1c70e0e71307ccf29ba 100644 (file)
@@ -179,11 +179,10 @@ static int fbnic_mc_unsync(struct net_device *netdev, const unsigned char *addr)
        return ret;
 }
 
-void __fbnic_set_rx_mode(struct net_device *netdev)
+void __fbnic_set_rx_mode(struct fbnic_dev *fbd)
 {
-       struct fbnic_net *fbn = netdev_priv(netdev);
        bool uc_promisc = false, mc_promisc = false;
-       struct fbnic_dev *fbd = fbn->fbd;
+       struct net_device *netdev = fbd->netdev;
        struct fbnic_mac_addr *mac_addr;
        int err;
 
@@ -237,9 +236,12 @@ void __fbnic_set_rx_mode(struct net_device *netdev)
 
 static void fbnic_set_rx_mode(struct net_device *netdev)
 {
+       struct fbnic_net *fbn = netdev_priv(netdev);
+       struct fbnic_dev *fbd = fbn->fbd;
+
        /* No need to update the hardware if we are not running */
        if (netif_running(netdev))
-               __fbnic_set_rx_mode(netdev);
+               __fbnic_set_rx_mode(fbd);
 }
 
 static int fbnic_set_mac(struct net_device *netdev, void *p)
@@ -256,10 +258,9 @@ static int fbnic_set_mac(struct net_device *netdev, void *p)
        return 0;
 }
 
-void fbnic_clear_rx_mode(struct net_device *netdev)
+void fbnic_clear_rx_mode(struct fbnic_dev *fbd)
 {
-       struct fbnic_net *fbn = netdev_priv(netdev);
-       struct fbnic_dev *fbd = fbn->fbd;
+       struct net_device *netdev = fbd->netdev;
        int idx;
 
        for (idx = ARRAY_SIZE(fbd->mac_addr); idx--;) {
index 0a6347f28210f62c6b646db6a19a14f4186b70b8..e84e0527c3a994bcdc48e9f932d46580fea39237 100644 (file)
@@ -94,8 +94,8 @@ void fbnic_time_init(struct fbnic_net *fbn);
 int fbnic_time_start(struct fbnic_net *fbn);
 void fbnic_time_stop(struct fbnic_net *fbn);
 
-void __fbnic_set_rx_mode(struct net_device *netdev);
-void fbnic_clear_rx_mode(struct net_device *netdev);
+void __fbnic_set_rx_mode(struct fbnic_dev *fbd);
+void fbnic_clear_rx_mode(struct fbnic_dev *fbd);
 
 void fbnic_phylink_get_pauseparam(struct net_device *netdev,
                                  struct ethtool_pauseparam *pause);
index ef7928b18ac0aad165fc317c0210550baf2c440f..fac89860b1b7bcc62a939f12b9684ec3db67d262 100644 (file)
@@ -137,7 +137,7 @@ void fbnic_up(struct fbnic_net *fbn)
 
        fbnic_rss_reinit_hw(fbn->fbd, fbn);
 
-       __fbnic_set_rx_mode(fbn->netdev);
+       __fbnic_set_rx_mode(fbn->fbd);
 
        /* Enable Tx/Rx processing */
        fbnic_napi_enable(fbn);
@@ -154,7 +154,7 @@ void fbnic_down_noidle(struct fbnic_net *fbn)
        fbnic_napi_disable(fbn);
        netif_tx_disable(fbn->netdev);
 
-       fbnic_clear_rx_mode(fbn->netdev);
+       fbnic_clear_rx_mode(fbn->fbd);
        fbnic_clear_rules(fbn->fbd);
        fbnic_rss_disable_hw(fbn->fbd);
        fbnic_disable(fbn);