octeontx2-af: debugfs: Add channel and channel mask.
authorRakesh Babu <rsaladi2@marvell.com>
Wed, 27 Oct 2021 18:07:45 +0000 (23:37 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Oct 2021 13:49:29 +0000 (14:49 +0100)
This patch is to dispaly channel and channel_mask for each RX
interface of NPC MCAM rule.

Signed-off-by: Rakesh Babu <rsaladi2@marvell.com>
Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/af/npc.h
drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c

index 3144d30..77fd39e 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef NPC_H
 #define NPC_H
 
+#define NPC_KEX_CHAN_MASK      0xFFFULL
+
 enum NPC_LID_E {
        NPC_LID_LA = 0,
        NPC_LID_LB,
@@ -591,6 +593,8 @@ struct rvu_npc_mcam_rule {
        u8 default_rule;
        bool enable;
        bool vfvlan_cfg;
+       u16 chan;
+       u16 chan_mask;
 };
 
 #endif /* NPC_H */
index 62dd9d7..94d4790 100644 (file)
@@ -2490,6 +2490,8 @@ static int rvu_dbg_npc_mcam_show_rules(struct seq_file *s, void *unused)
                                seq_printf(s, "VF%d", vf);
                        }
                        seq_puts(s, "\n");
+                       seq_printf(s, "\tchannel: 0x%x\n", iter->chan);
+                       seq_printf(s, "\tchannel_mask: 0x%x\n", iter->chan_mask);
                }
 
                rvu_dbg_npc_mcam_show_action(s, iter);
index 51ddc7b..ff2b219 100644 (file)
@@ -1119,6 +1119,9 @@ find_rule:
        rule->default_rule = req->default_rule;
        rule->owner = owner;
        rule->enable = enable;
+       rule->chan_mask = write_req.entry_data.kw_mask[0] & NPC_KEX_CHAN_MASK;
+       rule->chan = write_req.entry_data.kw[0] & NPC_KEX_CHAN_MASK;
+       rule->chan &= rule->chan_mask;
        if (is_npc_intf_tx(req->intf))
                rule->intf = pfvf->nix_tx_intf;
        else