svn commit: r333364 - in stable/11: share/man/man4 sys/dev/bnxt

Stephen Hurd shurd at FreeBSD.org
Tue May 8 15:51:42 UTC 2018


Author: shurd
Date: Tue May  8 15:51:40 2018
New Revision: 333364
URL: https://svnweb.freebsd.org/changeset/base/333364

Log:
  MFC: r308728, r314369, r315243, r316026, r316581, r316616, r318359,
  r319922, r319990, r321481, r323232-323233, r323321, r323874, r323955,
  r324323, r324964, r325169, r325488, r325620, r326985, r326999-327001,
  r327003, r329335
  
  Update bnxt to latest -CURRENT.
  
  Approved by:	re (gjb@)
  Differential Revision:	https://reviews.freebsd.org/D15143

Modified:
  stable/11/share/man/man4/bnxt.4
  stable/11/sys/dev/bnxt/bnxt.h
  stable/11/sys/dev/bnxt/bnxt_hwrm.c
  stable/11/sys/dev/bnxt/bnxt_hwrm.h
  stable/11/sys/dev/bnxt/bnxt_sysctl.c
  stable/11/sys/dev/bnxt/bnxt_sysctl.h
  stable/11/sys/dev/bnxt/bnxt_txrx.c
  stable/11/sys/dev/bnxt/hsi_struct_def.h
  stable/11/sys/dev/bnxt/if_bnxt.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/bnxt.4
==============================================================================
--- stable/11/share/man/man4/bnxt.4	Tue May  8 13:23:39 2018	(r333363)
+++ stable/11/share/man/man4/bnxt.4	Tue May  8 15:51:40 2018	(r333364)
@@ -68,28 +68,44 @@ Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Contr
 .It
 Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller
 .It
-Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller
+Broadcom BCM57304 NetXtreme-C Ethernet Virtual Function
 .It
-Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller
+Broadcom BCM57314 NetXtreme-C Ethernet Virtual Function
 .It
-Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller
+Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller
 .It
-Broadcom BCM57402 NetXtreme-E Partition
+Broadcom BCM57402 NetXtreme-E Ethernet Partition
 .It
-Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller
+Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller
 .It
+Broadcom BCM57404 NetXtreme-E Ethernet Virtual Function
+.It
 Broadcom BCM57404 NetXtreme-E Partition
 .It
+Broadcom BCM57406 NetXtreme-E 10GBASE-T Ethernet Controller
+.It
 Broadcom BCM57406 NetXtreme-E Partition
 .It
+Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller
+.It
 Broadcom BCM57407 NetXtreme-E 25Gb Ethernet Controller
 .It
-Broadcom BCM57304 NetXtreme-C Virtual Function
+Broadcom BCM57407 NetXtreme-E Partition
 .It
-Broadcom BCM57404 NetXtreme-E Virtual Function
+Broadcom BCM57412 NetXtreme-E Partition
+.It
+Broadcom BCM57414 NetXtreme-E Ethernet Virtual Function
+.It
+Broadcom BCM57414 NetXtreme-E Partition
+.It
+Broadcom BCM57416 NetXtreme-E Partition
+.It
+Broadcom BCM57417 NetXtreme-E Ethernet Partition
+.It
+Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet
 .El
 .Sh SYSCTL VARIABLES
-These variables must be set before loading the driver, either via 
+These variables must be set before loading the driver, either via
 .Xr loader.conf 5
 or through the use of
 .Xr kenv 1 .
@@ -165,11 +181,12 @@ variables are read-only:
 .Bl -tag -width indent
 .It Va dev.bnxt.X.if_name
 Current interface name of the device.
-This will normally be 
+This will normally be
 .Va bnxtX ,
 but this can be changed using
 .Cm ifconfig name .
-This sysctl allows correlating an interface with a child of dev.bnxt.
+This sysctl allows correlating an interface with a child of
+.Va dev.bnxt .
 .It Va dev.bnxt.X.nvram.*
 Information about the NVRAM device which contains the device firmware.
 .It Va dev.bnxt.X.ver.*
@@ -180,21 +197,30 @@ Supported HWRM API version of the currently running fi
 HWRM API version the driver was built to support.
 .It Va dev.bnxt.X.hwstats.*
 Per-queue statistics tracked by the hardware.
+.It Va dev.bnxt.X.hwstats.port_stats.*
+Per-port statistics tracked by the hardware.
 .It Va dev.bnxt.X.hwstats.rxq0.drop_pkts
 Number of packets dropped by hardware on queue zero.
 This number might seem high, but the count includes packets dropped due to
 incorrect destination MAC, unsubscribed multicast address, and other normal
 reasons to ignore Ethernet frames.
+.It Va dev.bnxt.X.hwstats.rxq0.tpa_*
+statistics related to HW LRO.
+.It Va dev.bnxt.X.hw_lro.*
+Enable / Disable HW LRO feature. Defaults to disable.
+Enabling HW LRO could cause issues when forwarding is enabled on host.
+.It Va dev.bnxt.X.fc
+Enable / Disable Flow Control feature. Defaults to Enable
 .El
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "bnxt%d: %s command returned %s error."
 Device firmware rejected a command from the driver.
 There might be a driver/firmware HWRM API mismatch.
-.It "bnxt%d: Timeout sending %s (timeout: %d) seq %d\n"
+.It "bnxt%d: Timeout sending %s (timeout: %d) seq %d"
 Device firmware unresponsive.
 A PCI device reset is likely needed.
-.It "bnxt%d: Timeout sending %s (timeout: %d) msg {0x%x 0x%x} len:%d v: %d\n"
+.It "bnxt%d: Timeout sending %s (timeout: %d) msg {0x%x 0x%x} len:%d v: %d"
 Partial firmware response.
 A PCI device reset is likely needed.
 .Pp
@@ -203,20 +229,23 @@ As of this writing, the system must be rebooted to ini
 .Sh SEE ALSO
 .Xr altq 4 ,
 .Xr arp 4 ,
+.Xr iflib 4 ,
 .Xr netintro 4 ,
 .Xr ng_ether 4 ,
 .Xr vlan 4 ,
-.Xr ifconfig 8 ,
-.Xr iflib 4
+.Xr ifconfig 8
 .Sh HISTORY
 The
 .Nm
 device driver first appeared in
 .Fx 11.1 .
 .Sh AUTHORS
+.An -nosplit
 The
 .Nm
 driver was written by
-.An Jack Vogel Aq Mt jfvogel at gmail.com .
+.An Jack Vogel Aq Mt jfvogel at gmail.com 
+and 
+.An Stephen Hurd Aq Mt shurd at freebsd.org ,
 and is currently maintained by
-.An Stephen Hurd Aq Mt stephen.hurd at broadcom.com .
+.An Broadcom Limited Aq Mt freebsd.pdl at broadcom.com .

Modified: stable/11/sys/dev/bnxt/bnxt.h
==============================================================================
--- stable/11/sys/dev/bnxt/bnxt.h	Tue May  8 13:23:39 2018	(r333363)
+++ stable/11/sys/dev/bnxt/bnxt.h	Tue May  8 15:51:40 2018	(r333364)
@@ -93,6 +93,18 @@ __FBSDID("$FreeBSD$");
 
 #define BNXT_MAX_MTU	9000
 
+#define BNXT_RSS_HASH_TYPE_TCPV4	0
+#define BNXT_RSS_HASH_TYPE_UDPV4	1
+#define BNXT_RSS_HASH_TYPE_IPV4		2
+#define BNXT_RSS_HASH_TYPE_TCPV6	3
+#define BNXT_RSS_HASH_TYPE_UDPV6	4
+#define BNXT_RSS_HASH_TYPE_IPV6		5
+#define BNXT_GET_RSS_PROFILE_ID(rss_hash_type) ((rss_hash_type >> 1) & 0x1F)
+
+#define BNXT_NO_MORE_WOL_FILTERS	0xFFFF
+#define bnxt_wol_supported(softc)	(!((softc)->flags & BNXT_FLAG_VF) && \
+					  ((softc)->flags & BNXT_FLAG_WOL_CAP ))
+
 /* Completion related defines */
 #define CMP_VALID(cmp, v_bit) \
 	((!!(((struct cmpl_base *)(cmp))->info3_v & htole32(CMPL_BASE_V))) == !!(v_bit) )
@@ -199,10 +211,31 @@ __FBSDID("$FreeBSD$");
 #define BNXT_HWRM_LOCK_DESTROY(_softc)	mtx_destroy(&(_softc)->hwrm_lock)
 #define BNXT_HWRM_LOCK_ASSERT(_softc)	mtx_assert(&(_softc)->hwrm_lock,    \
     MA_OWNED)
+#define BNXT_IS_FLOW_CTRL_CHANGED(link_info)				    \
+	((link_info->last_flow_ctrl.tx != link_info->flow_ctrl.tx) ||       \
+         (link_info->last_flow_ctrl.rx != link_info->flow_ctrl.rx) ||       \
+	 (link_info->last_flow_ctrl.autoneg != link_info->flow_ctrl.autoneg))
 
 /* Chip info */
 #define BNXT_TSO_SIZE	UINT16_MAX
 
+#define min_t(type, x, y) ({                    \
+        type __min1 = (x);                      \
+        type __min2 = (y);                      \
+        __min1 < __min2 ? __min1 : __min2; })
+
+#define max_t(type, x, y) ({                    \
+        type __max1 = (x);                      \
+        type __max2 = (y);                      \
+        __max1 > __max2 ? __max1 : __max2; })
+
+#define clamp_t(type, _x, min, max)     min_t(type, max_t(type, _x, min), max)
+
+#define BNXT_IFMEDIA_ADD(supported, fw_speed, ifm_speed) do {			\
+	if ((supported) & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_ ## fw_speed)	\
+		ifmedia_add(softc->media, IFM_ETHER | (ifm_speed), 0, NULL);	\
+} while(0)
+
 #define BNXT_MIN_FRAME_SIZE	52	/* Frames must be padded to this size for some A0 chips */
 
 /* NVRAM access */
@@ -266,6 +299,12 @@ struct bnxt_bar_info {
 	int			rid;
 };
 
+struct bnxt_flow_ctrl {
+	bool rx;
+	bool tx;
+	bool autoneg;
+};
+
 struct bnxt_link_info {
 	uint8_t		media_type;
 	uint8_t		transceiver;
@@ -277,10 +316,8 @@ struct bnxt_link_info {
 	uint8_t		last_link_up;
 	uint8_t		duplex;
 	uint8_t		last_duplex;
-	uint8_t		pause;
-	uint8_t		last_pause;
-	uint8_t		auto_pause;
-	uint8_t		force_pause;
+	struct bnxt_flow_ctrl   flow_ctrl;
+	struct bnxt_flow_ctrl   last_flow_ctrl;
 	uint8_t		duplex_setting;
 	uint8_t		auto_mode;
 #define PHY_VER_LEN		3
@@ -298,7 +335,6 @@ struct bnxt_link_info {
 #define BNXT_AUTONEG_SPEED	1
 #define BNXT_AUTONEG_FLOW_CTRL	2
 	uint8_t		req_duplex;
-	uint8_t		req_flow_ctrl;
 	uint16_t	req_link_speed;
 };
 
@@ -372,7 +408,6 @@ struct bnxt_vf_info {
 	bus_addr_t	hwrm_cmd_req_dma_addr;
 };
 
-#define BNXT_FLAG_VF		(1<<1)
 
 #define BNXT_PF(softc)		(!((softc)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(softc)		((softc)->flags & BNXT_FLAG_VF)
@@ -498,6 +533,21 @@ struct bnxt_nvram_info {
 	struct sysctl_oid	*nvm_oid;
 };
 
+struct bnxt_func_qcfg {
+	uint16_t alloc_completion_rings;
+	uint16_t alloc_tx_rings;
+	uint16_t alloc_rx_rings;
+	uint16_t alloc_vnics;
+};
+
+struct bnxt_hw_lro {
+	uint16_t enable;
+	uint16_t is_mode_gro;
+	uint16_t max_agg_segs;
+	uint16_t max_aggs;
+	uint32_t min_agg_len;
+};
+
 struct bnxt_softc {
 	device_t	dev;
 	if_ctx_t	ctx;
@@ -508,17 +558,22 @@ struct bnxt_softc {
 	struct bnxt_bar_info	hwrm_bar;
 	struct bnxt_bar_info	doorbell_bar;
 	struct bnxt_link_info	link_info;
-#define BNXT_FLAG_NPAR		1
+#define BNXT_FLAG_VF		0x0001
+#define BNXT_FLAG_NPAR		0x0002
+#define BNXT_FLAG_WOL_CAP	0x0004
+#define BNXT_FLAG_SHORT_CMD	0x0008 
 	uint32_t		flags;
 	uint32_t		total_msix;
 
 	struct bnxt_func_info	func;
+	struct bnxt_func_qcfg	fn_qcfg;
 	struct bnxt_pf_info	pf;
 	struct bnxt_vf_info	vf;
 
 	uint16_t		hwrm_cmd_seq;
 	uint32_t		hwrm_cmd_timeo;	/* milliseconds */
 	struct iflib_dma_info	hwrm_cmd_resp;
+	struct iflib_dma_info	hwrm_short_cmd_req_addr;
 	/* Interrupt info for HWRM */
 	struct if_irq		irq;
 	struct mtx		hwrm_lock;
@@ -528,6 +583,7 @@ struct bnxt_softc {
 	uint8_t			max_tc;
 	struct bnxt_cos_queue	q_info[BNXT_MAX_QUEUE];
 
+	uint64_t		admin_ticks;
 	struct iflib_dma_info	hw_rx_port_stats;
 	struct iflib_dma_info	hw_tx_port_stats;
 	struct rx_port_stats	*rx_port_stats;
@@ -554,9 +610,30 @@ struct bnxt_softc {
 
 	struct sysctl_ctx_list	hw_stats;
 	struct sysctl_oid	*hw_stats_oid;
+	struct sysctl_ctx_list	hw_lro_ctx;
+	struct sysctl_oid	*hw_lro_oid;
+	struct sysctl_ctx_list	flow_ctrl_ctx;
+	struct sysctl_oid	*flow_ctrl_oid;
 
 	struct bnxt_ver_info	*ver_info;
 	struct bnxt_nvram_info	*nvm_info;
+	bool wol;
+	struct bnxt_hw_lro	hw_lro;
+	uint8_t wol_filter_id;
+	uint16_t		rx_coal_usecs;
+	uint16_t		rx_coal_usecs_irq;
+	uint16_t               	rx_coal_frames;
+	uint16_t               	rx_coal_frames_irq;
+	uint16_t               	tx_coal_usecs;
+	uint16_t               	tx_coal_usecs_irq;
+	uint16_t               	tx_coal_frames;
+	uint16_t               	tx_coal_frames_irq;
+
+#define BNXT_USEC_TO_COAL_TIMER(x)      ((x) * 25 / 2)
+#define BNXT_DEF_STATS_COAL_TICKS        1000000
+#define BNXT_MIN_STATS_COAL_TICKS         250000
+#define BNXT_MAX_STATS_COAL_TICKS        1000000
+
 };
 
 struct bnxt_filter_info {

Modified: stable/11/sys/dev/bnxt/bnxt_hwrm.c
==============================================================================
--- stable/11/sys/dev/bnxt/bnxt_hwrm.c	Tue May  8 13:23:39 2018	(r333363)
+++ stable/11/sys/dev/bnxt/bnxt_hwrm.c	Tue May  8 15:51:40 2018	(r333364)
@@ -30,6 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/endian.h>
+#include <sys/bitstring.h>
 
 #include "bnxt.h"
 #include "bnxt_hwrm.h"
@@ -121,12 +122,37 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg
 	uint16_t cp_ring_id;
 	uint8_t *valid;
 	uint16_t err;
+	uint16_t max_req_len = HWRM_MAX_REQ_LEN;
+	struct hwrm_short_input short_input = {0};
 
 	/* TODO: DMASYNC in here. */
 	req->seq_id = htole16(softc->hwrm_cmd_seq++);
 	memset(resp, 0, PAGE_SIZE);
 	cp_ring_id = le16toh(req->cmpl_ring);
 
+	if (softc->flags & BNXT_FLAG_SHORT_CMD) {
+		void *short_cmd_req = softc->hwrm_short_cmd_req_addr.idi_vaddr;
+
+		memcpy(short_cmd_req, req, msg_len);
+		memset((uint8_t *) short_cmd_req + msg_len, 0, softc->hwrm_max_req_len-
+		    msg_len);
+
+		short_input.req_type = req->req_type;
+		short_input.signature =
+		    htole16(HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD);
+		short_input.size = htole16(msg_len);
+		short_input.req_addr =
+		    htole64(softc->hwrm_short_cmd_req_addr.idi_paddr);
+
+		data = (uint32_t *)&short_input;
+		msg_len = sizeof(short_input);
+
+		/* Sync memory write before updating doorbell */
+		wmb();
+
+		max_req_len = BNXT_HWRM_SHORT_REQ_LEN;
+	}
+
 	/* Write request msg to hwrm channel */
 	for (i = 0; i < msg_len; i += 4) {
 		bus_space_write_4(softc->hwrm_bar.tag,
@@ -136,7 +162,7 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg
 	}
 
 	/* Clear to the end of the request buffer */
-	for (i = msg_len; i < HWRM_MAX_REQ_LEN; i += 4)
+	for (i = msg_len; i < max_req_len; i += 4)
 		bus_space_write_4(softc->hwrm_bar.tag, softc->hwrm_bar.handle,
 		    i, 0);
 
@@ -247,6 +273,7 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc)
 	int				rc;
 	const char nastr[] = "<not installed>";
 	const char naver[] = "<N/A>";
+	uint32_t dev_caps_cfg;
 
 	softc->hwrm_max_req_len = HWRM_MAX_REQ_LEN;
 	softc->hwrm_cmd_timeo = 1000;
@@ -322,6 +349,11 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc)
 	if (resp->def_req_timeout)
 		softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout);
 
+	dev_caps_cfg = le32toh(resp->dev_caps_cfg);
+	if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) &&
+	    (dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED))
+		softc->flags |= BNXT_FLAG_SHORT_CMD;
+
 fail:
 	BNXT_HWRM_UNLOCK(softc);
 	return rc;
@@ -398,6 +430,10 @@ bnxt_hwrm_func_qcaps(struct bnxt_softc *softc)
 	if (rc)
 		goto fail;
 
+	if (resp->flags &
+	    htole32(HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED))
+		softc->flags |= BNXT_FLAG_WOL_CAP;
+
 	func->fw_fid = le16toh(resp->fid);
 	memcpy(func->mac_addr, resp->mac_address, ETHER_ADDR_LEN);
 	func->max_rsscos_ctxs = le16toh(resp->max_rsscos_ctx);
@@ -433,6 +469,31 @@ fail:
 	return rc;
 }
 
+int 
+bnxt_hwrm_func_qcfg(struct bnxt_softc *softc)
+{
+        struct hwrm_func_qcfg_input req = {0};
+        struct hwrm_func_qcfg_output *resp =
+	    (void *)softc->hwrm_cmd_resp.idi_vaddr;
+	struct bnxt_func_qcfg *fn_qcfg = &softc->fn_qcfg;
+        int rc;
+
+	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_QCFG);
+        req.fid = htole16(0xffff);
+	BNXT_HWRM_LOCK(softc);
+	rc = _hwrm_send_message(softc, &req, sizeof(req));
+        if (rc)
+		goto fail;
+
+	fn_qcfg->alloc_completion_rings = le16toh(resp->alloc_cmpl_rings);
+	fn_qcfg->alloc_tx_rings = le16toh(resp->alloc_tx_rings);
+	fn_qcfg->alloc_rx_rings = le16toh(resp->alloc_rx_rings);
+	fn_qcfg->alloc_vnics = le16toh(resp->alloc_vnics);
+fail:
+	BNXT_HWRM_UNLOCK(softc);
+        return rc;
+}
+
 int
 bnxt_hwrm_func_reset(struct bnxt_softc *softc)
 {
@@ -473,33 +534,28 @@ static void
 bnxt_hwrm_set_pause_common(struct bnxt_softc *softc,
     struct hwrm_port_phy_cfg_input *req)
 {
-	if (softc->link_info.autoneg & BNXT_AUTONEG_FLOW_CTRL) {
+	struct bnxt_link_info *link_info = &softc->link_info;
+
+	if (link_info->flow_ctrl.autoneg) {
 		req->auto_pause =
 		    HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_AUTONEG_PAUSE;
-		if (softc->link_info.req_flow_ctrl &
-		    HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX)
+		if (link_info->flow_ctrl.rx)
 			req->auto_pause |=
 			    HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX;
-		if (softc->link_info.req_flow_ctrl &
-		    HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX)
+		if (link_info->flow_ctrl.tx)
 			req->auto_pause |=
-			    HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_RX;
+			    HWRM_PORT_PHY_CFG_INPUT_AUTO_PAUSE_TX;
 		req->enables |=
 		    htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE);
 	} else {
-		if (softc->link_info.req_flow_ctrl &
-		    HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX)
+		if (link_info->flow_ctrl.rx)
 			req->force_pause |=
 			    HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_RX;
-		if (softc->link_info.req_flow_ctrl &
-		    HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX)
+		if (link_info->flow_ctrl.tx)
 			req->force_pause |=
 			    HWRM_PORT_PHY_CFG_INPUT_FORCE_PAUSE_TX;
 		req->enables |=
 			htole32(HWRM_PORT_PHY_CFG_INPUT_ENABLES_FORCE_PAUSE);
-		req->auto_pause = req->force_pause;
-		req->enables |= htole32(
-		    HWRM_PORT_PHY_CFG_INPUT_ENABLES_AUTO_PAUSE);
 	}
 }
 
@@ -533,49 +589,41 @@ bnxt_hwrm_set_eee(struct bnxt_softc *softc, struct hwr
 
 int
 bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause,
-    bool set_eee)
+    bool set_eee, bool set_link)
 {
 	struct hwrm_port_phy_cfg_input req = {0};
+	int rc;
 
 	if (softc->flags & BNXT_FLAG_NPAR)
 		return ENOTSUP;
 
 	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_PHY_CFG);
-	if (set_pause)
+	
+	if (set_pause) {
 		bnxt_hwrm_set_pause_common(softc, &req);
 
-	bnxt_hwrm_set_link_common(softc, &req);
-	if (set_eee)
-		bnxt_hwrm_set_eee(softc, &req);
-	return hwrm_send_message(softc, &req, sizeof(req));
-}
+		if (softc->link_info.flow_ctrl.autoneg)
+			set_link = true;
+	}
 
-
-int
-bnxt_hwrm_set_pause(struct bnxt_softc *softc)
-{
-	struct hwrm_port_phy_cfg_input req = {0};
-	int rc;
-
-	if (softc->flags & BNXT_FLAG_NPAR)
-		return ENOTSUP;
-
-	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_PHY_CFG);
-	bnxt_hwrm_set_pause_common(softc, &req);
-
-	if (softc->link_info.autoneg & BNXT_AUTONEG_FLOW_CTRL)
+	if (set_link)
 		bnxt_hwrm_set_link_common(softc, &req);
-
+	
+	if (set_eee)
+		bnxt_hwrm_set_eee(softc, &req);
+	
 	BNXT_HWRM_LOCK(softc);
 	rc = _hwrm_send_message(softc, &req, sizeof(req));
-	if (!rc && !(softc->link_info.autoneg & BNXT_AUTONEG_FLOW_CTRL)) {
-		/* since changing of pause setting doesn't trigger any link
-		 * change event, the driver needs to update the current pause
-		 * result upon successfully return of the phy_cfg command */
-		softc->link_info.pause =
-		softc->link_info.force_pause = softc->link_info.req_flow_ctrl;
-		softc->link_info.auto_pause = 0;
-		bnxt_report_link(softc);
+
+	if (!rc) {
+		if (set_pause) {
+			/* since changing of 'force pause' setting doesn't 
+			 * trigger any link change event, the driver needs to
+			 * update the current pause result upon successfully i
+			 * return of the phy_cfg command */
+			if (!softc->link_info.flow_ctrl.autoneg) 
+				bnxt_report_link(softc);
+		}
 	}
 	BNXT_HWRM_UNLOCK(softc);
 	return rc;
@@ -790,6 +838,25 @@ fail:
 }
 
 int
+bnxt_hwrm_port_qstats(struct bnxt_softc *softc)
+{
+	struct hwrm_port_qstats_input req = {0};
+	int rc = 0;
+
+	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_QSTATS);
+
+	req.port_id = htole16(softc->pf.port_id);
+	req.rx_stat_host_addr = htole64(softc->hw_rx_port_stats.idi_paddr);
+	req.tx_stat_host_addr = htole64(softc->hw_tx_port_stats.idi_paddr);
+
+	BNXT_HWRM_LOCK(softc);
+	rc = _hwrm_send_message(softc, &req, sizeof(req));
+	BNXT_HWRM_UNLOCK(softc);
+
+	return rc;
+}
+
+int
 bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc,
     struct bnxt_vnic_info *vnic)
 {
@@ -900,44 +967,82 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnx
 }
 
 int
-bnxt_hwrm_func_cfg(struct bnxt_softc *softc)
+bnxt_cfg_async_cr(struct bnxt_softc *softc)
 {
-	struct hwrm_func_cfg_input req = {0};
+	int rc = 0;
+	
+	if (BNXT_PF(softc)) {
+		struct hwrm_func_cfg_input req = {0};
 
-	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG);
+		bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG);
 
-	req.fid = 0xffff;
-	req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR);
+		req.fid = htole16(0xffff);
+		req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR);
+		req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id);
 
-	req.async_event_cr = softc->def_cp_ring.ring.phys_id;
+		rc = hwrm_send_message(softc, &req, sizeof(req));
+	}
+	else {
+		struct hwrm_func_vf_cfg_input req = {0};
 
-	return hwrm_send_message(softc, &req, sizeof(req));
+		bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG);
+
+		req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR);
+		req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id);
+
+		rc = hwrm_send_message(softc, &req, sizeof(req));
+	}
+	return rc;
 }
 
