Skip to content

Commit 53da048

Browse files
author
Zhou Hao
committed
generate: add linux-intelRdt-l3CacheSchema option
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
1 parent 1b3d6bd commit 53da048

5 files changed

Lines changed: 22 additions & 0 deletions

File tree

cmd/oci-runtime-tool/generate.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ var generateFlags = []cli.Flag{
5151
cli.StringSliceFlag{Name: "linux-gidmappings", Usage: "add GIDMappings e.g HostID:ContainerID:Size"},
5252
cli.StringSliceFlag{Name: "linux-hugepage-limits-add", Usage: "add hugepage resource limits"},
5353
cli.StringSliceFlag{Name: "linux-hugepage-limits-drop", Usage: "drop hugepage resource limits"},
54+
cli.StringFlag{Name: "linux-intelRdt-l3CacheSchema", Usage: "specifies the schema for L3 cache id and capacity bitmask"},
5455
cli.StringSliceFlag{Name: "linux-masked-paths", Usage: "specifies paths can not be read inside container"},
5556
cli.Uint64Flag{Name: "linux-mem-kernel-limit", Usage: "kernel memory limit (in bytes)"},
5657
cli.Uint64Flag{Name: "linux-mem-kernel-tcp", Usage: "kernel memory limit for tcp (in bytes)"},
@@ -652,6 +653,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
652653
}
653654
}
654655

656+
if context.IsSet("linux-intelRdt-l3CacheSchema") {
657+
g.SetLinuxIntelRdtL3CacheSchema(context.String("linux-intelRdt-l3CacheSchema"))
658+
}
659+
655660
if context.IsSet("linux-mems") {
656661
g.SetLinuxResourcesCPUMems(context.String("linux-mems"))
657662
}

completions/bash/oci-runtime-tool

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ _oci-runtime-tool_generate() {
331331
--linux-gidmappings
332332
--linux-hugepage-limits-add
333333
--linux-hugepage-limits-drop
334+
--linux-intelRdt-l3CacheSchema
334335
--linux-masked-paths
335336
--linux-mem-kernel-limit
336337
--linux-mem-kernel-tcp

generate/generate.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,12 @@ func (g *Generator) SetLinuxCgroupsPath(path string) {
492492
g.spec.Linux.CgroupsPath = path
493493
}
494494

495+
// SetLinuxIntelRdtL3CacheSchema sets g.spec.Linux.IntelRdt.L3CacheSchema
496+
func (g *Generator) SetLinuxIntelRdtL3CacheSchema(schema string) {
497+
g.initSpecLinuxIntelRdt()
498+
g.spec.Linux.IntelRdt.L3CacheSchema = schema
499+
}
500+
495501
// SetLinuxMountLabel sets g.spec.Linux.MountLabel.
496502
func (g *Generator) SetLinuxMountLabel(label string) {
497503
g.initSpecLinux()

generate/spec.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ func (g *Generator) initSpecLinux() {
5959
}
6060
}
6161

62+
func (g *Generator) initSpecLinuxIntelRdt() {
63+
g.initSpecLinux()
64+
if g.spec.Linux.IntelRdt == nil {
65+
g.spec.Linux.IntelRdt = &rspec.LinuxIntelRdt{}
66+
}
67+
}
68+
6269
func (g *Generator) initSpecLinuxSysctl() {
6370
g.initSpecLinux()
6471
if g.spec.Linux.Sysctl == nil {

man/oci-runtime-tool-generate.1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ read the configuration from `config.json`.
191191
Drop hugepage rsource limits. Just need to specify PAGESIZE. e.g. --linux-hugepage-limits-drop=4MB
192192
This option can be specified multiple times.
193193

194+
**--linux-intelRdt-l3CacheSchema**=""
195+
Specifies the schema for L3 cache id and capacity bitmask.
196+
194197
**--linux-masked-paths**=[]
195198
Specifies paths can not be read inside container. e.g. --linux-masked-paths=/proc/kcore
196199
This option can be specified multiple times.

0 commit comments

Comments
 (0)