Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
scdaq
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scouting-demonstrator
scdaq
Commits
1d3ccb68
Commit
1d3ccb68
authored
1 year ago
by
Giovanna Lazzari Miotto
Browse files
Options
Downloads
Patches
Plain Diff
Re-introduce hard-coded input size
parent
f4b8d235
No related branches found
No related tags found
No related merge requests found
Pipeline
#7187079
failed
1 year ago
Stage: check
Stage: build
Stage: run
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/FileDmaInputFilter.cc
+9
-7
9 additions, 7 deletions
src/FileDmaInputFilter.cc
with
9 additions
and
7 deletions
src/FileDmaInputFilter.cc
+
9
−
7
View file @
1d3ccb68
...
@@ -18,6 +18,7 @@ const bool USE_DAX_MEM = true;
...
@@ -18,6 +18,7 @@ const bool USE_DAX_MEM = true;
const
size_t
DEV_PAGE_SIZE
=
4096
;
// Presumably
const
size_t
DEV_PAGE_SIZE
=
4096
;
// Presumably
const
size_t
DAX_START_OFFSET
=
16777216
;
// Multiple of page size -- 4096 pages
const
size_t
DAX_START_OFFSET
=
16777216
;
// Multiple of page size -- 4096 pages
constexpr
size_t
DAX_DATA_LENGTH
=
16777216
;
// Note: might need to be multiple of huge page
constexpr
size_t
DAX_DATA_LENGTH
=
16777216
;
// Note: might need to be multiple of huge page
const
size_t
ACTUAL_GMT_FILE_SIZE
=
9050784
;
// (((9050784 / DEV_PAGE_SIZE) + 1) * DEV_PAGE_SIZE); // 9052160 (2210 pages)
// (((9050784 / DEV_PAGE_SIZE) + 1) * DEV_PAGE_SIZE); // 9052160 (2210 pages)
const
std
::
string
DAX_ADDRESS
=
"/dev/dax0.0"
;
const
std
::
string
DAX_ADDRESS
=
"/dev/dax0.0"
;
...
@@ -124,8 +125,8 @@ static inline ssize_t read_dma_packet_buffer(char *src_buf, char *dst_buf, size_
...
@@ -124,8 +125,8 @@ static inline ssize_t read_dma_packet_buffer(char *src_buf, char *dst_buf, size_
size_t
bytes_read
=
0
;
size_t
bytes_read
=
0
;
const
size_t
align_by
=
32
;
const
size_t
align_by
=
32
;
assert
(
size
%
align_by
==
0
);
assert
(
size
%
align_by
==
0
);
std
::
cout
<<
"read_dma_packet_buffer: reading up to "
<<
std
::
to_string
(
size
)
<<
" bytes."
//
std::cout << "read_dma_packet_buffer: reading up to " << std::to_string(size) << " bytes."
<<
std
::
endl
;
//
<< std::endl;
static
constexpr
uint64_t
deadbeef
=
0xdeadbeefdeadbeefL
;
static
constexpr
uint64_t
deadbeef
=
0xdeadbeefdeadbeefL
;
...
@@ -134,14 +135,15 @@ static inline ssize_t read_dma_packet_buffer(char *src_buf, char *dst_buf, size_
...
@@ -134,14 +135,15 @@ static inline ssize_t read_dma_packet_buffer(char *src_buf, char *dst_buf, size_
memcpy
(
dst_buf
+
bytes_read
,
src_buf
+
bytes_read
,
align_by
);
memcpy
(
dst_buf
+
bytes_read
,
src_buf
+
bytes_read
,
align_by
);
// Must find end of packet ('deadbeef') within the destination buffer's allocated space
// Must find end of packet ('deadbeef') within the destination buffer's allocated space
if
(
*
(
uint64_t
*
)(
src_buf
+
bytes_read
)
==
deadbeef
)
{
if
(
*
(
uint64_t
*
)(
src_buf
+
bytes_read
)
==
deadbeef
)
{
std
::
cout
<<
"Found deadbeef after "
<<
std
::
to_string
(
bytes_read
)
<<
" bytes."
<<
std
::
endl
;
// std::cout << "Found deadbeef after " << std::to_string(bytes_read) << " bytes." <<
// std::endl;
return
static_cast
<
ssize_t
>
(
bytes_read
+
align_by
);
return
static_cast
<
ssize_t
>
(
bytes_read
+
align_by
);
}
}
bytes_read
+=
align_by
;
bytes_read
+=
align_by
;
}
}
if
(
bytes_read
==
size
)
{
if
(
bytes_read
==
size
)
{
std
::
cout
<<
"Filled buffer but no deadbeef"
<<
std
::
endl
;
std
::
cout
<<
"Filled buffer but no deadbeef
found
"
<<
std
::
endl
;
// return static_cast<ssize_t>(bytes_read);
// return static_cast<ssize_t>(bytes_read);
}
}
...
@@ -157,8 +159,8 @@ inline ssize_t FileDmaInputFilter::readPacket(char **buffer, ssize_t bufferSize)
...
@@ -157,8 +159,8 @@ inline ssize_t FileDmaInputFilter::readPacket(char **buffer, ssize_t bufferSize)
if
constexpr
(
USE_DAX_MEM
)
{
if
constexpr
(
USE_DAX_MEM
)
{
// bufferSize must be multiple of page size
// bufferSize must be multiple of page size
if
(
source_offset_
>=
DAX_DATA_LENGTH
)
{
if
(
source_offset_
>=
ACTUAL_GMT_FILE_SIZE
)
{
LOG
(
INFO
)
<<
"Reached end of data buffer content ("
<<
DAX_DATA_LENGTH
LOG
(
INFO
)
<<
"Reached end of data buffer content ("
<<
ACTUAL_GMT_FILE_SIZE
<<
" bytes), starting over"
;
<<
" bytes), starting over"
;
source_offset_
=
DAX_START_OFFSET
;
source_offset_
=
DAX_START_OFFSET
;
}
}
...
@@ -168,7 +170,7 @@ inline ssize_t FileDmaInputFilter::readPacket(char **buffer, ssize_t bufferSize)
...
@@ -168,7 +170,7 @@ inline ssize_t FileDmaInputFilter::readPacket(char **buffer, ssize_t bufferSize)
bytesRead
=
read_dma_packet_from_file
(
inputFile
,
*
buffer
,
bufferSize
,
nbReads
());
bytesRead
=
read_dma_packet_from_file
(
inputFile
,
*
buffer
,
bufferSize
,
nbReads
());
}
}
std
::
cout
<<
"Bytes read: "
<<
std
::
to_string
(
bytesRead
)
<<
std
::
endl
;
//
std::cout << "Bytes read: " << std::to_string(bytesRead) << std::endl;
while
(
bytesRead
>
(
ssize_t
)
bufferSize
)
{
while
(
bytesRead
>
(
ssize_t
)
bufferSize
)
{
stats
.
nbOversizedPackets
++
;
stats
.
nbOversizedPackets
++
;
skip
++
;
skip
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment