Commit 6d758147 authored by Ajit Khaparde's avatar Ajit Khaparde

RDMA/bnxt_re: Use auxiliary driver interface

Use auxiliary driver interface for driver load, unload ROCE driver.
The driver does not need to register the interface using the netdev
notifier anymore. Removed the bnxt_re_dev_list which is not needed.
Currently probe, remove and shutdown ops have been implemented for
the auxiliary device.
Also remove exccessve validation checks for rdev.
Signed-off-by: default avatarAjit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: default avatarAndy Gospodarek <andrew.gospodarek@broadcom.com>
Reviewed-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
parent d80d88b0
...@@ -89,13 +89,6 @@ struct bnxt_re_ring_attr { ...@@ -89,13 +89,6 @@ struct bnxt_re_ring_attr {
u8 mode; u8 mode;
}; };
struct bnxt_re_work {
struct work_struct work;
unsigned long event;
struct bnxt_re_dev *rdev;
struct net_device *vlan_dev;
};
struct bnxt_re_sqp_entries { struct bnxt_re_sqp_entries {
struct bnxt_qplib_sge sge; struct bnxt_qplib_sge sge;
u64 wrid; u64 wrid;
...@@ -132,6 +125,7 @@ struct bnxt_re_dev { ...@@ -132,6 +125,7 @@ struct bnxt_re_dev {
#define BNXT_RE_FLAG_ERR_DEVICE_DETACHED 17 #define BNXT_RE_FLAG_ERR_DEVICE_DETACHED 17
#define BNXT_RE_FLAG_ISSUE_ROCE_STATS 29 #define BNXT_RE_FLAG_ISSUE_ROCE_STATS 29
struct net_device *netdev; struct net_device *netdev;
struct notifier_block nb;
unsigned int version, major, minor; unsigned int version, major, minor;
struct bnxt_qplib_chip_ctx *chip_ctx; struct bnxt_qplib_chip_ctx *chip_ctx;
struct bnxt_en_dev *en_dev; struct bnxt_en_dev *en_dev;
...@@ -194,5 +188,4 @@ static inline struct device *rdev_to_dev(struct bnxt_re_dev *rdev) ...@@ -194,5 +188,4 @@ static inline struct device *rdev_to_dev(struct bnxt_re_dev *rdev)
return &rdev->ibdev.dev; return &rdev->ibdev.dev;
return NULL; return NULL;
} }
#endif #endif
This diff is collapsed.
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/auxiliary_bus.h>
#include "bnxt_hsi.h" #include "bnxt_hsi.h"
#include "bnxt.h" #include "bnxt.h"
...@@ -73,8 +74,6 @@ static int bnxt_unregister_dev(struct bnxt_en_dev *edev, unsigned int ulp_id) ...@@ -73,8 +74,6 @@ static int bnxt_unregister_dev(struct bnxt_en_dev *edev, unsigned int ulp_id)
if (ulp_id >= BNXT_MAX_ULP) if (ulp_id >= BNXT_MAX_ULP)
return -EINVAL; return -EINVAL;
edev->flags |= BNXT_EN_FLAG_ULP_STOPPED;
ulp = &edev->ulp_tbl[ulp_id]; ulp = &edev->ulp_tbl[ulp_id];
if (!rcu_access_pointer(ulp->ulp_ops)) { if (!rcu_access_pointer(ulp->ulp_ops)) {
netdev_err(bp->dev, "ulp id %d not registered\n", ulp_id); netdev_err(bp->dev, "ulp id %d not registered\n", ulp_id);
...@@ -562,29 +561,3 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp) ...@@ -562,29 +561,3 @@ void bnxt_rdma_aux_device_init(struct bnxt *bp)
exit: exit:
bp->flags &= ~BNXT_FLAG_ROCE_CAP; bp->flags &= ~BNXT_FLAG_ROCE_CAP;
} }
struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev)
{
struct bnxt *bp = netdev_priv(dev);
struct bnxt_en_dev *edev;
edev = bp->edev;
if (!edev) {
edev = kzalloc(sizeof(*edev), GFP_KERNEL);
if (!edev)
return ERR_PTR(-ENOMEM);
edev->en_ops = &bnxt_en_ops_tbl;
edev->net = dev;
edev->pdev = bp->pdev;
edev->l2_db_size = bp->db_size;
edev->l2_db_size_nc = bp->db_size;
bp->edev = edev;
}
edev->flags &= ~BNXT_EN_FLAG_ROCE_CAP;
if (bp->flags & BNXT_FLAG_ROCEV1_CAP)
edev->flags |= BNXT_EN_FLAG_ROCEV1_CAP;
if (bp->flags & BNXT_FLAG_ROCEV2_CAP)
edev->flags |= BNXT_EN_FLAG_ROCEV2_CAP;
return bp->edev;
}
EXPORT_SYMBOL(bnxt_ulp_probe);
...@@ -31,7 +31,6 @@ struct bnxt_ulp_ops { ...@@ -31,7 +31,6 @@ struct bnxt_ulp_ops {
void (*ulp_stop)(void *); void (*ulp_stop)(void *);
void (*ulp_start)(void *); void (*ulp_start)(void *);
void (*ulp_sriov_config)(void *, int); void (*ulp_sriov_config)(void *, int);
void (*ulp_shutdown)(void *);
void (*ulp_irq_stop)(void *); void (*ulp_irq_stop)(void *);
void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *); void (*ulp_irq_restart)(void *, struct bnxt_msix_entry *);
}; };
...@@ -107,6 +106,4 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err); ...@@ -107,6 +106,4 @@ void bnxt_ulp_irq_restart(struct bnxt *bp, int err);
void bnxt_ulp_async_events(struct bnxt *bp, struct hwrm_async_event_cmpl *cmpl); void bnxt_ulp_async_events(struct bnxt *bp, struct hwrm_async_event_cmpl *cmpl);
void bnxt_rdma_aux_device_uninit(struct bnxt *bp); void bnxt_rdma_aux_device_uninit(struct bnxt *bp);
void bnxt_rdma_aux_device_init(struct bnxt *bp); void bnxt_rdma_aux_device_init(struct bnxt *bp);
struct bnxt_en_dev *bnxt_ulp_probe(struct net_device *dev);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment