From 49f385e69c89faf50ee0df683cd65ca1106123a0 Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Thu, 29 Sep 2022 14:31:24 +0200
Subject: [PATCH] Clarify use of c_sdp_stat_hdr_field_sel.

---
 .../sdp/src/vhdl/sdp_statistics_offload.vhd   | 77 +++++++++++++------
 1 file changed, 54 insertions(+), 23 deletions(-)

diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd
index eb9d5dec6c..aac7778fe7 100644
--- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd
+++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd
@@ -273,33 +273,64 @@ ARCHITECTURE str OF sdp_statistics_offload IS
 BEGIN
 
   -------------------------------------------------------------------------------
-  -- Assemble offload header info, for data path fields that are selected by:
+  -- Assemble offload header info
+  -------------------------------------------------------------------------------
+  -- Whether the dp_offload_tx_hdr_fields value is actually used in the Tx header depends on c_sdp_stat_hdr_field_sel
   --   c_sdp_stat_hdr_field_sel = "1"&"101"&"111011111001"&"0100"&"0100"&"000000010"&"1000000"&"0"
   --                                   eth   ip             udp    app
   --   where 0 = data path, 1 = MM controlled. The '0' fields are assigned here in dp_header_info
   --   in order:
-  --   . eth: eth_src_mac
-  --   . ip:  ip_total_length,
-  --          ip_header_checksum (not here, will be filled in by 1GbE eth component),
-  --          ip_src_addr
-  --   . udp: udp_src_port,
-  --          udp_total_length
-  --          udp_checksum, (not here, also not calculated in 1GbE eth component because would
-  --            require store and forward, send default 0)
-  --   . app: - sdp_marker, sdp_observation_id, sdp_station_id,
-  --          - sdp_source_info_antenna_band_id,
-  --            sdp_source_info_nyquist_zone_id,
-  --            sdp_source_info_f_adc,
-  --            sdp_source_info_fsub_type,
-  --            sdp_source_info_payload_error,
-  --            sdp_source_info_beam_repositioning_flag,
-  --            sdp_source_info_weighted_subbands_flag,
-  --            sdp_source_info_gn_id,
-  --          - sdp_integration_interval, sdp_data_id, sdp_nof_signal_inputs,
-  --            sdp_nof_bytes_per_statistic,
-  --            sdp_nof_statistics_per_packet, sdp_block_period
-  --          - dp_bsn
-  -------------------------------------------------------------------------------
+  --     access   field
+  --     MM       word_align
+  --
+  --     MM       eth_dst_mac
+  --        DP    eth_src_mac
+  --     MM       eth_type
+  --
+  --     MM       ip_version
+  --     MM       ip_header_length
+  --     MM       ip_services
+  --        DP    ip_total_length
+  --     MM       ip_identification
+  --     MM       ip_flags
+  --     MM       ip_fragment_offset
+  --     MM       ip_time_to_live
+  --     MM       ip_protocol
+  --        DP    ip_header_checksum --> not here, will be filled in by 1GbE eth component
+  --        DP    ip_src_addr
+  --     MM       ip_dst_addr
+  --
+  --        DP    udp_src_port
+  --     MM       udp_dst_port
+  --        DP    udp_total_length
+  --        DP    udp_checksum --> default fixed 0, so not used, not calculated here or in 1GbE
+  --                               eth component because would require store and forward
+  --
+  --        DP    sdp_marker
+  --     MM       sdp_version_id
+  --        DP    sdp_observation_id
+  --        DP    sdp_station_id
+  --
+  --        DP    sdp_source_info_antenna_band_id
+  --        DP    sdp_source_info_nyquist_zone_id
+  --        DP    sdp_source_info_f_adc
+  --        DP    sdp_source_info_fsub_type
+  --        DP    sdp_source_info_payload_error
+  --        DP    sdp_source_info_beam_repositioning_flag
+  --        DP    sdp_source_info_weighted_subbands_flag
+  --     MM       sdp_source_info_reserved
+  --        DP    sdp_source_info_gn_id
+  --
+  --     MM       sdp_reserved
+  --        DP    sdp_integration_interval
+  --        DP    sdp_data_id
+  --        DP    sdp_nof_signal_inputs
+  --        DP    sdp_nof_bytes_per_statistic
+  --        DP    sdp_nof_statistics_per_packet
+  --        DP    sdp_block_period
+  --
+  --        DP    dp_bsn
+
   dp_header_info(field_hi(c_sdp_stat_hdr_field_arr, "eth_src_mac"                             ) DOWNTO field_lo(c_sdp_stat_hdr_field_arr,  "eth_src_mac"                             )) <= eth_src_mac;
   dp_header_info(field_hi(c_sdp_stat_hdr_field_arr, "ip_total_length"                         ) DOWNTO field_lo(c_sdp_stat_hdr_field_arr,  "ip_total_length"                         )) <= TO_UVEC(c_ip_total_length, 16);
   dp_header_info(field_hi(c_sdp_stat_hdr_field_arr, "ip_src_addr"                             ) DOWNTO field_lo(c_sdp_stat_hdr_field_arr,  "ip_src_addr"                             )) <= ip_src_addr;
-- 
GitLab