-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smb hashmap/v5 #11786
Smb hashmap/v5 #11786
Conversation
Don't tag the session as gap'd when the GAP is in a precise location: 1. in "skip" data, where the GAP just fits the skip data 2. in file data, where we pass the GAP on to the file This reduces load of GAP post-processing that is unnecessary in these case.
Ticket: OISF#5672.
ERROR: ERROR: QA failed on build_asan. Pipeline 22678 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #11786 +/- ##
==========================================
- Coverage 82.63% 82.55% -0.08%
==========================================
Files 919 919
Lines 248943 248976 +33
==========================================
- Hits 205716 205550 -166
- Misses 43227 43426 +199
Flags with carried forward coverage won't be shown. Click here to find out more. |
e1a935e
to
c12f6a5
Compare
WARNING:
Pipeline 22679 |
Use `lru` crate. Add `app-layer.protocols.smb.max-guid-cache-size` to control the max size of the LRU cache.
c12f6a5
to
ef475aa
Compare
WARNING:
Pipeline 22680 |
Information: QA ran without warnings. Pipeline 22681 |
Probably best to convert the other hashmaps in the smb state as well. |
@@ -732,7 +734,7 @@ fn smb1_response_record_one(state: &mut SMBState, r: &SmbRecord, command: u8, an | |||
fid.extend_from_slice(&u32_as_bytes(r.ssn_id)); | |||
SCLogDebug!("SMB1_COMMAND_NT_CREATE_ANDX fid {:?}", fid); | |||
SCLogDebug!("fid {:?} name {:?}", fid, p); | |||
state.guid2name_map.insert(fid, p); | |||
_ = state.guid2name_map.put(fid, p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we handle somehow the return value ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what to do with it. IIRC it returns the evicted value.
@@ -732,7 +734,7 @@ fn smb1_response_record_one(state: &mut SMBState, r: &SmbRecord, command: u8, an | |||
fid.extend_from_slice(&u32_as_bytes(r.ssn_id)); | |||
SCLogDebug!("SMB1_COMMAND_NT_CREATE_ANDX fid {:?}", fid); | |||
SCLogDebug!("fid {:?} name {:?}", fid, p); | |||
state.guid2name_map.insert(fid, p); | |||
_ = state.guid2name_map.put(fid, p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps for consistency with let _name
, use let _evicted
?
Just for observation sake, this brings in some new crates:
|
Still a draft, but us of the lru crate looks good, and in general this crate is in very wide use. |
continued testing in #12028 |
Adds use of the
lru
crate to turnguid2name_map
into aLruCache
. In this test code it's hard coded to 1024 entries max.Continuation of #11721.
PR for initial LRU usage review and qa feedback.
Todos: