]> Gentwo Git Trees - linux/.git/commitdiff
fbnic: Rename PCS IRQ to MAC IRQ as it is actually a MAC interrupt
authorAlexander Duyck <alexanderduyck@fb.com>
Fri, 21 Nov 2025 16:40:23 +0000 (08:40 -0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 27 Nov 2025 09:41:31 +0000 (10:41 +0100)
Throughout several spots in the code I had called out the IRQ as being
related to the PCS. However the actual IRQ is a part of the MAC and it is
just exposing PCS data. To more accurately reflect the owner of the calls
this change makes it so that we rename the functions and values that are
taking in the interrupt value and processing it to reflect that it is a MAC
call and not a PCS one.

This change is mostly motivated by the fact that we will be moving the
handling of this interrupt from being PCS focused to being more PMA/PMD
focused as this will drive the phydev driver that I am adding instead of
driving the PCS directly.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/176374322373.959489.12018231545479053860.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic.h
drivers/net/ethernet/meta/fbnic/fbnic_irq.c
drivers/net/ethernet/meta/fbnic/fbnic_mac.c
drivers/net/ethernet/meta/fbnic/fbnic_mac.h
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
drivers/net/ethernet/meta/fbnic/fbnic_phylink.c

index b03e5a3d51445c5315b88e289b6f0d8b0457838f..98929add5f21ce406cf79760bdb1bb77d7edff75 100644 (file)
@@ -34,7 +34,7 @@ struct fbnic_dev {
        u32 __iomem *uc_addr4;
        const struct fbnic_mac *mac;
        unsigned int fw_msix_vector;
-       unsigned int pcs_msix_vector;
+       unsigned int mac_msix_vector;
        unsigned short num_irqs;
 
        struct {
@@ -175,8 +175,8 @@ void fbnic_fw_free_mbx(struct fbnic_dev *fbd);
 void fbnic_hwmon_register(struct fbnic_dev *fbd);
 void fbnic_hwmon_unregister(struct fbnic_dev *fbd);
 
-int fbnic_pcs_request_irq(struct fbnic_dev *fbd);
-void fbnic_pcs_free_irq(struct fbnic_dev *fbd);
+int fbnic_mac_request_irq(struct fbnic_dev *fbd);
+void fbnic_mac_free_irq(struct fbnic_dev *fbd);
 
 void fbnic_napi_name_irqs(struct fbnic_dev *fbd);
 int fbnic_napi_request_irq(struct fbnic_dev *fbd,
index 1c88a2bf3a7a78b7fb48f11643bbc3fac0e257ca..40947e142c5d0822d5fc90ca94e91da7a10cfcd6 100644 (file)
@@ -118,12 +118,12 @@ void fbnic_fw_free_mbx(struct fbnic_dev *fbd)
        fbd->fw_msix_vector = 0;
 }
 
-static irqreturn_t fbnic_pcs_msix_intr(int __always_unused irq, void *data)
+static irqreturn_t fbnic_mac_msix_intr(int __always_unused irq, void *data)
 {
        struct fbnic_dev *fbd = data;
        struct fbnic_net *fbn;
 
-       if (fbd->mac->pcs_get_link_event(fbd) == FBNIC_LINK_EVENT_NONE) {
+       if (fbd->mac->get_link_event(fbd) == FBNIC_LINK_EVENT_NONE) {
                fbnic_wr32(fbd, FBNIC_INTR_MASK_CLEAR(0),
                           1u << FBNIC_PCS_MSIX_ENTRY);
                return IRQ_HANDLED;
@@ -137,20 +137,20 @@ static irqreturn_t fbnic_pcs_msix_intr(int __always_unused irq, void *data)
 }
 
 /**
- * fbnic_pcs_request_irq - Configure the PCS to enable it to advertise link
+ * fbnic_mac_request_irq - Configure the MAC to enable it to advertise link
  * @fbd: Pointer to device to initialize
  *
- * This function provides basic bringup for the MAC/PCS IRQ. For now the IRQ
+ * This function provides basic bringup for the MAC/PHY IRQ. For now the IRQ
  * will remain disabled until we start the MAC/PCS/PHY logic via phylink.
  *
  * Return: non-zero on failure.
  **/
-int fbnic_pcs_request_irq(struct fbnic_dev *fbd)
+int fbnic_mac_request_irq(struct fbnic_dev *fbd)
 {
        struct pci_dev *pdev = to_pci_dev(fbd->dev);
        int vector, err;
 
-       WARN_ON(fbd->pcs_msix_vector);
+       WARN_ON(fbd->mac_msix_vector);
 
        vector = pci_irq_vector(pdev, FBNIC_PCS_MSIX_ENTRY);
        if (vector < 0)
@@ -159,7 +159,7 @@ int fbnic_pcs_request_irq(struct fbnic_dev *fbd)
        /* Request the IRQ for PCS link vector.
         * Map PCS cause to it, and unmask it
         */
-       err = request_irq(vector, &fbnic_pcs_msix_intr, 0,
+       err = request_irq(vector, &fbnic_mac_msix_intr, 0,
                          fbd->netdev->name, fbd);
        if (err)
                return err;
@@ -168,22 +168,22 @@ int fbnic_pcs_request_irq(struct fbnic_dev *fbd)
        fbnic_wr32(fbd, FBNIC_INTR_MSIX_CTRL(FBNIC_INTR_MSIX_CTRL_PCS_IDX),
                   FBNIC_PCS_MSIX_ENTRY | FBNIC_INTR_MSIX_CTRL_ENABLE);
 
-       fbd->pcs_msix_vector = vector;
+       fbd->mac_msix_vector = vector;
 
        return 0;
 }
 
 /**
- * fbnic_pcs_free_irq - Teardown the PCS IRQ to prepare for stopping
+ * fbnic_mac_free_irq - Teardown the MAC IRQ to prepare for stopping
  * @fbd: Pointer to device that is stopping
  *
- * This function undoes the work done in fbnic_pcs_request_irq and prepares
+ * This function undoes the work done in fbnic_mac_request_irq and prepares
  * the device to no longer receive traffic on the host interface.
  **/
-void fbnic_pcs_free_irq(struct fbnic_dev *fbd)
+void fbnic_mac_free_irq(struct fbnic_dev *fbd)
 {
        /* Vector has already been freed */
-       if (!fbd->pcs_msix_vector)
+       if (!fbd->mac_msix_vector)
                return;
 
        /* Disable interrupt */
@@ -192,14 +192,14 @@ void fbnic_pcs_free_irq(struct fbnic_dev *fbd)
        fbnic_wrfl(fbd);
 
        /* Synchronize IRQ to prevent race that would unmask vector */
-       synchronize_irq(fbd->pcs_msix_vector);
+       synchronize_irq(fbd->mac_msix_vector);
 
        /* Mask the vector */
        fbnic_wr32(fbd, FBNIC_INTR_MASK_SET(0), 1u << FBNIC_PCS_MSIX_ENTRY);
 
        /* Free the vector */
-       free_irq(fbd->pcs_msix_vector, fbd);
-       fbd->pcs_msix_vector = 0;
+       free_irq(fbd->mac_msix_vector, fbd);
+       fbd->mac_msix_vector = 0;
 }
 
 void fbnic_synchronize_irq(struct fbnic_dev *fbd, int nr)
index 2a84bd1d7e2684573fb323777d6e4089f4dee283..28a2e1fd3760a0f59559c313796c1301a728baed 100644 (file)
@@ -434,14 +434,14 @@ static void fbnic_mac_tx_pause_config(struct fbnic_dev *fbd, bool tx_pause)
        wr32(fbd, FBNIC_RXB_PAUSE_DROP_CTRL, rxb_pause_ctrl);
 }
 
-static int fbnic_pcs_get_link_event_asic(struct fbnic_dev *fbd)
+static int fbnic_mac_get_link_event(struct fbnic_dev *fbd)
 {
-       u32 pcs_intr_mask = rd32(fbd, FBNIC_SIG_PCS_INTR_STS);
+       u32 intr_mask = rd32(fbd, FBNIC_SIG_PCS_INTR_STS);
 
-       if (pcs_intr_mask & FBNIC_SIG_PCS_INTR_LINK_DOWN)
+       if (intr_mask & FBNIC_SIG_PCS_INTR_LINK_DOWN)
                return FBNIC_LINK_EVENT_DOWN;
 
-       return (pcs_intr_mask & FBNIC_SIG_PCS_INTR_LINK_UP) ?
+       return (intr_mask & FBNIC_SIG_PCS_INTR_LINK_UP) ?
               FBNIC_LINK_EVENT_UP : FBNIC_LINK_EVENT_NONE;
 }
 
@@ -521,7 +521,7 @@ static bool fbnic_mac_get_pcs_link_status(struct fbnic_dev *fbd)
        return !lane_mask;
 }
 
-static bool fbnic_pcs_get_link_asic(struct fbnic_dev *fbd)
+static bool fbnic_mac_get_link(struct fbnic_dev *fbd)
 {
        bool link;
 
@@ -869,8 +869,8 @@ static const struct fbnic_mac fbnic_mac_asic = {
        .init_regs = fbnic_mac_init_regs,
        .pcs_enable = fbnic_pcs_enable_asic,
        .pcs_disable = fbnic_pcs_disable_asic,
-       .pcs_get_link = fbnic_pcs_get_link_asic,
-       .pcs_get_link_event = fbnic_pcs_get_link_event_asic,
+       .get_link = fbnic_mac_get_link,
+       .get_link_event = fbnic_mac_get_link_event,
        .get_fec_stats = fbnic_mac_get_fec_stats,
        .get_pcs_stats = fbnic_mac_get_pcs_stats,
        .get_eth_mac_stats = fbnic_mac_get_eth_mac_stats,
index ede5ff0dae22fdff4a8479c86690c76293d7c173..414c170abcba06b1acd2d311ac78f51c1fb4caac 100644 (file)
@@ -59,9 +59,9 @@ enum fbnic_sensor_id {
  *     Configure and enable PCS to enable link if not already enabled
  * void (*pcs_disable)(struct fbnic_dev *fbd);
  *     Shutdown the link if we are the only consumer of it.
- * bool (*pcs_get_link)(struct fbnic_dev *fbd);
+ * bool (*get_link)(struct fbnic_dev *fbd);
  *     Check PCS link status
- * int (*pcs_get_link_event)(struct fbnic_dev *fbd)
+ * int (*get_link_event)(struct fbnic_dev *fbd)
  *     Get the current link event status, reports true if link has
  *     changed to either FBNIC_LINK_EVENT_DOWN or FBNIC_LINK_EVENT_UP
  *
@@ -76,8 +76,8 @@ struct fbnic_mac {
 
        int (*pcs_enable)(struct fbnic_dev *fbd);
        void (*pcs_disable)(struct fbnic_dev *fbd);
-       bool (*pcs_get_link)(struct fbnic_dev *fbd);
-       int (*pcs_get_link_event)(struct fbnic_dev *fbd);
+       bool (*get_link)(struct fbnic_dev *fbd);
+       int (*get_link_event)(struct fbnic_dev *fbd);
 
        void (*get_fec_stats)(struct fbnic_dev *fbd, bool reset,
                              struct fbnic_fec_stats *fec_stats);
index e95be0e7bd9e0d6f8916e28fab817977e70ff16e..2d5ae89b4a154188982e08f515baaadb14061a37 100644 (file)
@@ -44,7 +44,7 @@ int __fbnic_open(struct fbnic_net *fbn)
        if (err)
                goto time_stop;
 
-       err = fbnic_pcs_request_irq(fbd);
+       err = fbnic_mac_request_irq(fbd);
        if (err)
                goto time_stop;
 
@@ -89,7 +89,7 @@ static int fbnic_stop(struct net_device *netdev)
        phylink_suspend(fbn->phylink, fbnic_bmc_present(fbn->fbd));
 
        fbnic_down(fbn);
-       fbnic_pcs_free_irq(fbn->fbd);
+       fbnic_mac_free_irq(fbn->fbd);
 
        fbnic_time_stop(fbn);
        fbnic_fw_xmit_ownership_msg(fbn->fbd, false);
index 62701923cfe96f82d97c8843d0a34261dce46dc3..99fa79acd2df64573cd84e07eb10dd3a90a60f27 100644 (file)
@@ -132,7 +132,7 @@ fbnic_phylink_pcs_get_state(struct phylink_pcs *pcs, unsigned int neg_mode,
 
        state->duplex = DUPLEX_FULL;
 
-       state->link = fbd->mac->pcs_get_link(fbd);
+       state->link = fbd->mac->get_link(fbd);
 }
 
 static int