Page MenuHomeFreeBSD
Feed Advanced Search

Jan 14 2024

akiyano_amazon.com committed rGc8a0dbcaff3f: ena: Update driver version to v2.7.0 (authored by osamaabb_amazon.com).
ena: Update driver version to v2.7.0
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rGba2007c083ef: ena: Update the license dating to 2023 (authored by osamaabb_amazon.com).
ena: Update the license dating to 2023
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rGbe6292777476: ena: Support srd metrics with sysctl (authored by osamaabb_amazon.com).
ena: Support srd metrics with sysctl
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rG86f779a18c0d: ena: Support customer metric with sysctl (authored by osamaabb_amazon.com).
ena: Support customer metric with sysctl
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rGcdf3fb73ae13: ena: Introduce shared sample interval for all stats (authored by osamaabb_amazon.com).
ena: Introduce shared sample interval for all stats
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rG026a78a2adb4: ena: Remove CQ tail pointer update API (authored by osamaabb_amazon.com).
ena: Remove CQ tail pointer update API
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rG2f7f8526c38d: ena: Update ena_com_update_intr_reg API usage (authored by osamaabb_amazon.com).
ena: Update ena_com_update_intr_reg API usage
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rG99c3944243a0: ena: Add sysctl support for spreading IRQs (authored by osamaabb_amazon.com).
ena: Add sysctl support for spreading IRQs
Jan 14 2024, 10:09 PM
akiyano_amazon.com committed rG6e9bfa8040b5: ena: Change measurement unit of time since last tx cleanup to ms (authored by akiyano_amazon.com).
ena: Change measurement unit of time since last tx cleanup to ms
Jan 14 2024, 10:08 PM
akiyano_amazon.com committed rGc07c5801f82b: ena: Upgrade ena-com to freebsd v2.7.0 (authored by akiyano_amazon.com).
ena: Upgrade ena-com to freebsd v2.7.0
Jan 14 2024, 10:08 PM
akiyano_amazon.com committed rG9015208bff0a: ena: Update driver version to v2.7.0 (authored by osamaabb_amazon.com).
ena: Update driver version to v2.7.0
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rGeb29118a2fe5: ena: Update the license dating to 2023 (authored by osamaabb_amazon.com).
ena: Update the license dating to 2023
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG9757b07f1800: ena: Support srd metrics with sysctl (authored by osamaabb_amazon.com).
ena: Support srd metrics with sysctl
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG538f9ea8fa58: ena: Support customer metric with sysctl (authored by osamaabb_amazon.com).
ena: Support customer metric with sysctl
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG79c446badb02: ena: Introduce shared sample interval for all stats (authored by osamaabb_amazon.com).
ena: Introduce shared sample interval for all stats
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG9d773b0d5f56: ena: Remove CQ tail pointer update API (authored by osamaabb_amazon.com).
ena: Remove CQ tail pointer update API
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG00916b6d298e: ena: Update ena_com_update_intr_reg API usage (authored by osamaabb_amazon.com).
ena: Update ena_com_update_intr_reg API usage
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG71cd348d2454: ena: Add sysctl support for spreading IRQs (authored by osamaabb_amazon.com).
ena: Add sysctl support for spreading IRQs
Jan 14 2024, 9:55 PM
akiyano_amazon.com committed rG4526ef3d05dd: ena: Change measurement unit of time since last tx cleanup to ms (authored by akiyano_amazon.com).
ena: Change measurement unit of time since last tx cleanup to ms
Jan 14 2024, 9:54 PM
akiyano_amazon.com committed rG6b358493a69c: ena: Upgrade ena-com to freebsd v2.7.0 (authored by akiyano_amazon.com).
ena: Upgrade ena-com to freebsd v2.7.0
Jan 14 2024, 9:54 PM

Dec 28 2023

