From 97f4b019d87a073ff02a3ff8b08ada59aea6e688 Mon Sep 17 00:00:00 2001 From: Jiri Pirko Date: Mon, 21 Oct 2019 16:36:26 +0200 Subject: sys/linux: extend devlink for fixed pci handle Extend devlink to also work with fixed pci handle "pci/0000:00:10.0". Signed-off-by: Jiri Pirko --- sys/linux/gen/amd64.go | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'sys/linux/gen/amd64.go') diff --git a/sys/linux/gen/amd64.go b/sys/linux/gen/amd64.go index 612568515..c94d1906f 100644 --- a/sys/linux/gen/amd64.go +++ b/sys/linux/gen/amd64.go @@ -2720,23 +2720,31 @@ var structDescs_amd64 = []*KeyedStruct{ &ProcType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "proc", FldName: "id", TypeSize: 1}}, ValuesStart: 48, ValuesPerProc: 1}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "z", TypeSize: 1}}}, }}}, - {Key: StructKey{Name: "devlink_handle"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_handle", TypeSize: 32}, Fields: []Type{ + {Key: StructKey{Name: "devlink_handle"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_handle", IsVarlen: true}, Fields: []Type{ + &StructType{Key: StructKey{Name: "devlink_handle_nsim"}, FldName: "nsim"}, + &StructType{Key: StructKey{Name: "devlink_handle_pci"}, FldName: "pci"}, + }}}, + {Key: StructKey{Name: "devlink_handle_nsim"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_handle_nsim", TypeSize: 32}, Fields: []Type{ &StructType{Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_BUS_NAME, int16], string[\"netdevsim\"]]"}, FldName: "DEVLINK_ATTR_BUS_NAME"}, &StructType{Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_DEV_NAME, int16], devlink_devname]"}, FldName: "DEVLINK_ATTR_DEV_NAME"}, }, AlignAttr: 4}}, - {Key: StructKey{Name: "devlink_port_get"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_port_get", TypeSize: 40}, Fields: []Type{ + {Key: StructKey{Name: "devlink_handle_pci"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_handle_pci", TypeSize: 28}, Fields: []Type{ + &StructType{Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_BUS_NAME, int16], string[\"pci\"]]"}, FldName: "DEVLINK_ATTR_BUS_NAME"}, + &StructType{Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_DEV_NAME, int16], string[\"0000:00:10.0\"]]"}, FldName: "DEVLINK_ATTR_DEV_NAME"}, + }, AlignAttr: 4}}, + {Key: StructKey{Name: "devlink_port_get"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_port_get", IsVarlen: true}, Fields: []Type{ &StructType{Key: StructKey{Name: "devlink_port_handle"}, FldName: "port_handle"}, }, AlignAttr: 4}}, - {Key: StructKey{Name: "devlink_port_handle"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_port_handle", TypeSize: 40}, Fields: []Type{ - &StructType{Key: StructKey{Name: "devlink_handle"}, FldName: "port_handle"}, + {Key: StructKey{Name: "devlink_port_handle"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_port_handle", IsVarlen: true}, Fields: []Type{ + &UnionType{Key: StructKey{Name: "devlink_handle"}, FldName: "port_handle"}, &StructType{Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_PORT_INDEX, int16], int32[0:3]]"}, FldName: "DEVLINK_ATTR_PORT_INDEX"}, }, AlignAttr: 4}}, - {Key: StructKey{Name: "devlink_port_set"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_port_set", TypeSize: 48}, Fields: []Type{ + {Key: StructKey{Name: "devlink_port_set"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_port_set", IsVarlen: true}, Fields: []Type{ &StructType{Key: StructKey{Name: "devlink_port_handle"}, FldName: "port_handle"}, &StructType{Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_PORT_TYPE, int16], int16[DEVLINK_PORT_TYPE_NOTSET:DEVLINK_PORT_TYPE_IB]]"}, FldName: "DEVLINK_ATTR_PORT_TYPE"}, }, AlignAttr: 4}}, {Key: StructKey{Name: "devlink_reload"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_reload", IsVarlen: true}, Fields: []Type{ - &StructType{Key: StructKey{Name: "devlink_handle"}, FldName: "handle"}, + &UnionType{Key: StructKey{Name: "devlink_handle"}, FldName: "handle"}, &UnionType{Key: StructKey{Name: "devlink_reload_arg"}, FldName: "arg"}, }, AlignAttr: 4}}, {Key: StructKey{Name: "devlink_reload_arg"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "devlink_reload_arg", IsVarlen: true}, Fields: []Type{ @@ -14114,7 +14122,7 @@ var structDescs_amd64 = []*KeyedStruct{ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "seq", TypeSize: 4}}, Kind: 1, RangeBegin: 7388453, RangeEnd: 7388461}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "pid", TypeSize: 4}}, Kind: 1, RangeBegin: 635427835, RangeEnd: 635427839}, &StructType{Key: StructKey{Name: "genlmsghdr_t[DEVLINK_CMD_GET]"}, FldName: "payload"}, - &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "attrs", IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "devlink_handle"}}}, + &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "attrs", IsVarlen: true}, Type: &UnionType{Key: StructKey{Name: "devlink_handle"}}}, }, AlignAttr: 4}}, {Key: StructKey{Name: "netlink_msg_t[genl_devlink_family_id, genlmsghdr_t[DEVLINK_CMD_PORT_GET], devlink_port_get]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "netlink_msg_t[genl_devlink_family_id, genlmsghdr_t[DEVLINK_CMD_PORT_GET], devlink_port_get]", IsVarlen: true}, Fields: []Type{ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 4}}, Path: []string{"parent"}}, @@ -15020,12 +15028,23 @@ var structDescs_amd64 = []*KeyedStruct{ &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "payload", TypeSize: 10}, Kind: 2, Values: []string{"netdevsim\x00"}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 2}}, IsPad: true}, }, AlignAttr: 4}}, + {Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_BUS_NAME, int16], string[\"pci\"]]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "nlattr_t[const[DEVLINK_ATTR_BUS_NAME, int16], string[\"pci\"]]", TypeSize: 8}, Fields: []Type{ + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "nla_len", TypeSize: 2}}, Path: []string{"parent"}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "nla_type", TypeSize: 2}}, Val: 1}, + &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "payload", TypeSize: 4}, Kind: 2, Values: []string{"pci\x00"}}, + }, AlignAttr: 4}}, {Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_DEV_NAME, int16], devlink_devname]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "nlattr_t[const[DEVLINK_ATTR_DEV_NAME, int16], devlink_devname]", TypeSize: 16}, Fields: []Type{ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "nla_len", TypeSize: 2}}, Path: []string{"parent"}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "nla_type", TypeSize: 2}}, Val: 2}, &StructType{Key: StructKey{Name: "devlink_devname"}, FldName: "payload"}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 1}}, IsPad: true}, }, AlignAttr: 4}}, + {Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_DEV_NAME, int16], string[\"0000:00:10.0\"]]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "nlattr_t[const[DEVLINK_ATTR_DEV_NAME, int16], string[\"0000:00:10.0\"]]", TypeSize: 20}, Fields: []Type{ + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "nla_len", TypeSize: 2}}, Path: []string{"parent"}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "nla_type", TypeSize: 2}}, Val: 2}, + &BufferType{TypeCommon: TypeCommon{TypeName: "string", FldName: "payload", TypeSize: 13}, Kind: 2, Values: []string{"0000:00:10.0\x00"}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true}, + }, AlignAttr: 4}}, {Key: StructKey{Name: "nlattr_t[const[DEVLINK_ATTR_NETNS_FD, int16], fd_namespace]"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "nlattr_t[const[DEVLINK_ATTR_NETNS_FD, int16], fd_namespace]", TypeSize: 8}, Fields: []Type{ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "nla_len", TypeSize: 2}}, Path: []string{"parent"}}, &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "nla_type", TypeSize: 2}}, Val: 137}, @@ -56164,4 +56183,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "a093d5e1569dd464483bfd4d6bfa7543f16bbd5c" +const revision_amd64 = "50b907b28392ade8f795f8f88990d3cb84ab2ef5" -- cgit mrf-deployment