Page MenuHomeFreeBSD

gallatin (Andrew Gallatin)
User

Projects (2)

User Details

User Since
Jun 22 2015, 5:21 PM (594 w, 6 d)

Recent Activity

Yesterday

gallatin accepted D61512: sched_ule: Skip the CPU search for threads bound to one CPU.
Sun, Nov 15, 5:31 PM

Sat, Nov 14

gallatin updated the diff for D61518: mlx5en: only pass TCP packets to sw LRO.
  • moved to tcp |= as suggested by @kib and @glebius
  • used true/false rather than 1/0 for bools, as requested by @glebius
Sat, Nov 14, 9:38 PM
gallatin committed rG8a7328248622: ixgbe: Classify missed packets only as input drops.
Sat, Nov 14, 1:58 PM
gallatin closed D61523: ixgbe: missed packets are idrops, not errors.
Sat, Nov 14, 1:58 PM

Fri, Nov 13

gallatin requested review of D61523: ixgbe: missed packets are idrops, not errors.
Fri, Nov 13, 10:20 PM
gallatin requested review of D61518: mlx5en: only pass TCP packets to sw LRO.
Fri, Nov 13, 8:03 PM
gallatin closed D61361: callout: optionally round-robin default callout CPU, instead of always using 0.
Fri, Nov 13, 5:55 PM
gallatin committed rG67f3eac87e41: callout: optionally spread callouts to all CPUs.
Fri, Nov 13, 5:55 PM

Thu, Nov 12

gallatin accepted D61430: mlx5en: fix RX HW timestamp overflow with 1GHz clock.
Thu, Nov 12, 7:31 PM
gallatin updated subscribers of D61430: mlx5en: fix RX HW timestamp overflow with 1GHz clock.
Thu, Nov 12, 7:31 PM
gallatin added a comment to D61361: callout: optionally round-robin default callout CPU, instead of always using 0.

I would suggest to enable this by default. What are our potential pitfalls?

Thu, Nov 12, 6:33 PM
gallatin updated the diff for D61361: callout: optionally round-robin default callout CPU, instead of always using 0.

mjg's idea to use the current CPU works nearly as well as perfect round-robin and makes for a much smaller patch

Thu, Nov 12, 5:51 PM

Wed, Nov 11

gallatin added a comment to D61430: mlx5en: fix RX HW timestamp overflow with 1GHz clock.

My llm, when reviewing this, complains that the patch increases the number of divides per packet from 3 to 4, and suggests this math instead:

Wed, Nov 11, 9:46 PM

Tue, Nov 10

gallatin closed D61313: iflib: rate limit deferred tx ring drain.
Tue, Nov 10, 3:52 PM
gallatin closed D61279: iflib: simplify TXQ_AVAIL.
Tue, Nov 10, 3:52 PM
gallatin committed rGfe63435bdfae: iflib: rate limit deferred tx ring drain.
Tue, Nov 10, 3:52 PM
gallatin committed rG44df82b11c53: iflib: simplify TXQ_AVAIL.
Tue, Nov 10, 3:52 PM
gallatin added a comment to D61361: callout: optionally round-robin default callout CPU, instead of always using 0.
In D61361#1406968, @mjg wrote:

This does not solve the problem though as the same scheduling can still occur -- the real fix would notice the callout is taking too long while it is taking too long and if need be redirect queued callbacks to other CPUs.

Tue, Nov 10, 2:02 PM

Mon, Nov 9

gallatin requested review of D61361: callout: optionally round-robin default callout CPU, instead of always using 0.
Mon, Nov 9, 9:03 PM
gallatin updated the diff for D61313: iflib: rate limit deferred tx ring drain.
  • update baudrate usage as suggested by kbowling
Mon, Nov 9, 2:44 PM

Sun, Nov 8

gallatin requested review of D61313: iflib: rate limit deferred tx ring drain.
Sun, Nov 8, 1:39 AM

Sat, Nov 7

gallatin added a comment to D61262: if_bnxt: set COAL_NOW only on BDs that request a completion.

This seems reasonable. But bnxt_ktls_pre_xmit() seems to use the same pattern that you're fixing here. Does it also need the same fix?

Sat, Nov 7, 9:28 PM

Fri, Nov 6

gallatin requested review of D61279: iflib: simplify TXQ_AVAIL.
Fri, Nov 6, 11:42 PM
gallatin accepted D61262: if_bnxt: set COAL_NOW only on BDs that request a completion.

This seems reasonable. But bnxt_ktls_pre_xmit() seems to use the same pattern that you're fixing here. Does it also need the same fix?

Fri, Nov 6, 5:19 PM
gallatin requested changes to D61261: if_bnxt: add optional TX doorbell coalescing.

If I'm reading this right, a lone packet waits for two timer callbacks. bnxt_isc_txd_flush() saves the producer index and increments tx_db_seq without ringing. The next bnxt_if_timer() seees a changed sequence and only records it; the following callback rings if the sequence stayed unchanged. The default iflib period is hz / 2 (sys/net/iflib.c:6293), so this adds approximately 500 ms–1 second per affected transmit on an idle queue.

Fri, Nov 6, 5:14 PM

Thu, Nov 5

gallatin closed D60175: iflib: Use a single tx dma map.
Thu, Nov 5, 5:01 PM
gallatin committed rG4b732459f030: iflib: Use a single tx dma map.
Thu, Nov 5, 5:01 PM

Wed, Nov 4

gallatin closed D61164: bnxt: avoid unintialized use of media_type in bnxt_add_media_types().
Wed, Nov 4, 5:13 PM
gallatin committed rG36cd9f2ff331: bnxt: avoid unintialized use of media_type in bnxt_add_media_types().
Wed, Nov 4, 5:13 PM
gallatin committed rGd1695bbd48cc: iflib: prefer simple_tx over mp_ring.
Wed, Nov 4, 5:12 PM
gallatin closed D61166: iflib: prefer simple_tx over mp_ring.
Wed, Nov 4, 5:12 PM

Tue, Nov 3

gallatin requested review of D61166: iflib: prefer simple_tx over mp_ring.
Tue, Nov 3, 7:22 PM
gallatin requested review of D61164: bnxt: avoid unintialized use of media_type in bnxt_add_media_types().
Tue, Nov 3, 6:55 PM
gallatin closed D61162: bnxt: correct more mappings for 400G optics and 100G LR.
Tue, Nov 3, 5:45 PM
gallatin committed rG28d8abeaa574: bnxt: correct more mappings for 400G optics and 100G LR.
Tue, Nov 3, 5:45 PM
gallatin requested review of D61162: bnxt: correct more mappings for 400G optics and 100G LR.
Tue, Nov 3, 5:15 PM
gallatin committed rG9ed1713e2818: bnxt: add 400GBase-FR4 support.
Tue, Nov 3, 3:29 PM
gallatin accepted D61147: iflib: Expose locked datapath quiescence for driver resets.

Looks mostly OK to me.

Tue, Nov 3, 1:56 AM

Mon, Nov 2

gallatin added a comment to D61147: iflib: Expose locked datapath quiescence for driver resets.

I think the tx task could be running after iflib_stop(), thus leaving us not quite quiesced. Is there any reason why iflib_stop() does not do a gtaskqueue_drain() for tx tasks?

Mon, Nov 2, 8:42 PM
gallatin requested review of D61137: bnxt: add 400GBase-FR4 support.
Mon, Nov 2, 4:38 PM
gallatin committed rG0e44056f19ab: if_media: Add 400G FR4 media types.
Mon, Nov 2, 4:36 PM
gallatin closed D61135: if_media: Add 400G FR4 media types.
Mon, Nov 2, 4:36 PM
gallatin requested review of D61135: if_media: Add 400G FR4 media types.
Mon, Nov 2, 4:08 PM
gallatin closed D61084: lacp: fix lacp for interfaces with unknown media.
Mon, Nov 2, 3:59 PM
gallatin committed rG0b420c655f81: lacp: fix lacp for interfaces with unknown media.
Mon, Nov 2, 3:59 PM
gallatin accepted D61109: ice: Apply DCB queue mappings inside normal initialization.

Aside from that "locked" local, this looks fine to me.

Mon, Nov 2, 12:38 AM
gallatin updated the diff for D61084: lacp: fix lacp for interfaces with unknown media.

update patch to be more conservative and use ifmedia_baudrate() whenever it is non-zero,
due to known bugs in drivers properly reporting if_baudrate
as suggested by @kbowling

