Commit 7e617d57 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Paolo Abeni
Browse files

eth: fbnic: fix missing programming of the default descriptor



XDP_TX typically uses no offloads. To optimize XDP we added a "default
descriptor" feature to the chip, which allows us to send XDP frames with
just the buffer descriptors (DMA address + length). All the metadata
descriptors are derived from the queue config.

Commit under Fixes missed adding setting the defaults up when transplanting
the code from the prototype driver. Importantly after reset the "request
completion" bit is not set. Packets still get sent but there's no
completion, so ring is not cleaned up. We can send one ring's worth
of packets and then will start dropping all frames that got the XDP_TX
action from the XDP prog.

Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Fixes: 168deb7b ("eth: fbnic: Add support for XDP_TX action")
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20251007232653.2099376-2-kuba@kernel.org


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 2854378a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -83,8 +83,16 @@ static void fbnic_mac_init_axi(struct fbnic_dev *fbd)

static void fbnic_mac_init_qm(struct fbnic_dev *fbd)
{
	u64 default_meta = FIELD_PREP(FBNIC_TWD_L2_HLEN_MASK, ETH_HLEN) |
			   FBNIC_TWD_FLAG_REQ_COMPLETION;
	u32 clock_freq;

	/* Configure default TWQ Metadata descriptor */
	wr32(fbd, FBNIC_QM_TWQ_DEFAULT_META_L,
	     lower_32_bits(default_meta));
	wr32(fbd, FBNIC_QM_TWQ_DEFAULT_META_H,
	     upper_32_bits(default_meta));

	/* Configure TSO behavior */
	wr32(fbd, FBNIC_QM_TQS_CTL0,
	     FIELD_PREP(FBNIC_QM_TQS_CTL0_LSO_TS_MASK,