All of lore.kernel.org
 help / color / mirror / Atom feed
* irq_fpu_usable() is false in ndo_start_xmit() for UDP packets
@ 2015-11-16 19:52 Jason A. Donenfeld
  2015-11-16 20:32 ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: Jason A. Donenfeld @ 2015-11-16 19:52 UTC (permalink / raw)
  To: Netdev, LKML; +Cc: David Miller

Hi David & Folks,

I have a virtual device driver that does some fancy processing of
packets in ndo_start_xmit before forwarding them onward out of a
tunnel elsewhere. In order to make that fancy processing fast, I have
AVX and AVX2 implementations. This means I need to use the FPU.

So, I do the usual pattern found throughout the kernel:

        if (!irq_fpu_usable())
                generic_c(...);
        else {
                kernel_fpu_begin();
                optimized_avx(...);
                kernel_fpu_end();
         }

This works fine with, say, iperf3 in TCP mode. The AVX performance is
great. However, when using iperf3 in UDP mode, irq_fpu_usable() is
mostly false! I added a dump_stack() call to see why, except nothing
looks strange; the initial call in the stack trace is
entry_SYSCALL_64_fastpath. Why would irq_fpu_usable() return false
when we're in a syscall? Doesn't that mean this is in process context?

So, I find this a bit disturbing. If anybody has an explanation, and a
way to work around it, I'd be quite happy. Or, simply if there is a
debugging technique you'd recommend, I'd be happy to try something and
report back.

Thanks,
Jason

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-11-17 12:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-16 19:52 irq_fpu_usable() is false in ndo_start_xmit() for UDP packets Jason A. Donenfeld
2015-11-16 20:32 ` David Miller
2015-11-16 20:58   ` Jason A. Donenfeld
2015-11-16 21:17     ` David Miller
2015-11-16 21:28       ` Jason A. Donenfeld
2015-11-16 21:33         ` David Miller
2015-11-16 21:37           ` Jason A. Donenfeld
2015-11-16 22:27     ` Hannes Frederic Sowa
2015-11-16 23:57       ` Jason A. Donenfeld
2015-11-17  0:04         ` Jason A. Donenfeld
2015-11-17 12:38   ` David Laight

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.