aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2010-10-17 19:08:53 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-18 09:51:59 -0400
commit030f3356b64a129a1ab34175491a8175bef98e6e (patch)
tree444fccbb8f7dabb1987132c008525b71bea83c03
parentc8e4f48a8eb236eb672c6da0731ee01a633844f0 (diff)
bnx2x: remove unnecessary FUNC_FLG_RSS flag and related
As suggested by: Joe Perches <joe@perches.com> Although RSS is meaningless when there is a single HW queue we still need it enabled in order to have HW Rx hash generated. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bnx2x/bnx2x.h13
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c70
2 files changed, 34 insertions, 49 deletions
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index c49b643e009b..556cad5ed012 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1180,15 +1180,10 @@ struct bnx2x {
1180 TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY 1180 TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY
1181 1181
1182/* func init flags */ 1182/* func init flags */
1183#define FUNC_FLG_RSS 0x0001 1183#define FUNC_FLG_STATS 0x0001
1184#define FUNC_FLG_STATS 0x0002 1184#define FUNC_FLG_TPA 0x0002
1185/* removed FUNC_FLG_UNMATCHED 0x0004 */ 1185#define FUNC_FLG_SPQ 0x0004
1186#define FUNC_FLG_TPA 0x0008 1186#define FUNC_FLG_LEADING 0x0008 /* PF only */
1187#define FUNC_FLG_SPQ 0x0010
1188#define FUNC_FLG_LEADING 0x0020 /* PF only */
1189
1190#define FUNC_CONFIG(flgs) ((flgs) & (FUNC_FLG_RSS | FUNC_FLG_TPA | \
1191 FUNC_FLG_LEADING))
1192 1187
1193struct rxq_pause_params { 1188struct rxq_pause_params {
1194 u16 bd_th_lo; 1189 u16 bd_th_lo;
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index ead524bca8f2..012c093cb432 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -2284,35 +2284,31 @@ void bnx2x_rxq_set_mac_filters(struct bnx2x *bp, u16 cl_id, u32 filters)
2284 2284
2285void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p) 2285void bnx2x_func_init(struct bnx2x *bp, struct bnx2x_func_init_params *p)
2286{ 2286{
2287 if (FUNC_CONFIG(p->func_flgs)) { 2287 struct tstorm_eth_function_common_config tcfg = {0};
2288 struct tstorm_eth_function_common_config tcfg = {0}; 2288 u16 rss_flgs;
2289
2290 /* tpa */
2291 if (p->func_flgs & FUNC_FLG_TPA)
2292 tcfg.config_flags |=
2293 TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
2294
2295 /* set rss flags */
2296 if (p->func_flgs & FUNC_FLG_RSS) {
2297 u16 rss_flgs = (p->rss->mode <<
2298 TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);
2299
2300 if (p->rss->cap & RSS_IPV4_CAP)
2301 rss_flgs |= RSS_IPV4_CAP_MASK;
2302 if (p->rss->cap & RSS_IPV4_TCP_CAP)
2303 rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
2304 if (p->rss->cap & RSS_IPV6_CAP)
2305 rss_flgs |= RSS_IPV6_CAP_MASK;
2306 if (p->rss->cap & RSS_IPV6_TCP_CAP)
2307 rss_flgs |= RSS_IPV6_TCP_CAP_MASK;
2308
2309 tcfg.config_flags |= rss_flgs;
2310 tcfg.rss_result_mask = p->rss->result_mask;
2311 2289
2312 } 2290 /* tpa */
2291 if (p->func_flgs & FUNC_FLG_TPA)
2292 tcfg.config_flags |=
2293 TSTORM_ETH_FUNCTION_COMMON_CONFIG_ENABLE_TPA;
2313 2294
2314 storm_memset_func_cfg(bp, &tcfg, p->func_id); 2295 /* set rss flags */
2315 } 2296 rss_flgs = (p->rss->mode <<
2297 TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT);
2298
2299 if (p->rss->cap & RSS_IPV4_CAP)
2300 rss_flgs |= RSS_IPV4_CAP_MASK;
2301 if (p->rss->cap & RSS_IPV4_TCP_CAP)
2302 rss_flgs |= RSS_IPV4_TCP_CAP_MASK;
2303 if (p->rss->cap & RSS_IPV6_CAP)
2304 rss_flgs |= RSS_IPV6_CAP_MASK;
2305 if (p->rss->cap & RSS_IPV6_TCP_CAP)
2306 rss_flgs |= RSS_IPV6_TCP_CAP_MASK;
2307
2308 tcfg.config_flags |= rss_flgs;
2309 tcfg.rss_result_mask = p->rss->result_mask;
2310
2311 storm_memset_func_cfg(bp, &tcfg, p->func_id);
2316 2312
2317 /* Enable the function in the FW */ 2313 /* Enable the function in the FW */
2318 storm_memset_vf_to_pf(bp, p->func_id, p->pf_id); 2314 storm_memset_vf_to_pf(bp, p->func_id, p->pf_id);
@@ -2479,23 +2475,17 @@ void bnx2x_pf_init(struct bnx2x *bp)
2479 else 2475 else
2480 flags |= FUNC_FLG_TPA; 2476 flags |= FUNC_FLG_TPA;
2481 2477
2478 /* function setup */
2479
2482 /** 2480 /**
2483 * Although RSS is meaningless when there is a single HW queue we 2481 * Although RSS is meaningless when there is a single HW queue we
2484 * still need it enabled in order to have HW Rx hash generated. 2482 * still need it enabled in order to have HW Rx hash generated.
2485 *
2486 * if (is_eth_multi(bp))
2487 * flags |= FUNC_FLG_RSS;
2488 */ 2483 */
2489 flags |= FUNC_FLG_RSS; 2484 rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP |
2490 2485 RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
2491 /* function setup */ 2486 rss.mode = bp->multi_mode;
2492 if (flags & FUNC_FLG_RSS) { 2487 rss.result_mask = MULTI_MASK;
2493 rss.cap = (RSS_IPV4_CAP | RSS_IPV4_TCP_CAP | 2488 func_init.rss = &rss;
2494 RSS_IPV6_CAP | RSS_IPV6_TCP_CAP);
2495 rss.mode = bp->multi_mode;
2496 rss.result_mask = MULTI_MASK;
2497 func_init.rss = &rss;
2498 }
2499 2489
2500 func_init.func_flgs = flags; 2490 func_init.func_flgs = flags;
2501 func_init.pf_id = BP_FUNC(bp); 2491 func_init.pf_id = BP_FUNC(bp);