Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci ixg(4) add an option for Tx to use deferred soft...



details:   https://anonhg.NetBSD.org/src/rev/6b1e1e1043ad
branches:  trunk
changeset: 370077:6b1e1e1043ad
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Sep 16 03:05:51 2022 +0000

description:
ixg(4) add an option for Tx to use deferred softint regardless of whether can get txq lock or not.

That imporve (7%) and stabilize throughput.  But that can cause
latency degradation, so off by default.

ok'ed by msaitoh@n.o.

diffstat:

 sys/dev/pci/files.pci            |   3 ++-
 sys/dev/pci/ixgbe/ix_txrx.c      |  10 ++++++++--
 sys/dev/pci/ixgbe/ixgbe_netbsd.h |   6 +++++-
 3 files changed, 15 insertions(+), 4 deletions(-)

diffs (75 lines):

diff -r d31ee4cd94bc -r 6b1e1e1043ad sys/dev/pci/files.pci
--- a/sys/dev/pci/files.pci     Thu Sep 15 18:00:36 2022 +0000
+++ b/sys/dev/pci/files.pci     Fri Sep 16 03:05:51 2022 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pci,v 1.441 2022/09/07 06:37:04 martin Exp $
+#      $NetBSD: files.pci,v 1.442 2022/09/16 03:05:51 knakahara Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -665,6 +665,7 @@
 file   dev/pci/ixgbe/ixgbe_vf.c        ixg | ixv
 file   dev/pci/ixgbe/if_bypass.c       ixg | ixv
 file   dev/pci/ixgbe/if_fdir.c         ixg | ixv
+defflag        opt_if_ixg.h    IXGBE_ALWAYS_TXDEFER
 
 # This appears to be the driver for virtual instances of i82599.
 device ixv: ether, ifnet, arp, mii, mii_phy
diff -r d31ee4cd94bc -r 6b1e1e1043ad sys/dev/pci/ixgbe/ix_txrx.c
--- a/sys/dev/pci/ixgbe/ix_txrx.c       Thu Sep 15 18:00:36 2022 +0000
+++ b/sys/dev/pci/ixgbe/ix_txrx.c       Fri Sep 16 03:05:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.99 2022/08/07 09:37:47 andvar Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.100 2022/09/16 03:05:51 knakahara Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.99 2022/08/07 09:37:47 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.100 2022/09/16 03:05:51 knakahara Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -250,6 +250,11 @@
                IXGBE_EVC_ADD(&txr->pcq_drops, 1);
                return ENOBUFS;
        }
+#ifdef IXGBE_ALWAYS_TXDEFER
+       kpreempt_disable();
+       softint_schedule(txr->txr_si);
+       kpreempt_enable();
+#else
        if (IXGBE_TX_TRYLOCK(txr)) {
                ixgbe_mq_start_locked(ifp, txr);
                IXGBE_TX_UNLOCK(txr);
@@ -279,6 +284,7 @@
                        kpreempt_enable();
                }
        }
+#endif
 
        return (0);
 } /* ixgbe_mq_start */
diff -r d31ee4cd94bc -r 6b1e1e1043ad sys/dev/pci/ixgbe/ixgbe_netbsd.h
--- a/sys/dev/pci/ixgbe/ixgbe_netbsd.h  Thu Sep 15 18:00:36 2022 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_netbsd.h  Fri Sep 16 03:05:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_netbsd.h,v 1.16 2022/01/25 03:40:29 msaitoh Exp $ */
+/* $NetBSD: ixgbe_netbsd.h,v 1.17 2022/09/16 03:05:51 knakahara Exp $ */
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -31,6 +31,10 @@
 #ifndef _IXGBE_NETBSD_H
 #define _IXGBE_NETBSD_H
 
+#ifdef _KERNEL_OPT
+#include "opt_if_ixg.h"
+#endif
+
 #if 0 /* Enable this if you don't want to use TX multiqueue function */
 #define        IXGBE_LEGACY_TX 1
 #endif



Home | Main Index | Thread Index | Old Index