qed: Expose the doorbell overflow recovery mechanism to the protocol drivers
authorAriel Elior <Ariel.Elior@cavium.com>
Wed, 28 Nov 2018 16:16:06 +0000 (18:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Nov 2018 21:45:13 +0000 (13:45 -0800)
Most of the doorbelling entities are outside of the core module.
L2 queues, Roce queues, iscsi and fcoe all need to register.
Make the APIs available for these drivers.

Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Tomer Tayar <Tomer.Tayar@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_main.c
include/linux/qed/qed_if.h

index 5ec3f5d1d6b267a0dfb5ba845a7a1f1a8a239c40..6adf5bda9811ef70af7a3f62a7da4ac197af8164 100644 (file)
@@ -2384,6 +2384,8 @@ const struct qed_common_ops qed_common_ops_pass = {
        .update_mac = &qed_update_mac,
        .update_mtu = &qed_update_mtu,
        .update_wol = &qed_update_wol,
+       .db_recovery_add = &qed_db_recovery_add,
+       .db_recovery_del = &qed_db_recovery_del,
        .read_module_eeprom = &qed_read_module_eeprom,
 };
 
index eb851f89f417ab3bc8c268ab9ef927278620eabb..91c536a01b56891498b774002bc50cedb27b7739 100644 (file)
@@ -1029,6 +1029,33 @@ struct qed_common_ops {
  */
        int (*set_led)(struct qed_dev *cdev,
                       enum qed_led_mode mode);
+/**
+ * @brief db_recovery_add - add doorbell information to the doorbell
+ * recovery mechanism.
+ *
+ * @param cdev
+ * @param db_addr - doorbell address
+ * @param db_data - address of where db_data is stored
+ * @param db_is_32b - doorbell is 32b pr 64b
+ * @param db_is_user - doorbell recovery addresses are user or kernel space
+ */
+       int (*db_recovery_add)(struct qed_dev *cdev,
+                              void __iomem *db_addr,
+                              void *db_data,
+                              enum qed_db_rec_width db_width,
+                              enum qed_db_rec_space db_space);
+
+/**
+ * @brief db_recovery_del - remove doorbell information from the doorbell
+ * recovery mechanism. db_data serves as key (db_addr is not unique).
+ *
+ * @param cdev
+ * @param db_addr - doorbell address
+ * @param db_data - address where db_data is stored. Serves as key for the
+ *                 entry to delete.
+ */
+       int (*db_recovery_del)(struct qed_dev *cdev,
+                              void __iomem *db_addr, void *db_data);
 
 /**
  * @brief update_drv_state - API to inform the change in the driver state.