akiyano_amazon.com committed rG4e2688cc762d: ena: Update driver version to v2.7.0 (authored by osamaabb_amazon.com).
ena: Update driver version to v2.7.0
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rG246aa273244e: ena: Update the license dating to 2023 (authored by osamaabb_amazon.com).
ena: Update the license dating to 2023
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rG36d42c862f4a: ena: Support srd metrics with sysctl (authored by osamaabb_amazon.com).
ena: Support srd metrics with sysctl
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rGf97993ad7b9c: ena: Support customer metric with sysctl (authored by osamaabb_amazon.com).
ena: Support customer metric with sysctl
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rG5b925280d9a5: ena: Introduce shared sample interval for all stats (authored by osamaabb_amazon.com).
ena: Introduce shared sample interval for all stats
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rG2835752e075f: ena: Remove CQ tail pointer update API (authored by osamaabb_amazon.com).
ena: Remove CQ tail pointer update API
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rGf9e1d9471077: ena: Add sysctl support for spreading IRQs (authored by osamaabb_amazon.com).
ena: Add sysctl support for spreading IRQs
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rG72e34ebdd088: ena: Update ena_com_update_intr_reg API usage (authored by osamaabb_amazon.com).
ena: Update ena_com_update_intr_reg API usage
Dec 28 2023, 1:58 PM
akiyano_amazon.com committed rG9272e45c04c0: ena: Change measurement unit of time since last tx cleanup to ms (authored by akiyano_amazon.com).
ena: Change measurement unit of time since last tx cleanup to ms
Dec 28 2023, 1:57 PM
akiyano_amazon.com committed rGadfed2d835a7: ena: Upgrade ena-com to freebsd v2.7.0 (authored by akiyano_amazon.com).
ena: Upgrade ena-com to freebsd v2.7.0
Dec 28 2023, 1:55 PM
akiyano_amazon.com committed rG04cf7cee5ae0: ena: Upgrade ena-com to freebsd v2.7.0 (authored by osamaabb_amazon.com).
ena: Upgrade ena-com to freebsd v2.7.0
Dec 28 2023, 1:31 PM

Nov 20 2023

akiyano_amazon.com committed R11:eab69f7420f1: astro/xearth: add myself (akiyano) to freebsd.committers.markers (authored by akiyano_amazon.com).
astro/xearth: add myself (akiyano) to freebsd.committers.markers
Nov 20 2023, 8:57 PM
akiyano_amazon.com committed rGfec0c3fb08cc: Add myself (akiyano) to calendar.freebsd (authored by akiyano_amazon.com).
Add myself (akiyano) to calendar.freebsd
Nov 20 2023, 8:52 PM
akiyano_amazon.com committed R9:91b077d39e18: New committer (src): Arthur Kiyanovski (akiyano) (authored by akiyano_amazon.com).
New committer (src): Arthur Kiyanovski (akiyano)
Nov 20 2023, 8:50 PM

Nov 19 2023

akiyano_amazon.com committed rG33db883c9598: Add akiyano as src committer and cperciva as mentor (authored by akiyano_amazon.com).
Add akiyano as src committer and cperciva as mentor
Nov 19 2023, 2:08 PM

Jun 28 2023

akiyano_amazon.com added a comment to D40769: ena: Update driver version to v2.6.3.

Looks like you submitted the wrong patch?

Jun 28 2023, 6:08 AM

Jun 27 2023

akiyano_amazon.com added a reviewer for D40769: ena: Update driver version to v2.6.3: mw.
Jun 27 2023, 8:48 AM
akiyano_amazon.com added a reviewer for D40765: ena: Initialize statistics before the interface is available: mw.
Jun 27 2023, 8:48 AM
akiyano_amazon.com added a reviewer for D40766: ena: Fix driver unload crash: mw.
Jun 27 2023, 8:48 AM
akiyano_amazon.com requested review of D40769: ena: Update driver version to v2.6.3.
Jun 27 2023, 8:42 AM
akiyano_amazon.com requested review of D40766: ena: Fix driver unload crash.
Jun 27 2023, 8:32 AM
akiyano_amazon.com requested review of D40765: ena: Initialize statistics before the interface is available.
Jun 27 2023, 8:27 AM