Mon, Nov 2, 12:27 AM
gallatin added a comment to D61084: lacp: fix lacp for interfaces with unknown media.

There are about a dozen other driver issues, do you want me to open reviews with possible fixups?

Retaining valid media derived bandwidth and falling back to if_baudrate might limit the damage if you want this quickly.

Mon, Nov 2, 12:05 AM
gallatin added a comment to D61084: lacp: fix lacp for interfaces with unknown media.

I spot bxe(4) sets if_baudrate to 10 Gb/s even for a 1 Gb/s SFP, qlnx sets it based on PCI ID, oce sets on attach but needs update logic all which should be fixed independently.

But this is the right direction. What device did you spot the issue?

Mon, Nov 2, 12:05 AM

Sat, Oct 31

gallatin requested review of D61084: lacp: fix lacp for interfaces with unknown media.
Sat, Oct 31, 8:50 PM
gallatin accepted D61060: add NOTRIM to PRINT_UMA_ZFLAGS .
Sat, Oct 31, 7:10 PM

Fri, Oct 30

gallatin accepted D60976: if_bnxt: size MRAV from the AV split entry for backing store V2.
Fri, Oct 30, 5:41 PM
gallatin accepted D60977: if_bnxt: skip HW kTLS on old firmware and add a tunable to disable it.
Fri, Oct 30, 5:38 PM
gallatin accepted D60967: udp6: make udp6_ctlinput() same as IPv4 version.
Fri, Oct 30, 5:29 PM
gallatin added a comment to D60987: mbuf: declare mbuf hash types as distinct types, not flags.

In general, I'm not sure I like this change. The old code seems less complex

Why? The old code needed to filter hash type with a mask. The new code reduces all the macros to assignments and comparisons and provides a type. The old code allowed to plant a bug like the one fixed today. The new code, being strengthened with -Werror=assign-enum, such bug can not longer be compilable.

Fri, Oct 30, 5:27 PM
gallatin added a comment to D60987: mbuf: declare mbuf hash types as distinct types, not flags.

tests/sys/sys/mbuf_test.c still refs M_HASHTYPE_INNER so it needs to be updated or removed

IMHO, the test is not needed. I will include removal of the test into the change.

M_HASHTYPE_SET and M_HASHTYPE_CLEAR no longer reset INNER is that an issue?

Just an informational note.. the renumbering affects sockopt, netstat output, siftr, dtrace so it cannot MFC.

I don't think this needs to be MFC-ed at all. But theoretically it could, since IP_FLOWTYPE isn't documented and netstat just prints a binary value. Do you know of any practical use of IP_FLOWTYPE?

if_rxd_info grows from 56 to 64b, probably benign.

This can be addressed with bit field specification. Let me know if needs to be done so, or better leave as is?

Fri, Oct 30, 5:25 PM

Thu, Oct 29

gallatin added a comment to D60987: mbuf: declare mbuf hash types as distinct types, not flags.

In general, I'm not sure I like this change. The old code seems less complex once the difference between M_HASHTYPE_OPAQUE and M_HASHTYPE_OPAQUE_HASH is taken into account.

Thu, Oct 29, 8:52 PM

Wed, Oct 21

gallatin updated the diff for D60175: iflib: Use a single tx dma map.

Updated based on feedback from @kgalazka

Wed, Oct 21, 11:02 PM
gallatin added inline comments to D60175: iflib: Use a single tx dma map.
Wed, Oct 21, 10:46 PM

Tue, Oct 20

gallatin committed rGceb575553b22: arm64: enable ossl accelerated AES-GCM on arm64.
Tue, Oct 20, 7:08 PM
gallatin closed D60097: arm64: enable ossl accelerated AES-GCM on arm64.
Tue, Oct 20, 7:08 PM
gallatin added inline comments to D60097: arm64: enable ossl accelerated AES-GCM on arm64.
Tue, Oct 20, 7:07 PM
gallatin committed rGef7d7011ce2f: arm64: Fix EFI runtime mappings with 16K pages.
Tue, Oct 20, 6:56 PM
gallatin closed D60749: arm64: Fix EFI runtime mappings with 16K pages.
Tue, Oct 20, 6:56 PM

Sun, Oct 18

gallatin accepted D60805: iflib: Pass up the frames received before a descriptor error.

