]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: ethernet: cortina: Make RX SKB per-port
authorLinus Walleij <linusw@kernel.org>
Fri, 8 May 2026 22:13:37 +0000 (00:13 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 12 May 2026 13:20:16 +0000 (15:20 +0200)
commit06937db21ee311ed07eba47954447245041a982d
tree7705b669b95ec96fb404506905cfff3dbc1c1e86
parent2cb156213093a62b80cf40b1ec71738e93491971
net: ethernet: cortina: Make RX SKB per-port

The SKB used to assemble packets from fragments in gmac_rx()
is static local, but the Gemini has two ethernet ports, meaning
there can be races between the ports on a bad day if a device
is using both.

Make the RX SKB a per-port variable and carry it over between
invocations in the port struct instead.

Zero the pointer once we call napi_gro_frags(), on error (after
calling napi_free_frags()) or if the port is stopped.

Zero it in some place where not strictly necessary just to
emphasize what is going on.

This was found by Sashiko during normal patch review.

Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Link: https://sashiko.dev/#/patchset/20260505-gemini-ethernet-fix-v2-1-997c31d06079%40kernel.org
Signed-off-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260509-gemini-ethernet-fixes-v1-2-6c5d20ddc35b@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/cortina/gemini.c