Skip to content

Commit 49faf10

Browse files
committed
Add comment for struct_ops
Signed-off-by: shun159 <[email protected]>
1 parent 100a8a2 commit 49faf10

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

map.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,9 @@ func (spec *MapSpec) createMap(inner *sys.FD, c *btf.Cache) (_ *Map, err error)
590590
attr.ValueTypeBtfObjFd = int32(module.FD())
591591
}
592592

593-
// TODO: This is required to make the map load, but doesn't make
594-
// much sense. BtfFd mustn't be 0 either.
593+
// This is because when specifying the value type of
594+
// a StructOps for BtfVmlinuxValueTypeId, the key/value type IDs cannot be used together.
595+
// they must be explicitly set to 0.
595596
attr.BtfKeyTypeId = 0
596597
attr.BtfValueTypeId = 0
597598
}

0 commit comments

Comments
 (0)