Nice catch.

Sun, Oct 18, 1:37 PM

Oct 16 2026

gallatin updated the diff for D60523: ktls: Do direct dispatch of asynch crypto when possible.

Move assignment of queued=1 below new async bypass as suggested by @markj

Oct 16 2026, 7:09 PM
gallatin updated the diff for D60523: ktls: Do direct dispatch of asynch crypto when possible.

Updated patch to use @glebius suggestion of THREAD_CAN_SLEEP() rather than
a sleepable flap.

Oct 16 2026, 7:05 PM
gallatin added inline comments to D60749: arm64: Fix EFI runtime mappings with 16K pages.
Oct 16 2026, 3:15 PM
gallatin accepted D60689: net*: use inlined m_pullup().
Oct 16 2026, 2:39 PM
gallatin added a comment to D60416: iflib: Ring transmit doorbells once per receive batch.

Did you try measure doing the call to iflib_txdb_batch() in iflib_simple_encap(), rather than adding an argument all the way down? I hate the perceived complexity adding an arg adds.. Pushing it down adds 2 loads from hot cache lines per packet in the case where we have contention and the deferral ring is used, at the human savings of some complexity, and possibly 8 bytes of stack space. I think it won't matter at all for your workload, since I'm guessing your workload is mostly uncontended, so the deferral ring is probably not used.

Oct 16 2026, 2:06 PM

Oct 15 2026

gallatin added a comment to D60175: iflib: Use a single tx dma map.

The ICE version of the sparse check does the right thing. Both the X700 and E800 generations of adapters have the same limits: a header can span at most three descriptors, and a single frame can span up to eight. I guess this wasn't backported from ICE to IXL (and IAVF?) due to my oversight.

The idea of having a single implementation in iflib sounds really good. Would you like me to tackle that, or do you already have a draft and would prefer to submit it yourself?

Oct 15 2026, 10:09 PM
gallatin accepted D60758: ktls: Take the receiving interface of each packet in sbappend_ktls_rx().
Oct 15 2026, 10:06 PM
gallatin accepted D60757: ktls: Fix capability checks in ktls_reset_receive_tag().

@kib The more errors like this that I see, the more firmly convinced I am that ifcap2 was a mistake, and that we should just have just extended if_capabilities / if_capenable to 64-bits.

Oct 15 2026, 10:04 PM
gallatin added a reviewer for D60757: ktls: Fix capability checks in ktls_reset_receive_tag(): glebius.
Oct 15 2026, 10:01 PM
gallatin added a reviewer for D60757: ktls: Fix capability checks in ktls_reset_receive_tag(): kib.
Oct 15 2026, 9:59 PM
gallatin added inline comments to D60523: ktls: Do direct dispatch of asynch crypto when possible.
Oct 15 2026, 9:52 PM
gallatin requested review of D60749: arm64: Fix EFI runtime mappings with 16K pages.
Oct 15 2026, 6:09 PM

Oct 13 2026

gallatin accepted D60552: ip_encap: Recompute flowid for packets received over tunnel.
Oct 13 2026, 8:54 PM
gallatin added a comment to D60552: ip_encap: Recompute flowid for packets received over tunnel.

@gallatin
So, I can update this revision to:

  1. Do a m_pullup at the call site for at least a sizeof(struct ip/ip6_hdr). (It fails only if mbuf not contains L4 header AND rss_gethashconfig requires L4 hash)
  2. Add a new KPI to m_pullup based on rss_gethashconfig() and call it at the call site right before the encap_set_flowid. (ideal, expensive)
  3. Leave it as is and only set flowid when it won't cost a m_pullup. (simple, undeterministic, no dependency on D60689)

What do you recommend?

Oct 13 2026, 8:54 PM
gallatin committed rG83f5b5c2eeba: __FreeBSD_version: Bump for changing pkthdr layout.
Oct 13 2026, 3:41 PM
gallatin committed rG9890a0d5e04a: mbuf: move leaf_rcv union farther back in the pkthdr.
Oct 13 2026, 3:41 PM
gallatin closed D60691: mbuf: move leaf_rcv union farther back in the pkthdr.
Oct 13 2026, 3:41 PM
gallatin added a reviewer for D60175: iflib: Use a single tx dma map: rcm.
Oct 13 2026, 2:30 PM
gallatin added a comment to D60175: iflib: Use a single tx dma map.

