diff options
author | Suman Ghosh <sumang@marvell.com> | 2022-05-17 10:10:55 +0530 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-05-17 18:05:28 -0700 |
commit | 6e144b47f560edc25744498f360835b1042b73dd (patch) | |
tree | f821d4181bfabf6f2005ce6907028b22b7218e5a /drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | |
parent | dn_route: set rt neigh to blackhole_netdev instead of loopback_dev in ifdown (diff) | |
download | linux-dev-6e144b47f560edc25744498f360835b1042b73dd.tar.xz linux-dev-6e144b47f560edc25744498f360835b1042b73dd.zip |
octeontx2-pf: Add support for adaptive interrupt coalescing
Added support for adaptive IRQ coalescing. It uses net_dim
algorithm to find the suitable delay/IRQ count based on the
current packet rate.
Signed-off-by: Suman Ghosh <sumang@marvell.com>
Link: https://lore.kernel.org/r/20220517044055.876158-1-sumang@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h index c587c14ac2a3..ce2766317c0b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -18,6 +18,7 @@ #include <net/pkt_cls.h> #include <net/devlink.h> #include <linux/time64.h> +#include <linux/dim.h> #include <mbox.h> #include <npc.h> @@ -54,6 +55,11 @@ enum arua_mapped_qtypes { /* Send skid of 2000 packets required for CQ size of 4K CQEs. */ #define SEND_CQ_SKID 2000 +#define OTX2_GET_RX_STATS(reg) \ + otx2_read64(pfvf, NIX_LF_RX_STATX(reg)) +#define OTX2_GET_TX_STATS(reg) \ + otx2_read64(pfvf, NIX_LF_TX_STATX(reg)) + struct otx2_lmt_info { u64 lmt_addr; u16 lmt_id; @@ -351,6 +357,7 @@ struct otx2_nic { #define OTX2_FLAG_TC_MATCHALL_EGRESS_ENABLED BIT_ULL(12) #define OTX2_FLAG_TC_MATCHALL_INGRESS_ENABLED BIT_ULL(13) #define OTX2_FLAG_DMACFLTR_SUPPORT BIT_ULL(14) +#define OTX2_FLAG_ADPTV_INT_COAL_ENABLED BIT_ULL(16) u64 flags; u64 *cq_op_addr; @@ -408,6 +415,9 @@ struct otx2_nic { u8 pfc_en; u8 *queue_to_pfc_map; #endif + + /* napi event count. It is needed for adaptive irq coalescing. */ + u32 napi_events; }; static inline bool is_otx2_lbkvf(struct pci_dev *pdev) |