Commit f55d24f3 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

Mask rtu response for the ports that are down

This saves some resources (memory in the switching core) as we no longer forward
frames to the endpoints that have no fiber connected.
parent 0ab0ef16
......@@ -116,6 +116,7 @@ entity rtu_port_new is
port_almost_full_o : out std_logic;
port_full_o : out std_logic;
links_up_i : in std_logic_vector(g_port_mask_bits-1 downto 0);
-------------------------------------------------------------------------------
-- info to TRU
-------------------------------------------------------------------------------
......@@ -172,6 +173,8 @@ architecture behavioral of rtu_port_new is
signal rsp : t_rtu_response;
signal rtu_idle : std_logic;
signal forwarding_mask : std_logic_vector(c_rtu_max_ports-1 downto 0); --helper
signal fwd_mask_only_up : std_logic_vector(c_rtu_max_ports-1 downto 0); --helper
signal links_up_mask : std_logic_vector(c_rtu_max_ports-1 downto 0); --helper
signal forwarding_mask_CPU_filtered: std_logic_vector(c_rtu_max_ports-1 downto 0); --helper
signal forwarding_and_mirror_mask : std_logic_vector(c_rtu_max_ports-1 downto 0); --helper
signal forwarding_without_mr_dst_mask : std_logic_vector(c_rtu_max_ports-1 downto 0); --helper
......@@ -271,7 +274,7 @@ begin
-- (tx) frame to the reception port... we don't mirror this traffic, this is why we
-- apply below the f_set_bit() mask
mirror_port_src_tx <= '0' when (rtu_str_config_i.mr_ena = '0') else -- disabled
'1' when ((f_set_bit(forwarding_mask,'0',g_port_index) and --no to myself
'1' when ((f_set_bit(fwd_mask_only_up,'0',g_port_index) and --no to myself
rtu_str_config_i.mirror_port_src_tx) /=
zeros(c_rtu_max_ports-1 downto 0) ) else
'0';
......@@ -746,6 +749,11 @@ begin
-- 4) fast match decision only
fast_match.port_mask;
-- final forwarding mask only for links that are up
links_up_mask(c_rtu_max_ports-1 downto g_port_mask_bits) <= (others=>'0');
links_up_mask(g_port_mask_bits-1 downto 0) <= links_up_i;
fwd_mask_only_up <= forwarding_mask and links_up_mask;
-- forming final drop:
-- d) for debugging: forcing to have only fast match
drop <= fast_match.drop when (dbg_force_fast_match_only = '1') else
......@@ -779,13 +787,13 @@ begin
-- to make sure that HP traffic is not disturbed due to the fact that it's fowarded to slow NIC... just not
-- foward it there... (NIC should have it's own mechanism to prevent such situation, but precautions are not bad).
-- In case that some diagnostics is required, we can enable forwarding of HP traffic to NIC.
forwarding_mask_CPU_filtered <= forwarding_mask or rtu_str_config_i.cpu_forward_mask
forwarding_mask_CPU_filtered <= fwd_mask_only_up or rtu_str_config_i.cpu_forward_mask
when (rtu_str_config_i.hp_fw_cpu_ena = '1' and hp = '1') else
forwarding_mask when (hp = '0') else
forwarding_mask when (nf = '1') else
forwarding_mask and (not rtu_str_config_i.cpu_forward_mask);-- this is HP, not link-limited (nf) and
fwd_mask_only_up when (hp = '0') else
fwd_mask_only_up when (nf = '1') else
fwd_mask_only_up and (not rtu_str_config_i.cpu_forward_mask);-- this is HP, not link-limited (nf) and
-- forwarding of HP to NIC is disabled
-- f_set_bit(forwarding_mask,'0',g_num_ports) ; -- this is HP, not link-limited (nf) and
-- f_set_bit(fwd_mask_only_up,'0',g_num_ports) ; -- this is HP, not link-limited (nf) and
-- -- forwarding of HP to NIC is disabled
-- forwarding mask without mirror destination port
......
......@@ -311,6 +311,7 @@ package rtu_private_pkg is
fast_match_rd_data_i : in t_match_response;
port_almost_full_o : out std_logic;
port_full_o : out std_logic;
links_up_i : in std_logic_vector(g_port_mask_bits-1 downto 0);
-- tru_o : out t_rtu2tru;
rtu_str_config_i : in t_rtu_special_traffic_config;
rtu_gcr_g_ena_i : in std_logic;
......
......@@ -158,6 +158,7 @@ entity xwrsw_rtu_new is
tru_resp_i : in t_tru_response;
rtu2tru_o : out t_rtu2tru;
tru_enabled_i: in std_logic;
links_up_i : in std_logic_vector(g_port_mask_bits-1 downto 0);
rmon_events_o : out std_logic_vector(g_num_ports*g_rmon_events_bits_pp-1 downto 0);
wb_i : in t_wishbone_slave_in;
wb_o : out t_wishbone_slave_out
......@@ -367,6 +368,7 @@ begin
port_almost_full_o => open,
port_full_o => open,
links_up_i => links_up_i,
-- tru_o => rtu2tru_o,
......
......@@ -323,7 +323,7 @@ architecture rtl of scb_top_bare is
signal swc_nomem : std_logic;
signal swc_wdog_out : t_swc_fsms_array(c_NUM_PORTS downto 0);
signal ep_stop_traffic : std_logic;
signal ep_links_up : std_logic_vector(c_NUM_PORTS downto 0);
......@@ -618,6 +618,7 @@ begin
rtu_rsp(c_NUM_PORTS).hp <= '0';
fc_rx_pause(c_NUM_PORTS) <= c_zero_pause; -- no pause for NIC
ep_links_up(c_NUM_PORTS) <= '1'; --for RTU responses NIC is always up
U_Endpoint_Fanout : xwb_sdb_crossbar
generic map (
......@@ -718,13 +719,12 @@ begin
inject_packet_sel_i => tru2ep(i).inject_packet_sel,
inject_user_value_i => tru2ep(i).inject_user_value,
link_kill_i => tru2ep(i).link_kill, --'0' , --link_kill(i), -- to change
link_up_o => ep2tru(i).status,
------ PAUSE to SWcore ------------
fc_rx_pause_start_p_o => fc_rx_pause(i).req,
fc_rx_pause_quanta_o => fc_rx_pause(i).quanta,
fc_rx_pause_prio_mask_o => fc_rx_pause(i).classes,
----------------------------
link_up_o => ep_links_up(i),
rmon_events_o => ep_events((i+1)*c_epevents_sz-1 downto i*c_epevents_sz),
led_link_o => led_link_o(i),
......@@ -734,6 +734,7 @@ begin
phys_o(i).tx_data <= ep_dbg_data_array(i);
phys_o(i).tx_k <= ep_dbg_k_array(i);
ep2tru(i).status <= ep_links_up(i);
txtsu_timestamps(i).port_id(5) <= '0';
......@@ -876,6 +877,7 @@ begin
rsp_ack_i => rtu_rsp_ack(g_num_ports-1 downto 0),
rsp_abort_i=> rtu_rsp_abort(g_num_ports-1 downto 0), -- this is request from response receiving node
rq_abort_i => rtu_rq_abort(g_num_ports-1 downto 0), -- this is request from requesting module
links_up_i => ep_links_up,
------ new TRU stuff ----------
tru_req_o => tru_req,
tru_resp_i => tru_resp,
......
......@@ -354,6 +354,7 @@ package wrsw_components_pkg is
tru_resp_i : in t_tru_response;
rtu2tru_o : out t_rtu2tru;
tru_enabled_i: in std_logic;
links_up_i : in std_logic_vector(g_port_mask_bits-1 downto 0);
rmon_events_o : out std_logic_vector(g_num_ports*g_rmon_events_bits_pp-1 downto 0);
wb_i : in t_wishbone_slave_in;
wb_o : out t_wishbone_slave_out
......
......@@ -410,6 +410,7 @@ package wrsw_top_pkg is
tru_resp_i : in t_tru_response;
rtu2tru_o : out t_rtu2tru;
tru_enabled_i: in std_logic;
links_up_i : in std_logic_vector(g_port_mask_bits-1 downto 0);
rmon_events_o : out std_logic_vector(g_num_ports*g_rmon_events_bits_pp-1 downto 0);
wb_i : in t_wishbone_slave_in;
wb_o : out t_wishbone_slave_out
......
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