public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/4] net: ethernet: mtk_eth_soc: compile out netsys v2+ code on mt7621
@ 2024-10-15 11:09 Felix Fietkau
  2024-10-15 11:09 ` [PATCH net-next 2/4] net: ethernet: mtk_eth_soc: use napi_build_skb() Felix Fietkau
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Felix Fietkau @ 2024-10-15 11:09 UTC (permalink / raw)
  To: netdev, Sean Wang, Mark Lee, Lorenzo Bianconi, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: linux-kernel, linux-arm-kernel, linux-mediatek

Avoid some branches in the hot path on low-end devices with limited CPU power,
and reduce code size

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/ethernet/mediatek/mtk_eth_soc.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
index 0d5225f1d3ee..654897141869 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -1324,16 +1324,22 @@ extern const struct of_device_id of_mtk_match[];
 
 static inline bool mtk_is_netsys_v1(struct mtk_eth *eth)
 {
+	if (IS_ENABLED(CONFIG_SOC_MT7621))
+		return true;
 	return eth->soc->version == 1;
 }
 
 static inline bool mtk_is_netsys_v2_or_greater(struct mtk_eth *eth)
 {
+	if (IS_ENABLED(CONFIG_SOC_MT7621))
+		return false;
 	return eth->soc->version > 1;
 }
 
 static inline bool mtk_is_netsys_v3_or_greater(struct mtk_eth *eth)
 {
+	if (IS_ENABLED(CONFIG_SOC_MT7621))
+		return false;
 	return eth->soc->version > 2;
 }
 
-- 
2.47.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-10-21  9:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15 11:09 [PATCH net-next 1/4] net: ethernet: mtk_eth_soc: compile out netsys v2+ code on mt7621 Felix Fietkau
2024-10-15 11:09 ` [PATCH net-next 2/4] net: ethernet: mtk_eth_soc: use napi_build_skb() Felix Fietkau
2024-10-15 11:09 ` [PATCH net-next 3/4] net: ethernet: mtk_eth_soc: reduce rx ring size for older chipsets Felix Fietkau
2024-10-15 11:09 ` [PATCH net-next 4/4] net: ethernet: mtk_eth_soc: optimize dma ring address/index calculation Felix Fietkau
2024-10-15 12:54   ` Andrew Lunn
2024-10-15 13:07     ` Felix Fietkau
2024-10-21  9:23       ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox