1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-30 08:32:52 +08:00

fpga/common/tb: Pull out feature bits for easy access

Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
Alex Forencich 2023-05-13 00:54:56 -07:00
parent aef62af18c
commit 1c242f7d92

View File

@ -1193,6 +1193,11 @@ class Interface:
self.rx_queue_map_rb = None self.rx_queue_map_rb = None
self.if_features = None self.if_features = None
self.if_feature_rss = None
self.if_feature_ptp_ts = None
self.if_feature_tx_csum = None
self.if_feature_rx_csum = None
self.if_feature_rx_hash = None
self.max_tx_mtu = 0 self.max_tx_mtu = 0
self.max_rx_mtu = 0 self.max_rx_mtu = 0
@ -1238,6 +1243,12 @@ class Interface:
self.max_tx_mtu = await self.if_ctrl_rb.read_dword(MQNIC_RB_IF_CTRL_REG_MAX_TX_MTU) self.max_tx_mtu = await self.if_ctrl_rb.read_dword(MQNIC_RB_IF_CTRL_REG_MAX_TX_MTU)
self.max_rx_mtu = await self.if_ctrl_rb.read_dword(MQNIC_RB_IF_CTRL_REG_MAX_RX_MTU) self.max_rx_mtu = await self.if_ctrl_rb.read_dword(MQNIC_RB_IF_CTRL_REG_MAX_RX_MTU)
self.if_feature_rss = bool(self.if_features & MQNIC_IF_FEATURE_RSS)
self.if_feature_ptp_ts = bool(self.if_features & MQNIC_IF_FEATURE_PTP_TS)
self.if_feature_tx_csum = bool(self.if_features & MQNIC_IF_FEATURE_TX_CSUM)
self.if_feature_rx_csum = bool(self.if_features & MQNIC_IF_FEATURE_RX_CSUM)
self.if_feature_rx_hash = bool(self.if_features & MQNIC_IF_FEATURE_RX_HASH)
self.log.info("IF features: 0x%08x", self.if_features) self.log.info("IF features: 0x%08x", self.if_features)
self.log.info("Port count: %d", self.port_count) self.log.info("Port count: %d", self.port_count)
self.log.info("Scheduler block count: %d", self.sched_block_count) self.log.info("Scheduler block count: %d", self.sched_block_count)