Any comments or review on this? Its been 2 weeks and I'd really like to merge this.

Oct 13 2026, 2:30 PM
gallatin accepted D60698: if_bnxt: fix powerpc build of the MPC ring code.
Oct 13 2026, 1:11 PM
gallatin committed rGf4ff995e361f: pfil: Avoid potential mbuf tag leak.
Oct 13 2026, 1:09 PM
gallatin requested review of D60691: mbuf: move leaf_rcv union farther back in the pkthdr.
Oct 13 2026, 12:11 AM

Oct 12 2026

gallatin requested review of D60690: pfil: prevent tag leak in pfil_fake_mbuf().
Oct 12 2026, 11:54 PM
gallatin added a comment to D60686: mbuf: simplify m_free.

Okay, indeed this revision would open up the leak described. Normally m_tag_delete_chain is called from UMA destructor that is called via uma_zfree(zone_mbuf, m) and for M_NOFREE mbufs it is called here. AFAIR, those cxgbe's M_NOFREE mbufs were some kind of a pool. The pfil fake mbuf is on stack. So, if this change is combined with adding m_tag_delete_chain to the end of pfil_fake_mbuf, everything should be alright.

pfil_fake_mbuf(...) {
...
...
...
	if (!SLIST_EMPTY(&m.m_pkthdr.tags))
		m_tag_delete_chain(&m, NULL);
}
Oct 12 2026, 11:47 PM
gallatin accepted D60688: mbuf: make m_pullup() an inline over most expected case.
Oct 12 2026, 11:43 PM
gallatin committed rG398254f9999e: mbuf: simplify m_free.
Oct 12 2026, 11:10 PM
gallatin closed D60686: mbuf: simplify m_free.
Oct 12 2026, 11:09 PM
gallatin added a comment to D60686: mbuf: simplify m_free.

I think the only way it can get a tag is via m_pkthdr_init() calling mac_mbuf_init(). But I don't think that mac tags can be used in the pfil fake mbuf path.
I was going to suggest just skipping the call to mac_mbuf_init() for M_NOFREE mbufs

Or are there other ways a tag can get attached there?

Firewalls may attach tags. I think we found a bug: one can craft a ruleset with tags for pf(4) and then attach it to NIC level pfil. That would leak memory.

Oct 12 2026, 11:07 PM
gallatin added a comment to D60686: mbuf: simplify m_free.

Looks like pfil(9) in compatibility mode remains the only user of M_NOFREE. And this change hints that pfil_fake_mbuf() actually needs to call m_tag_delete_chain.

I think the only way it can get a tag is via m_pkthdr_init() calling mac_mbuf_init(). But I don't think that mac tags can be used in the pfil fake mbuf path.
I was going to suggest just skipping the call to mac_mbuf_init() for M_NOFREE mbufs

Or are there other ways a tag can get attached there?

Oct 12 2026, 10:22 PM
gallatin added a comment to D60686: mbuf: simplify m_free.

Looks like pfil(9) in compatibility mode remains the only user of M_NOFREE. And this change hints that pfil_fake_mbuf() actually needs to call m_tag_delete_chain.

Oct 12 2026, 10:14 PM
gallatin requested review of D60686: mbuf: simplify m_free.
Oct 12 2026, 9:45 PM
gallatin committed rGcdd95034d6f4: iflib: unify prefetching.
Oct 12 2026, 9:28 PM
gallatin closed D60602: iflib: unify prefetching & enable for non-x86.
Oct 12 2026, 9:27 PM
gallatin added a comment to D60602: iflib: unify prefetching & enable for non-x86.

My intention is to just get prefetching working for arm64 in iflib. His kern_prefetch uses a different level assembly instruction (nt0 in iflib, vs nt1 in rrs code).

Yep, and Randall's intention was also to just get his things working in HPTS :) And before that Macy's intention was also to get his things working in iflib (but not on arm64). It would be really great if we don't need a fourth person to achieve his intentions before we get some standardized KPI for that. :)

Oct 12 2026, 5:35 PM

Oct 10 2026

gallatin added a comment to D60602: iflib: unify prefetching & enable for non-x86.
Oct 10 2026, 11:28 PM