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

Fix send buffer misalignment [No 2] #1332

Merged
1 change: 1 addition & 0 deletions ipa-core/benches/oneshot/ipa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl Args {
self.active_work
.map(NonZeroUsize::get)
.unwrap_or_else(|| self.query_size.clamp(16, 1024))
.next_power_of_two()
}

fn attribution_window(&self) -> Option<NonZeroU32> {
Expand Down
7 changes: 4 additions & 3 deletions ipa-core/src/app.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{num::NonZeroUsize, sync::Weak};
use std::sync::Weak;

use async_trait::async_trait;

Expand All @@ -13,17 +13,18 @@
protocol::QueryId,
query::{NewQueryError, QueryProcessor, QueryStatus},
sync::Arc,
utils::NonZeroU32PowerOfTwo,
};

#[derive(Default)]
pub struct AppConfig {
active_work: Option<NonZeroUsize>,
active_work: Option<NonZeroU32PowerOfTwo>,
key_registry: Option<KeyRegistry<PrivateKeyOnly>>,
}

impl AppConfig {
#[must_use]
pub fn with_active_work(mut self, active_work: Option<NonZeroUsize>) -> Self {
pub fn with_active_work(mut self, active_work: Option<NonZeroU32PowerOfTwo>) -> Self {

Check warning on line 27 in ipa-core/src/app.rs

View check run for this annotation

Codecov / codecov/patch

ipa-core/src/app.rs#L27

Added line #L27 was not covered by tests
self.active_work = active_work;
self
}
Expand Down
5 changes: 2 additions & 3 deletions ipa-core/src/bin/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::{
fs,
io::BufReader,
net::TcpListener,
num::NonZeroUsize,
os::fd::{FromRawFd, RawFd},
path::{Path, PathBuf},
process,
Expand All @@ -18,7 +17,7 @@ use ipa_core::{
error::BoxError,
helpers::HelperIdentity,
net::{ClientIdentity, HttpShardTransport, HttpTransport, MpcHelperClient},
AppConfig, AppSetup,
AppConfig, AppSetup, NonZeroU32PowerOfTwo,
};
use tracing::{error, info};

Expand Down Expand Up @@ -93,7 +92,7 @@ struct ServerArgs {

/// Override the amount of active work processed in parallel
#[arg(long)]
active_work: Option<NonZeroUsize>,
active_work: Option<NonZeroU32PowerOfTwo>,
}

#[derive(Debug, Subcommand)]
Expand Down
Loading