summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/fman/fman_tgec.c
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2022-09-02 17:57:36 -0400
committerDavid S. Miller <davem@davemloft.net>2022-09-05 14:27:39 +0100
commitef2a8d5478b9ad653c318bdbb4f6e7f46c90f90b (patch)
tree0abc4ec937d7edd853a2ed03a32d71a5baf42cb5 /drivers/net/ethernet/freescale/fman/fman_tgec.c
parent914f8b228ede709274b8c80514b352248ec9da00 (diff)
downloadlinux-ef2a8d5478b9ad653c318bdbb4f6e7f46c90f90b.tar.gz
linux-ef2a8d5478b9ad653c318bdbb4f6e7f46c90f90b.tar.bz2
linux-ef2a8d5478b9ad653c318bdbb4f6e7f46c90f90b.zip
net: dpaa: Adjust queue depth on rate change
Instead of setting the queue depth once during probe, adjust it on the fly whenever we configure the link. This is a bit unusal, since usually the DPAA driver calls into the FMAN driver, but here we do the opposite. We need to add a netdev to struct mac_device for this, but it will soon live in the phylink config. I haven't tested this extensively, but it doesn't seem to break anything. We could possibly optimize this a bit by keeping track of the last rate, but for now we just update every time. 10GEC probably doesn't need to call into this at all, but I've added it for consistency. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Acked-by: Camelia Groza <camelia.groza@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman/fman_tgec.c')
-rw-r--r--drivers/net/ethernet/freescale/fman/fman_tgec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fman/fman_tgec.c b/drivers/net/ethernet/freescale/fman/fman_tgec.c
index 1b60239d5fc7..5a4be54ad459 100644
--- a/drivers/net/ethernet/freescale/fman/fman_tgec.c
+++ b/drivers/net/ethernet/freescale/fman/fman_tgec.c
@@ -601,8 +601,11 @@ static int tgec_del_hash_mac_address(struct fman_mac *tgec,
return 0;
}
-static void adjust_link_void(struct mac_device *mac_dev)
+static void tgec_adjust_link(struct mac_device *mac_dev)
{
+ struct phy_device *phy_dev = mac_dev->phy_dev;
+
+ mac_dev->update_speed(mac_dev, phy_dev->speed);
}
static int tgec_set_exception(struct fman_mac *tgec,
@@ -795,7 +798,7 @@ int tgec_initialization(struct mac_device *mac_dev,
mac_dev->set_allmulti = tgec_set_allmulti;
mac_dev->set_tstamp = tgec_set_tstamp;
mac_dev->set_multi = fman_set_multi;
- mac_dev->adjust_link = adjust_link_void;
+ mac_dev->adjust_link = tgec_adjust_link;
mac_dev->enable = tgec_enable;
mac_dev->disable = tgec_disable;