Skip to content

Commit bcf50ce

Browse files
committed
fix(tx-mac-lite): adjust the FIFO depth calculation in TX MAC
Incorrect depth settings could cause jamming, especially on 400G cards. The original calculation did not take into account the worstpacket alignment. A minimum depth of 512 items is now also taken into account.
1 parent ef56757 commit bcf50ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

comp/nic/mac_lite/tx_mac_lite/tx_mac_lite.vhd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ architecture FULL of TX_MAC_LITE is
193193

194194
constant NUM_OF_PKTS : natural := tsel(DEVICE = "ULTRASCALE" and TX_REGIONS = 1 and TX_REGION_SIZE = 1,1,4);
195195
constant LEN_WIDTH : natural := log2(PKT_MTU_BYTES+1);
196-
constant DFIFO_ITEMS : natural := 2**log2(div_roundup((PKT_MTU_BYTES+1),(MD_DATA_W/8)));
196+
constant WORST_ALIGNMENT : natural := MD_DATA_W-(MD_BLOCK_SIZE*MD_ITEM_WIDTH);
197+
constant DFIFO_ITEMS : natural := 2**log2(max(div_roundup((PKT_MTU_BYTES+WORST_ALIGNMENT),(MD_DATA_W/8)), 512));
197198
constant FRAME_LEN_MIN : natural := tsel(RX_INCLUDE_CRC,64,60);
198199
constant CRC_GEN : boolean := CRC_INSERT_EN and not RX_INCLUDE_CRC;
199200
constant SPACER_GEN : boolean := (CRC_GEN and not RX_INCLUDE_IPG) or IPG_GENERATE_EN;

0 commit comments

Comments
 (0)