+void
+bnxt_validate_hw_lro_settings(struct bnxt_softc *softc)
+{
+	softc->hw_lro.enable = min(softc->hw_lro.enable, 1);
+
+        softc->hw_lro.is_mode_gro = min(softc->hw_lro.is_mode_gro, 1);
+
+	softc->hw_lro.max_agg_segs = min(softc->hw_lro.max_agg_segs,
+		HWRM_VNIC_TPA_CFG_INPUT_MAX_AGG_SEGS_MAX);
+
+	softc->hw_lro.max_aggs = min(softc->hw_lro.max_aggs,
+		HWRM_VNIC_TPA_CFG_INPUT_MAX_AGGS_MAX);
+
+	softc->hw_lro.min_agg_len = min(softc->hw_lro.min_agg_len, BNXT_MAX_MTU);
+}
+
 int
-bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic,
-    uint32_t flags)
+bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc)
 {
 	struct hwrm_vnic_tpa_cfg_input req = {0};
+	uint32_t flags;
 
 	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG);
 
-	req.flags = htole32(flags);
-	req.vnic_id = htole16(vnic->id);
-	req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS |
-	    HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS |
-	    /* HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_TIMER | */
-	    HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN);
-	/* TODO: Calculate this based on ring size? */
-	req.max_agg_segs = htole16(3);
-	/* Base this in the allocated TPA start size... */
-	req.max_aggs = htole16(7);
-	/*
-	 * TODO: max_agg_timer?
-	 * req.mag_agg_timer = htole32(XXX);
-	 */
-	req.min_agg_len = htole32(0);
+	if (softc->hw_lro.enable) {
+		flags = HWRM_VNIC_TPA_CFG_INPUT_FLAGS_TPA |
+			HWRM_VNIC_TPA_CFG_INPUT_FLAGS_ENCAP_TPA |
+			HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_ECN |
+			HWRM_VNIC_TPA_CFG_INPUT_FLAGS_AGG_WITH_SAME_GRE_SEQ;
+		
+        	if (softc->hw_lro.is_mode_gro)
+			flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_GRO;
+		else
+			flags |= HWRM_VNIC_TPA_CFG_INPUT_FLAGS_RSC_WND_UPDATE;
+			
+		req.flags = htole32(flags);
 
+		req.enables = htole32(HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGG_SEGS |
+				HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MAX_AGGS |
+				HWRM_VNIC_TPA_CFG_INPUT_ENABLES_MIN_AGG_LEN);
+
+		req.max_agg_segs = htole16(softc->hw_lro.max_agg_segs);
+		req.max_aggs = htole16(softc->hw_lro.max_aggs);
+		req.min_agg_len = htole32(softc->hw_lro.min_agg_len);
+	}
+
+	req.vnic_id = htole16(softc->vnic_info.id);
+
 	return hwrm_send_message(softc, &req, sizeof(req));
 }
 
@@ -1448,12 +1553,45 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc)
 		goto exit;
 
 	link_info->phy_link_status = resp->link;
-	link_info->duplex =  resp->duplex;
-	link_info->pause = resp->pause;
+	link_info->duplex =  resp->duplex_cfg;
 	link_info->auto_mode = resp->auto_mode;
-	link_info->auto_pause = resp->auto_pause;
-	link_info->force_pause = resp->force_pause;
-	link_info->duplex_setting = resp->duplex;
+
+        /*
+         * When AUTO_PAUSE_AUTONEG_PAUSE bit is set to 1, 
+         * the advertisement of pause is enabled.
+         * 1. When the auto_mode is not set to none and this flag is set to 1,
+         *    then the auto_pause bits on this port are being advertised and
+         *    autoneg pause results are being interpreted.
+         * 2. When the auto_mode is not set to none and this flag is set to 0,
+         *    the pause is forced as indicated in force_pause, and also 
+	 *    advertised as auto_pause bits, but the autoneg results are not 
+	 *    interpreted since the pause configuration is being forced.
+         * 3. When the auto_mode is set to none and this flag is set to 1,
+         *    auto_pause bits should be ignored and should be set to 0.
+         */
+	
+	link_info->flow_ctrl.autoneg = false;
+	link_info->flow_ctrl.tx = false;
+	link_info->flow_ctrl.rx = false;
+
+	if ((resp->auto_mode) && 
+            (resp->auto_pause & BNXT_AUTO_PAUSE_AUTONEG_PAUSE)) {
+			link_info->flow_ctrl.autoneg = true;
+	}
+
+	if (link_info->flow_ctrl.autoneg) {
+		if (resp->auto_pause & BNXT_PAUSE_TX)
+			link_info->flow_ctrl.tx = true;
+		if (resp->auto_pause & BNXT_PAUSE_RX)
+			link_info->flow_ctrl.rx = true;
+	} else {
+		if (resp->force_pause & BNXT_PAUSE_TX)
+			link_info->flow_ctrl.tx = true;
+		if (resp->force_pause & BNXT_PAUSE_RX)
+			link_info->flow_ctrl.rx = true;
+	}
+
+	link_info->duplex_setting = resp->duplex_cfg;
 	if (link_info->phy_link_status == HWRM_PORT_PHY_QCFG_OUTPUT_LINK_LINK)
 		link_info->link_speed = le16toh(resp->link_speed);
 	else
@@ -1482,4 +1620,191 @@ bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc)
 exit:
 	BNXT_HWRM_UNLOCK(softc);
 	return rc;
