Commit 6935e96c authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

add port mirroring for NIC/CPU originated traffic

parent b01a8ee9
......@@ -118,6 +118,7 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_misc.all;
use ieee.math_real.CEIL;
use ieee.math_real.log2;
use ieee.numeric_std.all;
......@@ -276,6 +277,9 @@ architecture behavioral of xwrsw_rtu_new is
signal htab_src_dst : std_logic;
signal dbg_forwarded_to_port : std_logic_vector(g_num_ports - 1 downto 0);
signal aux_pmask_mirroring : std_logic_vector(c_RTU_MAX_PORTS-1 downto 0);
signal mirror_port_dst : std_logic;
signal mirror_port_tx : std_logic;
signal CONTROL0 : std_logic_vector(35 downto 0);
signal TRIG0, TRIG1, TRIG2, TRIG3 : std_logic_vector(31 downto 0);
......@@ -871,13 +875,27 @@ begin
------------------------------------------------------------
-- Port mirroring handling for NIC/CPU-originated traffic --
------------------------------------------------------------
-- 1. If a given port is in dst mask, all NIC traffic to this port is
-- suppressed
-- 2. If a given port is in dsk mask, all NIC traffic originated from ports in
aux_rsp_ack_o <= rsp_ack_i(g_num_ports);
rsp_o(g_num_ports).valid <= aux_rsp_i.valid;
rsp_o(g_num_ports).prio <= aux_rsp_i.prio;
rsp_o(g_num_ports).drop <= aux_rsp_i.drop;
rsp_o(g_num_ports).hp <= aux_rsp_i.hp;
-- port_mask includes at least one egress mirrored port
mirror_port_tx <= '1' when (or_reduce(aux_rsp_i.port_mask and rtu_special_traffic_config.mirror_port_src_tx) /= '0') else
'0';
rsp_o(g_num_ports).port_mask <= aux_rsp_i.port_mask when(rtu_special_traffic_config.mr_ena = '0') else
aux_pmask_mirroring;
-- 1. If mirrored port is in dst mask, all NIC traffic originated from ports in
-- egress mask goes also to this port.
-- 2. If a given port is in dst mask, all NIC traffic to this port is
-- suppressed
aux_pmask_mirroring <= aux_rsp_i.port_mask or rtu_special_traffic_config.mirror_port_dst when(mirror_port_tx = '1') else
aux_rsp_i.port_mask and (not rtu_special_traffic_config.mirror_port_dst);
rsp_o(g_num_ports) <= aux_rsp_i;
aux_rsp_ack_o <= rsp_ack_i(g_num_ports);
------------------------------------------------------------
-- CS_ICON : chipscope_icon
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment