diff options
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 53 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h | 28 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 204 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 41 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | 23 |
8 files changed, 296 insertions, 81 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 86e94517a536..c3a6072134f5 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -1448,6 +1448,12 @@ struct bnx2x_fp_stats { | |||
1448 | struct bnx2x_eth_q_stats_old eth_q_stats_old; | 1448 | struct bnx2x_eth_q_stats_old eth_q_stats_old; |
1449 | }; | 1449 | }; |
1450 | 1450 | ||
1451 | enum { | ||
1452 | SUB_MF_MODE_UNKNOWN = 0, | ||
1453 | SUB_MF_MODE_UFP, | ||
1454 | SUB_MF_MODE_NPAR1_DOT_5, | ||
1455 | }; | ||
1456 | |||
1451 | struct bnx2x { | 1457 | struct bnx2x { |
1452 | /* Fields used in the tx and intr/napi performance paths | 1458 | /* Fields used in the tx and intr/napi performance paths |
1453 | * are grouped together in the beginning of the structure | 1459 | * are grouped together in the beginning of the structure |
@@ -1659,6 +1665,9 @@ struct bnx2x { | |||
1659 | #define IS_MF_SI(bp) (bp->mf_mode == MULTI_FUNCTION_SI) | 1665 | #define IS_MF_SI(bp) (bp->mf_mode == MULTI_FUNCTION_SI) |
1660 | #define IS_MF_SD(bp) (bp->mf_mode == MULTI_FUNCTION_SD) | 1666 | #define IS_MF_SD(bp) (bp->mf_mode == MULTI_FUNCTION_SD) |
1661 | #define IS_MF_AFEX(bp) (bp->mf_mode == MULTI_FUNCTION_AFEX) | 1667 | #define IS_MF_AFEX(bp) (bp->mf_mode == MULTI_FUNCTION_AFEX) |
1668 | u8 mf_sub_mode; | ||
1669 | #define IS_MF_UFP(bp) (IS_MF_SD(bp) && \ | ||
1670 | bp->mf_sub_mode == SUB_MF_MODE_UFP) | ||
1662 | 1671 | ||
1663 | u8 wol; | 1672 | u8 wol; |
1664 | 1673 | ||
@@ -2361,7 +2370,7 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id, | |||
2361 | #define ATTN_HARD_WIRED_MASK 0xff00 | 2370 | #define ATTN_HARD_WIRED_MASK 0xff00 |
2362 | #define ATTENTION_ID 4 | 2371 | #define ATTENTION_ID 4 |
2363 | 2372 | ||
2364 | #define IS_MF_STORAGE_ONLY(bp) (IS_MF_STORAGE_SD(bp) || \ | 2373 | #define IS_MF_STORAGE_ONLY(bp) (IS_MF_STORAGE_PERSONALITY_ONLY(bp) || \ |
2365 | IS_MF_FCOE_AFEX(bp)) | 2374 | IS_MF_FCOE_AFEX(bp)) |
2366 | 2375 | ||
2367 | /* stuff added to make the code fit 80Col */ | 2376 | /* stuff added to make the code fit 80Col */ |
@@ -2537,14 +2546,44 @@ void bnx2x_notify_link_changed(struct bnx2x *bp); | |||
2537 | 2546 | ||
2538 | #define IS_MF_ISCSI_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) | 2547 | #define IS_MF_ISCSI_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) |
2539 | #define IS_MF_FCOE_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)) | 2548 | #define IS_MF_FCOE_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)) |
2549 | #define IS_MF_ISCSI_SI(bp) (IS_MF_SI(bp) && BNX2X_IS_MF_EXT_PROTOCOL_ISCSI(bp)) | ||
2550 | |||
2551 | #define IS_MF_ISCSI_ONLY(bp) (IS_MF_ISCSI_SD(bp) || IS_MF_ISCSI_SI(bp)) | ||
2552 | |||
2553 | #define BNX2X_MF_EXT_PROTOCOL_MASK \ | ||
2554 | (MACP_FUNC_CFG_FLAGS_ETHERNET | \ | ||
2555 | MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD | \ | ||
2556 | MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) | ||
2557 | |||
2558 | #define BNX2X_MF_EXT_PROT(bp) ((bp)->mf_ext_config & \ | ||
2559 | BNX2X_MF_EXT_PROTOCOL_MASK) | ||
2560 | |||
2561 | #define BNX2X_HAS_MF_EXT_PROTOCOL_FCOE(bp) \ | ||
2562 | (BNX2X_MF_EXT_PROT(bp) & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) | ||
2563 | |||
2564 | #define BNX2X_IS_MF_EXT_PROTOCOL_FCOE(bp) \ | ||
2565 | (BNX2X_MF_EXT_PROT(bp) == MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) | ||
2566 | |||
2567 | #define BNX2X_IS_MF_EXT_PROTOCOL_ISCSI(bp) \ | ||
2568 | (BNX2X_MF_EXT_PROT(bp) == MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) | ||
2569 | |||
2570 | #define IS_MF_FCOE_AFEX(bp) \ | ||
2571 | (IS_MF_AFEX(bp) && BNX2X_IS_MF_EXT_PROTOCOL_FCOE(bp)) | ||
2572 | |||
2573 | #define IS_MF_SD_STORAGE_PERSONALITY_ONLY(bp) \ | ||
2574 | (IS_MF_SD(bp) && \ | ||
2575 | (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \ | ||
2576 | BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) | ||
2577 | |||
2578 | #define IS_MF_SI_STORAGE_PERSONALITY_ONLY(bp) \ | ||
2579 | (IS_MF_SI(bp) && \ | ||
2580 | (BNX2X_IS_MF_EXT_PROTOCOL_ISCSI(bp) || \ | ||
2581 | BNX2X_IS_MF_EXT_PROTOCOL_FCOE(bp))) | ||
2540 | 2582 | ||
2541 | #define BNX2X_MF_EXT_PROTOCOL_FCOE(bp) ((bp)->mf_ext_config & \ | 2583 | #define IS_MF_STORAGE_PERSONALITY_ONLY(bp) \ |
2542 | MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) | 2584 | (IS_MF_SD_STORAGE_PERSONALITY_ONLY(bp) || \ |
2585 | IS_MF_SI_STORAGE_PERSONALITY_ONLY(bp)) | ||
2543 | 2586 | ||
2544 | #define IS_MF_FCOE_AFEX(bp) (IS_MF_AFEX(bp) && BNX2X_MF_EXT_PROTOCOL_FCOE(bp)) | ||
2545 | #define IS_MF_STORAGE_SD(bp) (IS_MF_SD(bp) && \ | ||
2546 | (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \ | ||
2547 | BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) | ||
2548 | 2587 | ||
2549 | #define SET_FLAG(value, mask, flag) \ | 2588 | #define SET_FLAG(value, mask, flag) \ |
2550 | do {\ | 2589 | do {\ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 6dc32aee96bf..40beef5bca88 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -1938,7 +1938,7 @@ void bnx2x_set_num_queues(struct bnx2x *bp) | |||
1938 | bp->num_ethernet_queues = bnx2x_calc_num_queues(bp); | 1938 | bp->num_ethernet_queues = bnx2x_calc_num_queues(bp); |
1939 | 1939 | ||
1940 | /* override in STORAGE SD modes */ | 1940 | /* override in STORAGE SD modes */ |
1941 | if (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)) | 1941 | if (IS_MF_STORAGE_ONLY(bp)) |
1942 | bp->num_ethernet_queues = 1; | 1942 | bp->num_ethernet_queues = 1; |
1943 | 1943 | ||
1944 | /* Add special queues */ | 1944 | /* Add special queues */ |
@@ -4231,14 +4231,13 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p) | |||
4231 | struct bnx2x *bp = netdev_priv(dev); | 4231 | struct bnx2x *bp = netdev_priv(dev); |
4232 | int rc = 0; | 4232 | int rc = 0; |
4233 | 4233 | ||
4234 | if (!bnx2x_is_valid_ether_addr(bp, addr->sa_data)) { | 4234 | if (!is_valid_ether_addr(addr->sa_data)) { |
4235 | BNX2X_ERR("Requested MAC address is not valid\n"); | 4235 | BNX2X_ERR("Requested MAC address is not valid\n"); |
4236 | return -EINVAL; | 4236 | return -EINVAL; |
4237 | } | 4237 | } |
4238 | 4238 | ||
4239 | if ((IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)) && | 4239 | if (IS_MF_STORAGE_ONLY(bp)) { |
4240 | !is_zero_ether_addr(addr->sa_data)) { | 4240 | BNX2X_ERR("Can't change address on STORAGE ONLY function\n"); |
4241 | BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n"); | ||
4242 | return -EINVAL; | 4241 | return -EINVAL; |
4243 | } | 4242 | } |
4244 | 4243 | ||
@@ -4417,8 +4416,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) | |||
4417 | u8 cos; | 4416 | u8 cos; |
4418 | int rx_ring_size = 0; | 4417 | int rx_ring_size = 0; |
4419 | 4418 | ||
4420 | if (!bp->rx_ring_size && | 4419 | if (!bp->rx_ring_size && IS_MF_STORAGE_ONLY(bp)) { |
4421 | (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) { | ||
4422 | rx_ring_size = MIN_RX_SIZE_NONTPA; | 4420 | rx_ring_size = MIN_RX_SIZE_NONTPA; |
4423 | bp->rx_ring_size = rx_ring_size; | 4421 | bp->rx_ring_size = rx_ring_size; |
4424 | } else if (!bp->rx_ring_size) { | 4422 | } else if (!bp->rx_ring_size) { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index ac63e16829ef..adcacda7af7b 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -936,6 +936,12 @@ static inline int bnx2x_func_start(struct bnx2x *bp) | |||
936 | start_params->gre_tunnel_type = IPGRE_TUNNEL; | 936 | start_params->gre_tunnel_type = IPGRE_TUNNEL; |
937 | start_params->inner_gre_rss_en = 1; | 937 | start_params->inner_gre_rss_en = 1; |
938 | 938 | ||
939 | if (IS_MF_UFP(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)) { | ||
940 | start_params->class_fail_ethtype = ETH_P_FIP; | ||
941 | start_params->class_fail = 1; | ||
942 | start_params->no_added_tags = 1; | ||
943 | } | ||
944 | |||
939 | return bnx2x_func_state_change(bp, &func_params); | 945 | return bnx2x_func_state_change(bp, &func_params); |
940 | } | 946 | } |
941 | 947 | ||
@@ -1298,15 +1304,7 @@ static inline void bnx2x_update_drv_flags(struct bnx2x *bp, u32 flags, u32 set) | |||
1298 | } | 1304 | } |
1299 | } | 1305 | } |
1300 | 1306 | ||
1301 | static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr) | ||
1302 | { | ||
1303 | if (is_valid_ether_addr(addr) || | ||
1304 | (is_zero_ether_addr(addr) && | ||
1305 | (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)))) | ||
1306 | return true; | ||
1307 | 1307 | ||
1308 | return false; | ||
1309 | } | ||
1310 | 1308 | ||
1311 | /** | 1309 | /** |
1312 | * bnx2x_fill_fw_str - Fill buffer with FW version string | 1310 | * bnx2x_fill_fw_str - Fill buffer with FW version string |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 0b173ed20ae9..1edc931b1458 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -1852,7 +1852,7 @@ static int bnx2x_set_ringparam(struct net_device *dev, | |||
1852 | if ((ering->rx_pending > MAX_RX_AVAIL) || | 1852 | if ((ering->rx_pending > MAX_RX_AVAIL) || |
1853 | (ering->rx_pending < (bp->disable_tpa ? MIN_RX_SIZE_NONTPA : | 1853 | (ering->rx_pending < (bp->disable_tpa ? MIN_RX_SIZE_NONTPA : |
1854 | MIN_RX_SIZE_TPA)) || | 1854 | MIN_RX_SIZE_TPA)) || |
1855 | (ering->tx_pending > (IS_MF_FCOE_AFEX(bp) ? 0 : MAX_TX_AVAIL)) || | 1855 | (ering->tx_pending > (IS_MF_STORAGE_ONLY(bp) ? 0 : MAX_TX_AVAIL)) || |
1856 | (ering->tx_pending <= MAX_SKB_FRAGS + 4)) { | 1856 | (ering->tx_pending <= MAX_SKB_FRAGS + 4)) { |
1857 | DP(BNX2X_MSG_ETHTOOL, "Command parameters not supported\n"); | 1857 | DP(BNX2X_MSG_ETHTOOL, "Command parameters not supported\n"); |
1858 | return -EINVAL; | 1858 | return -EINVAL; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h index 3e0621acdf05..583591d52497 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h | |||
@@ -280,17 +280,11 @@ struct shared_hw_cfg { /* NVRAM Offset */ | |||
280 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000 | 280 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000 |
281 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000 | 281 | #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000 |
282 | 282 | ||
283 | 283 | u32 config_3; /* 0x11C */ | |
284 | u32 power_dissipated; /* 0x11c */ | 284 | #define SHARED_HW_CFG_EXTENDED_MF_MODE_MASK 0x00000F00 |
285 | #define SHARED_HW_CFG_POWER_MGNT_SCALE_MASK 0x00ff0000 | 285 | #define SHARED_HW_CFG_EXTENDED_MF_MODE_SHIFT 8 |
286 | #define SHARED_HW_CFG_POWER_MGNT_SCALE_SHIFT 16 | 286 | #define SHARED_HW_CFG_EXTENDED_MF_MODE_NPAR1_DOT_5 0x00000000 |
287 | #define SHARED_HW_CFG_POWER_MGNT_UNKNOWN_SCALE 0x00000000 | 287 | #define SHARED_HW_CFG_EXTENDED_MF_MODE_NPAR2_DOT_0 0x00000100 |
288 | #define SHARED_HW_CFG_POWER_MGNT_DOT_1_WATT 0x00010000 | ||
289 | #define SHARED_HW_CFG_POWER_MGNT_DOT_01_WATT 0x00020000 | ||
290 | #define SHARED_HW_CFG_POWER_MGNT_DOT_001_WATT 0x00030000 | ||
291 | |||
292 | #define SHARED_HW_CFG_POWER_DIS_CMN_MASK 0xff000000 | ||
293 | #define SHARED_HW_CFG_POWER_DIS_CMN_SHIFT 24 | ||
294 | 288 | ||
295 | u32 ump_nc_si_config; /* 0x120 */ | 289 | u32 ump_nc_si_config; /* 0x120 */ |
296 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003 | 290 | #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003 |
@@ -859,6 +853,8 @@ struct shared_feat_cfg { /* NVRAM Offset */ | |||
859 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200 | 853 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200 |
860 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300 | 854 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300 |
861 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_AFEX_MODE 0x00000400 | 855 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_AFEX_MODE 0x00000400 |
856 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_UFP_MODE 0x00000600 | ||
857 | #define SHARED_FEAT_CFG_FORCE_SF_MODE_EXTENDED_MODE 0x00000700 | ||
862 | 858 | ||
863 | /* The interval in seconds between sending LLDP packets. Set to zero | 859 | /* The interval in seconds between sending LLDP packets. Set to zero |
864 | to disable the feature */ | 860 | to disable the feature */ |
@@ -1268,6 +1264,10 @@ struct drv_func_mb { | |||
1268 | #define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000 | 1264 | #define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000 |
1269 | #define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000 | 1265 | #define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000 |
1270 | #define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000 | 1266 | #define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000 |
1267 | #define DRV_MSG_CODE_OEM_OK 0x00010000 | ||
1268 | #define DRV_MSG_CODE_OEM_FAILURE 0x00020000 | ||
1269 | #define DRV_MSG_CODE_OEM_UPDATE_SVID_OK 0x00030000 | ||
1270 | #define DRV_MSG_CODE_OEM_UPDATE_SVID_FAILURE 0x00040000 | ||
1271 | /* | 1271 | /* |
1272 | * The optic module verification command requires bootcode | 1272 | * The optic module verification command requires bootcode |
1273 | * v5.0.6 or later, te specific optic module verification command | 1273 | * v5.0.6 or later, te specific optic module verification command |
@@ -1423,6 +1423,12 @@ struct drv_func_mb { | |||
1423 | #define DRV_STATUS_SET_MF_BW 0x00000004 | 1423 | #define DRV_STATUS_SET_MF_BW 0x00000004 |
1424 | #define DRV_STATUS_LINK_EVENT 0x00000008 | 1424 | #define DRV_STATUS_LINK_EVENT 0x00000008 |
1425 | 1425 | ||
1426 | #define DRV_STATUS_OEM_EVENT_MASK 0x00000070 | ||
1427 | #define DRV_STATUS_OEM_DISABLE_ENABLE_PF 0x00000010 | ||
1428 | #define DRV_STATUS_OEM_BANDWIDTH_ALLOCATION 0x00000020 | ||
1429 | |||
1430 | #define DRV_STATUS_OEM_UPDATE_SVID 0x00000080 | ||
1431 | |||
1426 | #define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00 | 1432 | #define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00 |
1427 | #define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100 | 1433 | #define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100 |
1428 | #define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200 | 1434 | #define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200 |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 32e2444ab5e1..74fbf9ea7bd8 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -2905,6 +2905,57 @@ static void bnx2x_handle_afex_cmd(struct bnx2x *bp, u32 cmd) | |||
2905 | } | 2905 | } |
2906 | } | 2906 | } |
2907 | 2907 | ||
2908 | static void bnx2x_handle_update_svid_cmd(struct bnx2x *bp) | ||
2909 | { | ||
2910 | struct bnx2x_func_switch_update_params *switch_update_params; | ||
2911 | struct bnx2x_func_state_params func_params; | ||
2912 | |||
2913 | memset(&func_params, 0, sizeof(struct bnx2x_func_state_params)); | ||
2914 | switch_update_params = &func_params.params.switch_update; | ||
2915 | func_params.f_obj = &bp->func_obj; | ||
2916 | func_params.cmd = BNX2X_F_CMD_SWITCH_UPDATE; | ||
2917 | |||
2918 | if (IS_MF_UFP(bp)) { | ||
2919 | int func = BP_ABS_FUNC(bp); | ||
2920 | u32 val; | ||
2921 | |||
2922 | /* Re-learn the S-tag from shmem */ | ||
2923 | val = MF_CFG_RD(bp, func_mf_config[func].e1hov_tag) & | ||
2924 | FUNC_MF_CFG_E1HOV_TAG_MASK; | ||
2925 | if (val != FUNC_MF_CFG_E1HOV_TAG_DEFAULT) { | ||
2926 | bp->mf_ov = val; | ||
2927 | } else { | ||
2928 | BNX2X_ERR("Got an SVID event, but no tag is configured in shmem\n"); | ||
2929 | goto fail; | ||
2930 | } | ||
2931 | |||
2932 | /* Configure new S-tag in LLH */ | ||
2933 | REG_WR(bp, NIG_REG_LLH0_FUNC_VLAN_ID + BP_PORT(bp) * 8, | ||
2934 | bp->mf_ov); | ||
2935 | |||
2936 | /* Send Ramrod to update FW of change */ | ||
2937 | __set_bit(BNX2X_F_UPDATE_SD_VLAN_TAG_CHNG, | ||
2938 | &switch_update_params->changes); | ||
2939 | switch_update_params->vlan = bp->mf_ov; | ||
2940 | |||
2941 | if (bnx2x_func_state_change(bp, &func_params) < 0) { | ||
2942 | BNX2X_ERR("Failed to configure FW of S-tag Change to %02x\n", | ||
2943 | bp->mf_ov); | ||
2944 | goto fail; | ||
2945 | } | ||
2946 | |||
2947 | DP(BNX2X_MSG_MCP, "Configured S-tag %02x\n", bp->mf_ov); | ||
2948 | |||
2949 | bnx2x_fw_command(bp, DRV_MSG_CODE_OEM_UPDATE_SVID_OK, 0); | ||
2950 | |||
2951 | return; | ||
2952 | } | ||
2953 | |||
2954 | /* not supported by SW yet */ | ||
2955 | fail: | ||
2956 | bnx2x_fw_command(bp, DRV_MSG_CODE_OEM_UPDATE_SVID_FAILURE, 0); | ||
2957 | } | ||
2958 | |||
2908 | static void bnx2x_pmf_update(struct bnx2x *bp) | 2959 | static void bnx2x_pmf_update(struct bnx2x *bp) |
2909 | { | 2960 | { |
2910 | int port = BP_PORT(bp); | 2961 | int port = BP_PORT(bp); |
@@ -3297,7 +3348,8 @@ static void bnx2x_e1h_enable(struct bnx2x *bp) | |||
3297 | { | 3348 | { |
3298 | int port = BP_PORT(bp); | 3349 | int port = BP_PORT(bp); |
3299 | 3350 | ||
3300 | REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 1); | 3351 | if (!(IS_MF_UFP(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) |
3352 | REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port * 8, 1); | ||
3301 | 3353 | ||
3302 | /* Tx queue should be only re-enabled */ | 3354 | /* Tx queue should be only re-enabled */ |
3303 | netif_tx_wake_all_queues(bp->dev); | 3355 | netif_tx_wake_all_queues(bp->dev); |
@@ -3652,14 +3704,30 @@ out: | |||
3652 | ethver, iscsiver, fcoever); | 3704 | ethver, iscsiver, fcoever); |
3653 | } | 3705 | } |
3654 | 3706 | ||
3655 | static void bnx2x_dcc_event(struct bnx2x *bp, u32 dcc_event) | 3707 | static void bnx2x_oem_event(struct bnx2x *bp, u32 event) |
3656 | { | 3708 | { |
3657 | DP(BNX2X_MSG_MCP, "dcc_event 0x%x\n", dcc_event); | 3709 | u32 cmd_ok, cmd_fail; |
3658 | 3710 | ||
3659 | if (dcc_event & DRV_STATUS_DCC_DISABLE_ENABLE_PF) { | 3711 | /* sanity */ |
3712 | if (event & DRV_STATUS_DCC_EVENT_MASK && | ||
3713 | event & DRV_STATUS_OEM_EVENT_MASK) { | ||
3714 | BNX2X_ERR("Received simultaneous events %08x\n", event); | ||
3715 | return; | ||
3716 | } | ||
3660 | 3717 | ||
3661 | /* | 3718 | if (event & DRV_STATUS_DCC_EVENT_MASK) { |
3662 | * This is the only place besides the function initialization | 3719 | cmd_fail = DRV_MSG_CODE_DCC_FAILURE; |
3720 | cmd_ok = DRV_MSG_CODE_DCC_OK; | ||
3721 | } else /* if (event & DRV_STATUS_OEM_EVENT_MASK) */ { | ||
3722 | cmd_fail = DRV_MSG_CODE_OEM_FAILURE; | ||
3723 | cmd_ok = DRV_MSG_CODE_OEM_OK; | ||
3724 | } | ||
3725 | |||
3726 | DP(BNX2X_MSG_MCP, "oem_event 0x%x\n", event); | ||
3727 | |||
3728 | if (event & (DRV_STATUS_DCC_DISABLE_ENABLE_PF | | ||
3729 | DRV_STATUS_OEM_DISABLE_ENABLE_PF)) { | ||
3730 | /* This is the only place besides the function initialization | ||
3663 | * where the bp->flags can change so it is done without any | 3731 | * where the bp->flags can change so it is done without any |
3664 | * locks | 3732 | * locks |
3665 | */ | 3733 | */ |
@@ -3674,18 +3742,22 @@ static void bnx2x_dcc_event(struct bnx2x *bp, u32 dcc_event) | |||
3674 | 3742 | ||
3675 | bnx2x_e1h_enable(bp); | 3743 | bnx2x_e1h_enable(bp); |
3676 | } | 3744 | } |
3677 | dcc_event &= ~DRV_STATUS_DCC_DISABLE_ENABLE_PF; | 3745 | event &= ~(DRV_STATUS_DCC_DISABLE_ENABLE_PF | |
3746 | DRV_STATUS_OEM_DISABLE_ENABLE_PF); | ||
3678 | } | 3747 | } |
3679 | if (dcc_event & DRV_STATUS_DCC_BANDWIDTH_ALLOCATION) { | 3748 | |
3749 | if (event & (DRV_STATUS_DCC_BANDWIDTH_ALLOCATION | | ||
3750 | DRV_STATUS_OEM_BANDWIDTH_ALLOCATION)) { | ||
3680 | bnx2x_config_mf_bw(bp); | 3751 | bnx2x_config_mf_bw(bp); |
3681 | dcc_event &= ~DRV_STATUS_DCC_BANDWIDTH_ALLOCATION; | 3752 | event &= ~(DRV_STATUS_DCC_BANDWIDTH_ALLOCATION | |
3753 | DRV_STATUS_OEM_BANDWIDTH_ALLOCATION); | ||
3682 | } | 3754 | } |
3683 | 3755 | ||
3684 | /* Report results to MCP */ | 3756 | /* Report results to MCP */ |
3685 | if (dcc_event) | 3757 | if (event) |
3686 | bnx2x_fw_command(bp, DRV_MSG_CODE_DCC_FAILURE, 0); | 3758 | bnx2x_fw_command(bp, cmd_fail, 0); |
3687 | else | 3759 | else |
3688 | bnx2x_fw_command(bp, DRV_MSG_CODE_DCC_OK, 0); | 3760 | bnx2x_fw_command(bp, cmd_ok, 0); |
3689 | } | 3761 | } |
3690 | 3762 | ||
3691 | /* must be called under the spq lock */ | 3763 | /* must be called under the spq lock */ |
@@ -4167,9 +4239,12 @@ static void bnx2x_attn_int_deasserted3(struct bnx2x *bp, u32 attn) | |||
4167 | func_mf_config[BP_ABS_FUNC(bp)].config); | 4239 | func_mf_config[BP_ABS_FUNC(bp)].config); |
4168 | val = SHMEM_RD(bp, | 4240 | val = SHMEM_RD(bp, |
4169 | func_mb[BP_FW_MB_IDX(bp)].drv_status); | 4241 | func_mb[BP_FW_MB_IDX(bp)].drv_status); |
4170 | if (val & DRV_STATUS_DCC_EVENT_MASK) | 4242 | |
4171 | bnx2x_dcc_event(bp, | 4243 | if (val & (DRV_STATUS_DCC_EVENT_MASK | |
4172 | (val & DRV_STATUS_DCC_EVENT_MASK)); | 4244 | DRV_STATUS_OEM_EVENT_MASK)) |
4245 | bnx2x_oem_event(bp, | ||
4246 | (val & (DRV_STATUS_DCC_EVENT_MASK | | ||
4247 | DRV_STATUS_OEM_EVENT_MASK))); | ||
4173 | 4248 | ||
4174 | if (val & DRV_STATUS_SET_MF_BW) | 4249 | if (val & DRV_STATUS_SET_MF_BW) |
4175 | bnx2x_set_mf_bw(bp); | 4250 | bnx2x_set_mf_bw(bp); |
@@ -4195,6 +4270,10 @@ static void bnx2x_attn_int_deasserted3(struct bnx2x *bp, u32 attn) | |||
4195 | val & DRV_STATUS_AFEX_EVENT_MASK); | 4270 | val & DRV_STATUS_AFEX_EVENT_MASK); |
4196 | if (val & DRV_STATUS_EEE_NEGOTIATION_RESULTS) | 4271 | if (val & DRV_STATUS_EEE_NEGOTIATION_RESULTS) |
4197 | bnx2x_handle_eee_event(bp); | 4272 | bnx2x_handle_eee_event(bp); |
4273 | |||
4274 | if (val & DRV_STATUS_OEM_UPDATE_SVID) | ||
4275 | bnx2x_handle_update_svid_cmd(bp); | ||
4276 | |||
4198 | if (bp->link_vars.periodic_flags & | 4277 | if (bp->link_vars.periodic_flags & |
4199 | PERIODIC_FLAGS_LINK_EVENT) { | 4278 | PERIODIC_FLAGS_LINK_EVENT) { |
4200 | /* sync with link */ | 4279 | /* sync with link */ |
@@ -7930,8 +8009,11 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) | |||
7930 | REG_WR(bp, CFC_REG_WEAK_ENABLE_PF, 1); | 8009 | REG_WR(bp, CFC_REG_WEAK_ENABLE_PF, 1); |
7931 | 8010 | ||
7932 | if (IS_MF(bp)) { | 8011 | if (IS_MF(bp)) { |
7933 | REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 1); | 8012 | if (!(IS_MF_UFP(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) { |
7934 | REG_WR(bp, NIG_REG_LLH0_FUNC_VLAN_ID + port*8, bp->mf_ov); | 8013 | REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port * 8, 1); |
8014 | REG_WR(bp, NIG_REG_LLH0_FUNC_VLAN_ID + port * 8, | ||
8015 | bp->mf_ov); | ||
8016 | } | ||
7935 | } | 8017 | } |
7936 | 8018 | ||
7937 | bnx2x_init_block(bp, BLOCK_MISC_AEU, init_phase); | 8019 | bnx2x_init_block(bp, BLOCK_MISC_AEU, init_phase); |
@@ -8323,13 +8405,6 @@ int bnx2x_del_all_macs(struct bnx2x *bp, | |||
8323 | 8405 | ||
8324 | int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) | 8406 | int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) |
8325 | { | 8407 | { |
8326 | if (is_zero_ether_addr(bp->dev->dev_addr) && | ||
8327 | (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) { | ||
8328 | DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN, | ||
8329 | "Ignoring Zero MAC for STORAGE SD mode\n"); | ||
8330 | return 0; | ||
8331 | } | ||
8332 | |||
8333 | if (IS_PF(bp)) { | 8408 | if (IS_PF(bp)) { |
8334 | unsigned long ramrod_flags = 0; | 8409 | unsigned long ramrod_flags = 0; |
8335 | 8410 | ||
@@ -11355,15 +11430,14 @@ static void bnx2x_get_fcoe_info(struct bnx2x *bp) | |||
11355 | dev_info.port_hw_config[port]. | 11430 | dev_info.port_hw_config[port]. |
11356 | fcoe_wwn_node_name_lower); | 11431 | fcoe_wwn_node_name_lower); |
11357 | } else if (!IS_MF_SD(bp)) { | 11432 | } else if (!IS_MF_SD(bp)) { |
11358 | /* | 11433 | /* Read the WWN info only if the FCoE feature is enabled for |
11359 | * Read the WWN info only if the FCoE feature is enabled for | ||
11360 | * this function. | 11434 | * this function. |
11361 | */ | 11435 | */ |
11362 | if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp)) | 11436 | if (BNX2X_HAS_MF_EXT_PROTOCOL_FCOE(bp)) |
11437 | bnx2x_get_ext_wwn_info(bp, func); | ||
11438 | } else { | ||
11439 | if (BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp)) | ||
11363 | bnx2x_get_ext_wwn_info(bp, func); | 11440 | bnx2x_get_ext_wwn_info(bp, func); |
11364 | |||
11365 | } else if (IS_MF_FCOE_SD(bp) && !CHIP_IS_E1x(bp)) { | ||
11366 | bnx2x_get_ext_wwn_info(bp, func); | ||
11367 | } | 11441 | } |
11368 | 11442 | ||
11369 | BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn); | 11443 | BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn); |
@@ -11401,7 +11475,7 @@ static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp) | |||
11401 | * In non SD mode features configuration comes from struct | 11475 | * In non SD mode features configuration comes from struct |
11402 | * func_ext_config. | 11476 | * func_ext_config. |
11403 | */ | 11477 | */ |
11404 | if (!IS_MF_SD(bp) && !CHIP_IS_E1x(bp)) { | 11478 | if (!IS_MF_SD(bp)) { |
11405 | u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); | 11479 | u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); |
11406 | if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) { | 11480 | if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) { |
11407 | val2 = MF_CFG_RD(bp, func_ext_config[func]. | 11481 | val2 = MF_CFG_RD(bp, func_ext_config[func]. |
@@ -11520,7 +11594,7 @@ static void bnx2x_get_mac_hwinfo(struct bnx2x *bp) | |||
11520 | 11594 | ||
11521 | memcpy(bp->link_params.mac_addr, bp->dev->dev_addr, ETH_ALEN); | 11595 | memcpy(bp->link_params.mac_addr, bp->dev->dev_addr, ETH_ALEN); |
11522 | 11596 | ||
11523 | if (!bnx2x_is_valid_ether_addr(bp, bp->dev->dev_addr)) | 11597 | if (!is_valid_ether_addr(bp->dev->dev_addr)) |
11524 | dev_err(&bp->pdev->dev, | 11598 | dev_err(&bp->pdev->dev, |
11525 | "bad Ethernet MAC address configuration: %pM\n" | 11599 | "bad Ethernet MAC address configuration: %pM\n" |
11526 | "change it manually before bringing up the appropriate network interface\n", | 11600 | "change it manually before bringing up the appropriate network interface\n", |
@@ -11550,11 +11624,27 @@ static bool bnx2x_get_dropless_info(struct bnx2x *bp) | |||
11550 | return cfg; | 11624 | return cfg; |
11551 | } | 11625 | } |
11552 | 11626 | ||
11627 | static void validate_set_si_mode(struct bnx2x *bp) | ||
11628 | { | ||
11629 | u8 func = BP_ABS_FUNC(bp); | ||
11630 | u32 val; | ||
11631 | |||
11632 | val = MF_CFG_RD(bp, func_mf_config[func].mac_upper); | ||
11633 | |||
11634 | /* check for legal mac (upper bytes) */ | ||
11635 | if (val != 0xffff) { | ||
11636 | bp->mf_mode = MULTI_FUNCTION_SI; | ||
11637 | bp->mf_config[BP_VN(bp)] = | ||
11638 | MF_CFG_RD(bp, func_mf_config[func].config); | ||
11639 | } else | ||
11640 | BNX2X_DEV_INFO("illegal MAC address for SI\n"); | ||
11641 | } | ||
11642 | |||
11553 | static int bnx2x_get_hwinfo(struct bnx2x *bp) | 11643 | static int bnx2x_get_hwinfo(struct bnx2x *bp) |
11554 | { | 11644 | { |
11555 | int /*abs*/func = BP_ABS_FUNC(bp); | 11645 | int /*abs*/func = BP_ABS_FUNC(bp); |
11556 | int vn; | 11646 | int vn; |
11557 | u32 val = 0; | 11647 | u32 val = 0, val2 = 0; |
11558 | int rc = 0; | 11648 | int rc = 0; |
11559 | 11649 | ||
11560 | bnx2x_get_common_hwinfo(bp); | 11650 | bnx2x_get_common_hwinfo(bp); |
@@ -11634,6 +11724,7 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp) | |||
11634 | 11724 | ||
11635 | bp->mf_ov = 0; | 11725 | bp->mf_ov = 0; |
11636 | bp->mf_mode = 0; | 11726 | bp->mf_mode = 0; |
11727 | bp->mf_sub_mode = 0; | ||
11637 | vn = BP_VN(bp); | 11728 | vn = BP_VN(bp); |
11638 | 11729 | ||
11639 | if (!CHIP_IS_E1(bp) && !BP_NOMCP(bp)) { | 11730 | if (!CHIP_IS_E1(bp) && !BP_NOMCP(bp)) { |
@@ -11663,15 +11754,7 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp) | |||
11663 | 11754 | ||
11664 | switch (val) { | 11755 | switch (val) { |
11665 | case SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT: | 11756 | case SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT: |
11666 | val = MF_CFG_RD(bp, func_mf_config[func]. | 11757 | validate_set_si_mode(bp); |
11667 | mac_upper); | ||
11668 | /* check for legal mac (upper bytes)*/ | ||
11669 | if (val != 0xffff) { | ||
11670 | bp->mf_mode = MULTI_FUNCTION_SI; | ||
11671 | bp->mf_config[vn] = MF_CFG_RD(bp, | ||
11672 | func_mf_config[func].config); | ||
11673 | } else | ||
11674 | BNX2X_DEV_INFO("illegal MAC address for SI\n"); | ||
11675 | break; | 11758 | break; |
11676 | case SHARED_FEAT_CFG_FORCE_SF_MODE_AFEX_MODE: | 11759 | case SHARED_FEAT_CFG_FORCE_SF_MODE_AFEX_MODE: |
11677 | if ((!CHIP_IS_E1x(bp)) && | 11760 | if ((!CHIP_IS_E1x(bp)) && |
@@ -11699,9 +11782,33 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp) | |||
11699 | } else | 11782 | } else |
11700 | BNX2X_DEV_INFO("illegal OV for SD\n"); | 11783 | BNX2X_DEV_INFO("illegal OV for SD\n"); |
11701 | break; | 11784 | break; |
11785 | case SHARED_FEAT_CFG_FORCE_SF_MODE_UFP_MODE: | ||
11786 | bp->mf_mode = MULTI_FUNCTION_SD; | ||
11787 | bp->mf_sub_mode = SUB_MF_MODE_UFP; | ||
11788 | bp->mf_config[vn] = | ||
11789 | MF_CFG_RD(bp, | ||
11790 | func_mf_config[func].config); | ||
11791 | break; | ||
11702 | case SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF: | 11792 | case SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF: |
11703 | bp->mf_config[vn] = 0; | 11793 | bp->mf_config[vn] = 0; |
11704 | break; | 11794 | break; |
11795 | case SHARED_FEAT_CFG_FORCE_SF_MODE_EXTENDED_MODE: | ||
11796 | val2 = SHMEM_RD(bp, | ||
11797 | dev_info.shared_hw_config.config_3); | ||
11798 | val2 &= SHARED_HW_CFG_EXTENDED_MF_MODE_MASK; | ||
11799 | switch (val2) { | ||
11800 | case SHARED_HW_CFG_EXTENDED_MF_MODE_NPAR1_DOT_5: | ||
11801 | validate_set_si_mode(bp); | ||
11802 | bp->mf_sub_mode = | ||
11803 | SUB_MF_MODE_NPAR1_DOT_5; | ||
11804 | break; | ||
11805 | default: | ||
11806 | /* Unknown configuration */ | ||
11807 | bp->mf_config[vn] = 0; | ||
11808 | BNX2X_DEV_INFO("unknown extended MF mode 0x%x\n", | ||
11809 | val); | ||
11810 | } | ||
11811 | break; | ||
11705 | default: | 11812 | default: |
11706 | /* Unknown configuration: reset mf_config */ | 11813 | /* Unknown configuration: reset mf_config */ |
11707 | bp->mf_config[vn] = 0; | 11814 | bp->mf_config[vn] = 0; |
@@ -11722,6 +11829,11 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp) | |||
11722 | 11829 | ||
11723 | BNX2X_DEV_INFO("MF OV for func %d is %d (0x%04x)\n", | 11830 | BNX2X_DEV_INFO("MF OV for func %d is %d (0x%04x)\n", |
11724 | func, bp->mf_ov, bp->mf_ov); | 11831 | func, bp->mf_ov, bp->mf_ov); |
11832 | } else if (bp->mf_sub_mode == SUB_MF_MODE_UFP) { | ||
11833 | dev_err(&bp->pdev->dev, | ||
11834 | "Unexpected - no valid MF OV for func %d in UFP mode\n", | ||
11835 | func); | ||
11836 | bp->path_has_ovlan = true; | ||
11725 | } else { | 11837 | } else { |
11726 | dev_err(&bp->pdev->dev, | 11838 | dev_err(&bp->pdev->dev, |
11727 | "No valid MF OV for func %d, aborting\n", | 11839 | "No valid MF OV for func %d, aborting\n", |
@@ -11970,7 +12082,7 @@ static int bnx2x_init_bp(struct bnx2x *bp) | |||
11970 | dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n"); | 12082 | dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n"); |
11971 | 12083 | ||
11972 | bp->disable_tpa = disable_tpa; | 12084 | bp->disable_tpa = disable_tpa; |
11973 | bp->disable_tpa |= IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp); | 12085 | bp->disable_tpa |= !!IS_MF_STORAGE_ONLY(bp); |
11974 | /* Reduce memory usage in kdump environment by disabling TPA */ | 12086 | /* Reduce memory usage in kdump environment by disabling TPA */ |
11975 | bp->disable_tpa |= is_kdump_kernel(); | 12087 | bp->disable_tpa |= is_kdump_kernel(); |
11976 | 12088 | ||
@@ -11990,7 +12102,7 @@ static int bnx2x_init_bp(struct bnx2x *bp) | |||
11990 | 12102 | ||
11991 | bp->mrrs = mrrs; | 12103 | bp->mrrs = mrrs; |
11992 | 12104 | ||
11993 | bp->tx_ring_size = IS_MF_FCOE_AFEX(bp) ? 0 : MAX_TX_AVAIL; | 12105 | bp->tx_ring_size = IS_MF_STORAGE_ONLY(bp) ? 0 : MAX_TX_AVAIL; |
11994 | if (IS_VF(bp)) | 12106 | if (IS_VF(bp)) |
11995 | bp->rx_ring_size = MAX_RX_AVAIL; | 12107 | bp->rx_ring_size = MAX_RX_AVAIL; |
11996 | 12108 | ||
@@ -12310,7 +12422,7 @@ void bnx2x_set_rx_mode_inner(struct bnx2x *bp) | |||
12310 | 12422 | ||
12311 | bp->rx_mode = rx_mode; | 12423 | bp->rx_mode = rx_mode; |
12312 | /* handle ISCSI SD mode */ | 12424 | /* handle ISCSI SD mode */ |
12313 | if (IS_MF_ISCSI_SD(bp)) | 12425 | if (IS_MF_ISCSI_ONLY(bp)) |
12314 | bp->rx_mode = BNX2X_RX_MODE_NONE; | 12426 | bp->rx_mode = BNX2X_RX_MODE_NONE; |
12315 | 12427 | ||
12316 | /* Schedule the rx_mode command */ | 12428 | /* Schedule the rx_mode command */ |
@@ -12417,7 +12529,7 @@ static int bnx2x_validate_addr(struct net_device *dev) | |||
12417 | if (IS_VF(bp)) | 12529 | if (IS_VF(bp)) |
12418 | bnx2x_sample_bulletin(bp); | 12530 | bnx2x_sample_bulletin(bp); |
12419 | 12531 | ||
12420 | if (!bnx2x_is_valid_ether_addr(bp, dev->dev_addr)) { | 12532 | if (!is_valid_ether_addr(dev->dev_addr)) { |
12421 | BNX2X_ERR("Non-valid Ethernet address\n"); | 12533 | BNX2X_ERR("Non-valid Ethernet address\n"); |
12422 | return -EADDRNOTAVAIL; | 12534 | return -EADDRNOTAVAIL; |
12423 | } | 12535 | } |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 19d0c1152434..7bc2924a7e24 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | |||
@@ -5673,8 +5673,23 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp, | |||
5673 | rdata->gre_tunnel_type = start_params->gre_tunnel_type; | 5673 | rdata->gre_tunnel_type = start_params->gre_tunnel_type; |
5674 | rdata->inner_gre_rss_en = start_params->inner_gre_rss_en; | 5674 | rdata->inner_gre_rss_en = start_params->inner_gre_rss_en; |
5675 | rdata->vxlan_dst_port = cpu_to_le16(4789); | 5675 | rdata->vxlan_dst_port = cpu_to_le16(4789); |
5676 | rdata->sd_vlan_eth_type = cpu_to_le16(0x8100); | 5676 | rdata->sd_accept_mf_clss_fail = start_params->class_fail; |
5677 | if (start_params->class_fail_ethtype) { | ||
5678 | rdata->sd_accept_mf_clss_fail_match_ethtype = 1; | ||
5679 | rdata->sd_accept_mf_clss_fail_ethtype = | ||
5680 | cpu_to_le16(start_params->class_fail_ethtype); | ||
5681 | } | ||
5682 | |||
5683 | rdata->sd_vlan_force_pri_flg = start_params->sd_vlan_force_pri; | ||
5684 | rdata->sd_vlan_force_pri_val = start_params->sd_vlan_force_pri_val; | ||
5685 | if (start_params->sd_vlan_eth_type) | ||
5686 | rdata->sd_vlan_eth_type = | ||
5687 | cpu_to_le16(start_params->sd_vlan_eth_type); | ||
5688 | else | ||
5689 | rdata->sd_vlan_eth_type = | ||
5690 | cpu_to_le16(0x8100); | ||
5677 | 5691 | ||
5692 | rdata->no_added_tags = start_params->no_added_tags; | ||
5678 | /* No need for an explicit memory barrier here as long we would | 5693 | /* No need for an explicit memory barrier here as long we would |
5679 | * need to ensure the ordering of writing to the SPQ element | 5694 | * need to ensure the ordering of writing to the SPQ element |
5680 | * and updating of the SPQ producer which involves a memory | 5695 | * and updating of the SPQ producer which involves a memory |
@@ -5708,6 +5723,30 @@ static inline int bnx2x_func_send_switch_update(struct bnx2x *bp, | |||
5708 | &switch_update_params->changes); | 5723 | &switch_update_params->changes); |
5709 | } | 5724 | } |
5710 | 5725 | ||
5726 | if (test_bit(BNX2X_F_UPDATE_SD_VLAN_TAG_CHNG, | ||
5727 | &switch_update_params->changes)) { | ||
5728 | rdata->sd_vlan_tag_change_flg = 1; | ||
5729 | rdata->sd_vlan_tag = | ||
5730 | cpu_to_le16(switch_update_params->vlan); | ||
5731 | } | ||
5732 | |||
5733 | if (test_bit(BNX2X_F_UPDATE_SD_VLAN_ETH_TYPE_CHNG, | ||
5734 | &switch_update_params->changes)) { | ||
5735 | rdata->sd_vlan_eth_type_change_flg = 1; | ||
5736 | rdata->sd_vlan_eth_type = | ||
5737 | cpu_to_le16(switch_update_params->vlan_eth_type); | ||
5738 | } | ||
5739 | |||
5740 | if (test_bit(BNX2X_F_UPDATE_VLAN_FORCE_PRIO_CHNG, | ||
5741 | &switch_update_params->changes)) { | ||
5742 | rdata->sd_vlan_force_pri_change_flg = 1; | ||
5743 | if (test_bit(BNX2X_F_UPDATE_VLAN_FORCE_PRIO_FLAG, | ||
5744 | &switch_update_params->changes)) | ||
5745 | rdata->sd_vlan_force_pri_flg = 1; | ||
5746 | rdata->sd_vlan_force_pri_flg = | ||
5747 | switch_update_params->vlan_force_prio; | ||
5748 | } | ||
5749 | |||
5711 | if (test_bit(BNX2X_F_UPDATE_TUNNEL_CFG_CHNG, | 5750 | if (test_bit(BNX2X_F_UPDATE_TUNNEL_CFG_CHNG, |
5712 | &switch_update_params->changes)) { | 5751 | &switch_update_params->changes)) { |
5713 | rdata->update_tunn_cfg_flg = 1; | 5752 | rdata->update_tunn_cfg_flg = 1; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h index 21c8f6fb89e5..e97275f456c0 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h | |||
@@ -1098,6 +1098,10 @@ struct bnx2x_queue_sp_obj { | |||
1098 | enum { | 1098 | enum { |
1099 | BNX2X_F_UPDATE_TX_SWITCH_SUSPEND_CHNG, | 1099 | BNX2X_F_UPDATE_TX_SWITCH_SUSPEND_CHNG, |
1100 | BNX2X_F_UPDATE_TX_SWITCH_SUSPEND, | 1100 | BNX2X_F_UPDATE_TX_SWITCH_SUSPEND, |
1101 | BNX2X_F_UPDATE_SD_VLAN_TAG_CHNG, | ||
1102 | BNX2X_F_UPDATE_SD_VLAN_ETH_TYPE_CHNG, | ||
1103 | BNX2X_F_UPDATE_VLAN_FORCE_PRIO_CHNG, | ||
1104 | BNX2X_F_UPDATE_VLAN_FORCE_PRIO_FLAG, | ||
1101 | BNX2X_F_UPDATE_TUNNEL_CFG_CHNG, | 1105 | BNX2X_F_UPDATE_TUNNEL_CFG_CHNG, |
1102 | BNX2X_F_UPDATE_TUNNEL_CLSS_EN, | 1106 | BNX2X_F_UPDATE_TUNNEL_CLSS_EN, |
1103 | BNX2X_F_UPDATE_TUNNEL_INNER_GRE_RSS_EN, | 1107 | BNX2X_F_UPDATE_TUNNEL_INNER_GRE_RSS_EN, |
@@ -1178,10 +1182,29 @@ struct bnx2x_func_start_params { | |||
1178 | * capailities | 1182 | * capailities |
1179 | */ | 1183 | */ |
1180 | u8 inner_gre_rss_en; | 1184 | u8 inner_gre_rss_en; |
1185 | |||
1186 | /* Allows accepting of packets failing MF classification, possibly | ||
1187 | * only matching a given ethertype | ||
1188 | */ | ||
1189 | u8 class_fail; | ||
1190 | u16 class_fail_ethtype; | ||
1191 | |||
1192 | /* Override priority of output packets */ | ||
1193 | u8 sd_vlan_force_pri; | ||
1194 | u8 sd_vlan_force_pri_val; | ||
1195 | |||
1196 | /* Replace vlan's ethertype */ | ||
1197 | u16 sd_vlan_eth_type; | ||
1198 | |||
1199 | /* Prevent inner vlans from being added by FW */ | ||
1200 | u8 no_added_tags; | ||
1181 | }; | 1201 | }; |
1182 | 1202 | ||
1183 | struct bnx2x_func_switch_update_params { | 1203 | struct bnx2x_func_switch_update_params { |
1184 | unsigned long changes; /* BNX2X_F_UPDATE_XX bits */ | 1204 | unsigned long changes; /* BNX2X_F_UPDATE_XX bits */ |
1205 | u16 vlan; | ||
1206 | u16 vlan_eth_type; | ||
1207 | u8 vlan_force_prio; | ||
1185 | u8 tunnel_mode; | 1208 | u8 tunnel_mode; |
1186 | u8 gre_tunnel_type; | 1209 | u8 gre_tunnel_type; |
1187 | }; | 1210 | }; |