Skip to content

Commit

Permalink
nvproxy: Clean up struct field tags.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 708532738
  • Loading branch information
ayushr2 authored and gvisor-bot committed Dec 21, 2024
1 parent 0f8db9f commit 3baec23
Show file tree
Hide file tree
Showing 13 changed files with 567 additions and 604 deletions.
56 changes: 28 additions & 28 deletions pkg/abi/nvgpu/classes.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ const (
//
// +marshal
type NV2081_ALLOC_PARAMETERS struct {
Reserved uint32 `nvproxy:"same"`
Reserved uint32
}

// NV0005_ALLOC_PARAMETERS is the alloc params type for NV01_EVENT* classes
// from src/common/sdk/nvidia/inc/class/cl0005.h.
//
// +marshal
type NV0005_ALLOC_PARAMETERS struct {
HParentClient Handle `nvproxy:"same"`
HParentClient Handle
HSrcResource Handle
HClass ClassID
NotifyIndex uint32
Expand All @@ -118,7 +118,7 @@ const (
//
// +marshal
type NV_MEMORY_VIRTUAL_ALLOCATION_PARAMS struct {
Offset uint64 `nvproxy:"same"`
Offset uint64
Limit uint64
HVASpace Handle
Pad0 [4]byte
Expand All @@ -129,7 +129,7 @@ type NV_MEMORY_VIRTUAL_ALLOCATION_PARAMS struct {
//
// +marshal
type NV0080_ALLOC_PARAMETERS struct {
DeviceID uint32 `nvproxy:"same"`
DeviceID uint32
HClientShare Handle
HTargetClient Handle
HTargetDevice Handle
Expand All @@ -147,15 +147,15 @@ type NV0080_ALLOC_PARAMETERS struct {
//
// +marshal
type NV2080_ALLOC_PARAMETERS struct {
SubDeviceID uint32 `nvproxy:"same"`
SubDeviceID uint32
}

// NV_MEMORY_ALLOCATION_PARAMS is the alloc params type for various NV*_MEMORY*
// allocation classes, from src/common/sdk/nvidia/inc/nvos.h.
//
// +marshal
type NV_MEMORY_ALLOCATION_PARAMS struct {
Owner uint32 `nvproxy:"same"`
Owner uint32
Type uint32
Flags uint32
Width uint32
Expand Down Expand Up @@ -185,16 +185,16 @@ type NV_MEMORY_ALLOCATION_PARAMS struct {
//
// +marshal
type NV_MEMORY_ALLOCATION_PARAMS_V545 struct {
NV_MEMORY_ALLOCATION_PARAMS `nvproxy:"NV_MEMORY_ALLOCATION_PARAMS"`
NumaNode int32
_ uint32
NV_MEMORY_ALLOCATION_PARAMS
NumaNode int32
_ uint32
}

// NV503B_BAR1_P2P_DMA_INFO from src/common/sdk/nvidia/inc/class/cl503b.h.
//
// +marshal
type NV503B_BAR1_P2P_DMA_INFO struct {
DmaAddress uint64 `nvproxy:"same"`
DmaAddress uint64
DmaSize uint64
}

Expand All @@ -203,7 +203,7 @@ type NV503B_BAR1_P2P_DMA_INFO struct {
//
// +marshal
type NV503B_ALLOC_PARAMETERS struct {
HSubDevice Handle `nvproxy:"same"`
HSubDevice Handle
HPeerSubDevice Handle
SubDevicePeerIDMask uint32
PeerSubDevicePeerIDMask uint32
Expand All @@ -221,15 +221,15 @@ type NV503B_ALLOC_PARAMETERS struct {
//
// +marshal
type NV503C_ALLOC_PARAMETERS struct {
Flags uint32 `nvproxy:"same"`
Flags uint32
}

// NV83DE_ALLOC_PARAMETERS is the alloc params type for GT200_DEBUGGER,
// from src/common/sdk/nvidia/inc/class/cl83de.h.
//
// +marshal
type NV83DE_ALLOC_PARAMETERS struct {
HDebuggerClient_Obsolete Handle `nvproxy:"same"`
HDebuggerClient_Obsolete Handle
HAppClient Handle
HClass3DObject Handle
}
Expand All @@ -239,7 +239,7 @@ type NV83DE_ALLOC_PARAMETERS struct {
//
// +marshal
type NV_CTXSHARE_ALLOCATION_PARAMETERS struct {
HVASpace Handle `nvproxy:"same"`
HVASpace Handle
Flags uint32
SubctxID uint32
}
Expand All @@ -249,7 +249,7 @@ type NV_CTXSHARE_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV_VASPACE_ALLOCATION_PARAMETERS struct {
Index uint32 `nvproxy:"same"`
Index uint32
Flags uint32
VASize uint64
VAStartInternal uint64
Expand All @@ -264,7 +264,7 @@ type NV_VASPACE_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS struct {
HObjectError Handle `nvproxy:"same"`
HObjectError Handle
HObjectECCError Handle
HVASpace Handle
EngineType uint32
Expand All @@ -277,7 +277,7 @@ type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV_MEMORY_DESC_PARAMS struct {
Base uint64 `nvproxy:"same"`
Base uint64
Size uint64
AddressSpace uint32
CacheAttrib uint32
Expand All @@ -289,7 +289,7 @@ type NV_MEMORY_DESC_PARAMS struct {
//
// +marshal
type NV_CHANNEL_ALLOC_PARAMS struct {
HObjectError Handle `nvproxy:"same"`
HObjectError Handle
HObjectBuffer Handle
GPFIFOOffset uint64
GPFIFOEntries uint32
Expand Down Expand Up @@ -323,7 +323,7 @@ type NV_CHANNEL_ALLOC_PARAMS struct {
//
// +marshal
type NVB0B5_ALLOCATION_PARAMETERS struct {
Version uint32 `nvproxy:"same"`
Version uint32
EngineType uint32
}

Expand All @@ -332,7 +332,7 @@ type NVB0B5_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV_GR_ALLOCATION_PARAMETERS struct {
Version uint32 `nvproxy:"same"`
Version uint32
Flags uint32
Size uint32
Caps uint32
Expand All @@ -343,7 +343,7 @@ type NV_GR_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV_HOPPER_USERMODE_A_PARAMS struct {
Bar1Mapping uint8 `nvproxy:"same"`
Bar1Mapping uint8
Priv uint8
}

Expand All @@ -352,7 +352,7 @@ type NV_HOPPER_USERMODE_A_PARAMS struct {
//
// +marshal
type NV9072_ALLOCATION_PARAMETERS struct {
LogicalHeadID uint32 `nvproxy:"same"`
LogicalHeadID uint32
DisplayMask uint32
Caps uint32
}
Expand All @@ -362,15 +362,15 @@ type NV9072_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV00DE_ALLOC_PARAMETERS struct {
Reserved uint32 `nvproxy:"same"`
Reserved uint32
}

// NV00DE_ALLOC_PARAMETERS_V545 is the updated version of
// NV00DE_ALLOC_PARAMETERS since 545.23.06.
//
// +marshal
type NV00DE_ALLOC_PARAMETERS_V545 struct {
PolledDataMask uint64 `nvproxy:"NV00DE_ALLOC_PARAMETERS"`
PolledDataMask uint64
}

// +marshal
Expand All @@ -385,7 +385,7 @@ type nv00f8Map struct {
//
// +marshal
type NV00F8_ALLOCATION_PARAMETERS struct {
Alignment uint64 `nvproxy:"same"`
Alignment uint64
AllocSize uint64
PageSize uint64
AllocFlags uint32
Expand All @@ -412,7 +412,7 @@ type NV_EXPORT_MEM_PACKET struct {
//
// +marshal
type NV00FD_ALLOCATION_PARAMETERS struct {
Alignment uint64 `nvproxy:"same"`
Alignment uint64
AllocSize uint64
PageSize uint32
AllocFlags uint32
Expand All @@ -426,7 +426,7 @@ type NV00FD_ALLOCATION_PARAMETERS struct {
//
// +marshal
type NV00FD_ALLOCATION_PARAMETERS_V545 struct {
ExpPacket NV_EXPORT_MEM_PACKET `nvproxy:"NV00FD_ALLOCATION_PARAMETERS"`
ExpPacket NV_EXPORT_MEM_PACKET
Index uint16
_ [6]byte
NV00FD_ALLOCATION_PARAMETERS
Expand All @@ -437,5 +437,5 @@ type NV00FD_ALLOCATION_PARAMETERS_V545 struct {
//
// +marshal
type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS struct {
Handle Handle `nvproxy:"same"`
Handle Handle
}
32 changes: 16 additions & 16 deletions pkg/abi/nvgpu/ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const (
//
// +marshal
type NV0000_CTRL_GPU_GET_ID_INFO_PARAMS struct {
GpuID uint32 `nvproxy:"same"`
GpuID uint32
GpuFlags uint32
DeviceInstance uint32
SubDeviceInstance uint32
Expand Down Expand Up @@ -120,7 +120,7 @@ const (
//
// +marshal
type NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS struct {
GpuIDs [NV0000_CTRL_SYSTEM_MAX_ATTACHED_GPUS]uint32 `nvproxy:"same"`
GpuIDs [NV0000_CTRL_SYSTEM_MAX_ATTACHED_GPUS]uint32
GpuCount uint32
P2PCaps uint32
P2POptimalReadCEs uint32
Expand All @@ -135,8 +135,8 @@ type NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS struct {
//
// +marshal
type NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS_V550 struct {
NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS `nvproxy:"NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS"`
BusEgmPeerIDs P64
NV0000_CTRL_SYSTEM_GET_P2P_CAPS_PARAMS
BusEgmPeerIDs P64
}

// From src/common/sdk/nvidia/inc/ctrl/ctrl0000/ctrl0000unix.h:
Expand All @@ -149,7 +149,7 @@ const (

// +marshal
type NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS struct {
FD int32 `nvproxy:"same"`
FD int32
DeviceInstance uint32
MaxObjects uint16
Metadata [NV0000_OS_UNIX_EXPORT_OBJECT_FD_BUFFER_SIZE]uint8
Expand All @@ -168,7 +168,7 @@ func (p *NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS) SetFrontendFD(fd int

// +marshal
type NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS_V545 struct {
FD int32 `nvproxy:"NV0000_CTRL_OS_UNIX_GET_EXPORT_OBJECT_INFO_PARAMS"`
FD int32
DeviceInstance uint32
GpuInstanceID uint32
MaxObjects uint16
Expand All @@ -194,7 +194,7 @@ type NV0000_CTRL_OS_UNIX_EXPORT_OBJECT struct {

// +marshal
type NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS struct {
Object NV0000_CTRL_OS_UNIX_EXPORT_OBJECT `nvproxy:"same"`
Object NV0000_CTRL_OS_UNIX_EXPORT_OBJECT
FD int32
Flags uint32
}
Expand All @@ -211,7 +211,7 @@ func (p *NV0000_CTRL_OS_UNIX_EXPORT_OBJECT_TO_FD_PARAMS) SetFrontendFD(fd int32)

// +marshal
type NV0000_CTRL_OS_UNIX_IMPORT_OBJECT_FROM_FD_PARAMS struct {
FD int32 `nvproxy:"same"`
FD int32
Object NV0000_CTRL_OS_UNIX_EXPORT_OBJECT
}

Expand All @@ -227,7 +227,7 @@ func (p *NV0000_CTRL_OS_UNIX_IMPORT_OBJECT_FROM_FD_PARAMS) SetFrontendFD(fd int3

// +marshal
type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS struct {
SizeOfStrings uint32 `nvproxy:"same"`
SizeOfStrings uint32
Pad [4]byte
PDriverVersionBuffer P64
PVersionBuffer P64
Expand Down Expand Up @@ -262,7 +262,7 @@ const (

// +marshal
type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS struct {
NumChannels uint32 `nvproxy:"same"`
NumChannels uint32
Pad [4]byte
PChannelHandleList P64
PChannelList P64
Expand Down Expand Up @@ -309,7 +309,7 @@ type NV0080_CTRL_GET_CAPS_PARAMS struct {

// +marshal
type NV0080_CTRL_GR_ROUTE_INFO struct {
Flags uint32 `nvproxy:"same"`
Flags uint32
Pad [4]byte
Route uint64
}
Expand Down Expand Up @@ -377,7 +377,7 @@ const (

// +marshal
type NV00FD_CTRL_ATTACH_GPU_PARAMS struct {
HSubDevice Handle `nvproxy:"same"`
HSubDevice Handle
Flags uint32
DevDescriptor uint64
}
Expand Down Expand Up @@ -431,7 +431,7 @@ const (

// +marshal
type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS struct {
BDisable uint8 `nvproxy:"same"`
BDisable uint8
Pad1 [3]byte
NumChannels uint32
BOnlyDisableScheduling uint8
Expand Down Expand Up @@ -495,8 +495,8 @@ const (

// +marshal
type NV2080_CTRL_GR_GET_INFO_PARAMS struct {
NvxxxCtrlXxxGetInfoParams `nvproxy:"same"`
GRRouteInfo NV0080_CTRL_GR_ROUTE_INFO
NvxxxCtrlXxxGetInfoParams
GRRouteInfo NV0080_CTRL_GR_ROUTE_INFO
}

// ListSize implements HasCtrlInfoList.ListSize.
Expand Down Expand Up @@ -555,7 +555,7 @@ const (

// +marshal
type NV503C_CTRL_REGISTER_VA_SPACE_PARAMS struct {
HVASpace Handle `nvproxy:"same"`
HVASpace Handle
Pad [4]byte
VASpaceToken uint64
}
Expand Down
Loading

0 comments on commit 3baec23

Please sign in to comment.