Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Add ALWAYS_TXDEFER option to vmx(4), too.



details:   https://anonhg.NetBSD.org/src/rev/f717a19d965a
branches:  trunk
changeset: 370078:f717a19d965a
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Sep 16 03:10:12 2022 +0000

description:
Add ALWAYS_TXDEFER option to vmx(4), too.

diffstat:

 sys/dev/pci/files.pci |   3 ++-
 sys/dev/pci/if_vmx.c  |  14 ++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r 6b1e1e1043ad -r f717a19d965a sys/dev/pci/files.pci
--- a/sys/dev/pci/files.pci     Fri Sep 16 03:05:51 2022 +0000
+++ b/sys/dev/pci/files.pci     Fri Sep 16 03:10:12 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pci,v 1.442 2022/09/16 03:05:51 knakahara Exp $
+#      $NetBSD: files.pci,v 1.443 2022/09/16 03:10:12 knakahara Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1186,6 +1186,7 @@
 device vmx: ether, ifnet, arp
 attach vmx at pci
 file   dev/pci/if_vmx.c        vmx
+defflag        opt_if_vmx.h    VMXNET3_ALWAYS_TXDEFER
 
 # Realtek RTL8125 2.5GBASE-T Ethernet
 device rge: ether, ifnet, arp, mii
diff -r 6b1e1e1043ad -r f717a19d965a sys/dev/pci/if_vmx.c
--- a/sys/dev/pci/if_vmx.c      Fri Sep 16 03:05:51 2022 +0000
+++ b/sys/dev/pci/if_vmx.c      Fri Sep 16 03:10:12 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vmx.c,v 1.9 2022/07/06 06:32:50 msaitoh Exp $       */
+/*     $NetBSD: if_vmx.c,v 1.10 2022/09/16 03:10:12 knakahara Exp $    */
 /*     $OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $        */
 
 /*
@@ -19,7 +19,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.9 2022/07/06 06:32:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.10 2022/09/16 03:10:12 knakahara Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_if_vmx.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -3286,6 +3290,11 @@
                return ENOBUFS;
        }
 
+#ifdef VMXNET3_ALWAYS_TXDEFER
+       kpreempt_disable();
+       softint_schedule(txq->vxtxq_si);
+       kpreempt_enable();
+#else
        if (VMXNET3_TXQ_TRYLOCK(txq)) {
                vmxnet3_transmit_locked(ifp, txq);
                VMXNET3_TXQ_UNLOCK(txq);
@@ -3294,6 +3303,7 @@
                softint_schedule(txq->vxtxq_si);
                kpreempt_enable();
        }
+#endif
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index