+}
+
+uint16_t
+bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle)
+{
+	struct hwrm_wol_filter_qcfg_input req = {0};
+	struct hwrm_wol_filter_qcfg_output *resp =
+			(void *)softc->hwrm_cmd_resp.idi_vaddr;
+	uint16_t next_handle = 0;
+	int rc;
+
+	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_WOL_FILTER_QCFG);
+	req.port_id = htole16(softc->pf.port_id);
+	req.handle = htole16(handle);
+	rc = hwrm_send_message(softc, &req, sizeof(req));
+	if (!rc) {
+		next_handle = le16toh(resp->next_handle);
+		if (next_handle != 0) {
+			if (resp->wol_type ==
+				HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT) {
+				softc->wol = 1;
+				softc->wol_filter_id = resp->wol_filter_id;
+			}
+		}
+	}
+	return next_handle;
+}
+
+int
+bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc)
+{
+	struct hwrm_wol_filter_alloc_input req = {0};
+	struct hwrm_wol_filter_alloc_output *resp =
+		(void *)softc->hwrm_cmd_resp.idi_vaddr;
+	int rc;
+
+	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_WOL_FILTER_ALLOC);
+	req.port_id = htole16(softc->pf.port_id);
+	req.wol_type = HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT;
+	req.enables =
+		htole32(HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_MAC_ADDRESS);
+	memcpy(req.mac_address, softc->func.mac_addr, ETHER_ADDR_LEN);
+	rc = hwrm_send_message(softc, &req, sizeof(req));
+	if (!rc)
+		softc->wol_filter_id = resp->wol_filter_id;
+
+	return rc;
+}
+
+int
+bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc)
+{
+	struct hwrm_wol_filter_free_input req = {0};
+
+	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_WOL_FILTER_FREE);
+	req.port_id = htole16(softc->pf.port_id);
+	req.enables =
+		htole32(HWRM_WOL_FILTER_FREE_INPUT_ENABLES_WOL_FILTER_ID);
+	req.wol_filter_id = softc->wol_filter_id;
+	return hwrm_send_message(softc, &req, sizeof(req));
+}
+
+static void bnxt_hwrm_set_coal_params(struct bnxt_softc *softc, uint32_t max_frames,
+        uint32_t buf_tmrs, uint16_t flags,
+        struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req)
+{
+        req->flags = htole16(flags);
+        req->num_cmpl_dma_aggr = htole16((uint16_t)max_frames);
+        req->num_cmpl_dma_aggr_during_int = htole16(max_frames >> 16);
+        req->cmpl_aggr_dma_tmr = htole16((uint16_t)buf_tmrs);
+        req->cmpl_aggr_dma_tmr_during_int = htole16(buf_tmrs >> 16);
+        /* Minimum time between 2 interrupts set to buf_tmr x 2 */
+        req->int_lat_tmr_min = htole16((uint16_t)buf_tmrs * 2);
+        req->int_lat_tmr_max = htole16((uint16_t)buf_tmrs * 4);
+        req->num_cmpl_aggr_int = htole16((uint16_t)max_frames * 4);
+}
+
+
+int bnxt_hwrm_set_coal(struct bnxt_softc *softc)
+{
+        int i, rc = 0;
+        struct hwrm_ring_cmpl_ring_cfg_aggint_params_input req_rx = {0},
+                                                           req_tx = {0}, *req;
+        uint16_t max_buf, max_buf_irq;
+        uint16_t buf_tmr, buf_tmr_irq;
+        uint32_t flags;
+
+        bnxt_hwrm_cmd_hdr_init(softc, &req_rx,
+                               HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
+        bnxt_hwrm_cmd_hdr_init(softc, &req_tx,
+                               HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
+
+        /* Each rx completion (2 records) should be DMAed immediately.
+         * DMA 1/4 of the completion buffers at a time.
+         */
+        max_buf = min_t(uint16_t, softc->rx_coal_frames / 4, 2);
+        /* max_buf must not be zero */
+        max_buf = clamp_t(uint16_t, max_buf, 1, 63);
+        max_buf_irq = clamp_t(uint16_t, softc->rx_coal_frames_irq, 1, 63);
+        buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs);
+        /* buf timer set to 1/4 of interrupt timer */
+        buf_tmr = max_t(uint16_t, buf_tmr / 4, 1);
+        buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs_irq);
+        buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1);
+
+        flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET;
+
+        /* RING_IDLE generates more IRQs for lower latency.  Enable it only
+         * if coal_usecs is less than 25 us.
+         */
+        if (softc->rx_coal_usecs < 25)
+                flags |= HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE;
+
+        bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf,
+                                  buf_tmr_irq << 16 | buf_tmr, flags, &req_rx);
+
+        /* max_buf must not be zero */
+        max_buf = clamp_t(uint16_t, softc->tx_coal_frames, 1, 63);
+        max_buf_irq = clamp_t(uint16_t, softc->tx_coal_frames_irq, 1, 63);
+        buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs);
+        /* buf timer set to 1/4 of interrupt timer */
+        buf_tmr = max_t(uint16_t, buf_tmr / 4, 1);
+        buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs_irq);
+        buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1);
+        flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET;
+        bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf,
+                                  buf_tmr_irq << 16 | buf_tmr, flags, &req_tx);
+
+        for (i = 0; i < softc->nrxqsets; i++) {
+
+                
+		req = &req_rx;
+                /*
+                 * TBD:
+		 *      Check if Tx also needs to be done
+                 *      So far, Tx processing has been done in softirq contest
+                 *
+		 * req = &req_tx;
+		 */
+		req->ring_id = htole16(softc->grp_info[i].cp_ring_id);
+
+                rc = hwrm_send_message(softc, req, sizeof(*req));
+                if (rc)
+                        break;
+        }
+        return rc;
+}
+
+
+
+int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap,
+                                     int bmap_size)
+{
+	struct hwrm_func_drv_rgtr_input req = {0};
+	bitstr_t *async_events_bmap;
+	uint32_t *events;
+	int i;
+
+	async_events_bmap = bit_alloc(256, M_DEVBUF, M_WAITOK|M_ZERO);
+	events = (uint32_t *)async_events_bmap;
+
+	bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR);
+
+	req.enables =
+		htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD);
+
+	memset(async_events_bmap, 0, sizeof(256 / 8));
+
+	bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE);
+	bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD);
+	bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED);
+	bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE);
+	bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE);
+
+	if (bmap && bmap_size) {
+		for (i = 0; i < bmap_size; i++) {
+			if (bit_test(bmap, i))
+				bit_set(async_events_bmap, i);
+		}
+	}
+
+	for (i = 0; i < 8; i++)
+		req.async_event_fwd[i] |= htole32(events[i]);
+
+	free(async_events_bmap, M_DEVBUF);
+
+	return hwrm_send_message(softc, &req, sizeof(req));
 }

