Page MenuHomeFreeBSD

if_bnxt: add HW-based TX completion coalescing
AcceptedPublic

Authored by sumit.saxena_broadcom.com on Aug 3 2026, 12:07 PM.
Tags
None
Referenced Files
F171445518: D58599.id184629.diff
Fri, Sep 11, 4:14 AM
F171435920: D58599.id183278.diff
Fri, Sep 11, 3:15 AM
F171426205: D58599.id.diff
Fri, Sep 11, 2:01 AM
F171373075: D58599.diff
Thu, Sep 10, 6:29 PM
Unknown Object (File)
Mon, Sep 7, 9:30 PM
Unknown Object (File)
Mon, Sep 7, 8:29 PM
Unknown Object (File)
Sat, Sep 5, 12:45 PM
Unknown Object (File)
Fri, Sep 4, 2:26 PM
Subscribers
None

Details

Summary

When firmware advertises BNXT_FLAG_TX_COAL_CMPL, request coalesced
completions via cmpl_coal_cnt on TX ring alloc and decode the
resulting tx_cmpl_coal_t records using a free-running SQ consumer
index per ring, instead of one completion per BD. Add the
tx_hw_coal_cnt sysctl to tune the firmware coalescing count code.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/dev/bnxt/bnxt_en/bnxt.h
612

This does not seem to be re-initialized like cons/raw_cons/v_bit/toggle is in bnxt_init()

Why is this 64 bits? It looks like this is capped at 24 bits at most by hardware/

Maybe put it next to db_ring_mask? Then it would fit into an alignment hole.

sys/dev/bnxt/bnxt_en/bnxt_txrx.c
287

What's the point of the atomic load / stores here?

293

Shouldn't you be doing the store *AFTER* checking for !clear? Eg, if we hit this with clear==false, won't that corrupt the ring by advancing sq_cons without actually consuming anything? Eg, mbufs there would be orphaned.

In fact, setting this can introduce a race between the iflib interrupt filter and the gtaskq, where they might both write this. Not writing this in the filter (clear==0) eliminates the race and the need for atomics.

sys/dev/bnxt/bnxt_en/bnxt.h
612

Ack

sys/dev/bnxt/bnxt_en/bnxt_txrx.c
287

We don't need atomics here.

293

Agreed.

This revision is now accepted and ready to land.Fri, Aug 21, 2:08 PM