bna: Fix Ucast Failure Handling
authorRasesh Mody <rmody@brocade.com>
Mon, 20 May 2013 10:08:02 +0000 (10:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 May 2013 21:07:59 +0000 (14:07 -0700)
Failure of the UCAST set for base mac address fails when user configures a
duplicate mac address that matches that of another vNIC on the same port.
The bna does not handle the ucast failure and keeps this address in cache.
On disable of the vNIC, bna tries to delete the failed base mac address and the
fw asserts.

On failure of ucast address, mark ucast address set to false.

Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/brocade/bna/bna.h
drivers/net/ethernet/brocade/bna/bna_enet.c
drivers/net/ethernet/brocade/bna/bna_tx_rx.c

index 25dae757e9c42661b094270786d5f141ab72c3b4..f1eafc409bbd131894146d775b5b586d5318de86 100644 (file)
@@ -455,6 +455,8 @@ void bna_bfi_rx_enet_stop_rsp(struct bna_rx *rx,
 void bna_bfi_rxf_cfg_rsp(struct bna_rxf *rxf, struct bfi_msgq_mhdr *msghdr);
 void bna_bfi_rxf_mcast_add_rsp(struct bna_rxf *rxf,
                               struct bfi_msgq_mhdr *msghdr);
+void bna_bfi_rxf_ucast_set_rsp(struct bna_rxf *rxf,
+                              struct bfi_msgq_mhdr *msghdr);
 
 /* APIs for BNA */
 void bna_rx_mod_init(struct bna_rx_mod *rx_mod, struct bna *bna,
index db14f69d63bcd4b5268b0c9d76bff81739de41ed..3ca77fad4851ca077e1f598e28d46155887f22c2 100644 (file)
@@ -298,7 +298,6 @@ bna_msgq_rsp_handler(void *arg, struct bfi_msgq_mhdr *msghdr)
        case BFI_ENET_I2H_RSS_ENABLE_RSP:
        case BFI_ENET_I2H_RX_PROMISCUOUS_RSP:
        case BFI_ENET_I2H_RX_DEFAULT_RSP:
-       case BFI_ENET_I2H_MAC_UCAST_SET_RSP:
        case BFI_ENET_I2H_MAC_UCAST_CLR_RSP:
        case BFI_ENET_I2H_MAC_UCAST_ADD_RSP:
        case BFI_ENET_I2H_MAC_UCAST_DEL_RSP:
@@ -311,6 +310,12 @@ bna_msgq_rsp_handler(void *arg, struct bfi_msgq_mhdr *msghdr)
                        bna_bfi_rxf_cfg_rsp(&rx->rxf, msghdr);
                break;
 
+       case BFI_ENET_I2H_MAC_UCAST_SET_RSP:
+               bna_rx_from_rid(bna, msghdr->enet_id, rx);
+               if (rx)
+                       bna_bfi_rxf_ucast_set_rsp(&rx->rxf, msghdr);
+               break;
+
        case BFI_ENET_I2H_MAC_MCAST_ADD_RSP:
                bna_rx_from_rid(bna, msghdr->enet_id, rx);
                if (rx)
index ea6f4a036401aae98d9e02126119d343f05ede71..57cd1bff59f1cd056f5d7b68755612ef7e985426 100644 (file)
@@ -710,6 +710,21 @@ bna_bfi_rxf_cfg_rsp(struct bna_rxf *rxf, struct bfi_msgq_mhdr *msghdr)
        bfa_fsm_send_event(rxf, RXF_E_FW_RESP);
 }
 
+void
+bna_bfi_rxf_ucast_set_rsp(struct bna_rxf *rxf,
+                       struct bfi_msgq_mhdr *msghdr)
+{
+       struct bfi_enet_rsp *rsp =
+               (struct bfi_enet_rsp *)msghdr;
+
+       if (rsp->error) {
+               /* Clear ucast from cache */
+               rxf->ucast_active_set = 0;
+       }
+
+       bfa_fsm_send_event(rxf, RXF_E_FW_RESP);
+}
+
 void
 bna_bfi_rxf_mcast_add_rsp(struct bna_rxf *rxf,
                        struct bfi_msgq_mhdr *msghdr)