Skip to content

Commit

Permalink
MINOR: global: add tune.h2.zero-copy-fwd-send
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 f120158 commit ca44a7a
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 @@ -62,6 +62,7 @@ global
tune.h2.initial-window-size 16
tune.h2.max-concurrent-streams 17
tune.h2.max-frame-size 18
tune.h2.zero-copy-fwd-send on
tune.http.cookielen 19
tune.http.logurilen 20
tune.http.maxhdr 21
Expand Down
9 changes: 9 additions & 0 deletions configuration/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -2569,6 +2569,9 @@ func serializeTuneOptions(p parser.Parser, options *models.GlobalTuneOptions) er
if err := serializeInt64Option(p, "tune.h2.fe.max-concurrent-streams", options.H2FeMaxConcurrentStreams); err != nil {
return err
}
if err := serializeOnOffOption(p, "tune.h2.zero-copy-fwd-send", options.H2ZeroCopyFwdSend); err != nil {
return err
}
return serializeInt64Option(p, "tune.zlib.windowsize", options.ZlibWindowsize)
}

Expand Down Expand Up @@ -3207,6 +3210,12 @@ func parseTuneOptions(p parser.Parser) (*models.GlobalTuneOptions, error) { //no
}
options.H2FeMaxConcurrentStreams = intOption

strOption, err = parseOnOffOption(p, "tune.h2.zero-copy-fwd-send")
if err != nil {
return nil, err
}
options.H2ZeroCopyFwdSend = 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 @@ -312,6 +312,9 @@ func TestGetGlobal(t *testing.T) {
if global.TuneOptions.H2MaxFrameSize != 18 {
t.Errorf("H2MaxFrameSize is %v, expected 18", global.TuneOptions.H2MaxFrameSize)
}
if global.TuneOptions.H2ZeroCopyFwdSend != "enabled" {
t.Errorf("H2ZeroCopyFwdSend is %v, expected enabled", global.TuneOptions.H2ZeroCopyFwdSend)
}
if global.TuneOptions.HTTPCookielen != 19 {
t.Errorf("HTTPCookielen is %v, expected 19", global.TuneOptions.HTTPCookielen)
}
Expand Down Expand Up @@ -739,6 +742,7 @@ func TestPutGlobal(t *testing.T) {
EventsMaxEventsAtOnce: 50,
H1ZeroCopyFwdRecv: "disabled",
H1ZeroCopyFwdSend: "disabled",
H2ZeroCopyFwdSend: "disabled",
LuaLogLoggers: "disabled",
LuaLogStderr: "disabled",
MaxChecksPerThread: misc.Int64P(20),
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 @@ -1641,6 +1641,12 @@ definitions:
h2_max_frame_size:
type: integer
x-display-name: HTTP/2 Maximum Frame Size
h2_zero_copy_fwd_send:
enum:
- enabled
- disabled
type: string
x-display-name: enable or disable the zero-copy sends of data for the HTTP/2 multiplexer
http_cookielen:
type: integer
x-display-name: Maximum Cookie Length
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 @@ -341,6 +341,10 @@ global:
h2_fe_max_concurrent_streams:
type: integer
x-display-name: Maximum number of concurrent streams per incoming connection
h2_zero_copy_fwd_send:
type: string
enum: [enabled, disabled]
x-display-name: enable or disable the zero-copy sends of data for the HTTP/2 multiplexer
http_cookielen:
type: integer
x-display-name: Maximum Cookie Length
Expand Down

0 comments on commit ca44a7a

Please sign in to comment.