scsi: qed: Send BW update notifications to the protocol drivers
authorSudarsana Reddy Kalluru <skalluru@marvell.com>
Thu, 16 Apr 2020 08:43:10 +0000 (01:43 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 17 Apr 2020 21:55:26 +0000 (17:55 -0400)
Management firmware (MFW) sends a notification whenever there is a change
in the bandwidth values. Add driver support for sending this notification
to the upper layer drivers (e.g., qedf).

Link: https://lore.kernel.org/r/20200416084314.18851-6-skashyap@marvell.com
Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/net/ethernet/qlogic/qed/qed.h
drivers/net/ethernet/qlogic/qed/qed_main.c
include/linux/qed/qed_if.h

index fa41bf08a58951c4ff216d7ba612f1a74d65d44e..d00663967afe73236b0f1d56e418efd738ad5f19 100644 (file)
@@ -1016,6 +1016,7 @@ int qed_device_num_ports(struct qed_dev *cdev);
 int qed_fill_dev_info(struct qed_dev *cdev,
                      struct qed_dev_info *dev_info);
 void qed_link_update(struct qed_hwfn *hwfn, struct qed_ptt *ptt);
+void qed_bw_update(struct qed_hwfn *hwfn, struct qed_ptt *ptt);
 u32 qed_unzip_data(struct qed_hwfn *p_hwfn,
                   u32 input_len, u8 *input_buf,
                   u32 max_size, u8 *unzip_buf);
index 96356e897c80ea86c232890fd2d0b61fca9a327d..645d1dbf04cec2365ca0b401371d83cbf5196468 100644 (file)
@@ -1940,6 +1940,15 @@ void qed_link_update(struct qed_hwfn *hwfn, struct qed_ptt *ptt)
                op->link_update(cookie, &if_link);
 }
 
+void qed_bw_update(struct qed_hwfn *hwfn, struct qed_ptt *ptt)
+{
+       void *cookie = hwfn->cdev->ops_cookie;
+       struct qed_common_cb_ops *op = hwfn->cdev->protocol_ops.common;
+
+       if (IS_LEAD_HWFN(hwfn) && cookie && op && op->bw_update)
+               op->bw_update(cookie);
+}
+
 static int qed_drain(struct qed_dev *cdev)
 {
        struct qed_hwfn *hwfn;
index 8f29e0d8a7b382083dddcf11c38f7dcf3be0da4d..c4956374a44429fa320c20b7d1132659648ae795 100644 (file)
@@ -817,6 +817,7 @@ struct qed_common_cb_ops {
        void    (*dcbx_aen)(void *dev, struct qed_dcbx_get *get, u32 mib_type);
        void (*get_generic_tlv_data)(void *dev, struct qed_generic_tlvs *data);
        void (*get_protocol_tlv_data)(void *dev, void *data);
+       void (*bw_update)(void *dev);
 };
 
 struct qed_selftest_ops {