]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/infiniband/sw/rxe/rxe_verbs.c
IB/rxe: Add port protocol stats
[karo-tx-linux.git] / drivers / infiniband / sw / rxe / rxe_verbs.c
index d2e2eff7a515dd31ac5bd12cde06a80c5f806fcb..f75210e478024b692bc259aa3c76602cf24b359d 100644 (file)
  * SOFTWARE.
  */
 
+#include <linux/dma-mapping.h>
 #include "rxe.h"
 #include "rxe_loc.h"
 #include "rxe_queue.h"
+#include "rxe_hw_counters.h"
 
 static int rxe_query_device(struct ib_device *dev,
                            struct ib_device_attr *attr,
@@ -169,7 +171,7 @@ static int rxe_query_pkey(struct ib_device *device,
        struct rxe_port *port;
 
        if (unlikely(port_num != 1)) {
-               dev_warn(device->dma_device, "invalid port_num = %d\n",
+               dev_warn(device->dev.parent, "invalid port_num = %d\n",
                         port_num);
                goto err1;
        }
@@ -177,7 +179,7 @@ static int rxe_query_pkey(struct ib_device *device,
        port = &rxe->port;
 
        if (unlikely(index >= port->attr.pkey_tbl_len)) {
-               dev_warn(device->dma_device, "invalid index = %d\n",
+               dev_warn(device->dev.parent, "invalid index = %d\n",
                         index);
                goto err1;
        }
@@ -1234,10 +1236,10 @@ int rxe_register_device(struct rxe_dev *rxe)
        dev->node_type = RDMA_NODE_IB_CA;
        dev->phys_port_cnt = 1;
        dev->num_comp_vectors = RXE_NUM_COMP_VECTORS;
-       dev->dma_device = rxe_dma_device(rxe);
+       dev->dev.parent = rxe_dma_device(rxe);
        dev->local_dma_lkey = 0;
        dev->node_guid = rxe_node_guid(rxe);
-       dev->dma_ops = &rxe_dma_mapping_ops;
+       dev->dev.dma_ops = &dma_virt_ops;
 
        dev->uverbs_abi_ver = RXE_UVERBS_ABI_VERSION;
        dev->uverbs_cmd_mask = BIT_ULL(IB_USER_VERBS_CMD_GET_CONTEXT)
@@ -1317,6 +1319,8 @@ int rxe_register_device(struct rxe_dev *rxe)
        dev->map_mr_sg = rxe_map_mr_sg;
        dev->attach_mcast = rxe_attach_mcast;
        dev->detach_mcast = rxe_detach_mcast;
+       dev->get_hw_stats = rxe_ib_get_hw_stats;
+       dev->alloc_hw_stats = rxe_ib_alloc_hw_stats;
 
        err = ib_register_device(dev, NULL);
        if (err) {