summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/bnxt_re/bnxt_re.h
diff options
context:
space:
mode:
authorChandramohan Akula <chandramohan.akula@broadcom.com>2023-07-19 08:02:56 +0300
committerJason Gunthorpe <jgg@nvidia.com>2023-07-21 22:15:32 +0300
commit2ad4e6303a6d7518632739eaf67821a3553db1bd (patch)
tree09789e912a74015f608580c607f7ae63c5515cfa /drivers/infiniband/hw/bnxt_re/bnxt_re.h
parentea222485788208cd79bad42d25aae9232b33a934 (diff)
downloadlinux-2ad4e6303a6d7518632739eaf67821a3553db1bd.tar.xz
RDMA/bnxt_re: Implement doorbell pacing algorithm
User applications alert the driver when the Doorbell FIFO reaches the alarm threshold. The driver updates the pacing parameters in the shared page to do the maximum pacing by the application till the DB FIFO congestion reduces to pacing threshold. Driver keeps checking the DB FIFO depth at the pacing interval and gradually adjusts the pacing level. Once the pacing level reaches default values (no congestion in the FIFO) pacing gets completed. Link: https://lore.kernel.org/r/1689742977-9128-7-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Chandramohan Akula <chandramohan.akula@broadcom.com> Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/hw/bnxt_re/bnxt_re.h')
-rw-r--r--drivers/infiniband/hw/bnxt_re/bnxt_re.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/bnxt_re/bnxt_re.h b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
index 1543f80a1b5c..2175103d570f 100644
--- a/drivers/infiniband/hw/bnxt_re/bnxt_re.h
+++ b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
@@ -121,8 +121,10 @@ struct bnxt_re_pacing {
u32 dbq_pacing_time; /* ms */
u32 dbr_def_do_pacing;
bool dbr_pacing;
+ struct mutex dbq_lock; /* synchronize db pacing algo */
};
+#define BNXT_RE_MAX_DBR_DO_PACING 0xFFFF
#define BNXT_RE_DBR_PACING_TIME 5 /* ms */
#define BNXT_RE_PACING_ALGO_THRESHOLD 250 /* Entries in DB FIFO */
#define BNXT_RE_PACING_ALARM_TH_MULTIPLE 2 /* Multiple of pacing algo threshold */
@@ -193,6 +195,8 @@ struct bnxt_re_dev {
u32 is_virtfn;
u32 num_vfs;
struct bnxt_re_pacing pacing;
+ struct work_struct dbq_fifo_check_work;
+ struct delayed_work dbq_pacing_work;
};
#define to_bnxt_re_dev(ptr, member) \
@@ -203,6 +207,7 @@ struct bnxt_re_dev {
#define BNXT_RE_ROCEV2_IPV6_PACKET 3
#define BNXT_RE_CHECK_RC(x) ((x) && ((x) != -ETIMEDOUT))
+void bnxt_re_pacing_alert(struct bnxt_re_dev *rdev);
static inline struct device *rdev_to_dev(struct bnxt_re_dev *rdev)
{