From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ariel Elior Subject: [PATCH net-next v3 5/6] qed: Expose the doorbell overflow recovery mechanism to the protocol drivers Date: Tue, 23 Oct 2018 08:35:48 +0300 Message-ID: <20181023053549.5591-6-Ariel.Elior@cavium.com> References: <20181023053549.5591-1-Ariel.Elior@cavium.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , Ariel Elior , "Michal Kalderon" , Tomer Tayar To: Return-path: Received: from mail-by2nam03on0088.outbound.protection.outlook.com ([104.47.42.88]:52570 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727250AbeJWOBA (ORCPT ); Tue, 23 Oct 2018 10:01:00 -0400 In-Reply-To: <20181023053549.5591-1-Ariel.Elior@cavium.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 Signed-off-by: Michal Kalderon Signed-off-by: Tomer Tayar --- drivers/net/ethernet/qlogic/qed/qed_main.c | 2 ++ include/linux/qed/qed_if.h | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index f2c50ef..a0b761d 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c +++ b/drivers/net/ethernet/qlogic/qed/qed_main.c @@ -2238,6 +2238,8 @@ static int qed_read_module_eeprom(struct qed_dev *cdev, char *buf, .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, }; diff --git a/include/linux/qed/qed_if.h b/include/linux/qed/qed_if.h index 41382e7..8b2b005 100644 --- a/include/linux/qed/qed_if.h +++ b/include/linux/qed/qed_if.h @@ -1009,6 +1009,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. -- 1.8.3.1