Skip to content

Commit

Permalink
MINOR: add tune.disable-zero-copy-forwarding keyword
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Gramer <[email protected]>
  • Loading branch information
vgramer committed Nov 27, 2023
1 parent c6e986d commit 52f98a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ global
tune.buffers.reserve 12
tune.bufsize 13
tune.comp.maxlevel 14
tune.disable-zero-copy-forwarding
tune.fail-alloc
tune.fd.edge-triggered on
tune.h2.header-table-size 15
Expand Down
9 changes: 9 additions & 0 deletions configuration/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -2348,6 +2348,9 @@ func serializeTuneOptions(p parser.Parser, options *models.GlobalTuneOptions) er
if err := serializeInt64Option(p, "tune.comp.maxlevel", options.CompMaxlevel); err != nil {
return err
}
if err := serializeBoolOption(p, "tune.disable-zero-copy-forwarding", options.DisableZeroCopyForwarding); err != nil {
return err
}
if err := serializeBoolOption(p, "tune.fail-alloc", options.FailAlloc); err != nil {
return err
}
Expand Down Expand Up @@ -2720,6 +2723,12 @@ func parseTuneOptions(p parser.Parser) (*models.GlobalTuneOptions, error) { //no
}
options.CompMaxlevel = intOption

boolOption, err = parseBoolOption(p, "tune.disable-zero-copy-forwarding")
if err != nil {
return nil, err
}
options.DisableZeroCopyForwarding = boolOption

boolOption, err = parseBoolOption(p, "tune.fail-alloc")
if err != nil {
return nil, err
Expand Down
4 changes: 4 additions & 0 deletions configuration/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ func TestGetGlobal(t *testing.T) {
if global.TuneOptions.CompMaxlevel != 14 {
t.Errorf("CompMaxlevel is %v, expected 14", global.TuneOptions.CompMaxlevel)
}
if !global.TuneOptions.DisableZeroCopyForwarding {
t.Errorf("DisableZeroCopyForwarding is %v, expected true", global.TuneOptions.DisableZeroCopyForwarding)
}
if global.TuneOptions.H2HeaderTableSize != 15 {
t.Errorf("H2HeaderTableSize is %v, expected 15", global.TuneOptions.H2HeaderTableSize)
}
Expand Down Expand Up @@ -699,6 +702,7 @@ func TestPutGlobal(t *testing.T) {
Param: "something",
},
TuneOptions: &models.GlobalTuneOptions{
DisableZeroCopyForwarding: true,
PeersMaxUpdatesAtOnce: 100,
QuicFrontendConnTxBuffersLimit: nil,
QuicFrontendMaxIdleTimeout: misc.Int64P(5000),
Expand Down

0 comments on commit 52f98a3

Please sign in to comment.