[PATCH net] net: spacemit: Implement emac_set_pauseparam properly

Michael Opdenacker michael.opdenacker at rootcommit.com
Thu Oct 30 13:30:42 PDT 2025


On 10/30/25 15:31, Vivian Wang wrote:
> emac_set_pauseparam (the set_pauseparam callback) didn't properly update
> phydev->advertising. Fix it by changing it to call phy_set_asym_pause.
>
> Also simplify/reorganize related code around this.
>
> Fixes: bfec6d7f2001 ("net: spacemit: Add K1 Ethernet MAC")
> Signed-off-by: Vivian Wang <wangruikang at iscas.ac.cn>
> ---
>   drivers/net/ethernet/spacemit/k1_emac.c | 48 ++++++++++++++-------------------
>   1 file changed, 20 insertions(+), 28 deletions(-)


Tested on OrangePi RV2 through performance tests, on 
https://github.com/spacemit-com/linux/commits/for-next. No regressions 
found:

root at orangepi-rv2-mainline:~# iperf3 -c 172.24.0.1
Connecting to host 172.24.0.1, port 5201
[  5] local 172.24.0.2 port 49948 connected to 172.24.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   113 MBytes   946 Mbits/sec    0    339 KBytes
[  5]   1.00-2.00   sec   112 MBytes   943 Mbits/sec    0    447 KBytes
[  5]   2.00-3.00   sec   113 MBytes   948 Mbits/sec    0    447 KBytes
[  5]   3.00-4.00   sec   112 MBytes   941 Mbits/sec    0    475 KBytes
[  5]   4.00-5.00   sec   112 MBytes   940 Mbits/sec    0    505 KBytes
[  5]   5.00-6.00   sec   112 MBytes   944 Mbits/sec    0    567 KBytes
[  5]   6.00-7.00   sec   113 MBytes   949 Mbits/sec    0    600 KBytes
[  5]   7.00-8.00   sec   112 MBytes   939 Mbits/sec    0    600 KBytes
[  5]   8.00-9.00   sec   112 MBytes   936 Mbits/sec    0    600 KBytes
[  5]   9.00-10.01  sec   113 MBytes   940 Mbits/sec    0    600 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.01  sec  1.10 GBytes   943 Mbits/sec    0   sender
[  5]   0.00-10.02  sec  1.10 GBytes   940 Mbits/sec     receiver

iperf Done.
root at orangepi-rv2-mainline:~# iperf3 -s
-----------------------------------------------------------
Server listening on 5201 (test #1)
-----------------------------------------------------------
Accepted connection from 172.24.0.1, port 47834
[  5] local 172.24.0.2 port 5201 connected to 172.24.0.1 port 47840
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   112 MBytes   934 Mbits/sec
[  5]   1.00-2.00   sec   112 MBytes   941 Mbits/sec
[  5]   2.00-3.00   sec   112 MBytes   942 Mbits/sec
[  5]   3.00-4.00   sec   112 MBytes   942 Mbits/sec
[  5]   4.00-5.00   sec   112 MBytes   942 Mbits/sec
[  5]   5.00-6.00   sec   112 MBytes   942 Mbits/sec
[  5]   6.00-7.00   sec   112 MBytes   942 Mbits/sec
[  5]   7.00-8.00   sec   112 MBytes   942 Mbits/sec
[  5]   8.00-9.00   sec   112 MBytes   941 Mbits/sec
[  5]   9.00-10.00  sec   112 MBytes   942 Mbits/sec
[  5]  10.00-10.01  sec   640 KBytes  1.04 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.01  sec  1.10 GBytes   941 Mbits/sec     receiver
-----------------------------------------------------------
Server listening on 5201 (test #2)
-----------------------------------------------------------

Tested-by: Michael Opdenacker <michael.opdenacker at rootcommit.com>
Thanks!
Michael.

-- 
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/




More information about the linux-riscv mailing list