diff options
author | Vladislav Zolotarov <vladz@broadcom.com> | 2011-02-06 14:21:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-06 14:21:49 -0500 |
commit | 711c914688163dbe757c174788e20695088478e5 (patch) | |
tree | 6df522b4dc1374f5a738cf54612ecfc9b4ae340e /drivers/net/bnx2x | |
parent | bf1f9ae05036e12035f8e9a48f3dcf4dd14fdada (diff) |
bnx2x: Duplication in promisc mode
Prevent packets duplication for frames targeting FCoE L2 ring:
packets were arriving to stack from both L2 RSS and from FCoE
L2 in a promiscuous mode.
Configure FCoE L2 ring to DROP_ALL rx mode, when interface is
configured to PROMISC, and to accept only unicast frames, when
interface is configured to ALL_MULTI.
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>
Diffstat (limited to 'drivers/net/bnx2x')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_main.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index f40740e68ea5..d584d32c747d 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -4276,9 +4276,12 @@ void bnx2x_set_storm_rx_mode(struct bnx2x *bp) | |||
4276 | def_q_filters |= BNX2X_ACCEPT_UNICAST | BNX2X_ACCEPT_BROADCAST | | 4276 | def_q_filters |= BNX2X_ACCEPT_UNICAST | BNX2X_ACCEPT_BROADCAST | |
4277 | BNX2X_ACCEPT_MULTICAST; | 4277 | BNX2X_ACCEPT_MULTICAST; |
4278 | #ifdef BCM_CNIC | 4278 | #ifdef BCM_CNIC |
4279 | cl_id = bnx2x_fcoe(bp, cl_id); | 4279 | if (!NO_FCOE(bp)) { |
4280 | bnx2x_rxq_set_mac_filters(bp, cl_id, BNX2X_ACCEPT_UNICAST | | 4280 | cl_id = bnx2x_fcoe(bp, cl_id); |
4281 | BNX2X_ACCEPT_MULTICAST); | 4281 | bnx2x_rxq_set_mac_filters(bp, cl_id, |
4282 | BNX2X_ACCEPT_UNICAST | | ||
4283 | BNX2X_ACCEPT_MULTICAST); | ||
4284 | } | ||
4282 | #endif | 4285 | #endif |
4283 | break; | 4286 | break; |
4284 | 4287 | ||
@@ -4286,18 +4289,29 @@ void bnx2x_set_storm_rx_mode(struct bnx2x *bp) | |||
4286 | def_q_filters |= BNX2X_ACCEPT_UNICAST | BNX2X_ACCEPT_BROADCAST | | 4289 | def_q_filters |= BNX2X_ACCEPT_UNICAST | BNX2X_ACCEPT_BROADCAST | |
4287 | BNX2X_ACCEPT_ALL_MULTICAST; | 4290 | BNX2X_ACCEPT_ALL_MULTICAST; |
4288 | #ifdef BCM_CNIC | 4291 | #ifdef BCM_CNIC |
4289 | cl_id = bnx2x_fcoe(bp, cl_id); | 4292 | /* |
4290 | bnx2x_rxq_set_mac_filters(bp, cl_id, BNX2X_ACCEPT_UNICAST | | 4293 | * Prevent duplication of multicast packets by configuring FCoE |
4291 | BNX2X_ACCEPT_MULTICAST); | 4294 | * L2 Client to receive only matched unicast frames. |
4295 | */ | ||
4296 | if (!NO_FCOE(bp)) { | ||
4297 | cl_id = bnx2x_fcoe(bp, cl_id); | ||
4298 | bnx2x_rxq_set_mac_filters(bp, cl_id, | ||
4299 | BNX2X_ACCEPT_UNICAST); | ||
4300 | } | ||
4292 | #endif | 4301 | #endif |
4293 | break; | 4302 | break; |
4294 | 4303 | ||
4295 | case BNX2X_RX_MODE_PROMISC: | 4304 | case BNX2X_RX_MODE_PROMISC: |
4296 | def_q_filters |= BNX2X_PROMISCUOUS_MODE; | 4305 | def_q_filters |= BNX2X_PROMISCUOUS_MODE; |
4297 | #ifdef BCM_CNIC | 4306 | #ifdef BCM_CNIC |
4298 | cl_id = bnx2x_fcoe(bp, cl_id); | 4307 | /* |
4299 | bnx2x_rxq_set_mac_filters(bp, cl_id, BNX2X_ACCEPT_UNICAST | | 4308 | * Prevent packets duplication by configuring DROP_ALL for FCoE |
4300 | BNX2X_ACCEPT_MULTICAST); | 4309 | * L2 Client. |
4310 | */ | ||
4311 | if (!NO_FCOE(bp)) { | ||
4312 | cl_id = bnx2x_fcoe(bp, cl_id); | ||
4313 | bnx2x_rxq_set_mac_filters(bp, cl_id, BNX2X_ACCEPT_NONE); | ||
4314 | } | ||
4301 | #endif | 4315 | #endif |
4302 | /* pass management unicast packets as well */ | 4316 | /* pass management unicast packets as well */ |
4303 | llh_mask |= NIG_LLH0_BRB1_DRV_MASK_REG_LLH0_BRB1_DRV_MASK_UNCST; | 4317 | llh_mask |= NIG_LLH0_BRB1_DRV_MASK_REG_LLH0_BRB1_DRV_MASK_UNCST; |