Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Nov 2012 23:40:01 GMT
From:      "Steven Hartland" <killing@multiplay.co.uk>
To:        freebsd-net@FreeBSD.org
Subject:   Re: kern/173201: [ixgbe] [patch] Missing / broken ixgbe sysctl&#39; s and tunables (patch included)
Message-ID:  <201211072340.qA7Ne1Ur079628@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/173201; it has been noted by GNATS.

From: "Steven Hartland" <killing@multiplay.co.uk>
To: <bug-followup@freebsd.org>
Cc:  
Subject: Re: kern/173201: [ixgbe] [patch] Missing / broken ixgbe sysctl&#39;s and tunables (patch included)
Date: Wed, 7 Nov 2012 23:34:39 -0000

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_00B9_01CDBD40.74878ED0
 Content-Type: text/plain;
 	format=flowed;
 	charset="Windows-1252";
 	reply-type=original
 Content-Transfer-Encoding: 7bit
 
 Updated patch that applies to HEAD as of yesterday.
 
 ================================================
 This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 
 
 In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337
 or return the E.mail to postmaster@multiplay.co.uk.
 ------=_NextPart_000_00B9_01CDBD40.74878ED0
 Content-Type: text/plain;
 	format=flowed;
 	name="ixgbe-sysctl.txt";
 	reply-type=original
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="ixgbe-sysctl.txt"
 
 Added sysctl's for ixgbe all tunables=0A=
 =0A=
 Added back in hw.ixgbe.flow_control which enable the default flow_control=0A=
 of all ixgbe interfaces to be set in loader.conf=0A=
 =0A=
 Added hw.ixgbe.advertise_speed which allows /boot/loader.conf to =
 configure=0A=
 advertised speed as sysctl.conf is too late for driver changes.=0A=
 =0A=
 Made enable_aim device independent based on hw.ixgbe.enable_aim default.=0A=
 --- sys/dev/ixgbe/ixgbe.c.orig	2012-11-06 12:28:35.607778862 +0000=0A=
 +++ sys/dev/ixgbe/ixgbe.c	2012-11-06 14:20:02.774297585 +0000=0A=
 @@ -157,8 +157,10 @@=0A=
  static void     ixgbe_update_link_status(struct adapter *);=0A=
  static void	ixgbe_refresh_mbufs(struct rx_ring *, int);=0A=
  static int      ixgbe_xmit(struct tx_ring *, struct mbuf **);=0A=
 -static int	ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS);=0A=
 -static int	ixgbe_set_advertise(SYSCTL_HANDLER_ARGS);=0A=
 +static int	ixgbe_set_flowcntl_sysctl(SYSCTL_HANDLER_ARGS);=0A=
 +static int	ixgbe_set_flowcntl(struct adapter *);=0A=
 +static int	ixgbe_set_advertise_sysctl(SYSCTL_HANDLER_ARGS);=0A=
 +static int	ixgbe_set_advertise(struct adapter *);=0A=
  static int	ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS);=0A=
  static int	ixgbe_dma_malloc(struct adapter *, bus_size_t,=0A=
  		    struct ixgbe_dma_alloc *, int);=0A=
 @@ -230,32 +232,52 @@=0A=
  MODULE_DEPEND(ixgbe, ether, 1, 1, 1);=0A=
  =0A=
  /*=0A=
 -** TUNEABLE PARAMETERS:=0A=
 -*/=0A=
 + * TUNEABLE PARAMETERS:=0A=
 + */=0A=
 +static SYSCTL_NODE(_hw, OID_AUTO, ixgbe, CTLFLAG_RD, 0, "IXGBE driver =
 parameters");=0A=
  =0A=
  /*=0A=
 -** AIM: Adaptive Interrupt Moderation=0A=
 -** which means that the interrupt rate=0A=
 -** is varied over time based on the=0A=
 -** traffic for that interrupt vector=0A=
 -*/=0A=
 + * AIM: Adaptive Interrupt Moderation=0A=
 + * which means that the interrupt rate=0A=
 + * is varied over time based on the=0A=
 + * traffic for that interrupt vector=0A=
 + */=0A=
  static int ixgbe_enable_aim =3D TRUE;=0A=
  TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, enable_aim, CTLFLAG_RDTUN,=0A=
 +    &ixgbe_enable_aim, 0, "Enable adaptive interrupt moderation");=0A=
  =0A=
  static int ixgbe_max_interrupt_rate =3D (4000000 / IXGBE_LOW_LATENCY);=0A=
  TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN,=0A=
 +    &ixgbe_max_interrupt_rate, 0, "Maximum interrupt rate used in AIM");=0A=
  =0A=
  /* How many packets rxeof tries to clean at a time */=0A=
  static int ixgbe_rx_process_limit =3D 128;=0A=
  TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,=0A=
 +    &ixgbe_rx_process_limit, 0, "Maximum number of received packets to =
 process"=0A=
 +    " at a time, -1 means unlimited");=0A=
 +=0A=
 +/* Flow control setting, default to full */=0A=
 +static int ixgbe_flow_control =3D ixgbe_fc_full;=0A=
 +TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, flow_control, CTLFLAG_RDTUN,=0A=
 +    &ixgbe_flow_control, 0, "Default flow control used for all =
 adapters");=0A=
 +=0A=
 +/* Advertise Speed, default to 0 (10G) */=0A=
 +static int ixgbe_advertise_speed =3D 0;=0A=
 +TUNABLE_INT("hw.ixgbe.advertise_speed", &ixgbe_advertise_speed);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, advertise_speed, CTLFLAG_RDTUN,=0A=
 +    &ixgbe_advertise_speed, 0, "Default advertised speed for all =
 adapters");=0A=
  =0A=
  /*=0A=
 -** Smart speed setting, default to on=0A=
 -** this only works as a compile option=0A=
 -** right now as its during attach, set=0A=
 -** this to 'ixgbe_smart_speed_off' to=0A=
 -** disable.=0A=
 -*/=0A=
 + * Smart speed setting, default to on=0A=
 + * this only works as a compile option=0A=
 + * right now as its during attach, set=0A=
 + * this to 'ixgbe_smart_speed_off' to=0A=
 + * disable.=0A=
 + */=0A=
  static int ixgbe_smart_speed =3D ixgbe_smart_speed_on;=0A=
  =0A=
  /*=0A=
 @@ -264,6 +286,8 @@=0A=
   */=0A=
  static int ixgbe_enable_msix =3D 1;=0A=
  TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, enable_msix, CTLFLAG_RDTUN, =
 &ixgbe_enable_msix,=0A=
 +    0, "Enable/disble MSIX for ixgbe adapters");=0A=
  =0A=
  /*=0A=
   * Header split: this causes the hardware to DMA=0A=
 @@ -273,6 +297,8 @@=0A=
   */=0A=
  static int ixgbe_header_split =3D FALSE;=0A=
  TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe_header_split);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, hdr_split, CTLFLAG_RDTUN, =
 &ixgbe_header_split,=0A=
 +    0, "Enable receive mbuf header split");=0A=
  =0A=
  /*=0A=
   * Number of Queues, can be set to 0,=0A=
 @@ -282,6 +308,8 @@=0A=
   */=0A=
  static int ixgbe_num_queues =3D 0;=0A=
  TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, num_queues, CTLFLAG_RDTUN, =
 &ixgbe_num_queues, 0,=0A=
 +    "Number of queues to configure, 0 indicates autoconfigure");=0A=
  =0A=
  /*=0A=
  ** Number of TX descriptors per ring,=0A=
 @@ -290,10 +318,14 @@=0A=
  */=0A=
  static int ixgbe_txd =3D PERFORM_TXD;=0A=
  TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0,=0A=
 +    "Number of receive descriptors per queue");=0A=
  =0A=
  /* Number of RX descriptors per ring */=0A=
  static int ixgbe_rxd =3D PERFORM_RXD;=0A=
  TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd);=0A=
 +SYSCTL_INT(_hw_ixgbe, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0,=0A=
 +    "Number of transmit descriptors per queue");=0A=
  =0A=
  /*=0A=
  ** HW RSC control: =0A=
 @@ -426,12 +458,19 @@=0A=
  	/* Core Lock Init*/=0A=
  	IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));=0A=
  =0A=
 +	/* hw.ixgbe defaults init */=0A=
 +	adapter->advertise =3D ixgbe_advertise_speed;=0A=
 +	adapter->fc =3D ixgbe_flow_control;=0A=
 +	adapter->enable_aim =3D ixgbe_enable_aim;=0A=
 +	ixgbe_set_advertise(adapter);=0A=
 +	ixgbe_set_flowcntl(adapter);=0A=
 +=0A=
  	/* SYSCTL APIs */=0A=
  =0A=
  	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),=0A=
  			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),=0A=
  			OID_AUTO, "fc", CTLTYPE_INT | CTLFLAG_RW,=0A=
 -			adapter, 0, ixgbe_set_flowcntl, "I", "Flow Control");=0A=
 +			adapter, 0, ixgbe_set_flowcntl_sysctl, "I", "Flow Control");=0A=
  =0A=
          SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),=0A=
  			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),=0A=
 @@ -446,7 +485,7 @@=0A=
  	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),=0A=
  			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),=0A=
  			OID_AUTO, "advertise_speed", CTLTYPE_INT | CTLFLAG_RW,=0A=
 -			adapter, 0, ixgbe_set_advertise, "I", "Link Speed");=0A=
 +			adapter, 0, ixgbe_set_advertise_sysctl, "I", "Link Speed");=0A=
  =0A=
  	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),=0A=
  			SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),=0A=
 @@ -1528,7 +1567,7 @@=0A=
  =0A=
  	/* Do AIM now? */=0A=
  =0A=
 -	if (ixgbe_enable_aim =3D=3D FALSE)=0A=
 +	if (adapter->enable_aim =3D=3D FALSE)=0A=
  		goto no_calc;=0A=
  	/*=0A=
  	** Do Adaptive Interrupt Moderation:=0A=
 @@ -5744,7 +5787,7 @@=0A=
  **	3 - full=0A=
  */=0A=
  static int=0A=
 -ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS)=0A=
 +ixgbe_set_flowcntl_sysctl(SYSCTL_HANDLER_ARGS)=0A=
  {=0A=
  	int error, last;=0A=
  	struct adapter *adapter =3D (struct adapter *) arg1;=0A=
 @@ -5758,6 +5801,13 @@=0A=
  	if (adapter->fc =3D=3D last)=0A=
  		return (0);=0A=
  =0A=
 +	return ixgbe_set_flowcntl(adapter);=0A=
 +}=0A=
 +=0A=
 +static int=0A=
 +ixgbe_set_flowcntl(struct adapter *adapter)=0A=
 +{=0A=
 +=0A=
  	switch (adapter->fc) {=0A=
  		case ixgbe_fc_rx_pause:=0A=
  		case ixgbe_fc_tx_pause:=0A=
 @@ -5775,7 +5825,7 @@=0A=
  	/* Don't autoneg if forcing a value */=0A=
  	adapter->hw.fc.disable_fc_autoneg =3D TRUE;=0A=
  	ixgbe_fc_enable(&adapter->hw);=0A=
 -	return error;=0A=
 +	return 0;=0A=
  }=0A=
  =0A=
  static void=0A=
 @@ -5795,23 +5845,32 @@=0A=
  **	3 - advertise normal=0A=
  */=0A=
  static int=0A=
 -ixgbe_set_advertise(SYSCTL_HANDLER_ARGS)=0A=
 +ixgbe_set_advertise_sysctl(SYSCTL_HANDLER_ARGS)=0A=
  {=0A=
  	int			error =3D 0;=0A=
  	struct adapter		*adapter;=0A=
 -	device_t		dev;=0A=
 -	struct ixgbe_hw		*hw;=0A=
 -	ixgbe_link_speed	speed, last;=0A=
  =0A=
  	adapter =3D (struct adapter *) arg1;=0A=
 -	dev =3D adapter->dev;=0A=
 -	hw =3D &adapter->hw;=0A=
 -	last =3D adapter->advertise;=0A=
  =0A=
  	error =3D sysctl_handle_int(oidp, &adapter->advertise, 0, req);=0A=
  	if ((error) || (adapter->advertise =3D=3D -1))=0A=
  		return (error);=0A=
  =0A=
 +	return ixgbe_set_advertise(adapter);=0A=
 +}=0A=
 + =0A=
 +static int=0A=
 +ixgbe_set_advertise(struct adapter *adapter)=0A=
 +{=0A=
 +	int			error =3D 0;=0A=
 +	device_t		dev;=0A=
 +	struct ixgbe_hw		*hw;=0A=
 +	ixgbe_link_speed	speed, last;=0A=
 +=0A=
 +	hw =3D &adapter->hw;=0A=
 +	dev =3D adapter->dev;=0A=
 +	last =3D hw->phy.autoneg_advertised;=0A=
 +=0A=
  	if (adapter->advertise =3D=3D last) /* no change */=0A=
  		return (0);=0A=
  =0A=
 --- sys/dev/ixgbe/ixgbe.h.orig	2012-11-06 12:28:48.969656479 +0000=0A=
 +++ sys/dev/ixgbe/ixgbe.h	2012-11-06 12:48:39.784556819 +0000=0A=
 @@ -410,6 +410,7 @@=0A=
  	u32			optics;=0A=
  	u32			fc; /* local flow ctrl setting */=0A=
  	int			advertise;  /* link speeds */=0A=
 +	bool			enable_aim; /* adaptive interrupt moderation */=0A=
  	bool			link_active;=0A=
  	u16			max_frame_size;=0A=
  	u16			num_segs;=0A=
 
 ------=_NextPart_000_00B9_01CDBD40.74878ED0--
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211072340.qA7Ne1Ur079628>