Modified: stable/11/sys/dev/bnxt/bnxt_hwrm.h
==============================================================================
--- stable/11/sys/dev/bnxt/bnxt_hwrm.h	Tue May  8 13:23:39 2018	(r333363)
+++ stable/11/sys/dev/bnxt/bnxt_hwrm.h	Tue May  8 15:51:40 2018	(r333364)
@@ -32,6 +32,12 @@ __FBSDID("$FreeBSD$");
 #ifndef _BNXT_HWRM_H
 #define _BNXT_HWRM_H
 
+#define BNXT_PAUSE_TX 	 (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX)
+#define BNXT_PAUSE_RX 	 (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX)
+#define BNXT_AUTO_PAUSE_AUTONEG_PAUSE  				\
+        (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE)
+#define BNXT_HWRM_SHORT_REQ_LEN	sizeof(struct hwrm_short_input)
+
 /* HWRM Function Prototypes */
 int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc);
 void bnxt_free_hwrm_dma_mem(struct bnxt_softc *softc);
@@ -43,14 +49,16 @@ int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc)
 int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc);
 int bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown);
 int bnxt_hwrm_func_qcaps(struct bnxt_softc *softc);
+int bnxt_hwrm_func_qcfg(struct bnxt_softc *softc);
 int bnxt_hwrm_func_reset(struct bnxt_softc *softc);
-int bnxt_hwrm_set_link_setting(struct bnxt_softc *, bool set_pause,
-    bool set_eee);
+int bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause,
+    bool set_eee, bool set_link); 
 int bnxt_hwrm_set_pause(struct bnxt_softc *softc);
 int bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id);
 int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
 int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr,
     uint64_t paddr);
+int bnxt_hwrm_port_qstats(struct bnxt_softc *softc);
 int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc,
     struct bnxt_grp_info *grp);
 int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
@@ -59,9 +67,9 @@ int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *so
 int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
 int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic,
     uint32_t hash_type);
-int bnxt_hwrm_func_cfg(struct bnxt_softc *softc);
-int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc,
-    struct bnxt_vnic_info *vnic, uint32_t flags);
+int bnxt_cfg_async_cr(struct bnxt_softc *softc);
+int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc);
+void bnxt_validate_hw_lro_settings(struct bnxt_softc *softc);
 int bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type,
     uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index,
     uint8_t search_opt, uint32_t *data_length, uint32_t *item_length,
@@ -98,5 +106,10 @@ int bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, ui
     uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second,
     uint16_t millisecond, uint16_t zone);
 int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc);
-
+uint16_t bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle);
+int bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc);
+int bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc);
+int bnxt_hwrm_set_coal(struct bnxt_softc *softc);
+int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap,
+                                     int bmap_size);
 #endif

Modified: stable/11/sys/dev/bnxt/bnxt_sysctl.c
==============================================================================
--- stable/11/sys/dev/bnxt/bnxt_sysctl.c	Tue May  8 13:23:39 2018	(r333363)
+++ stable/11/sys/dev/bnxt/bnxt_sysctl.c	Tue May  8 15:51:40 2018	(r333364)
@@ -74,16 +74,38 @@ bnxt_init_sysctl_ctx(struct bnxt_softc *softc)
 		return ENOMEM;
 	}
 
-	sysctl_ctx_init(&softc->nvm_info->nvm_ctx);
+	if (BNXT_PF(softc)) {
+		sysctl_ctx_init(&softc->nvm_info->nvm_ctx);
+		ctx = device_get_sysctl_ctx(softc->dev);
+		softc->nvm_info->nvm_oid = SYSCTL_ADD_NODE(ctx,
+		    SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO,
+		    "nvram", CTLFLAG_RD, 0, "nvram information");
+		if (!softc->nvm_info->nvm_oid) {
+			sysctl_ctx_free(&softc->nvm_info->nvm_ctx);
+			return ENOMEM;
+		}
+	}
+
+	sysctl_ctx_init(&softc->hw_lro_ctx);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list