summaryrefslogtreecommitdiff
path: root/rust/helpers/slab.c
diff options
context:
space:
mode:
authorWei Fang <wei.fang@nxp.com>2025-09-26 09:39:53 +0800
committerPaolo Abeni <pabeni@redhat.com>2025-09-30 10:47:41 +0200
commit2aff4420efc2910e905ee5b000e04e87422aebc4 (patch)
treeeba0a21b1760e3da98cb8fcbc20b574207987c88 /rust/helpers/slab.c
parent9c328f54741bd5465ca1dc717c84c04242fac2e1 (diff)
net: enetc: initialize SW PIR and CIR based HW PIR and CIR values
Software can only initialize the PIR and CIR of the command BD ring after a FLR, and these two registers can only be set to 0. But the reset values of these two registers are 0, so software does not need to update them. If there is no a FLR and PIR and CIR are not 0, resetting them to 0 or other values by software will cause the command BD ring to work abnormally. This is because of an internal context in the ring prefetch logic that will retain the state from the first incarnation of the ring and continue prefetching from the stale location when the ring is reinitialized. The internal context can only be reset by the FLR. In addition, there is a logic error in the implementation, next_to_clean indicates the software CIR and next_to_use indicates the software PIR. But the current driver uses next_to_clean to set PIR and use next_to_use to set CIR. This does not cause a problem in actual use, because the current command BD ring is only initialized after FLR, and the initial values of next_to_use and next_to_clean are both 0. Therefore, this patch removes the initialization of PIR and CIR. Instead, next_to_use and next_to_clean are initialized by reading the values of PIR and CIR. Fixes: 4701073c3deb ("net: enetc: add initial netc-lib driver to support NTMP") Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20250926013954.2003456-1-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'rust/helpers/slab.c')
0 files changed, 0 insertions, 0 deletions