Permalink
Browse files

Merge r258187 from head.

Approved by:	re@ (delphij)
Approved by:	davidch (mentor)
  • Loading branch information...
1 parent 5b26108 commit 5683b3641f7d8054726d936e00db7d5e488c2e47 edavis committed Nov 16, 2013
Showing with 186 additions and 115 deletions.
  1. +52 −56 sys/dev/bxe/bxe.c
  2. +5 −2 sys/dev/bxe/bxe.h
  3. +33 −14 sys/dev/bxe/bxe_elink.c
  4. +8 −2 sys/dev/bxe/ecore_hsi.h
  5. +25 −13 sys/dev/bxe/ecore_init.h
  6. +1 −0 sys/dev/bxe/ecore_reg.h
  7. +56 −28 sys/dev/bxe/ecore_sp.c
  8. +6 −0 sys/dev/bxe/ecore_sp.h
View
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#define BXE_DRIVER_VERSION "1.78.18"
+#define BXE_DRIVER_VERSION "1.78.75"
#include "bxe.h"
#include "ecore_sp.h"
@@ -303,70 +303,70 @@ static int load_count[2][3] = { {0} }; /* per-path: 0-common, 1-port0, 2-port1 *
SYSCTL_NODE(_hw, OID_AUTO, bxe, CTLFLAG_RD, 0, "bxe driver parameters");
/* Debug */
-uint32_t bxe_debug = 0;
-TUNABLE_INT("hw.bxe.debug", &bxe_debug);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, debug, (CTLFLAG_RDTUN),
- &bxe_debug, 0, "Debug logging mode");
+unsigned long bxe_debug = 0;
+TUNABLE_ULONG("hw.bxe.debug", &bxe_debug);
+SYSCTL_ULONG(_hw_bxe, OID_AUTO, debug, (CTLFLAG_RDTUN),
+ &bxe_debug, 0, "Debug logging mode");
/* Interrupt Mode: 0 (IRQ), 1 (MSI/IRQ), and 2 (MSI-X/MSI/IRQ) */
static int bxe_interrupt_mode = INTR_MODE_MSIX;
TUNABLE_INT("hw.bxe.interrupt_mode", &bxe_interrupt_mode);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, interrupt_mode, CTLFLAG_RDTUN,
- &bxe_interrupt_mode, 0, "Interrupt (MSI-X/MSI/INTx) mode");
+SYSCTL_INT(_hw_bxe, OID_AUTO, interrupt_mode, CTLFLAG_RDTUN,
+ &bxe_interrupt_mode, 0, "Interrupt (MSI-X/MSI/INTx) mode");
/* Number of Queues: 0 (Auto) or 1 to 16 (fixed queue number) */
static int bxe_queue_count = 4;
TUNABLE_INT("hw.bxe.queue_count", &bxe_queue_count);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, queue_count, CTLFLAG_RDTUN,
- &bxe_queue_count, 0, "Multi-Queue queue count");
+SYSCTL_INT(_hw_bxe, OID_AUTO, queue_count, CTLFLAG_RDTUN,
+ &bxe_queue_count, 0, "Multi-Queue queue count");
/* max number of buffers per queue (default RX_BD_USABLE) */
-static uint32_t bxe_max_rx_bufs = 0;
+static int bxe_max_rx_bufs = 0;
TUNABLE_INT("hw.bxe.max_rx_bufs", &bxe_max_rx_bufs);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, max_rx_bufs, CTLFLAG_RDTUN,
- &bxe_max_rx_bufs, 0, "Maximum Number of Rx Buffers Per Queue");
+SYSCTL_INT(_hw_bxe, OID_AUTO, max_rx_bufs, CTLFLAG_RDTUN,
+ &bxe_max_rx_bufs, 0, "Maximum Number of Rx Buffers Per Queue");
/* Host interrupt coalescing RX tick timer (usecs) */
-static uint32_t bxe_hc_rx_ticks = 25;
+static int bxe_hc_rx_ticks = 25;
TUNABLE_INT("hw.bxe.hc_rx_ticks", &bxe_hc_rx_ticks);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, hc_rx_ticks, CTLFLAG_RDTUN,
- &bxe_hc_rx_ticks, 0, "Host Coalescing Rx ticks");
+SYSCTL_INT(_hw_bxe, OID_AUTO, hc_rx_ticks, CTLFLAG_RDTUN,
+ &bxe_hc_rx_ticks, 0, "Host Coalescing Rx ticks");
/* Host interrupt coalescing TX tick timer (usecs) */
-static uint32_t bxe_hc_tx_ticks = 50;
+static int bxe_hc_tx_ticks = 50;
TUNABLE_INT("hw.bxe.hc_tx_ticks", &bxe_hc_tx_ticks);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, hc_tx_ticks, CTLFLAG_RDTUN,
- &bxe_hc_tx_ticks, 0, "Host Coalescing Tx ticks");
+SYSCTL_INT(_hw_bxe, OID_AUTO, hc_tx_ticks, CTLFLAG_RDTUN,
+ &bxe_hc_tx_ticks, 0, "Host Coalescing Tx ticks");
/* Maximum number of Rx packets to process at a time */
-static uint32_t bxe_rx_budget = 0xffffffff;
+static int bxe_rx_budget = 0xffffffff;
TUNABLE_INT("hw.bxe.rx_budget", &bxe_rx_budget);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, rx_budget, CTLFLAG_TUN,
- &bxe_rx_budget, 0, "Rx processing budget");
+SYSCTL_INT(_hw_bxe, OID_AUTO, rx_budget, CTLFLAG_TUN,
+ &bxe_rx_budget, 0, "Rx processing budget");
/* Maximum LRO aggregation size */
-static uint32_t bxe_max_aggregation_size = 0;
+static int bxe_max_aggregation_size = 0;
TUNABLE_INT("hw.bxe.max_aggregation_size", &bxe_max_aggregation_size);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, max_aggregation_size, CTLFLAG_TUN,
- &bxe_max_aggregation_size, 0, "max aggregation size");
+SYSCTL_INT(_hw_bxe, OID_AUTO, max_aggregation_size, CTLFLAG_TUN,
+ &bxe_max_aggregation_size, 0, "max aggregation size");
/* PCI MRRS: -1 (Auto), 0 (128B), 1 (256B), 2 (512B), 3 (1KB) */
static int bxe_mrrs = -1;
TUNABLE_INT("hw.bxe.mrrs", &bxe_mrrs);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, mrrs, CTLFLAG_RDTUN,
- &bxe_mrrs, 0, "PCIe maximum read request size");
+SYSCTL_INT(_hw_bxe, OID_AUTO, mrrs, CTLFLAG_RDTUN,
+ &bxe_mrrs, 0, "PCIe maximum read request size");
/* AutoGrEEEn: 0 (hardware default), 1 (force on), 2 (force off) */
static int bxe_autogreeen = 0;
TUNABLE_INT("hw.bxe.autogreeen", &bxe_autogreeen);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, autogreeen, CTLFLAG_RDTUN,
- &bxe_autogreeen, 0, "AutoGrEEEn support");
+SYSCTL_INT(_hw_bxe, OID_AUTO, autogreeen, CTLFLAG_RDTUN,
+ &bxe_autogreeen, 0, "AutoGrEEEn support");
/* 4-tuple RSS support for UDP: 0 (disabled), 1 (enabled) */
static int bxe_udp_rss = 0;
TUNABLE_INT("hw.bxe.udp_rss", &bxe_udp_rss);
-SYSCTL_UINT(_hw_bxe, OID_AUTO, udp_rss, CTLFLAG_RDTUN,
- &bxe_udp_rss, 0, "UDP RSS support");
+SYSCTL_INT(_hw_bxe, OID_AUTO, udp_rss, CTLFLAG_RDTUN,
+ &bxe_udp_rss, 0, "UDP RSS support");
#define STAT_NAME_LEN 32 /* no stat names below can be longer than this */
@@ -3604,10 +3604,10 @@ bxe_watchdog(struct bxe_softc *sc,
return (0);
}
- BXE_FP_TX_UNLOCK(fp);
-
BLOGE(sc, "TX watchdog timeout on fp[%02d], resetting!\n", fp->index);
+ BXE_FP_TX_UNLOCK(fp);
+
atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT);
taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task);
@@ -3652,21 +3652,21 @@ bxe_txeof(struct bxe_softc *sc,
tx_bd_avail = bxe_tx_avail(sc, fp);
- /* reset the watchdog timer if there are pending transmits */
- if (tx_bd_avail >= BXE_TX_CLEANUP_THRESHOLD) {
+ if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) {
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+ } else {
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+ }
- if (tx_bd_avail >= (TX_BD_USABLE - 1)) {
- /* clear watchdog if the tx chain is empty */
- fp->watchdog_timer = 0;
- return (FALSE);
- }
-
- /* reset watchdog if there are pending transmits */
+ if (fp->tx_pkt_prod != fp->tx_pkt_cons) {
+ /* reset the watchdog timer if there are pending transmits */
fp->watchdog_timer = BXE_TX_TIMEOUT;
+ return (TRUE);
+ } else {
+ /* clear watchdog when there are no pending transmits */
+ fp->watchdog_timer = 0;
+ return (FALSE);
}
-
- return (TRUE);
}
static void
@@ -5879,13 +5879,11 @@ bxe_tx_start_locked(struct bxe_softc *sc,
/* handle any completions if we're running low */
if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) {
+ /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */
bxe_txeof(sc, fp);
- }
-
- /* close TX if we're still running low */
- if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) {
- ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- break;
+ if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
+ break;
+ }
}
}
@@ -6008,13 +6006,11 @@ bxe_tx_mq_start_locked(struct bxe_softc *sc,
/* handle any completions if we're running low */
if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) {
+ /* bxe_txeof will set IFF_DRV_OACTIVE appropriately */
bxe_txeof(sc, fp);
- }
-
- /* close TX if we're still running low */
- if (tx_bd_avail < BXE_TX_CLEANUP_THRESHOLD) {
- ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- break;
+ if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
+ break;
+ }
}
next = drbr_dequeue(ifp, tx_br);
@@ -14173,7 +14169,7 @@ bxe_get_tunable_params(struct bxe_softc *sc)
BLOGD(sc, DBG_LOAD,
"User Config: "
- "debug=0x%x "
+ "debug=0x%lx "
"interrupt_mode=%d "
"queue_count=%d "
"hc_rx_ticks=%d "
View
@@ -748,6 +748,9 @@ struct bxe_fastpath {
#define BXE_VF_ID_INVALID 0xFF
#define IS_SRIOV(sc) 0
+#define GET_NUM_VFS_PER_PATH(sc) 0
+#define GET_NUM_VFS_PER_PF(sc) 0
+
/* maximum number of fast-path interrupt contexts */
#define FP_SB_MAX_E1x 16
#define FP_SB_MAX_E2 HC_SB_MAX_SB_E2
@@ -1405,7 +1408,7 @@ struct bxe_softc {
#define BXE_MF_FUNC_DIS 0x00000800
#define BXE_TX_SWITCHING 0x00001000
- uint32_t debug; /* per-instance debug logging config */
+ unsigned long debug; /* per-instance debug logging config */
#define MAX_BARS 5
struct bxe_bar bar[MAX_BARS]; /* map BARs 0, 2, 4 */
@@ -1603,7 +1606,7 @@ struct bxe_softc {
int max_rx_bufs;
int hc_rx_ticks;
int hc_tx_ticks;
- uint32_t rx_budget;
+ int rx_budget;
int max_aggregation_size;
int mrrs;
int autogreeen;
View
@@ -607,6 +607,7 @@ Theotherbitsarereservedandshouldbezero*/
#define MDIO_WC_REG_RX1_PCI_CTRL 0x80ca
#define MDIO_WC_REG_RX2_PCI_CTRL 0x80da
#define MDIO_WC_REG_RX3_PCI_CTRL 0x80ea
+#define MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI 0x80fa
#define MDIO_WC_REG_XGXSBLK2_UNICORE_MODE_10G 0x8104
#define MDIO_WC_REG_XGXS_STATUS3 0x8129
#define MDIO_WC_REG_PAR_DET_10G_STATUS 0x8130
@@ -4632,6 +4633,19 @@ static void elink_warpcore_enable_AN_KR(struct elink_phy *phy,
elink_warpcore_enable_AN_KR2(phy, params, vars);
} else {
+ /* Enable Auto-Detect to support 1G over CL37 as well */
+ elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
+ MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10);
+
+ /* Force cl48 sync_status LOW to avoid getting stuck in CL73
+ * parallel-detect loop when CL73 and CL37 are enabled.
+ */
+ CL22_WR_OVER_CL45(sc, phy, MDIO_REG_BANK_AER_BLOCK,
+ MDIO_AER_BLOCK_AER_REG, 0);
+ elink_cl45_write(sc, phy, MDIO_WC_DEVAD,
+ MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI, 0x0800);
+ elink_set_aer_mmd(params, phy);
+
elink_disable_kr2(params, vars, phy);
}
@@ -7317,10 +7331,8 @@ static elink_status_t elink_link_initialize(struct elink_params *params,
(CHIP_IS_E1x(sc) ||
CHIP_IS_E2(sc)))
elink_set_parallel_detection(phy, params);
- if (params->phy[ELINK_INT_PHY].config_init)
- params->phy[ELINK_INT_PHY].config_init(phy,
- params,
- vars);
+ if (params->phy[ELINK_INT_PHY].config_init)
+ params->phy[ELINK_INT_PHY].config_init(phy, params, vars);
}
/* Re-read this value in case it was changed inside config_init due to
@@ -8904,17 +8916,20 @@ static elink_status_t elink_get_edc_mode(struct elink_phy *phy,
*edc_mode = ELINK_EDC_MODE_ACTIVE_DAC;
else
check_limiting_mode = 1;
- } else if (copper_module_type &
- ELINK_SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
- ELINK_DEBUG_P0(sc,
- "Passive Copper cable detected\n");
- *edc_mode =
- ELINK_EDC_MODE_PASSIVE_DAC;
} else {
- ELINK_DEBUG_P1(sc,
- "Unknown copper-cable-type 0x%x !!!\n",
- copper_module_type);
- return ELINK_STATUS_ERROR;
+ *edc_mode = ELINK_EDC_MODE_PASSIVE_DAC;
+ /* Even in case PASSIVE_DAC indication is not set,
+ * treat it as a passive DAC cable, since some cables
+ * don't have this indication.
+ */
+ if (copper_module_type &
+ ELINK_SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) {
+ ELINK_DEBUG_P0(sc,
+ "Passive Copper cable detected\n");
+ } else {
+ ELINK_DEBUG_P0(sc,
+ "Unknown copper-cable-type\n");
+ }
}
break;
}
@@ -14360,6 +14375,10 @@ static uint8_t elink_analyze_link_error(struct elink_params *params,
ELINK_DEBUG_P3(sc, "Link changed:[%x %x]->%x\n", vars->link_up,
old_status, status);
+ /* Do not touch the link in case physical link down */
+ if ((vars->phy_flags & PHY_PHYSICAL_LINK_FLAG) == 0)
+ return 1;
+
/* a. Update shmem->link_status accordingly
* b. Update elink_vars->link_up
*/
View
@@ -1057,6 +1057,9 @@ struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
#define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000FFFF
#define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0
#define PORT_FEATURE_MBA_VLAN_EN 0x00010000
+ #define PORT_FEATUTE_BOFM_CFGD_EN 0x00020000
+ #define PORT_FEATURE_BOFM_CFGD_FTGT 0x00040000
+ #define PORT_FEATURE_BOFM_CFGD_VEN 0x00080000
uint32_t Reserved1;
uint32_t smbus_config;
@@ -1099,8 +1102,8 @@ struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
#define PORT_FEATURE_LINK_SPEED_MASK 0x000F0000
#define PORT_FEATURE_LINK_SPEED_SHIFT 16
#define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000
- #define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000
- #define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000
+ #define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00010000
+ #define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00020000
#define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000
#define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000
#define PORT_FEATURE_LINK_SPEED_1G 0x00050000
@@ -1654,6 +1657,7 @@ struct drv_func_mb {
#define DRV_MSG_CODE_LOAD_REQ_FORCE_LFA 0x00002000
#define DRV_MSG_CODE_USR_BLK_IMAGE_REQ 0x00000001
+ #define DRV_MSG_CODE_ISCSI_PERS_IMAGE_REQ 0x00000002
uint32_t fw_mb_header;
#define FW_MSG_CODE_MASK 0xffff0000
@@ -2558,6 +2562,8 @@ struct shmem2_region {
uint32_t drv_func_info_size; /* Offset 0x150 */
uint32_t link_attr_sync[PORT_MAX]; /* Offset 0x154 */
#define LINK_ATTR_SYNC_KR2_ENABLE (1<<0)
+
+ uint32_t ibft_host_addr_hi; /* Initialize by uEFI ROM */
};
Oops, something went wrong.

0 comments on commit 5683b36

Please sign in to comment.