summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/qca8k.h
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2022-02-02 03:03:33 +0300
committerDavid S. Miller <davem@davemloft.net>2022-02-02 17:44:00 +0300
commit2481d206fae7884cd07014fd1318e63af35e99eb (patch)
tree19a085ed03883771bf1ebd489ec5baa53824596c /drivers/net/dsa/qca8k.h
parent4264350acb75430d5021a1d7de56a33faf69a097 (diff)
downloadlinux-2481d206fae7884cd07014fd1318e63af35e99eb.tar.xz
net: dsa: qca8k: cache lo and hi for mdio write
From Documentation, we can cache lo and hi the same way we do with the page. This massively reduce the mdio write as 3/4 of the time as we only require to write the lo or hi part for a mdio write. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/qca8k.h')
-rw-r--r--drivers/net/dsa/qca8k.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h
index 57368acae41b..c3d3c2269b1d 100644
--- a/drivers/net/dsa/qca8k.h
+++ b/drivers/net/dsa/qca8k.h
@@ -369,6 +369,11 @@ struct qca8k_mdio_cache {
* mdio writes
*/
u16 page;
+/* lo and hi can also be cached and from Documentation we can skip one
+ * extra mdio write if lo or hi is didn't change.
+ */
+ u16 lo;
+ u16 hi;
};
struct qca8k_priv {