Module Name: src
Committed By: knakahara
Date: Fri Sep 16 03:10:12 UTC 2022
Modified Files:
src/sys/dev/pci: files.pci if_vmx.c
Log Message:
Add ALWAYS_TXDEFER option to vmx(4), too.
To generate a diff of this commit:
cvs rdiff -u -r1.442 -r1.443 src/sys/dev/pci/files.pci
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_vmx.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.442 src/sys/dev/pci/files.pci:1.443
--- src/sys/dev/pci/files.pci:1.442 Fri Sep 16 03:05:51 2022
+++ src/sys/dev/pci/files.pci Fri Sep 16 03:10:12 2022
@@ -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 @@ file dev/pci/xmm7360.c
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
Index: src/sys/dev/pci/if_vmx.c
diff -u src/sys/dev/pci/if_vmx.c:1.9 src/sys/dev/pci/if_vmx.c:1.10
--- src/sys/dev/pci/if_vmx.c:1.9 Wed Jul 6 06:32:50 2022
+++ src/sys/dev/pci/if_vmx.c Fri Sep 16 03:10:12 2022
@@ -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 @@ vmxnet3_transmit(struct ifnet *ifp, stru
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 @@ vmxnet3_transmit(struct ifnet *ifp, stru
softint_schedule(txq->vxtxq_si);
kpreempt_enable();
}
+#endif
return 0;
}