diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 85 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 27 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | 75 |
6 files changed, 145 insertions, 60 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index e7400d9d60c4..8d726f6e1c52 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -1942,7 +1942,7 @@ static void bnx2x_set_rx_buf_size(struct bnx2x *bp) | |||
1942 | } | 1942 | } |
1943 | } | 1943 | } |
1944 | 1944 | ||
1945 | static int bnx2x_init_rss_pf(struct bnx2x *bp) | 1945 | static int bnx2x_init_rss(struct bnx2x *bp) |
1946 | { | 1946 | { |
1947 | int i; | 1947 | int i; |
1948 | u8 num_eth_queues = BNX2X_NUM_ETH_QUEUES(bp); | 1948 | u8 num_eth_queues = BNX2X_NUM_ETH_QUEUES(bp); |
@@ -1966,8 +1966,8 @@ static int bnx2x_init_rss_pf(struct bnx2x *bp) | |||
1966 | return bnx2x_config_rss_eth(bp, bp->port.pmf || !CHIP_IS_E1x(bp)); | 1966 | return bnx2x_config_rss_eth(bp, bp->port.pmf || !CHIP_IS_E1x(bp)); |
1967 | } | 1967 | } |
1968 | 1968 | ||
1969 | int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, | 1969 | int bnx2x_rss(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, |
1970 | bool config_hash) | 1970 | bool config_hash, bool enable) |
1971 | { | 1971 | { |
1972 | struct bnx2x_config_rss_params params = {NULL}; | 1972 | struct bnx2x_config_rss_params params = {NULL}; |
1973 | 1973 | ||
@@ -1982,17 +1982,21 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, | |||
1982 | 1982 | ||
1983 | __set_bit(RAMROD_COMP_WAIT, ¶ms.ramrod_flags); | 1983 | __set_bit(RAMROD_COMP_WAIT, ¶ms.ramrod_flags); |
1984 | 1984 | ||
1985 | __set_bit(BNX2X_RSS_MODE_REGULAR, ¶ms.rss_flags); | 1985 | if (enable) { |
1986 | 1986 | __set_bit(BNX2X_RSS_MODE_REGULAR, ¶ms.rss_flags); | |
1987 | /* RSS configuration */ | 1987 | |
1988 | __set_bit(BNX2X_RSS_IPV4, ¶ms.rss_flags); | 1988 | /* RSS configuration */ |
1989 | __set_bit(BNX2X_RSS_IPV4_TCP, ¶ms.rss_flags); | 1989 | __set_bit(BNX2X_RSS_IPV4, ¶ms.rss_flags); |
1990 | __set_bit(BNX2X_RSS_IPV6, ¶ms.rss_flags); | 1990 | __set_bit(BNX2X_RSS_IPV4_TCP, ¶ms.rss_flags); |
1991 | __set_bit(BNX2X_RSS_IPV6_TCP, ¶ms.rss_flags); | 1991 | __set_bit(BNX2X_RSS_IPV6, ¶ms.rss_flags); |
1992 | if (rss_obj->udp_rss_v4) | 1992 | __set_bit(BNX2X_RSS_IPV6_TCP, ¶ms.rss_flags); |
1993 | __set_bit(BNX2X_RSS_IPV4_UDP, ¶ms.rss_flags); | 1993 | if (rss_obj->udp_rss_v4) |
1994 | if (rss_obj->udp_rss_v6) | 1994 | __set_bit(BNX2X_RSS_IPV4_UDP, ¶ms.rss_flags); |
1995 | __set_bit(BNX2X_RSS_IPV6_UDP, ¶ms.rss_flags); | 1995 | if (rss_obj->udp_rss_v6) |
1996 | __set_bit(BNX2X_RSS_IPV6_UDP, ¶ms.rss_flags); | ||
1997 | } else { | ||
1998 | __set_bit(BNX2X_RSS_MODE_DISABLED, ¶ms.rss_flags); | ||
1999 | } | ||
1996 | 2000 | ||
1997 | /* Hash bits */ | 2001 | /* Hash bits */ |
1998 | params.rss_result_mask = MULTI_MASK; | 2002 | params.rss_result_mask = MULTI_MASK; |
@@ -2001,11 +2005,14 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, | |||
2001 | 2005 | ||
2002 | if (config_hash) { | 2006 | if (config_hash) { |
2003 | /* RSS keys */ | 2007 | /* RSS keys */ |
2004 | prandom_bytes(params.rss_key, sizeof(params.rss_key)); | 2008 | prandom_bytes(params.rss_key, T_ETH_RSS_KEY * 4); |
2005 | __set_bit(BNX2X_RSS_SET_SRCH, ¶ms.rss_flags); | 2009 | __set_bit(BNX2X_RSS_SET_SRCH, ¶ms.rss_flags); |
2006 | } | 2010 | } |
2007 | 2011 | ||
2008 | return bnx2x_config_rss(bp, ¶ms); | 2012 | if (IS_PF(bp)) |
2013 | return bnx2x_config_rss(bp, ¶ms); | ||
2014 | else | ||
2015 | return bnx2x_vfpf_config_rss(bp, ¶ms); | ||
2009 | } | 2016 | } |
2010 | 2017 | ||
2011 | static int bnx2x_init_hw(struct bnx2x *bp, u32 load_code) | 2018 | static int bnx2x_init_hw(struct bnx2x *bp, u32 load_code) |
@@ -2645,38 +2652,32 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
2645 | 2652 | ||
2646 | /* initialize FW coalescing state machines in RAM */ | 2653 | /* initialize FW coalescing state machines in RAM */ |
2647 | bnx2x_update_coalesce(bp); | 2654 | bnx2x_update_coalesce(bp); |
2655 | } | ||
2648 | 2656 | ||
2649 | /* setup the leading queue */ | 2657 | /* setup the leading queue */ |
2650 | rc = bnx2x_setup_leading(bp); | 2658 | rc = bnx2x_setup_leading(bp); |
2651 | if (rc) { | 2659 | if (rc) { |
2652 | BNX2X_ERR("Setup leading failed!\n"); | 2660 | BNX2X_ERR("Setup leading failed!\n"); |
2653 | LOAD_ERROR_EXIT(bp, load_error3); | 2661 | LOAD_ERROR_EXIT(bp, load_error3); |
2654 | } | 2662 | } |
2655 | |||
2656 | /* set up the rest of the queues */ | ||
2657 | for_each_nondefault_eth_queue(bp, i) { | ||
2658 | rc = bnx2x_setup_queue(bp, &bp->fp[i], 0); | ||
2659 | if (rc) { | ||
2660 | BNX2X_ERR("Queue setup failed\n"); | ||
2661 | LOAD_ERROR_EXIT(bp, load_error3); | ||
2662 | } | ||
2663 | } | ||
2664 | 2663 | ||
2665 | /* setup rss */ | 2664 | /* set up the rest of the queues */ |
2666 | rc = bnx2x_init_rss_pf(bp); | 2665 | for_each_nondefault_eth_queue(bp, i) { |
2666 | if (IS_PF(bp)) | ||
2667 | rc = bnx2x_setup_queue(bp, &bp->fp[i], false); | ||
2668 | else /* VF */ | ||
2669 | rc = bnx2x_vfpf_setup_q(bp, &bp->fp[i], false); | ||
2667 | if (rc) { | 2670 | if (rc) { |
2668 | BNX2X_ERR("PF RSS init failed\n"); | 2671 | BNX2X_ERR("Queue %d setup failed\n", i); |
2669 | LOAD_ERROR_EXIT(bp, load_error3); | 2672 | LOAD_ERROR_EXIT(bp, load_error3); |
2670 | } | 2673 | } |
2674 | } | ||
2671 | 2675 | ||
2672 | } else { /* vf */ | 2676 | /* setup rss */ |
2673 | for_each_eth_queue(bp, i) { | 2677 | rc = bnx2x_init_rss(bp); |
2674 | rc = bnx2x_vfpf_setup_q(bp, i); | 2678 | if (rc) { |
2675 | if (rc) { | 2679 | BNX2X_ERR("PF RSS init failed\n"); |
2676 | BNX2X_ERR("Queue setup failed\n"); | 2680 | LOAD_ERROR_EXIT(bp, load_error3); |
2677 | LOAD_ERROR_EXIT(bp, load_error3); | ||
2678 | } | ||
2679 | } | ||
2680 | } | 2681 | } |
2681 | 2682 | ||
2682 | /* Now when Clients are configured we are ready to work */ | 2683 | /* Now when Clients are configured we are ready to work */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index affb7646241e..da8fcaa74495 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -105,9 +105,10 @@ void bnx2x_send_unload_done(struct bnx2x *bp, bool keep_link); | |||
105 | * @rss_obj: RSS object to use | 105 | * @rss_obj: RSS object to use |
106 | * @ind_table: indirection table to configure | 106 | * @ind_table: indirection table to configure |
107 | * @config_hash: re-configure RSS hash keys configuration | 107 | * @config_hash: re-configure RSS hash keys configuration |
108 | * @enable: enabled or disabled configuration | ||
108 | */ | 109 | */ |
109 | int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, | 110 | int bnx2x_rss(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj, |
110 | bool config_hash); | 111 | bool config_hash, bool enable); |
111 | 112 | ||
112 | /** | 113 | /** |
113 | * bnx2x__init_func_obj - init function object | 114 | * bnx2x__init_func_obj - init function object |
@@ -980,7 +981,7 @@ static inline int func_by_vn(struct bnx2x *bp, int vn) | |||
980 | 981 | ||
981 | static inline int bnx2x_config_rss_eth(struct bnx2x *bp, bool config_hash) | 982 | static inline int bnx2x_config_rss_eth(struct bnx2x *bp, bool config_hash) |
982 | { | 983 | { |
983 | return bnx2x_config_rss_pf(bp, &bp->rss_conf_obj, config_hash); | 984 | return bnx2x_rss(bp, &bp->rss_conf_obj, config_hash, true); |
984 | } | 985 | } |
985 | 986 | ||
986 | /** | 987 | /** |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index c5f225101684..2612e3c715d4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -3281,14 +3281,14 @@ static int bnx2x_set_rss_flags(struct bnx2x *bp, struct ethtool_rxnfc *info) | |||
3281 | DP(BNX2X_MSG_ETHTOOL, | 3281 | DP(BNX2X_MSG_ETHTOOL, |
3282 | "rss re-configured, UDP 4-tupple %s\n", | 3282 | "rss re-configured, UDP 4-tupple %s\n", |
3283 | udp_rss_requested ? "enabled" : "disabled"); | 3283 | udp_rss_requested ? "enabled" : "disabled"); |
3284 | return bnx2x_config_rss_pf(bp, &bp->rss_conf_obj, 0); | 3284 | return bnx2x_rss(bp, &bp->rss_conf_obj, false, true); |
3285 | } else if ((info->flow_type == UDP_V6_FLOW) && | 3285 | } else if ((info->flow_type == UDP_V6_FLOW) && |
3286 | (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) { | 3286 | (bp->rss_conf_obj.udp_rss_v6 != udp_rss_requested)) { |
3287 | bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested; | 3287 | bp->rss_conf_obj.udp_rss_v6 = udp_rss_requested; |
3288 | DP(BNX2X_MSG_ETHTOOL, | 3288 | DP(BNX2X_MSG_ETHTOOL, |
3289 | "rss re-configured, UDP 4-tupple %s\n", | 3289 | "rss re-configured, UDP 4-tupple %s\n", |
3290 | udp_rss_requested ? "enabled" : "disabled"); | 3290 | udp_rss_requested ? "enabled" : "disabled"); |
3291 | return bnx2x_config_rss_pf(bp, &bp->rss_conf_obj, 0); | 3291 | return bnx2x_rss(bp, &bp->rss_conf_obj, false, true); |
3292 | } | 3292 | } |
3293 | return 0; | 3293 | return 0; |
3294 | 3294 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 5729aa7be1d0..c69990d2170e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -8060,7 +8060,10 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) | |||
8060 | 8060 | ||
8061 | int bnx2x_setup_leading(struct bnx2x *bp) | 8061 | int bnx2x_setup_leading(struct bnx2x *bp) |
8062 | { | 8062 | { |
8063 | return bnx2x_setup_queue(bp, &bp->fp[0], 1); | 8063 | if (IS_PF(bp)) |
8064 | return bnx2x_setup_queue(bp, &bp->fp[0], true); | ||
8065 | else /* VF */ | ||
8066 | return bnx2x_vfpf_setup_q(bp, &bp->fp[0], true); | ||
8064 | } | 8067 | } |
8065 | 8068 | ||
8066 | /** | 8069 | /** |
@@ -8074,8 +8077,10 @@ int bnx2x_set_int_mode(struct bnx2x *bp) | |||
8074 | { | 8077 | { |
8075 | int rc = 0; | 8078 | int rc = 0; |
8076 | 8079 | ||
8077 | if (IS_VF(bp) && int_mode != BNX2X_INT_MODE_MSIX) | 8080 | if (IS_VF(bp) && int_mode != BNX2X_INT_MODE_MSIX) { |
8081 | BNX2X_ERR("VF not loaded since interrupt mode not msix\n"); | ||
8078 | return -EINVAL; | 8082 | return -EINVAL; |
8083 | } | ||
8079 | 8084 | ||
8080 | switch (int_mode) { | 8085 | switch (int_mode) { |
8081 | case BNX2X_INT_MODE_MSIX: | 8086 | case BNX2X_INT_MODE_MSIX: |
@@ -11658,9 +11663,11 @@ static int bnx2x_init_bp(struct bnx2x *bp) | |||
11658 | * second status block for the L2 queue, and a third status block for | 11663 | * second status block for the L2 queue, and a third status block for |
11659 | * CNIC if supported. | 11664 | * CNIC if supported. |
11660 | */ | 11665 | */ |
11661 | if (CNIC_SUPPORT(bp)) | 11666 | if (IS_VF(bp)) |
11667 | bp->min_msix_vec_cnt = 1; | ||
11668 | else if (CNIC_SUPPORT(bp)) | ||
11662 | bp->min_msix_vec_cnt = 3; | 11669 | bp->min_msix_vec_cnt = 3; |
11663 | else | 11670 | else /* PF w/o cnic */ |
11664 | bp->min_msix_vec_cnt = 2; | 11671 | bp->min_msix_vec_cnt = 2; |
11665 | BNX2X_DEV_INFO("bp->min_msix_vec_cnt %d", bp->min_msix_vec_cnt); | 11672 | BNX2X_DEV_INFO("bp->min_msix_vec_cnt %d", bp->min_msix_vec_cnt); |
11666 | 11673 | ||
@@ -12571,8 +12578,7 @@ static int bnx2x_set_qm_cid_count(struct bnx2x *bp) | |||
12571 | * @dev: pci device | 12578 | * @dev: pci device |
12572 | * | 12579 | * |
12573 | */ | 12580 | */ |
12574 | static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev, | 12581 | static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev, int cnic_cnt) |
12575 | int cnic_cnt, bool is_vf) | ||
12576 | { | 12582 | { |
12577 | int index; | 12583 | int index; |
12578 | u16 control = 0; | 12584 | u16 control = 0; |
@@ -12598,7 +12604,7 @@ static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev, | |||
12598 | 12604 | ||
12599 | index = control & PCI_MSIX_FLAGS_QSIZE; | 12605 | index = control & PCI_MSIX_FLAGS_QSIZE; |
12600 | 12606 | ||
12601 | return is_vf ? index + 1 : index; | 12607 | return index; |
12602 | } | 12608 | } |
12603 | 12609 | ||
12604 | static int set_max_cos_est(int chip_id) | 12610 | static int set_max_cos_est(int chip_id) |
@@ -12678,10 +12684,13 @@ static int bnx2x_init_one(struct pci_dev *pdev, | |||
12678 | is_vf = set_is_vf(ent->driver_data); | 12684 | is_vf = set_is_vf(ent->driver_data); |
12679 | cnic_cnt = is_vf ? 0 : 1; | 12685 | cnic_cnt = is_vf ? 0 : 1; |
12680 | 12686 | ||
12681 | max_non_def_sbs = bnx2x_get_num_non_def_sbs(pdev, cnic_cnt, is_vf); | 12687 | max_non_def_sbs = bnx2x_get_num_non_def_sbs(pdev, cnic_cnt); |
12688 | |||
12689 | /* add another SB for VF as it has no default SB */ | ||
12690 | max_non_def_sbs += is_vf ? 1 : 0; | ||
12682 | 12691 | ||
12683 | /* Maximum number of RSS queues: one IGU SB goes to CNIC */ | 12692 | /* Maximum number of RSS queues: one IGU SB goes to CNIC */ |
12684 | rss_count = is_vf ? 1 : max_non_def_sbs - cnic_cnt; | 12693 | rss_count = max_non_def_sbs - cnic_cnt; |
12685 | 12694 | ||
12686 | if (rss_count < 1) | 12695 | if (rss_count < 1) |
12687 | return -EINVAL; | 12696 | return -EINVAL; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h index 8e9847fef861..2a8c1dc65d9c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | |||
@@ -746,9 +746,12 @@ int bnx2x_vfpf_release(struct bnx2x *bp); | |||
746 | int bnx2x_vfpf_release(struct bnx2x *bp); | 746 | int bnx2x_vfpf_release(struct bnx2x *bp); |
747 | int bnx2x_vfpf_init(struct bnx2x *bp); | 747 | int bnx2x_vfpf_init(struct bnx2x *bp); |
748 | void bnx2x_vfpf_close_vf(struct bnx2x *bp); | 748 | void bnx2x_vfpf_close_vf(struct bnx2x *bp); |
749 | int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx); | 749 | int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, |
750 | bool is_leading); | ||
750 | int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx); | 751 | int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx); |
751 | int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set); | 752 | int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set); |
753 | int bnx2x_vfpf_config_rss(struct bnx2x *bp, | ||
754 | struct bnx2x_config_rss_params *params); | ||
752 | int bnx2x_vfpf_set_mcast(struct net_device *dev); | 755 | int bnx2x_vfpf_set_mcast(struct net_device *dev); |
753 | int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp); | 756 | int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp); |
754 | 757 | ||
@@ -809,7 +812,7 @@ static inline int bnx2x_vfpf_acquire(struct bnx2x *bp, | |||
809 | static inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; } | 812 | static inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; } |
810 | static inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; } | 813 | static inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; } |
811 | static inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {} | 814 | static inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {} |
812 | static inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx) {return 0; } | 815 | static inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, bool is_leading) {return 0; } |
813 | static inline int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx) {return 0; } | 816 | static inline int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx) {return 0; } |
814 | static inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, | 817 | static inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, |
815 | u8 vf_qid, bool set) {return 0; } | 818 | u8 vf_qid, bool set) {return 0; } |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c index a7e88a405a43..6cfb88732452 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | |||
@@ -379,6 +379,8 @@ int bnx2x_vfpf_init(struct bnx2x *bp) | |||
379 | req->stats_addr = bp->fw_stats_data_mapping + | 379 | req->stats_addr = bp->fw_stats_data_mapping + |
380 | offsetof(struct bnx2x_fw_stats_data, queue_stats); | 380 | offsetof(struct bnx2x_fw_stats_data, queue_stats); |
381 | 381 | ||
382 | req->stats_stride = sizeof(struct per_queue_stats); | ||
383 | |||
382 | /* add list termination tlv */ | 384 | /* add list termination tlv */ |
383 | bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, | 385 | bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, |
384 | sizeof(struct channel_list_end_tlv)); | 386 | sizeof(struct channel_list_end_tlv)); |
@@ -506,11 +508,12 @@ static void bnx2x_leading_vfq_init(struct bnx2x *bp, struct bnx2x_virtf *vf, | |||
506 | } | 508 | } |
507 | 509 | ||
508 | /* ask the pf to open a queue for the vf */ | 510 | /* ask the pf to open a queue for the vf */ |
509 | int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx) | 511 | int bnx2x_vfpf_setup_q(struct bnx2x *bp, struct bnx2x_fastpath *fp, |
512 | bool is_leading) | ||
510 | { | 513 | { |
511 | struct vfpf_setup_q_tlv *req = &bp->vf2pf_mbox->req.setup_q; | 514 | struct vfpf_setup_q_tlv *req = &bp->vf2pf_mbox->req.setup_q; |
512 | struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; | 515 | struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; |
513 | struct bnx2x_fastpath *fp = &bp->fp[fp_idx]; | 516 | u8 fp_idx = fp->index; |
514 | u16 tpa_agg_size = 0, flags = 0; | 517 | u16 tpa_agg_size = 0, flags = 0; |
515 | int rc; | 518 | int rc; |
516 | 519 | ||
@@ -526,6 +529,9 @@ int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx) | |||
526 | tpa_agg_size = TPA_AGG_SIZE; | 529 | tpa_agg_size = TPA_AGG_SIZE; |
527 | } | 530 | } |
528 | 531 | ||
532 | if (is_leading) | ||
533 | flags |= VFPF_QUEUE_FLG_LEADING_RSS; | ||
534 | |||
529 | /* calculate queue flags */ | 535 | /* calculate queue flags */ |
530 | flags |= VFPF_QUEUE_FLG_STATS; | 536 | flags |= VFPF_QUEUE_FLG_STATS; |
531 | flags |= VFPF_QUEUE_FLG_CACHE_ALIGN; | 537 | flags |= VFPF_QUEUE_FLG_CACHE_ALIGN; |
@@ -699,6 +705,71 @@ out: | |||
699 | return 0; | 705 | return 0; |
700 | } | 706 | } |
701 | 707 | ||
708 | /* request pf to config rss table for vf queues*/ | ||
709 | int bnx2x_vfpf_config_rss(struct bnx2x *bp, | ||
710 | struct bnx2x_config_rss_params *params) | ||
711 | { | ||
712 | struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp; | ||
713 | struct vfpf_rss_tlv *req = &bp->vf2pf_mbox->req.update_rss; | ||
714 | int rc = 0; | ||
715 | |||
716 | /* clear mailbox and prep first tlv */ | ||
717 | bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_UPDATE_RSS, | ||
718 | sizeof(*req)); | ||
719 | |||
720 | /* add list termination tlv */ | ||
721 | bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END, | ||
722 | sizeof(struct channel_list_end_tlv)); | ||
723 | |||
724 | memcpy(req->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE); | ||
725 | memcpy(req->rss_key, params->rss_key, sizeof(params->rss_key)); | ||
726 | req->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE; | ||
727 | req->rss_key_size = T_ETH_RSS_KEY; | ||
728 | req->rss_result_mask = params->rss_result_mask; | ||
729 | |||
730 | /* flags handled individually for backward/forward compatability */ | ||
731 | if (params->rss_flags & (1 << BNX2X_RSS_MODE_DISABLED)) | ||
732 | req->rss_flags |= VFPF_RSS_MODE_DISABLED; | ||
733 | if (params->rss_flags & (1 << BNX2X_RSS_MODE_REGULAR)) | ||
734 | req->rss_flags |= VFPF_RSS_MODE_REGULAR; | ||
735 | if (params->rss_flags & (1 << BNX2X_RSS_SET_SRCH)) | ||
736 | req->rss_flags |= VFPF_RSS_SET_SRCH; | ||
737 | if (params->rss_flags & (1 << BNX2X_RSS_IPV4)) | ||
738 | req->rss_flags |= VFPF_RSS_IPV4; | ||
739 | if (params->rss_flags & (1 << BNX2X_RSS_IPV4_TCP)) | ||
740 | req->rss_flags |= VFPF_RSS_IPV4_TCP; | ||
741 | if (params->rss_flags & (1 << BNX2X_RSS_IPV4_UDP)) | ||
742 | req->rss_flags |= VFPF_RSS_IPV4_UDP; | ||
743 | if (params->rss_flags & (1 << BNX2X_RSS_IPV6)) | ||
744 | req->rss_flags |= VFPF_RSS_IPV6; | ||
745 | if (params->rss_flags & (1 << BNX2X_RSS_IPV6_TCP)) | ||
746 | req->rss_flags |= VFPF_RSS_IPV6_TCP; | ||
747 | if (params->rss_flags & (1 << BNX2X_RSS_IPV6_UDP)) | ||
748 | req->rss_flags |= VFPF_RSS_IPV6_UDP; | ||
749 | |||
750 | DP(BNX2X_MSG_IOV, "rss flags %x\n", req->rss_flags); | ||
751 | |||
752 | /* output tlvs list */ | ||
753 | bnx2x_dp_tlv_list(bp, req); | ||
754 | |||
755 | /* send message to pf */ | ||
756 | rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping); | ||
757 | if (rc) { | ||
758 | BNX2X_ERR("failed to send message to pf. rc was %d\n", rc); | ||
759 | goto out; | ||
760 | } | ||
761 | |||
762 | if (resp->hdr.status != PFVF_STATUS_SUCCESS) { | ||
763 | BNX2X_ERR("failed to send rss message to PF over Vf PF channel %d\n", | ||
764 | resp->hdr.status); | ||
765 | rc = -EINVAL; | ||
766 | } | ||
767 | out: | ||
768 | bnx2x_vfpf_finalize(bp, &req->first_tlv); | ||
769 | |||
770 | return 0; | ||
771 | } | ||
772 | |||
702 | int bnx2x_vfpf_set_mcast(struct net_device *dev) | 773 | int bnx2x_vfpf_set_mcast(struct net_device *dev) |
703 | { | 774 | { |
704 | struct bnx2x *bp = netdev_priv(dev); | 775 | struct bnx2x *bp = netdev_priv(dev); |