Skip to content
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

Src div0 5920 v4 #9253

Closed
wants to merge 2 commits into from
Closed

Conversation

catenacyber
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/5920

Describe changes:

  • src: checks to avoid divisions by zero

Modifies #9150 with rebase now that Suricata 7 is released and this is targeted for 7.0.1

@@ -152,12 +152,18 @@ static void DPDKFreeMbufArray(struct rte_mbuf **mbuf_array, uint16_t mbuf_cnt, u
static uint64_t CyclesToMicroseconds(const uint64_t cycles)
{
const uint64_t ticks_per_us = rte_get_tsc_hz() / 1000000;
if (ticks_per_us == 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukashino is this necessary? Or can rte_get_tsc_hz return < 1000000?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be possible only when:

  • the CPU would have a clock rate less than 100MHz
  • the CPU would not be well supported by DPDK and some register would return 0/random number instead ticks per second

So, assuming every CPU has a clock rate of at least 800MHz, and we will not care about unsupported CPUs then it should be fine even without the check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks, I feel it's probably safer to keep the check

@suricata-qa
Copy link

Information:

ERROR: QA failed on SURI_TLPR1_alerts_cmp.

field baseline test %
SURI_TLPR1_stats_chk
.uptime 1267 1409 111.21%
.tcp.active_sessions 0 474 -
.flow.active 0 98434 -
.flow.get_used 0 98434 -
.flow.get_used_eval 0 11609865 -
.flow.get_used_eval_reject 0 6136 -
.flow.get_used_eval_busy 0 2415 -
.flow.get_used_failed 0 1604299 -
.flow.emerg_mode_entered 0 2 -
.flow.emerg_mode_over 0 1 -
.app_layer.error.tls.parser 23942 29751 124.26%

Pipeline 15326

@victorjulien
Copy link
Member

Merged in #9288, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants