|
@@ -1942,7 +1942,7 @@ static void bnx2x_set_rx_buf_size(struct bnx2x *bp)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static int bnx2x_init_rss_pf(struct bnx2x *bp)
|
|
|
+static int bnx2x_init_rss(struct bnx2x *bp)
|
|
|
{
|
|
|
int i;
|
|
|
u8 num_eth_queues = BNX2X_NUM_ETH_QUEUES(bp);
|
|
@@ -1966,8 +1966,8 @@ static int bnx2x_init_rss_pf(struct bnx2x *bp)
|
|
|
return bnx2x_config_rss_eth(bp, bp->port.pmf || !CHIP_IS_E1x(bp));
|
|
|
}
|
|
|
|
|
|
-int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj,
|
|
|
- bool config_hash)
|
|
|
+int bnx2x_rss(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj,
|
|
|
+ bool config_hash, bool enable)
|
|
|
{
|
|
|
struct bnx2x_config_rss_params params = {NULL};
|
|
|
|
|
@@ -1982,17 +1982,21 @@ int bnx2x_config_rss_pf(struct bnx2x *bp, struct bnx2x_rss_config_obj *rss_obj,
|
|
|
|
|
|
__set_bit(RAMROD_COMP_WAIT, ¶ms.ramrod_flags);
|
|
|
|
|
|
- __set_bit(BNX2X_RSS_MODE_REGULAR, ¶ms.rss_flags);
|
|
|
-
|
|
|
- /* RSS configuration */
|
|
|
- __set_bit(BNX2X_RSS_IPV4, ¶ms.rss_flags);
|
|
|
- __set_bit(BNX2X_RSS_IPV4_TCP, ¶ms.rss_flags);
|
|
|
- __set_bit(BNX2X_RSS_IPV6, ¶ms.rss_flags);
|
|
|
- __set_bit(BNX2X_RSS_IPV6_TCP, ¶ms.rss_flags);
|
|
|
- if (rss_obj->udp_rss_v4)
|
|
|
- __set_bit(BNX2X_RSS_IPV4_UDP, ¶ms.rss_flags);
|
|
|
- if (rss_obj->udp_rss_v6)
|
|
|
- __set_bit(BNX2X_RSS_IPV6_UDP, ¶ms.rss_flags);
|
|
|
+ if (enable) {
|
|
|
+ __set_bit(BNX2X_RSS_MODE_REGULAR, ¶ms.rss_flags);
|
|
|
+
|
|
|
+ /* RSS configuration */
|
|
|
+ __set_bit(BNX2X_RSS_IPV4, ¶ms.rss_flags);
|
|
|
+ __set_bit(BNX2X_RSS_IPV4_TCP, ¶ms.rss_flags);
|
|
|
+ __set_bit(BNX2X_RSS_IPV6, ¶ms.rss_flags);
|
|
|
+ __set_bit(BNX2X_RSS_IPV6_TCP, ¶ms.rss_flags);
|
|
|
+ if (rss_obj->udp_rss_v4)
|
|
|
+ __set_bit(BNX2X_RSS_IPV4_UDP, ¶ms.rss_flags);
|
|
|
+ if (rss_obj->udp_rss_v6)
|
|
|
+ __set_bit(BNX2X_RSS_IPV6_UDP, ¶ms.rss_flags);
|
|
|
+ } else {
|
|
|
+ __set_bit(BNX2X_RSS_MODE_DISABLED, ¶ms.rss_flags);
|
|
|
+ }
|
|
|
|
|
|
/* Hash bits */
|
|
|
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,
|
|
|
|
|
|
if (config_hash) {
|
|
|
/* RSS keys */
|
|
|
- prandom_bytes(params.rss_key, sizeof(params.rss_key));
|
|
|
+ prandom_bytes(params.rss_key, T_ETH_RSS_KEY * 4);
|
|
|
__set_bit(BNX2X_RSS_SET_SRCH, ¶ms.rss_flags);
|
|
|
}
|
|
|
|
|
|
- return bnx2x_config_rss(bp, ¶ms);
|
|
|
+ if (IS_PF(bp))
|
|
|
+ return bnx2x_config_rss(bp, ¶ms);
|
|
|
+ else
|
|
|
+ return bnx2x_vfpf_config_rss(bp, ¶ms);
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
|
|
|
/* initialize FW coalescing state machines in RAM */
|
|
|
bnx2x_update_coalesce(bp);
|
|
|
+ }
|
|
|
|
|
|
- /* setup the leading queue */
|
|
|
- rc = bnx2x_setup_leading(bp);
|
|
|
- if (rc) {
|
|
|
- BNX2X_ERR("Setup leading failed!\n");
|
|
|
- LOAD_ERROR_EXIT(bp, load_error3);
|
|
|
- }
|
|
|
-
|
|
|
- /* set up the rest of the queues */
|
|
|
- for_each_nondefault_eth_queue(bp, i) {
|
|
|
- rc = bnx2x_setup_queue(bp, &bp->fp[i], 0);
|
|
|
- if (rc) {
|
|
|
- BNX2X_ERR("Queue setup failed\n");
|
|
|
- LOAD_ERROR_EXIT(bp, load_error3);
|
|
|
- }
|
|
|
- }
|
|
|
+ /* setup the leading queue */
|
|
|
+ rc = bnx2x_setup_leading(bp);
|
|
|
+ if (rc) {
|
|
|
+ BNX2X_ERR("Setup leading failed!\n");
|
|
|
+ LOAD_ERROR_EXIT(bp, load_error3);
|
|
|
+ }
|
|
|
|
|
|
- /* setup rss */
|
|
|
- rc = bnx2x_init_rss_pf(bp);
|
|
|
+ /* set up the rest of the queues */
|
|
|
+ for_each_nondefault_eth_queue(bp, i) {
|
|
|
+ if (IS_PF(bp))
|
|
|
+ rc = bnx2x_setup_queue(bp, &bp->fp[i], false);
|
|
|
+ else /* VF */
|
|
|
+ rc = bnx2x_vfpf_setup_q(bp, &bp->fp[i], false);
|
|
|
if (rc) {
|
|
|
- BNX2X_ERR("PF RSS init failed\n");
|
|
|
+ BNX2X_ERR("Queue %d setup failed\n", i);
|
|
|
LOAD_ERROR_EXIT(bp, load_error3);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- } else { /* vf */
|
|
|
- for_each_eth_queue(bp, i) {
|
|
|
- rc = bnx2x_vfpf_setup_q(bp, i);
|
|
|
- if (rc) {
|
|
|
- BNX2X_ERR("Queue setup failed\n");
|
|
|
- LOAD_ERROR_EXIT(bp, load_error3);
|
|
|
- }
|
|
|
- }
|
|
|
+ /* setup rss */
|
|
|
+ rc = bnx2x_init_rss(bp);
|
|
|
+ if (rc) {
|
|
|
+ BNX2X_ERR("PF RSS init failed\n");
|
|
|
+ LOAD_ERROR_EXIT(bp, load_error3);
|
|
|
}
|
|
|
|
|
|
/* Now when Clients are configured we are ready to work */
|