diff options
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index a78edaccceee..b260913db236 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -13233,6 +13233,8 @@ static void __bnx2x_remove(struct pci_dev *pdev, | |||
13233 | iounmap(bp->doorbells); | 13233 | iounmap(bp->doorbells); |
13234 | 13234 | ||
13235 | bnx2x_release_firmware(bp); | 13235 | bnx2x_release_firmware(bp); |
13236 | } else { | ||
13237 | bnx2x_vf_pci_dealloc(bp); | ||
13236 | } | 13238 | } |
13237 | bnx2x_free_mem_bp(bp); | 13239 | bnx2x_free_mem_bp(bp); |
13238 | 13240 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 5c523b32db70..046c9cca0072 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -2896,6 +2896,14 @@ void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp) | |||
2896 | return bp->regview + PXP_VF_ADDR_DB_START; | 2896 | return bp->regview + PXP_VF_ADDR_DB_START; |
2897 | } | 2897 | } |
2898 | 2898 | ||
2899 | void bnx2x_vf_pci_dealloc(struct bnx2x *bp) | ||
2900 | { | ||
2901 | BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->vf2pf_mbox_mapping, | ||
2902 | sizeof(struct bnx2x_vf_mbx_msg)); | ||
2903 | BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->pf2vf_bulletin_mapping, | ||
2904 | sizeof(union pf_vf_bulletin)); | ||
2905 | } | ||
2906 | |||
2899 | int bnx2x_vf_pci_alloc(struct bnx2x *bp) | 2907 | int bnx2x_vf_pci_alloc(struct bnx2x *bp) |
2900 | { | 2908 | { |
2901 | mutex_init(&bp->vf2pf_mutex); | 2909 | mutex_init(&bp->vf2pf_mutex); |
@@ -2915,10 +2923,7 @@ int bnx2x_vf_pci_alloc(struct bnx2x *bp) | |||
2915 | return 0; | 2923 | return 0; |
2916 | 2924 | ||
2917 | alloc_mem_err: | 2925 | alloc_mem_err: |
2918 | BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->vf2pf_mbox_mapping, | 2926 | bnx2x_vf_pci_dealloc(bp); |
2919 | sizeof(struct bnx2x_vf_mbx_msg)); | ||
2920 | BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->pf2vf_bulletin_mapping, | ||
2921 | sizeof(union pf_vf_bulletin)); | ||
2922 | return -ENOMEM; | 2927 | return -ENOMEM; |
2923 | } | 2928 | } |
2924 | 2929 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h index 8bf764570eef..bb16c4b5c2af 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h | |||
@@ -502,6 +502,7 @@ static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp, | |||
502 | enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp); | 502 | enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp); |
503 | void bnx2x_timer_sriov(struct bnx2x *bp); | 503 | void bnx2x_timer_sriov(struct bnx2x *bp); |
504 | void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp); | 504 | void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp); |
505 | void bnx2x_vf_pci_dealloc(struct bnx2x *bp); | ||
505 | int bnx2x_vf_pci_alloc(struct bnx2x *bp); | 506 | int bnx2x_vf_pci_alloc(struct bnx2x *bp); |
506 | int bnx2x_enable_sriov(struct bnx2x *bp); | 507 | int bnx2x_enable_sriov(struct bnx2x *bp); |
507 | void bnx2x_disable_sriov(struct bnx2x *bp); | 508 | void bnx2x_disable_sriov(struct bnx2x *bp); |
@@ -568,6 +569,7 @@ static inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp) | |||
568 | return NULL; | 569 | return NULL; |
569 | } | 570 | } |
570 | 571 | ||
572 | static inline void bnx2x_vf_pci_dealloc(struct bnx2 *bp) {return 0; } | ||
571 | static inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; } | 573 | static inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; } |
572 | static inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {} | 574 | static inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {} |
573 | static inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; } | 575 | static inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; } |