Skip to content

Commit

Permalink
MINOR: global: add tune.pt.zero-copy-forwarding
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Gramer <[email protected]>
  • Loading branch information
vgramer committed Dec 5, 2023
1 parent ca44a7a commit 368ce77
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 2 deletions.
1 change: 1 addition & 0 deletions configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ global
tune.pipesize 32
tune.pool-high-fd-ratio 33
tune.pool-low-fd-ratio 34
tune.pt.zero-copy-forwarding on
tune.rcvbuf.backend 1024
tune.rcvbuf.client 35
tune.rcvbuf.frontend 2048
Expand Down
9 changes: 9 additions & 0 deletions configuration/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -2572,6 +2572,9 @@ func serializeTuneOptions(p parser.Parser, options *models.GlobalTuneOptions) er
if err := serializeOnOffOption(p, "tune.h2.zero-copy-fwd-send", options.H2ZeroCopyFwdSend); err != nil {
return err
}
if err := serializeOnOffOption(p, "tune.pt.zero-copy-forwarding", options.PtZeroCopyForwarding); err != nil {
return err
}
return serializeInt64Option(p, "tune.zlib.windowsize", options.ZlibWindowsize)
}

Expand Down Expand Up @@ -3216,6 +3219,12 @@ func parseTuneOptions(p parser.Parser) (*models.GlobalTuneOptions, error) { //no
}
options.H2ZeroCopyFwdSend = strOption

strOption, err = parseOnOffOption(p, "tune.pt.zero-copy-forwarding")
if err != nil {
return nil, err
}
options.PtZeroCopyForwarding = strOption

return options, nil
}

Expand Down
4 changes: 4 additions & 0 deletions configuration/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ func TestGetGlobal(t *testing.T) {
if global.TuneOptions.PoolLowFdRatio != 34 {
t.Errorf("PoolLowFdRatio is %v, expected 34", global.TuneOptions.PoolLowFdRatio)
}
if global.TuneOptions.PtZeroCopyForwarding != "enabled" {
t.Errorf("PtZeroCopyForwarding is %v, expected enabled", global.TuneOptions.PtZeroCopyForwarding)
}
if *global.TuneOptions.RcvbufBackend != 1024 {
t.Errorf("RcvbufBackend is %v, expected 1024", global.TuneOptions.RcvbufBackend)
}
Expand Down Expand Up @@ -747,6 +750,7 @@ func TestPutGlobal(t *testing.T) {
LuaLogStderr: "disabled",
MaxChecksPerThread: misc.Int64P(20),
PeersMaxUpdatesAtOnce: 100,
PtZeroCopyForwarding: "disabled",
QuicFrontendConnTxBuffersLimit: nil,
QuicFrontendMaxIdleTimeout: misc.Int64P(5000),
QuicSocketOwner: "listener",
Expand Down
50 changes: 50 additions & 0 deletions models/global.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions models/global_compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions models/global_compare_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions specification/build/haproxy_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,12 @@ definitions:
pool_low_fd_ratio:
type: integer
x-display-name: Max Used Low FD Ratio
pt_zero_copy_forwarding:
enum:
- enabled
- disabled
type: string
x-display-name: enable or disable the zero-copy forwarding of data for the pass-through multiplexer
quic_frontend_conn_tx_buffers_limit:
type: integer
x-display-name: QUIC Frontend Connection TX Buffer Limit
Expand Down
4 changes: 4 additions & 0 deletions specification/models/configuration/global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ global:
pool_low_fd_ratio:
type: integer
x-display-name: Max Used Low FD Ratio
pt_zero_copy_forwarding:
type: string
enum: [enabled, disabled]
x-display-name: enable or disable the zero-copy forwarding of data for the pass-through multiplexer
rcvbuf_backend:
type: integer
x-display-name: Backend Receive Buffer Size
Expand Down

0 comments on commit 368ce77

Please sign in to comment.