aboutsummaryrefslogtreecommitdiffstats
path: root/fpga
diff options
context:
space:
mode:
authorAndrew Moch <Andrew.Moch@ni.com>2020-10-02 23:41:59 +0100
committerWade Fife <wade.fife@ettus.com>2020-10-05 16:03:21 -0500
commit1938bb951a981f4d3016b796f771b5047fb846a2 (patch)
tree753c96541bc861e47ec675b52c1f187cbf58d8cc /fpga
parent8fea36aa81195d758a29067141afdc4becefe5ae (diff)
downloaduhd-1938bb951a981f4d3016b796f771b5047fb846a2.tar.gz
uhd-1938bb951a981f4d3016b796f771b5047fb846a2.tar.bz2
uhd-1938bb951a981f4d3016b796f771b5047fb846a2.zip
fpga: lib: Fix small packets stuck in 10 GbE TX
Any packet less than CUT_THROUGH bytes has a high chance of getting stuck in the TX FIFO of the xge_mac_wrapper. In cut-through mode we were waiting for CUT_THROUGH bytes before transmitting the packet.
Diffstat (limited to 'fpga')
-rw-r--r--fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v20
1 files changed, 17 insertions, 3 deletions
diff --git a/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v b/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v
index 143808f6d..b5c6943ed 100644
--- a/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v
+++ b/fpga/usrp3/lib/xge_interface/xge_mac_wrapper.v
@@ -434,20 +434,27 @@ module xge_mac_wrapper #(
//
reg cut_through;
reg cut_wait;
+ reg [15:0] cut_idlecount;
if (CUT_THROUGH > 0) begin : yes_cut_through
wire cut_start;
wire cut_end;
- assign cut_start = tx_occupied > CUT_THROUGH;
+ // start under 2 conditions
+ // (1) we have more the CUT_THROUGH bytes buffered
+ assign cut_start = tx_occupied > CUT_THROUGH ||
+ // (2) we have kept bytes waiting for too long
+ // The second case happens when less than CUT_THROUGH bytes are pushed
+ (cut_idlecount == 0);
assign cut_end = eth_tx_eof && eth_tx_valid;
// Add SOF
always @(posedge xgmii_clk) begin : cut_through_dff
if (xgmii_reset) begin
- cut_through <= 1'b0;
- cut_wait <= 1'b0;
+ cut_through <= 1'b0;
+ cut_wait <= 1'b0;
+ cut_idlecount <= CUT_THROUGH+2;
end else begin
cut_wait <= eth_tx_full;
if (cut_start) begin
@@ -455,6 +462,13 @@ module xge_mac_wrapper #(
end else if (cut_end) begin
cut_through <= 1'b0;
end
+ if (tx_occupied > 0 && cut_through == 1'b0) begin
+ if (cut_idlecount > 0) begin
+ cut_idlecount <= cut_idlecount-1;
+ end
+ end else begin
+ cut_idlecount <= CUT_THROUGH+2;
+ end
end
end
end else begin : no_cut_through