diff options
author | Ariel Elior <ariele@broadcom.com> | 2013-08-27 18:13:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-27 22:03:04 -0400 |
commit | 35a04aa35c2929f24c7f063f42b6d776ad848c24 (patch) | |
tree | 3ad629e011eca6e161f0b824848e1716f40d2c77 | |
parent | 34d5626afc39c43d63ec7781b648091e92fae45a (diff) |
bnx2x: Fix functionality of configuring vlan list
The check on return code of bnx2x_vfop_config_vlan0() would lead to error
handling flow as the return value indicating an existing pending ramrod would
be erroneously considered as an error.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index ad83f4b48777..b7efe27f845c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -522,23 +522,6 @@ static int bnx2x_vfop_set_user_req(struct bnx2x *bp, | |||
522 | return 0; | 522 | return 0; |
523 | } | 523 | } |
524 | 524 | ||
525 | static int | ||
526 | bnx2x_vfop_config_vlan0(struct bnx2x *bp, | ||
527 | struct bnx2x_vlan_mac_ramrod_params *vlan_mac, | ||
528 | bool add) | ||
529 | { | ||
530 | int rc; | ||
531 | |||
532 | vlan_mac->user_req.cmd = add ? BNX2X_VLAN_MAC_ADD : | ||
533 | BNX2X_VLAN_MAC_DEL; | ||
534 | vlan_mac->user_req.u.vlan.vlan = 0; | ||
535 | |||
536 | rc = bnx2x_config_vlan_mac(bp, vlan_mac); | ||
537 | if (rc == -EEXIST) | ||
538 | rc = 0; | ||
539 | return rc; | ||
540 | } | ||
541 | |||
542 | static int bnx2x_vfop_config_list(struct bnx2x *bp, | 525 | static int bnx2x_vfop_config_list(struct bnx2x *bp, |
543 | struct bnx2x_vfop_filters *filters, | 526 | struct bnx2x_vfop_filters *filters, |
544 | struct bnx2x_vlan_mac_ramrod_params *vlan_mac) | 527 | struct bnx2x_vlan_mac_ramrod_params *vlan_mac) |
@@ -643,30 +626,14 @@ static void bnx2x_vfop_vlan_mac(struct bnx2x *bp, struct bnx2x_virtf *vf) | |||
643 | 626 | ||
644 | case BNX2X_VFOP_VLAN_CONFIG_LIST: | 627 | case BNX2X_VFOP_VLAN_CONFIG_LIST: |
645 | /* next state */ | 628 | /* next state */ |
646 | vfop->state = BNX2X_VFOP_VLAN_CONFIG_LIST_0; | 629 | vfop->state = BNX2X_VFOP_VLAN_MAC_CHK_DONE; |
647 | |||
648 | /* remove vlan0 - could be no-op */ | ||
649 | vfop->rc = bnx2x_vfop_config_vlan0(bp, vlan_mac, false); | ||
650 | if (vfop->rc) | ||
651 | goto op_err; | ||
652 | 630 | ||
653 | /* Do vlan list config. if this operation fails we try to | 631 | /* do list config */ |
654 | * restore vlan0 to keep the queue is working order | ||
655 | */ | ||
656 | vfop->rc = bnx2x_vfop_config_list(bp, filters, vlan_mac); | 632 | vfop->rc = bnx2x_vfop_config_list(bp, filters, vlan_mac); |
657 | if (!vfop->rc) { | 633 | if (!vfop->rc) { |
658 | set_bit(RAMROD_CONT, &vlan_mac->ramrod_flags); | 634 | set_bit(RAMROD_CONT, &vlan_mac->ramrod_flags); |
659 | vfop->rc = bnx2x_config_vlan_mac(bp, vlan_mac); | 635 | vfop->rc = bnx2x_config_vlan_mac(bp, vlan_mac); |
660 | } | 636 | } |
661 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_CONT); /* fall-through */ | ||
662 | |||
663 | case BNX2X_VFOP_VLAN_CONFIG_LIST_0: | ||
664 | /* next state */ | ||
665 | vfop->state = BNX2X_VFOP_VLAN_MAC_CHK_DONE; | ||
666 | |||
667 | if (list_empty(&obj->head)) | ||
668 | /* add vlan0 */ | ||
669 | vfop->rc = bnx2x_vfop_config_vlan0(bp, vlan_mac, true); | ||
670 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE); | 637 | bnx2x_vfop_finalize(vf, vfop->rc, VFOP_DONE); |
671 | 638 | ||
672 | default: | 639 | default: |