diff options
author | Sunil Goutham <sgoutham@marvell.com> | 2018-10-22 20:56:00 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-23 06:15:38 +0300 |
commit | 759001406654f4ec8738a1149ed2729306bd335d (patch) | |
tree | 449d920187cc67b50e9312944deaf1c8f86014ed /drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | |
parent | f5721f76a4376eacbbcc260d318872d2008fffbb (diff) | |
download | linux-759001406654f4ec8738a1149ed2729306bd335d.tar.xz |
octeontx2-af: Install ucast and bcast pkt forwarding rules
Upon NIXLF_ALLOC install a unicast forwarding rule in NPC MCAM
like below
- Match pkt DMAC with NIXLF attached PF/VF's MAC address.
- Ingress channel
- Action is UCAST
- Forward to PF_FUNC of this NIXLF
And broadcast pkt forwarding rule as
- Match L2B bit in MCAM search key
- Ingress channel
- Action is UCAST, for now, later it will be changed to MCAST.
Only PFs can install this rule
Upon NIXLF_FREE disable all MCAM entries in use by that NIXLF.
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c index 86b1e9b2fcf8..fbe4ff09b28d 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -151,13 +151,24 @@ static int nix_interface_init(struct rvu *rvu, u16 pcifunc, int type, int nixlf) break; } + /* Add a UCAST forwarding rule in MCAM with this NIXLF attached + * RVU PF/VF's MAC address. + */ + rvu_npc_install_ucast_entry(rvu, pcifunc, nixlf, + pfvf->rx_chan_base, pfvf->mac_addr); + /* Add this PF_FUNC to bcast pkt replication list */ err = nix_update_bcast_mce_list(rvu, pcifunc, true); if (err) { dev_err(rvu->dev, "Bcast list, failed to enable PF_FUNC 0x%x\n", pcifunc); + return err; } + + rvu_npc_install_bcast_match_entry(rvu, pcifunc, + nixlf, pfvf->rx_chan_base); + return 0; } @@ -172,6 +183,9 @@ static void nix_interface_deinit(struct rvu *rvu, u16 pcifunc, u8 nixlf) "Bcast list, failed to disable PF_FUNC 0x%x\n", pcifunc); } + + /* Free and disable any MCAM entries used by this NIX LF */ + rvu_npc_disable_mcam_entries(rvu, pcifunc, nixlf); } static void nix_setup_lso_tso_l3(struct rvu *rvu, int blkaddr, |