diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 82 |
4 files changed, 64 insertions, 44 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index f534bf132373..562cec34932d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -2117,14 +2117,22 @@ void bnx2x_set_ethtool_ops(struct net_device *netdev); | |||
2117 | void bnx2x_notify_link_changed(struct bnx2x *bp); | 2117 | void bnx2x_notify_link_changed(struct bnx2x *bp); |
2118 | 2118 | ||
2119 | 2119 | ||
2120 | #define BNX2X_MF_PROTOCOL(bp) \ | 2120 | #define BNX2X_MF_SD_PROTOCOL(bp) \ |
2121 | ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK) | 2121 | ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK) |
2122 | 2122 | ||
2123 | #ifdef BCM_CNIC | 2123 | #ifdef BCM_CNIC |
2124 | #define BNX2X_IS_MF_PROTOCOL_ISCSI(bp) \ | 2124 | #define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \ |
2125 | (BNX2X_MF_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI) | 2125 | (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI) |
2126 | 2126 | ||
2127 | #define IS_MF_ISCSI_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_PROTOCOL_ISCSI(bp)) | 2127 | #define BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp) \ |
2128 | (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_FCOE) | ||
2129 | |||
2130 | #define IS_MF_ISCSI_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) | ||
2131 | #define IS_MF_FCOE_SD(bp) (IS_MF_SD(bp) && BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)) | ||
2132 | |||
2133 | #define IS_MF_STORAGE_SD(bp) (IS_MF_SD(bp) && \ | ||
2134 | (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \ | ||
2135 | BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) | ||
2128 | #endif | 2136 | #endif |
2129 | 2137 | ||
2130 | #endif /* bnx2x.h */ | 2138 | #endif /* bnx2x.h */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index 673bd83b5a26..f1f3ca65667a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -1453,8 +1453,8 @@ void bnx2x_set_num_queues(struct bnx2x *bp) | |||
1453 | } | 1453 | } |
1454 | 1454 | ||
1455 | #ifdef BCM_CNIC | 1455 | #ifdef BCM_CNIC |
1456 | /* override in ISCSI SD mod */ | 1456 | /* override in STORAGE SD mode */ |
1457 | if (IS_MF_ISCSI_SD(bp)) | 1457 | if (IS_MF_STORAGE_SD(bp)) |
1458 | bp->num_queues = 1; | 1458 | bp->num_queues = 1; |
1459 | #endif | 1459 | #endif |
1460 | /* Add special queues */ | 1460 | /* Add special queues */ |
@@ -3077,7 +3077,7 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p) | |||
3077 | } | 3077 | } |
3078 | 3078 | ||
3079 | #ifdef BCM_CNIC | 3079 | #ifdef BCM_CNIC |
3080 | if (IS_MF_ISCSI_SD(bp) && !is_zero_ether_addr(addr->sa_data)) { | 3080 | if (IS_MF_STORAGE_SD(bp) && !is_zero_ether_addr(addr->sa_data)) { |
3081 | BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n"); | 3081 | BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n"); |
3082 | return -EINVAL; | 3082 | return -EINVAL; |
3083 | } | 3083 | } |
@@ -3199,7 +3199,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) | |||
3199 | int rx_ring_size = 0; | 3199 | int rx_ring_size = 0; |
3200 | 3200 | ||
3201 | #ifdef BCM_CNIC | 3201 | #ifdef BCM_CNIC |
3202 | if (!bp->rx_ring_size && IS_MF_ISCSI_SD(bp)) { | 3202 | if (!bp->rx_ring_size && IS_MF_STORAGE_SD(bp)) { |
3203 | rx_ring_size = MIN_RX_SIZE_NONTPA; | 3203 | rx_ring_size = MIN_RX_SIZE_NONTPA; |
3204 | bp->rx_ring_size = rx_ring_size; | 3204 | bp->rx_ring_size = rx_ring_size; |
3205 | } else | 3205 | } else |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index 04d78c02c8cc..8b163388659a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -1664,7 +1664,7 @@ static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr) | |||
1664 | if (is_valid_ether_addr(addr)) | 1664 | if (is_valid_ether_addr(addr)) |
1665 | return true; | 1665 | return true; |
1666 | #ifdef BCM_CNIC | 1666 | #ifdef BCM_CNIC |
1667 | if (is_zero_ether_addr(addr) && IS_MF_ISCSI_SD(bp)) | 1667 | if (is_zero_ether_addr(addr) && IS_MF_STORAGE_SD(bp)) |
1668 | return true; | 1668 | return true; |
1669 | #endif | 1669 | #endif |
1670 | return false; | 1670 | return false; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index a626fe87b2a4..df350708022e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -7177,7 +7177,7 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) | |||
7177 | unsigned long ramrod_flags = 0; | 7177 | unsigned long ramrod_flags = 0; |
7178 | 7178 | ||
7179 | #ifdef BCM_CNIC | 7179 | #ifdef BCM_CNIC |
7180 | if (is_zero_ether_addr(bp->dev->dev_addr) && IS_MF_ISCSI_SD(bp)) { | 7180 | if (is_zero_ether_addr(bp->dev->dev_addr) && IS_MF_STORAGE_SD(bp)) { |
7181 | DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN, | 7181 | DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN, |
7182 | "Ignoring Zero MAC for STORAGE SD mode\n"); | 7182 | "Ignoring Zero MAC for STORAGE SD mode\n"); |
7183 | return 0; | 7183 | return 0; |
@@ -9479,6 +9479,7 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) | |||
9479 | 9479 | ||
9480 | void bnx2x_get_iscsi_info(struct bnx2x *bp) | 9480 | void bnx2x_get_iscsi_info(struct bnx2x *bp) |
9481 | { | 9481 | { |
9482 | u32 no_flags = NO_ISCSI_FLAG; | ||
9482 | #ifdef BCM_CNIC | 9483 | #ifdef BCM_CNIC |
9483 | int port = BP_PORT(bp); | 9484 | int port = BP_PORT(bp); |
9484 | 9485 | ||
@@ -9498,12 +9499,28 @@ void bnx2x_get_iscsi_info(struct bnx2x *bp) | |||
9498 | * disable the feature. | 9499 | * disable the feature. |
9499 | */ | 9500 | */ |
9500 | if (!bp->cnic_eth_dev.max_iscsi_conn) | 9501 | if (!bp->cnic_eth_dev.max_iscsi_conn) |
9501 | bp->flags |= NO_ISCSI_FLAG; | 9502 | bp->flags |= no_flags; |
9502 | #else | 9503 | #else |
9503 | bp->flags |= NO_ISCSI_FLAG; | 9504 | bp->flags |= no_flags; |
9504 | #endif | 9505 | #endif |
9505 | } | 9506 | } |
9506 | 9507 | ||
9508 | #ifdef BCM_CNIC | ||
9509 | static void __devinit bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func) | ||
9510 | { | ||
9511 | /* Port info */ | ||
9512 | bp->cnic_eth_dev.fcoe_wwn_port_name_hi = | ||
9513 | MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_port_name_upper); | ||
9514 | bp->cnic_eth_dev.fcoe_wwn_port_name_lo = | ||
9515 | MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_port_name_lower); | ||
9516 | |||
9517 | /* Node info */ | ||
9518 | bp->cnic_eth_dev.fcoe_wwn_node_name_hi = | ||
9519 | MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_node_name_upper); | ||
9520 | bp->cnic_eth_dev.fcoe_wwn_node_name_lo = | ||
9521 | MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_node_name_lower); | ||
9522 | } | ||
9523 | #endif | ||
9507 | static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) | 9524 | static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) |
9508 | { | 9525 | { |
9509 | #ifdef BCM_CNIC | 9526 | #ifdef BCM_CNIC |
@@ -9546,24 +9563,11 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) | |||
9546 | * Read the WWN info only if the FCoE feature is enabled for | 9563 | * Read the WWN info only if the FCoE feature is enabled for |
9547 | * this function. | 9564 | * this function. |
9548 | */ | 9565 | */ |
9549 | if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) { | 9566 | if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) |
9550 | /* Port info */ | 9567 | bnx2x_get_ext_wwn_info(bp, func); |
9551 | bp->cnic_eth_dev.fcoe_wwn_port_name_hi = | 9568 | |
9552 | MF_CFG_RD(bp, func_ext_config[func]. | 9569 | } else if (IS_MF_FCOE_SD(bp)) |
9553 | fcoe_wwn_port_name_upper); | 9570 | bnx2x_get_ext_wwn_info(bp, func); |
9554 | bp->cnic_eth_dev.fcoe_wwn_port_name_lo = | ||
9555 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9556 | fcoe_wwn_port_name_lower); | ||
9557 | |||
9558 | /* Node info */ | ||
9559 | bp->cnic_eth_dev.fcoe_wwn_node_name_hi = | ||
9560 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9561 | fcoe_wwn_node_name_upper); | ||
9562 | bp->cnic_eth_dev.fcoe_wwn_node_name_lo = | ||
9563 | MF_CFG_RD(bp, func_ext_config[func]. | ||
9564 | fcoe_wwn_node_name_lower); | ||
9565 | } | ||
9566 | } | ||
9567 | 9571 | ||
9568 | BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn); | 9572 | BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn); |
9569 | 9573 | ||
@@ -9616,8 +9620,11 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) | |||
9616 | /* | 9620 | /* |
9617 | * iSCSI and FCoE NPAR MACs: if there is no either iSCSI or | 9621 | * iSCSI and FCoE NPAR MACs: if there is no either iSCSI or |
9618 | * FCoE MAC then the appropriate feature should be disabled. | 9622 | * FCoE MAC then the appropriate feature should be disabled. |
9623 | * | ||
9624 | * In non SD mode features configuration comes from | ||
9625 | * struct func_ext_config. | ||
9619 | */ | 9626 | */ |
9620 | if (IS_MF_SI(bp)) { | 9627 | if (!IS_MF_SD(bp)) { |
9621 | u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); | 9628 | u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg); |
9622 | if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) { | 9629 | if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) { |
9623 | val2 = MF_CFG_RD(bp, func_ext_config[func]. | 9630 | val2 = MF_CFG_RD(bp, func_ext_config[func]. |
@@ -9641,16 +9648,25 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) | |||
9641 | 9648 | ||
9642 | } else | 9649 | } else |
9643 | bp->flags |= NO_FCOE_FLAG; | 9650 | bp->flags |= NO_FCOE_FLAG; |
9644 | } else { /* SD mode */ | 9651 | } else { /* SD MODE */ |
9645 | if (BNX2X_IS_MF_PROTOCOL_ISCSI(bp)) { | 9652 | if (IS_MF_STORAGE_SD(bp)) { |
9646 | /* use primary mac as iscsi mac */ | 9653 | if (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) { |
9647 | memcpy(iscsi_mac, bp->dev->dev_addr, ETH_ALEN); | 9654 | /* use primary mac as iscsi mac */ |
9655 | memcpy(iscsi_mac, bp->dev->dev_addr, | ||
9656 | ETH_ALEN); | ||
9657 | |||
9658 | BNX2X_DEV_INFO("SD ISCSI MODE\n"); | ||
9659 | BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n", | ||
9660 | iscsi_mac); | ||
9661 | } else { /* FCoE */ | ||
9662 | memcpy(fip_mac, bp->dev->dev_addr, | ||
9663 | ETH_ALEN); | ||
9664 | BNX2X_DEV_INFO("SD FCoE MODE\n"); | ||
9665 | BNX2X_DEV_INFO("Read FIP MAC: %pM\n", | ||
9666 | fip_mac); | ||
9667 | } | ||
9648 | /* Zero primary MAC configuration */ | 9668 | /* Zero primary MAC configuration */ |
9649 | memset(bp->dev->dev_addr, 0, ETH_ALEN); | 9669 | memset(bp->dev->dev_addr, 0, ETH_ALEN); |
9650 | |||
9651 | BNX2X_DEV_INFO("SD ISCSI MODE\n"); | ||
9652 | BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n", | ||
9653 | iscsi_mac); | ||
9654 | } | 9670 | } |
9655 | } | 9671 | } |
9656 | #endif | 9672 | #endif |
@@ -9679,10 +9695,6 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp) | |||
9679 | memcpy(bp->dev->perm_addr, bp->dev->dev_addr, ETH_ALEN); | 9695 | memcpy(bp->dev->perm_addr, bp->dev->dev_addr, ETH_ALEN); |
9680 | 9696 | ||
9681 | #ifdef BCM_CNIC | 9697 | #ifdef BCM_CNIC |
9682 | /* Set the FCoE MAC in MF_SD mode */ | ||
9683 | if (!CHIP_IS_E1x(bp) && IS_MF_SD(bp)) | ||
9684 | memcpy(fip_mac, bp->dev->dev_addr, ETH_ALEN); | ||
9685 | |||
9686 | /* Disable iSCSI if MAC configuration is | 9698 | /* Disable iSCSI if MAC configuration is |
9687 | * invalid. | 9699 | * invalid. |
9688 | */ | 9700 | */ |
@@ -10092,7 +10104,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
10092 | bp->disable_tpa = disable_tpa; | 10104 | bp->disable_tpa = disable_tpa; |
10093 | 10105 | ||
10094 | #ifdef BCM_CNIC | 10106 | #ifdef BCM_CNIC |
10095 | bp->disable_tpa |= IS_MF_ISCSI_SD(bp); | 10107 | bp->disable_tpa |= IS_MF_STORAGE_SD(bp); |
10096 | #endif | 10108 | #endif |
10097 | 10109 | ||
10098 | /* Set TPA flags */ | 10110 | /* Set TPA flags */ |