Page MenuHomeFreeBSD

mlx5en: do no call if_input() while holding the rq mutex
Needs RevisionPublic

Authored by kib on Mon, Sep 23, 1:21 PM.
Tags
None
Referenced Files
F97512383: D46761.diff
Sun, Sep 29, 8:05 PM
Unknown Object (File)
Fri, Sep 27, 7:14 PM
Unknown Object (File)
Tue, Sep 24, 9:18 PM
Subscribers

Details

Reviewers
jhb
gallatin
Summary
Instead, collect a batch of the received mbufs and push them into upper
stack with temporary unlocked rq.

PR:     281469
Reviewed by:    Ariel Ehrenberg <aehrenberg@nvidia.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Mon, Sep 23, 1:21 PM
sys/dev/mlx5/mlx5_en/mlx5_en_rx.c
516

Note that you can pass a list of packets to ether_input where they are linked by m_nextpkt.

640–643

Could also use an mbufq which takes up less stack space (though this approach is probably fine).

This revision is now accepted and ready to land.Wed, Sep 25, 2:13 PM
kib marked an inline comment as done.
kib edited the summary of this revision. (Show Details)

Use mbufq to collect the batch.

This revision now requires review to proceed.Wed, Sep 25, 2:42 PM

I'm very afraid there will be performance implications due to new cache misses here from queing mbufs twice. On tens of thounsands of interfaces running over 8 years, we've never hit a deadlock from this lock, and I don't think fixing this is important enough to hurt performance for.

Instead of doing this, can you remove the lock entirely, change it to a sleepable lock, or reduce its scope instead? From some reading I did last week at the bug session, I gather that it exists only to guard against 2 rare conditions (doing work later because something failed to restock,the ring, and bringing the interface down).

This revision now requires changes to proceed.Wed, Sep 25, 11:17 PM