Module Name:    src
Committed By:   msaitoh
Date:           Thu Dec 28 10:02:14 UTC 2023

Modified Files:
        src/sys/dev/pci/ixgbe: ix_txrx.c ixgbe.h

Log Message:
ixgbe: Use #ifdef IXGBE_FDIR more

 Don't include the Flow Director related members to reduce the size of
struct tx_ring. On amd64 and aarch64, the real size is not changed
because of the alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/pci/ixgbe/ixgbe.h

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/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.111 src/sys/dev/pci/ixgbe/ix_txrx.c:1.112
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.111	Wed Dec 13 08:25:54 2023
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Dec 28 10:02:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.111 2023/12/13 08:25:54 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.112 2023/12/28 10:02:14 msaitoh Exp $ */
 
 /******************************************************************************
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.111 2023/12/13 08:25:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.112 2023/12/28 10:02:14 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -85,6 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 
  */
 static bool ixgbe_rsc_enable = FALSE;
 
+#ifdef IXGBE_FDIR
 /*
  * For Flow Director: this is the
  * number of TX packets we sample
@@ -95,6 +96,7 @@ static bool ixgbe_rsc_enable = FALSE;
  * setting this to 0.
  */
 static int atr_sample_rate = 20;
+#endif
 
 #define IXGBE_M_ADJ(sc, rxr, mp)					\
 	if (sc->max_frame_size <= (rxr->mbuf_sz - ETHER_ALIGN))	\
@@ -715,9 +717,11 @@ ixgbe_setup_transmit_ring(struct tx_ring
 		txbuf->eop = NULL;
 	}
 
+#ifdef IXGBE_FDIR
 	/* Set the rate at which we sample packets */
 	if (sc->feat_en & IXGBE_FEATURE_FDIR)
 		txr->atr_sample = atr_sample_rate;
+#endif
 
 	/* Set number of descriptors available */
 	txr->tx_avail = sc->num_tx_desc;

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.93 src/sys/dev/pci/ixgbe/ixgbe.h:1.94
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.93	Thu Oct 12 08:06:13 2023
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Thu Dec 28 10:02:14 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.93 2023/10/12 08:06:13 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.94 2023/12/28 10:02:14 msaitoh Exp $ */
 
 /******************************************************************************
   SPDX-License-Identifier: BSD-3-Clause
@@ -376,9 +376,11 @@ struct tx_ring {
 	void			*txr_si;
 	bool			txr_no_space; /* Like IFF_OACTIVE */
 
+#ifdef IXGBE_FDIR
 	/* Flow Director */
 	u16			atr_sample;
 	u16			atr_count;
+#endif
 
 	u64			bytes;  /* Used for AIM */
 	u64			packets;

Reply via email to