Commit 8c23ba5d authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

wr_endpoint/rx_path: don't store pfilter decision if frame is dropped by rx_buffer

If there is a storm of frames and rx_buffer gets full it starts to drop frames.
However, before this commit even if a frame was dropped that way, U_match_buffer
was storing pfilter decision for that frame. As a result decisions coming out
from the match_buffer were shifted and applied to wrong frames. With this commit
I check if the rx_buffer is full at the beginning of frame and eventually block
mbuf_we so that the pfilter decision is not stored.
parent 87ad0d56
......@@ -60,6 +60,7 @@ entity ep_rx_buffer is
src_dreq_i : in std_logic;
level_o : out std_logic_vector(7 downto 0);
full_o : out std_logic;
regs_i : in t_ep_out_registers;
rmon_o : out t_rmon_triggers
);
......@@ -177,6 +178,8 @@ architecture behavioral of ep_rx_buffer is
signal out_cur_addr : std_logic_vector(1 downto 0);
begin
full_o <= q_drop;
p_fifo_write : process(clk_sys_i)
begin
......
......@@ -268,6 +268,7 @@ architecture behavioral of ep_rx_path is
src_fab_o : out t_ep_internal_fabric;
src_dreq_i : in std_logic;
level_o : out std_logic_vector(7 downto 0);
full_o : out std_logic;
regs_i : in t_ep_out_registers;
rmon_o : out t_rmon_triggers);
end component;
......@@ -327,6 +328,10 @@ architecture behavioral of ep_rx_path is
signal rtu_rq_valid : std_logic;
signal stat_reg_mbuf_valid : std_logic;
signal rxbuf_full : std_logic;
signal rxbuf_drop_frame : std_logic;
signal rxbuf_got_sof : std_logic;
begin -- behavioral
fab_pipe(0) <= pcs_fab_i;
......@@ -383,8 +388,9 @@ begin -- behavioral
pfilter_pclass <= (others => '0');
end generate gen_without_packet_filter;
mbuf_we <= '1' when ((ematch_done='1' and g_with_early_match) or
(pfilter_done='1' and g_with_dpi_classifier)) else
mbuf_we <= '1' when (((ematch_done='1' and g_with_early_match) or
(pfilter_done='1' and g_with_dpi_classifier)) and
rxbuf_drop_frame='0') else
'0';
gen_with_match_buff: if( g_with_early_match or g_with_dpi_classifier) generate
......@@ -536,6 +542,7 @@ begin -- behavioral
src_fab_o => fab_pipe(8),
src_dreq_i => dreq_pipe(8),
level_o => fc_buffer_occupation_o,
full_o => rxbuf_full,
regs_i => regs_i,
rmon_o => open);
end generate gen_with_rx_buffer;
......@@ -543,8 +550,27 @@ begin -- behavioral
gen_without_rx_buffer : if (not g_with_rx_buffer) generate
fab_pipe(8) <= fab_pipe(7);
dreq_pipe(7) <= dreq_pipe(8);
rxbuf_full <= '0';
end generate gen_without_rx_buffer;
-- If rx_buffer was full at the beginning of the frame, that means this frame
-- won't be stored there at all. In this process I detect if rxbuf_full is
-- high when first data word of each frame is valid.
process(clk_sys_i)
begin
if rising_edge(clk_sys_i) then
if (rst_n_sys_i='0') then
rxbuf_drop_frame <= '0';
rxbuf_got_sof <= '0';
elsif (fab_pipe(7).sof='1') then
rxbuf_got_sof <= '1';
elsif (rxbuf_got_sof='1' and fab_pipe(7).dvalid='1') then
rxbuf_drop_frame <= rxbuf_full;
rxbuf_got_sof <= '0';
end if;
end if;
end process;
-- U_RTU_Header_Extract : ep_rtu_header_extract
-- generic map (
-- g_with_rtu => g_with_rtu)
......
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