Jun 6 2023

akiyano_amazon.com added a comment to D39614: ifnet: fix use-after-free by ignoring post-detach ifp link events..
In D39614#907626, @kp wrote:
In D39614#902547, @kp wrote:

The fix to this particular issue depends on the answers of the above (or can be a bandaid as in diff if we want to kick the can down the road).

Those are all good questions, but I think in this case our issue is that the ifnet goes away between the task being enqueued and executed. There are a number of other places where we see things like that, and that's the 'general problem' I was referring to.

Ack! I was looking into it from a different angle. The mental model of "safe detach" to me is a) set the demarcation point that signals "no more data accepted", b) ensure no data is indeed accepted and c) clear the queued data. I'm a bit unsure if we can or should generalise the implementations for the different datapaths and control plane. The current code mostly have everything implemented - IFF_DYING flag is set, marking the end of the era and the taskq is cleaned from the link tasks matching this interface. The remaining part is rejecting new changes.

We can indeed do an MPASS() check in the enqueue code to reject such code patterns if that's what we agree with.

What do you folks think?

So that seems like a sane general approach, but I'm not clear on how it'd work here. We'd have to make sure the ifp sticks around until the task queue no longer has any if_linktasks remaining, and I don't think we have a mechanism for that currently.

I think we have something in if.c:if_detach_internal() for that ( https://cgit.freebsd.org/src/tree/sys/net/if.c#n1145 ):

	/*
	 * In any case (destroy or vmove) detach us from the groups
	 * and remove/wait for pending events on the taskq.
	 * XXX-BZ in theory an interface could still enqueue a taskq change?
	 */
	if_delgroups(ifp);

	taskqueue_drain(taskqueue_swi, &ifp->if_linktask);
	taskqueue_drain(taskqueue_swi, &ifp->if_addmultitask);

So I still believe that the remaining part is to reject the new changes. Happy to discuss it more :-)
And anyway, @akiyano_amazon.com, I guess we need the driver to be updated to avoid setting the state when dying. Could you please look at that?

Jun 6 2023, 9:25 AM

Apr 19 2023

akiyano_amazon.com added a comment to D39614: ifnet: fix use-after-free by ignoring post-detach ifp link events..
In D39614#901770, @zlei wrote:

I do not quite understand this logic:

ena_detach()
  ether_ifdetach()
    if_detach()
      if_detach_internal()  # here we drain taskqueue_swi from link events
  ena_destroy_device()
    if_link_state_change()  # here we enqueue new link event

Why is ether_ifdetach() invoked before if_link_state_change() ???

As far as I understand, ena_destroy_device() is called in multiple places, including an init error handler, so it incorporates setting the link down. I think that it would make sense for the driver to move the link state change elsewhere, but I'd prefer to address the stack problem first.

Apr 19 2023, 1:30 PM

Apr 17 2023

akiyano_amazon.com added a comment to D39614: ifnet: fix use-after-free by ignoring post-detach ifp link events..

I've tested this commit and it solves the issue.
Updated kernel and world to the latest main. => Issue reproduced.
Applied this fix to kernel sources, built and installed kernel => issue doesn't reproduce.

Apr 17 2023, 2:18 PM

Apr 13 2023

akiyano_amazon.com added a comment to D39048: carp: add netlink interface.
In D39048#899603, @zlei wrote:

Hi all,
I hope it is OK that I write this here, if not please tell me what will be a better place to do it.
This commit has made the ENA driver crash upon kldunload if_ena.ko. (I made sure by running buildworld on this commit and on the commit before it)

Here is the full call stack that was dumped:

curthread () at /root/freebsd-src/sys/amd64/include/pcpu_aux.h:59
59
asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu,
(kgdb) #0 __curthread () at /root/freebsd-src/sys/amd64/include/pcpu_aux.h:59
#1 doadump (textdump=textdump@entry=1)
at /root/freebsd-src/sys/kern/kern_shutdown.c:407
#2 0xffffffff80bedc6c in kern_reboot (howto=260)
at /root/freebsd-src/sys/kern/kern_shutdown.c:528
#3 0xffffffff80bee18f in vpanic (fmt=<optimized out>,
ap=ap@entry=0xfffffe01fef62ae0)
at /root/freebsd-src/sys/kern/kern_shutdown.c:972
#4 0xffffffff80bedf13 in panic (fmt=<unavailable>)
at /root/freebsd-src/sys/kern/kern_shutdown.c:896
#5 0xffffffff810e2b39 in trap_fatal (frame=0xfffffe01fef62b70, eva=0)
at /root/freebsd-src/sys/amd64/amd64/trap.c:954
#6 <signal handler called>
#7 dump_sa (nw=nw@entry=0xfffffe01fef62d08, attr=attr@entry=1,
sa=0xdeadc0dedeadc0de) at /root/freebsd-src/sys/netlink/route/iface.c:210
#8 0xffffffff80e5659a in dump_iface (nw=nw@entry=0xfffffe01fef62d08,
ifp=ifp@entry=0xfffff80109bbe800, hdr=hdr@entry=0xfffffe01fef62d48,
if_flags_mask=if_flags_mask@entry=0)
at /root/freebsd-src/sys/netlink/route/iface.c:279
#9 0xffffffff80e55e7b in rtnl_handle_ifevent (ifp=0xfffff80109bbe800,
nlmsg_type=<optimized out>, if_flags_mask=0)
at /root/freebsd-src/sys/netlink/route/iface.c:943
#10 0xffffffff80d1fc1d in do_link_state_change (arg=0xfffff80109bbe800,
pending=1) at /root/freebsd-src/sys/net/if.c:2205
#11 0xffffffff80c5233a in taskqueue_run_locked (
queue=queue@entry=0xfffff80106ce7100)
at /root/freebsd-src/sys/kern/subr_taskqueue.c:514
#12 0xffffffff80c5224d in taskqueue_run (queue=0xfffff80106ce7100)
at /root/freebsd-src/sys/kern/subr_taskqueue.c:529
#13 0xffffffff80ba8126 in intr_event_execute_handlers (ie=0xfffff80106a9d300,
p=<optimized out>) at /root/freebsd-src/sys/kern/kern_intr.c:1207
#14 ithread_execute_handlers (ie=0xfffff80106a9d300, p=<optimized out>)
at /root/freebsd-src/sys/kern/kern_intr.c:1220
#15 ithread_loop (arg=arg@entry=0xfffff80106c951c0)
at /root/freebsd-src/sys/kern/kern_intr.c:1308
#16 0xffffffff80ba45c0 in fork_exit (
callout=0xffffffff80ba7eb0 <ithread_loop>, arg=0xfffff80106c951c0,
frame=0xfffffe01fef62f40) at /root/freebsd-src/sys/kern/kern_fork.c:1102
#17 <signal handler called>
(kgdb)

I don't have much experience with CARP, and I was wondering if anything obvious jumps out from this call stack with regard to this commit?

Thank you for the report!
I agree with the assessment, it's not carp related.
When the ifnet departure hook is called, indeed some stuff from the ifnet may have been already disappeared. I'll update the callback handler to use only basic interface info, that should be present till the end.

Apr 13 2023, 6:47 AM

Apr 11 2023

akiyano_amazon.com added a comment to D39048: carp: add netlink interface.

Hi all,
I hope it is OK that I write this here, if not please tell me what will be a better place to do it.
This commit has made the ENA driver crash upon kldunload if_ena.ko. (I made sure by running buildworld on this commit and on the commit before it)

Apr 11 2023, 8:58 PM