aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/bnxt_re/main.c
Commit message (Collapse)AuthorAgeFilesLines
...
* RDMA/bnxt_re: Use auxiliary driver interfaceAjit Khaparde2023-02-021-265/+130
| | | | | | | | | | | | | | 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: Ajit Khaparde <[email protected]> Reviewed-by: Andy Gospodarek <[email protected]> Reviewed-by: Selvin Xavier <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]>
* IB: move from strlcpy with unused retval to strscpyWolfram Sang2022-08-211-1/+1
| | | | | | | | | | | Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/bnxt_re: Remove unneeded variableChangcheng Deng2021-11-161-2/+1
| | | | | | | | | | | | | Fix the following coccicheck review: ./drivers/infiniband/hw/bnxt_re/main.c: 896: 5-7: Unneeded variable Remove unneeded variable used to store return value. Link: https://lore.kernel.org/r/[email protected] Reported-by: Zeal Robot <[email protected]> Signed-off-by: Changcheng Deng <[email protected]> Reviewed-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Remove unsupported bnxt_re_modify_ah callbackKamal Heib2021-11-031-1/+0
| | | | | | | | | There is no need to return always zero for function which is not supported, especially since 0 is the wrong return code. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kamal Heib <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Use helper function to set GUIDsKamal Heib2021-10-291-1/+1
| | | | | | | | | Use addrconf_addr_eui48() helper function to set the GUIDs and remove the driver specific version. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kamal Heib <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Use GFP_KERNEL in non atomic contextSelvin Xavier2021-09-201-1/+1
| | | | | | | | | | Use GFP_KERNEL instead of GFP_ATOMIC while allocating control path structures which will be only called from non atomic context Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Use separate response buffer for stat_ctx_freeEdwin Peer2021-09-201-3/+4
| | | | | | | | | | | Use separate buffers for the request and response data. Eventhough the response data is not used, providing the correct length is appropriate. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Edwin Peer <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Add extended statistics countersSelvin Xavier2021-09-201-0/+4
| | | | | | | | | | | | Implement extended statistics counters for newer adapters. Check if the FW support for this command and issue the FW command only if is supported. Includes code re-organization to handle extended stats. Also, add AH and PD software counters. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdmaLinus Torvalds2021-09-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull rdma updates from Jason Gunthorpe: "This is quite a small cycle, no major series stands out. The HNS and rxe drivers saw the most activity this cycle, with rxe being broken for a good chunk of time. The significant deleted line count is due to a SPDX cleanup series. Summary: - Various cleanup and small features for rtrs - kmap_local_page() conversions - Driver updates and fixes for: efa, rxe, mlx5, hfi1, qed, hns - Cache the IB subnet prefix - Rework how CRC is calcuated in rxe - Clean reference counting in iwpm's netlink - Pull object allocation and lifecycle for user QPs to the uverbs core code - Several small hns features and continued general code cleanups - Fix the scatterlist confusion of orig_nents/nents introduced in an earlier patch creating the append operation" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (90 commits) RDMA/mlx5: Relax DCS QP creation checks RDMA/hns: Delete unnecessary blank lines. RDMA/hns: Encapsulate the qp db as a function RDMA/hns: Adjust the order in which irq are requested and enabled RDMA/hns: Remove RST2RST error prints for hw v1 RDMA/hns: Remove dqpn filling when modify qp from Init to Init RDMA/hns: Fix QP's resp incomplete assignment RDMA/hns: Fix query destination qpn RDMA/hfi1: Convert to SPDX identifier IB/rdmavt: Convert to SPDX identifier RDMA/hns: Bugfix for incorrect association between dip_idx and dgid RDMA/hns: Bugfix for the missing assignment for dip_idx RDMA/hns: Bugfix for data type of dip_idx RDMA/hns: Fix incorrect lsn field RDMA/irdma: Remove the repeated declaration RDMA/core/sa_query: Retry SA queries RDMA: Use the sg_table directly and remove the opencoded version from umem lib/scatterlist: Fix wrong update of orig_nents lib/scatterlist: Provide a dedicated function to support table append RDMA/hns: Delete unused hns bitmap interface ...
| * Merge branch 'sg_nents' into rdma.git for-nextJason Gunthorpe2021-08-301-1/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Maor Gottlieb ==================== Fix the use of nents and orig_nents in the sg table append helpers. The nents should be used by the DMA layer to store the number of DMA mapped sges, the orig_nents is the number of CPU sges. Since the sg append logic doesn't always create a SGL with exactly orig_nents entries store a total_nents as well to allow the table to be properly free'd and reorganize the freeing logic to share across all the use cases. ==================== Signed-off-by: Jason Gunthorpe <[email protected]> * 'sg_nents': RDMA: Use the sg_table directly and remove the opencoded version from umem lib/scatterlist: Fix wrong update of orig_nents lib/scatterlist: Provide a dedicated function to support table append
| * | RDMA: Globally allocate and release QP memoryLeon Romanovsky2021-08-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert QP object to follow IB/core general allocation scheme. That change allows us to make sure that restrack properly kref the memory. Link: https://lore.kernel.org/r/48e767124758aeecc433360ddd85eaa6325b34d9.1627040189.git.leonro@nvidia.com Reviewed-by: Gal Pressman <[email protected]> #efa Tested-by: Gal Pressman <[email protected]> Reviewed-by: Dennis Dalessandro <[email protected]> #rdma and core Tested-by: Dennis Dalessandro <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Tested-by: Tatyana Nikolova <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* | | RDMA/bnxt_re: Remove unpaired rtnl unlock in bnxt_re_dev_init()Dinghao Liu2021-08-191-1/+0
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | The fixed commit removes all rtnl_lock() and rtnl_unlock() calls in function bnxt_re_dev_init(), but forgets to remove a rtnl_unlock() in the error handling path of bnxt_re_register_netdev(), which may cause a deadlock. This bug is suggested by a static analysis tool. Fixes: c2b777a95923 ("RDMA/bnxt_re: Refactor device add/remove functionalities") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dinghao Liu <[email protected]> Acked-by: Selvin Xavier <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* | RDMA/bnxt_re: Fix stats countersNaresh Kumar PBS2021-07-121-1/+3
|/ | | | | | | | | | | | | | Statistical counters are not incrementing in some adapter versions with newer FW. This is due to the stats context length mismatch between FW and driver. Since the L2 driver updates the length correctly, use the stats length from L2 driver while allocating the DMA'able memory and creating the stats context. Fixes: 9d6b648c3112 ("bnxt_en: Update firmware interface spec to 1.10.1.65.") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Remove rdma_set_device_sysfs_group()Jason Gunthorpe2021-06-161-1/+1
| | | | | | | | | The driver's device group can be specified as part of the ops structure like the device's port group. No need for the complicated API. Link: https://lore.kernel.org/r/8964785a34fd3a29ff5b6693493f575b717e594d.1623427137.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Split the alloc_hw_stats() ops to port and device variantsJason Gunthorpe2021-06-161-1/+1
| | | | | | | | | | | | | | | This is being used to implement both the port and device global stats, which is causing some confusion in the drivers. For instance EFA and i40iw both seem to be misusing the device stats. Split it into two ops so drivers that don't support one or the other can leave the op NULL'd, making the calling code a little simpler to understand. Link: https://lore.kernel.org/r/1955c154197b2a159adc2dc97266ddc74afe420c.1623427137.git.leonro@nvidia.com Tested-by: Gal Pressman <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Enable global atomic ops if platform supportsDevesh Sharma2021-06-031-0/+3
| | | | | | | | | Enabling Atomic operations for Gen P5 devices if the underlying platform supports global atomic ops. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Drop unnecessary NULL checks after container_ofGuenter Roeck2021-05-201-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The result of container_of() operations is never NULL unless the first element of the embedding structure is extracted. This is either not the case here, or the pointer passed to container_of() is known to be not NULL. The NULL checks are therefore unnecessary and misleading. Remove them. The channges in this patch were made automatically with the following Coccinelle script. @@ type t; identifier v; statement s; @@ <+... ( t v = container_of(...); | v = container_of(...); ) ... when != v - if (\( !v \| v == NULL \) ) s ...+> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Get rid of custom module reference countingLeon Romanovsky2021-04-191-14/+2
| | | | | | | | | | | Instead of manually messing with parent driver module reference counting rely on export symbol mechanism to ensure that proper probe/remove chain is performed. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Acked-By: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Create direct symbol link between bnxt modulesLeon Romanovsky2021-04-191-6/+1
| | | | | | | | | | | Convert indirect probe call to its direct equivalent to create a symbol link between RDMA and netdev modules. This will give us an ability to remove custom module reference counting that doesn't belong to the driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]> Acked-By: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Move device to error state upon device crashSelvin Xavier2021-03-261-0/+40
| | | | | | | | | | | | | | | | When the L2 driver detects a device crash or device undergone reset, it invokes a stop callback to recover from error. The current RoCE driver doesn't recover the device. So move the device to error state and dispatch fatal events to all qps Release the MSIx vectors to avoid a crash when L2 driver disables the MSIx. Also, check for the device state to avoid posting further commands to the HW. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Convert sysfs device * show functions to use sysfs_emit()Joe Perches2020-10-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with cocci script: @@ identifier d_show; identifier dev, attr, buf; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... return - sprintf(buf, + sysfs_emit(buf, ...); ...> } @@ identifier d_show; identifier dev, attr, buf; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... return - snprintf(buf, PAGE_SIZE, + sysfs_emit(buf, ...); ...> } @@ identifier d_show; identifier dev, attr, buf; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... return - scnprintf(buf, PAGE_SIZE, + sysfs_emit(buf, ...); ...> } @@ identifier d_show; identifier dev, attr, buf; expression chr; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... return - strcpy(buf, chr); + sysfs_emit(buf, chr); ...> } @@ identifier d_show; identifier dev, attr, buf; identifier len; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... len = - sprintf(buf, + sysfs_emit(buf, ...); ...> return len; } @@ identifier d_show; identifier dev, attr, buf; identifier len; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... len = - snprintf(buf, PAGE_SIZE, + sysfs_emit(buf, ...); ...> return len; } @@ identifier d_show; identifier dev, attr, buf; identifier len; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... len = - scnprintf(buf, PAGE_SIZE, + sysfs_emit(buf, ...); ...> return len; } @@ identifier d_show; identifier dev, attr, buf; identifier len; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { <... - len += scnprintf(buf + len, PAGE_SIZE - len, + len += sysfs_emit_at(buf, len, ...); ...> return len; } @@ identifier d_show; identifier dev, attr, buf; expression chr; @@ ssize_t d_show(struct device *dev, struct device_attribute *attr, char *buf) { ... - strcpy(buf, chr); - return strlen(buf); + return sysfs_emit(buf, chr); } Link: https://lore.kernel.org/r/7f406fa8e3aa2552c022bec680f621e38d1fe414.1602122879.git.joe@perches.com Signed-off-by: Joe Perches <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Remove AH from uverbs_cmd_maskJason Gunthorpe2020-10-261-9/+1
| | | | | | | | | Drivers that need a uverbs AH should instead set the create_user_ah() op similar to reg_user_mr(). MODIFY_AH and QUERY_AH cmds were never implemented so are just deleted. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Move more uverbs_cmd_mask settings to the coreJason Gunthorpe2020-10-261-6/+0
| | | | | | | | | | | | | | | | | | | | | | | These functions all depend on the driver providing a specific op: - REREG_MR is rereg_user_mr(). bnxt_re set this without providing the op - ATTACH/DEATCH_MCAST is attach_mcast()/detach_mcast(). usnic set this without providing the op - OPEN_QP doesn't involve the driver but requires a XRCD. qedr provides xrcd but forgot to set it, usnic doesn't provide XRCD but set it anyhow. - OPEN/CLOSE_XRCD are the ops alloc_xrcd()/dealloc_xrcd() - CREATE_SRQ/DESTROY_SRQ are the ops create_srq()/destroy_srq() - QUERY/MODIFY_SRQ is op query_srq()/modify_srq(). hns sets this but sometimes supplies a NULL op. - RESIZE_CQ is op resize_cq(). bnxt_re sets this boes doesn't supply an op - ALLOC/DEALLOC_MW is alloc_mw()/dealloc_mw(). cxgb4 provided an (now deleted) implementation but no userspace All drivers were checked that no drivers provide the op without also setting uverbs_cmd_mask so this should have no functional change. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Remove elements in uverbs_cmd_mask that all drivers setJason Gunthorpe2020-10-261-15/+1
| | | | | | | | | This is a step toward eliminating uverbs_cmd_mask. Preset this list in the core code. Only the op reg_user_mr wasn't already being required from the drivers. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Explicitly pass in the dma_device to ib_register_deviceJason Gunthorpe2020-10-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in setup_dma_device has become rather convoluted, move all of this to the drivers. Drives now pass in a DMA capable struct device which will be used to setup DMA, or drivers must fully configure the ibdev for DMA and pass in NULL. Other than setting the masks in rvt all drivers were doing this already anyhow. mthca, mlx4 and mlx5 were already setting up maximum DMA segment size for DMA based on their hardweare limits in: __mthca_init_one() dma_set_max_seg_size (1G) __mlx4_init_one() dma_set_max_seg_size (1G) mlx5_pci_init() set_dma_caps() dma_set_max_seg_size (2G) Other non software drivers (except usnic) were extended to UINT_MAX [1, 2] instead of 2G as was before. [1] https://lore.kernel.org/linux-rdma/[email protected]/ [2] https://lore.kernel.org/linux-rdma/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/6b2ed339933d066622d5715903870676d8cc523a.1602590106.git.mchehab+huawei@kernel.org Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: Parav Pandit <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Remove set but not used variable 'qplib_ctx'YueHaibing2020-09-091-2/+0
| | | | | | | | | | | drivers/infiniband/hw/bnxt_re/main.c:1012:25: warning: variable ‘qplib_ctx’ set but not used [-Wunused-but-set-variable] Fixes: f86b31c6a28f ("RDMA/bnxt_re: Static NQ depth allocation") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: YueHaibing <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Static NQ depth allocationNaresh Kumar PBS2020-08-271-2/+1
| | | | | | | | | | | | | | At first, driver allocates memory for NQ based on qplib_ctx->cq_count and qplib_ctx->srqc_count. Later when creating ring, it uses a static value of 128K -1. Fixing this with a static value for now. Fixes: b08fe048a69d ("RDMA/bnxt_re: Refactor net ring allocation function") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Do not add user qps to flushlistSelvin Xavier2020-08-201-1/+2
| | | | | | | | | | | | | | Driver shall add only the kernel qps to the flush list for clean up. During async error events from the HW, driver is adding qps to this list without checking if the qp is kernel qp or not. Add a check to avoid user qp addition to the flush list. Fixes: 942c9b6ca8de ("RDMA/bnxt_re: Avoid Hard lockup during error CQE processing") Fixes: c50866e2853a ("bnxt_re: fix the regression due to changes in alloc_pbl") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: introduce wqe mode to select execution pathDevesh Sharma2020-07-201-6/+17
| | | | | | | | | | | | | | | The bnxt_re driver need to decide on how much SQ and RQ memory should to be allocated and which wqe posting/polling algorithm to use. Making changes to set the wqe-mode to a default value during device registration sequence. The wqe-mode is passed to the lower layer driver as well. Going forward in the lower layer driver wqe-mode will be used to decide execution path. Initializing the wqe-mode to static wqe type for now. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: make bnxt_re_ib_init staticYueHaibing2020-03-301-1/+1
| | | | | | | | | | | | Fix sparse warning: drivers/infiniband/hw/bnxt_re/main.c:1313:5: warning: symbol 'bnxt_re_ib_init' was not declared. Should it be static? Link: https://lore.kernel.org/r/[email protected] Signed-off-by: YueHaibing <[email protected]> Acked-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Remove unnecessary sched countSelvin Xavier2020-03-171-8/+0
| | | | | | | | | Since the lifetime of bnxt_re_task is controlled by the kref of device, sched_count is no longer required. Remove it. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Fix lifetimes in bnxt_re_taskJason Gunthorpe2020-03-171-0/+2
| | | | | | | | | | | A work queue cannot just rely on the ib_device not being freed, it must hold a kref on the memory so that the BNXT_RE_FLAG_IBDEV_REGISTERED check works. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Use ib_device_try_get()Jason Gunthorpe2020-03-171-13/+14
| | | | | | | | | | There are a couple places in this driver running from a work queue that need the ib_device to be registered. Instead of using a broken internal bit rely on the new core code to guarantee device registration. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Use driver_unregister and unregistration APISelvin Xavier2020-03-021-64/+42
| | | | | | | | | | | | | | | Using the new unregister APIs provided by the core. Provide the dealloc_driver hook for the core to callback at the time of device un-registration. bnxt_re VF resources are created by the corresponding PF driver. During ib_unregister_driver, PF might get removed before VF and this could cause failure when VFs are removed. Driver is explicitly queuing the removal of VF devices before calling ib_unregister_driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Refactor device add/remove functionalitiesSelvin Xavier2020-03-021-57/+82
| | | | | | | | | | | | | | | | | | - bnxt_re_ib_reg() handles two main functionalities - initializing the device and registering with the IB stack. Split it into 2 functions i.e. bnxt_re_dev_init() and bnxt_re_ib_init() to account for the same thereby improve modularity. Do the same for bnxt_re_ib_unreg()i.e. split into two functions - bnxt_re_dev_uninit() and bnxt_re_ib_uninit(). - Simplify the code by combining the different steps to add and remove the device into two functions. - Report correct netdev link state during device register Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: use ibdev based message printing functionsDevesh Sharma2020-02-221-59/+72
| | | | | | | | | | | | Replacing the dev_err/dbg/warn with ibdev_err/dbg/warn. In the IB device provider driver these functions are recommended to use. Currently qplib layer function calls has not been replaced due to unavailability of ib_device pointer at that layer. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Refactor command queue management codeDevesh Sharma2020-02-221-5/+7
| | | | | | | | | | | | | | | | | | Refactoring the command queue (rcfw) management code. A new data-structure is introduced to describe the bar register. each object which deals with mmio space should have a descriptor structure. This structure specifically hold DB register information. Thus, slow path creq structure now hold a bar register descriptor. Further cleanup the rcfw structure to introduce the command queue context and command response event queue context structures. Rest of the rcfw related code has been touched to incorporate these three structures. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Refactor net ring allocation functionDevesh Sharma2020-02-221-29/+35
| | | | | | | | | | | | | | Introducing a new attribute structure to reduce the long list of arguments passed in bnxt_re_net_ring_alloc() function. The caller of bnxt_re_net_ring_alloc should fill in the list of attributes in bnxt_re_ring_attr structure and then pass the pointer to the function. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Refactor hardware queue memory allocationDevesh Sharma2020-02-221-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | At top level there are three major data structure addition. viz bnxt_qplib_hwq_attr, bnxt_qplib_sg_info and bnxt_qplib_tqm_ctx Intorduction of first data structure reduces the arguments list to bnxt_re_alloc_init_hwq() function. There are changes all over the driver code to incorporate this new structure. The caller needs to fill the attribute data structure and pass to this function. The second data structure is to pass memory region description viz. sghead, page_size and page_shift. There are changes all over the driver code to initialize bnxt_re_sg_info data structure. The new data structure helps to reduce the argument list of __alloc_pbl() function call. Till now the TQM rings related members were not collected under any specific data-structure making it hard to manage. The third data sctructure bnxt_qplib_tqm_ctx is added to refactor the TQM queue allocation and initialization. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Replace chip context structure with pointerDevesh Sharma2020-02-221-13/+27
| | | | | | | | | | | | The chip_ctx member in bnxt_re_dev structure is now a pointer to struct bnxt_qplib_chip_ctx. Since the member type has changed there are changes in rest of the code wherever dev->chip_ctx is used. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Refactor queue pair creation codeDevesh Sharma2020-02-221-1/+2
| | | | | | | | | | | | | | | | | Restructuring the bnxt_re_create_qp function. Listing below the major changes: - Monolithic central part of create_qp where attributes are initialized is now enclosed in one function and this new function has few more sub-functions. - Top level qp limit checking code moved to a function. - GSI QP creation and GSI Shadow qp creation code is handled in a sub function. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Naresh Kumar PBS <[email protected]> Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Report more number of completion vectorsSelvin Xavier2020-01-031-1/+1
| | | | | | | | | | | Report the the data path MSIx vectors allocated by driver as number of completion vectors. One interrupt vector is used for Control path. So reporting one less than the total number of MSIx vectors allocated by the driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Selvin Xavier <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Fix missing le16_to_cpuDevesh Sharma2019-11-251-4/+4
| | | | | | | | | | | | | | From sparse: drivers/infiniband/hw/bnxt_re/main.c:1274:18: warning: cast from restricted __le16 drivers/infiniband/hw/bnxt_re/main.c:1275:18: warning: cast from restricted __le16 drivers/infiniband/hw/bnxt_re/main.c:1276:18: warning: cast from restricted __le16 drivers/infiniband/hw/bnxt_re/main.c:1277:21: warning: restricted __le16 degrades to integer Fixes: 2b827ea1926b ("RDMA/bnxt_re: Query HWRM Interface version from FW") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Fix stat push into dma buffer on gen p5 devicesDevesh Sharma2019-11-251-0/+1
| | | | | | | | | | | | | | Due to recent advances in the firmware for Broadcom's gen p5 series of adaptors the driver code to report hardware counters has been broken w.r.t. roce devices. The new firmware command expects dma length to be specified during stat dma buffer allocation. Fixes: 2792b5b95ed5 ("bnxt_en: Update firmware interface spec. to 1.10.0.89.") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Enable SRIOV VF support on Broadcom's 57500 adapter seriesDevesh Sharma2019-10-081-54/+75
| | | | | | | | | | | | | | | | | Broadcom's 575xx adapter series has support for SRIOV VFs. Making changes to enable SRIOV VF support. There are two major area where changes are done: - Added new DB location for control-path and data-path DB ring - New devices do not need to issue the sriov-config slow-path command thus, skipping to call that firmware command. For now enabling support for 64 RoCE VFs. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Devesh Sharma <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/bnxt_re: Remove unsupported modify_device callbackKamal Heib2019-10-011-1/+0
| | | | | | | | | | There is no need to return always zero for function which is not supported. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kamal Heib <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* IB/bnxt_re: Do not notifify GID change eventParav Pandit2019-07-291-1/+0
| | | | | | | | | | | | GID table entry operations such as add/remove/modify are triggered by the IB core for RoCE ports. Hence, remove GID change notification from hw driver. Reviewed-by: Selvin Xavier <[email protected]> Tested-by: Selvin Xavier <[email protected]> Signed-off-by: Parav Pandit <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Doug Ledford <[email protected]>
* RDMA: Convert CQ allocations to be under core responsibilityLeon Romanovsky2019-06-111-0/+1
| | | | | | | | | | Ensure that CQ is allocated and freed by IB/core and not by drivers. Signed-off-by: Leon Romanovsky <[email protected]> Acked-by: Gal Pressman <[email protected]> Reviewed-by: Dennis Dalessandro <[email protected]> Tested-by: Dennis Dalessandro <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
* RDMA: Move owner into struct ib_device_opsJason Gunthorpe2019-06-101-1/+1
| | | | | | | | | This more closely follows how other subsytems work, with owner being a member of the structure containing the function pointers. Signed-off-by: Jason Gunthorpe <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA: Move uverbs_abi_ver into struct ib_device_opsJason Gunthorpe2019-06-101-1/+1
| | | | | | | | | No reason for every driver to emit code to set this, just make it part of the driver's existing static const ops structure. Signed-off-by: Jason Gunthorpe <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>