Skip to content

Commit cc45b96

Browse files
Subbaraya Sundeepdavem330
authored andcommitted
octeontx2-af: Check whether ipolicers exists
While displaying ingress policers information in debugfs check whether ingress policers exist in the hardware or not because some platforms(CN9XXX) do not have this feature. Fixes: e7d8971 ("octeontx2-af: cn10k: Debugfs support for bandwidth") Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: Rakesh Babu <[email protected]> Signed-off-by: Sunil Kovvuri Goutham <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e8684db commit cc45b96

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,10 @@ static int rvu_dbg_nix_band_prof_ctx_display(struct seq_file *m, void *unused)
17191719
u16 pcifunc;
17201720
char *str;
17211721

1722+
/* Ingress policers do not exist on all platforms */
1723+
if (!nix_hw->ipolicer)
1724+
return 0;
1725+
17221726
for (layer = 0; layer < BAND_PROF_NUM_LAYERS; layer++) {
17231727
if (layer == BAND_PROF_INVAL_LAYER)
17241728
continue;
@@ -1768,6 +1772,10 @@ static int rvu_dbg_nix_band_prof_rsrc_display(struct seq_file *m, void *unused)
17681772
int layer;
17691773
char *str;
17701774

1775+
/* Ingress policers do not exist on all platforms */
1776+
if (!nix_hw->ipolicer)
1777+
return 0;
1778+
17711779
seq_puts(m, "\nBandwidth profile resource free count\n");
17721780
seq_puts(m, "=====================================\n");
17731781
for (layer = 0; layer < BAND_PROF_NUM_LAYERS; layer++) {

0 commit comments

Comments
 (0)