1 #ifndef _G_THIRD_PARTY_P2P_NVOC_H_ 2 #define _G_THIRD_PARTY_P2P_NVOC_H_ 3 #include "nvoc/runtime.h" 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 /* 10 * SPDX-FileCopyrightText: Copyright (c) 2009-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 11 * SPDX-License-Identifier: MIT 12 * 13 * Permission is hereby granted, free of charge, to any person obtaining a 14 * copy of this software and associated documentation files (the "Software"), 15 * to deal in the Software without restriction, including without limitation 16 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 17 * and/or sell copies of the Software, and to permit persons to whom the 18 * Software is furnished to do so, subject to the following conditions: 19 * 20 * The above copyright notice and this permission notice shall be included in 21 * all copies or substantial portions of the Software. 22 * 23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 29 * DEALINGS IN THE SOFTWARE. 30 */ 31 32 #include "g_third_party_p2p_nvoc.h" 33 34 #ifndef _THIRD_PARTY_P2P_H_ 35 #define _THIRD_PARTY_P2P_H_ 36 37 #include "rmapi/client.h" 38 #include "gpu/mem_mgr/mem_desc.h" 39 #include "gpu/gpu_resource.h" 40 41 #include <ctrl/ctrl503c.h> 42 43 struct Subdevice; 44 45 #ifndef __NVOC_CLASS_Subdevice_TYPEDEF__ 46 #define __NVOC_CLASS_Subdevice_TYPEDEF__ 47 typedef struct Subdevice Subdevice; 48 #endif /* __NVOC_CLASS_Subdevice_TYPEDEF__ */ 49 50 #ifndef __nvoc_class_id_Subdevice 51 #define __nvoc_class_id_Subdevice 0x4b01b3 52 #endif /* __nvoc_class_id_Subdevice */ 53 54 55 struct Memory; 56 57 #ifndef __NVOC_CLASS_Memory_TYPEDEF__ 58 #define __NVOC_CLASS_Memory_TYPEDEF__ 59 typedef struct Memory Memory; 60 #endif /* __NVOC_CLASS_Memory_TYPEDEF__ */ 61 62 #ifndef __nvoc_class_id_Memory 63 #define __nvoc_class_id_Memory 0x4789f2 64 #endif /* __nvoc_class_id_Memory */ 65 66 67 68 #define CLI_THIRD_PARTY_P2P_FLAGS_INITIALIZED NVBIT(0) 69 70 #define CLI_THIRD_PARTY_P2P_MAX_CLIENT 256 71 72 // 73 // CUDA tools has requested that the third-party P2P code reserve at least 74 // 32MB of BAR1 address space for RM clients. Pad this reservation by 75 // 4MB to account for miscellaneous RM mappings. 76 // 77 #define CLI_THIRD_PARTY_P2P_BAR1_RESERVE (36 << 20) 78 79 // **************************************************************************** 80 // Type definitions 81 // **************************************************************************** 82 83 // 84 // third-party p2p support types 85 // 86 struct _def_client_third_party_p2p_vaspace_info 87 { 88 NvHandle hClient; 89 NvHandle hThirdPartyP2P; 90 NvHandle hVASpace; 91 NvU32 vaSpaceToken; 92 }; 93 typedef struct _def_client_third_party_p2p_vaspace_info CLI_THIRD_PARTY_P2P_VASPACE_INFO, *PCLI_THIRD_PARTY_P2P_VASPACE_INFO; 94 95 MAKE_MAP(CLI_THIRD_PARTY_P2P_VASPACE_INFO_MAP, CLI_THIRD_PARTY_P2P_VASPACE_INFO); 96 97 typedef void (THIRD_PARTY_P2P_VIDMEM_FREE_CALLBACK)(void *); 98 99 struct _def_client_third_party_p2p_mapping_info 100 { 101 NODE Node; 102 THIRD_PARTY_P2P_VIDMEM_FREE_CALLBACK *pFreeCallback; 103 void *pData; 104 105 // Address and length describe a subrange of the parent vidmem info address range 106 NvU64 address; 107 NvU64 length; 108 109 struct _def_client_third_party_p2p_mapping_extent_info *pStart; 110 }; 111 typedef struct _def_client_third_party_p2p_mapping_info CLI_THIRD_PARTY_P2P_MAPPING_INFO, *PCLI_THIRD_PARTY_P2P_MAPPING_INFO; 112 113 struct _def_client_third_party_p2p_mapping_extent_info 114 { 115 // Address and length describe a subrange of the parent vidmem info address range 116 NvU64 address; 117 NvU64 length; 118 119 NvU64 fbApertureOffset; 120 PMEMORY_DESCRIPTOR pMemDesc; 121 NvU32 refCount; 122 ListNode listNode; // Node in the list. 123 }; 124 typedef struct _def_client_third_party_p2p_mapping_extent_info CLI_THIRD_PARTY_P2P_MAPPING_EXTENT_INFO, *PCLI_THIRD_PARTY_P2P_MAPPING_EXTENT_INFO; 125 126 MAKE_INTRUSIVE_LIST(CLI_THIRD_PARTY_P2P_MAPPING_EXTENT_INFO_LIST, CLI_THIRD_PARTY_P2P_MAPPING_EXTENT_INFO, listNode); 127 128 struct _def_client_third_party_p2p_vidmem_info 129 { 130 NvHandle hClient; 131 NvHandle hThirdPartyP2P; 132 NvHandle hMemory; 133 134 // 135 // A node in the PCLI_THIRD_PARTY_P2P_INFO::pAddressRangeTree btree tracking 136 // the address range registered for this vidmem allocation. 137 // 138 // Notably the address ranges come from the user and are not enforced to 139 // be mapped in any GPU VA space. It's up to the user to pick them and they 140 // are used purely for exposing the registered vidmem allocations through 141 // the third-party P2P APIs at the specified ranges. See documentation of 142 // NV503C_CTRL_CMD_REGISTER_VIDMEM for more details. 143 // 144 // Commonly clients will map the allocation at the same address as it's 145 // registered with for third-party P2P and the third-party P2P APIs still 146 // call the address parameter a virtual address, but the implementation 147 // refers to them just as addresses to make it clear they are not enforced 148 // to be actually mapped. 149 // 150 // Notably in the past the addresses have been indeed looked up in the GPU 151 // VA spaces directly, but that became challenging with the introduction of 152 // externally managed VA spaces and now it's up to the clients to register 153 // them explicitly. 154 // 155 NODE addressRangeNode; 156 MapNode mapNode; 157 // Offset at which the address range starts in the vidmem allocation. 158 NvU64 offset; 159 160 // VidmemInfo ID used for persistent mappings 161 NvU64 id; 162 163 PMEMORY_DESCRIPTOR pMemDesc; 164 PNODE pMappingInfoList; 165 CLI_THIRD_PARTY_P2P_MAPPING_EXTENT_INFO_LIST mappingExtentList; 166 }; 167 typedef struct _def_client_third_party_p2p_vidmem_info CLI_THIRD_PARTY_P2P_VIDMEM_INFO, *PCLI_THIRD_PARTY_P2P_VIDMEM_INFO; 168 169 MAKE_INTRUSIVE_MAP(CLI_THIRD_PARTY_P2P_VIDMEM_INFO_MAP, CLI_THIRD_PARTY_P2P_VIDMEM_INFO, mapNode); 170 171 typedef void (THIRD_PARTY_P2P_DESTROY_CALLBACK)(void *); 172 173 enum _def_client_third_party_p2p_type 174 { 175 CLI_THIRD_PARTY_P2P_TYPE_PROPRIETARY, 176 CLI_THIRD_PARTY_P2P_TYPE_BAR1, 177 CLI_THIRD_PARTY_P2P_TYPE_NVLINK 178 }; 179 typedef enum _def_client_third_party_p2p_type CLI_THIRD_PARTY_P2P_TYPE; 180 181 struct _def_client_third_party_p2p_pid_client_mapping_info 182 { 183 NvU32 pid; 184 NvHandle hClient; 185 }; 186 typedef struct _def_client_third_party_p2p_pid_client_mapping_info CLI_THIRD_PARTY_P2P_PID_CLIENT_INFO, *PCLI_THIRD_PARTY_P2P_PID_CLIENT_INFO; 187 188 struct ThirdPartyP2P; 189 190 #ifndef __NVOC_CLASS_ThirdPartyP2P_TYPEDEF__ 191 #define __NVOC_CLASS_ThirdPartyP2P_TYPEDEF__ 192 typedef struct ThirdPartyP2P ThirdPartyP2P; 193 #endif /* __NVOC_CLASS_ThirdPartyP2P_TYPEDEF__ */ 194 195 #ifndef __nvoc_class_id_ThirdPartyP2P 196 #define __nvoc_class_id_ThirdPartyP2P 0x34d08b 197 #endif /* __nvoc_class_id_ThirdPartyP2P */ 198 199 200 #ifdef NVOC_THIRD_PARTY_P2P_H_PRIVATE_ACCESS_ALLOWED 201 #define PRIVATE_FIELD(x) x 202 #else 203 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x) 204 #endif 205 struct P2PTokenShare { 206 const struct NVOC_RTTI *__nvoc_rtti; 207 struct RsShared __nvoc_base_RsShared; 208 struct Object *__nvoc_pbase_Object; 209 struct RsShared *__nvoc_pbase_RsShared; 210 struct P2PTokenShare *__nvoc_pbase_P2PTokenShare; 211 struct ThirdPartyP2P *pThirdPartyP2P; 212 }; 213 214 #ifndef __NVOC_CLASS_P2PTokenShare_TYPEDEF__ 215 #define __NVOC_CLASS_P2PTokenShare_TYPEDEF__ 216 typedef struct P2PTokenShare P2PTokenShare; 217 #endif /* __NVOC_CLASS_P2PTokenShare_TYPEDEF__ */ 218 219 #ifndef __nvoc_class_id_P2PTokenShare 220 #define __nvoc_class_id_P2PTokenShare 0x3e3a6a 221 #endif /* __nvoc_class_id_P2PTokenShare */ 222 223 extern const struct NVOC_CLASS_DEF __nvoc_class_def_P2PTokenShare; 224 225 #define __staticCast_P2PTokenShare(pThis) \ 226 ((pThis)->__nvoc_pbase_P2PTokenShare) 227 228 #ifdef __nvoc_third_party_p2p_h_disabled 229 #define __dynamicCast_P2PTokenShare(pThis) ((P2PTokenShare*)NULL) 230 #else //__nvoc_third_party_p2p_h_disabled 231 #define __dynamicCast_P2PTokenShare(pThis) \ 232 ((P2PTokenShare*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(P2PTokenShare))) 233 #endif //__nvoc_third_party_p2p_h_disabled 234 235 236 NV_STATUS __nvoc_objCreateDynamic_P2PTokenShare(P2PTokenShare**, Dynamic*, NvU32, va_list); 237 238 NV_STATUS __nvoc_objCreate_P2PTokenShare(P2PTokenShare**, Dynamic*, NvU32); 239 #define __objCreate_P2PTokenShare(ppNewObj, pParent, createFlags) \ 240 __nvoc_objCreate_P2PTokenShare((ppNewObj), staticCast((pParent), Dynamic), (createFlags)) 241 242 NV_STATUS shrp2pConstruct_IMPL(struct P2PTokenShare *arg_pP2PTokenShare); 243 244 #define __nvoc_shrp2pConstruct(arg_pP2PTokenShare) shrp2pConstruct_IMPL(arg_pP2PTokenShare) 245 void shrp2pDestruct_IMPL(struct P2PTokenShare *pP2PTokenShare); 246 247 #define __nvoc_shrp2pDestruct(pP2PTokenShare) shrp2pDestruct_IMPL(pP2PTokenShare) 248 #undef PRIVATE_FIELD 249 250 251 #ifdef NVOC_THIRD_PARTY_P2P_H_PRIVATE_ACCESS_ALLOWED 252 #define PRIVATE_FIELD(x) x 253 #else 254 #define PRIVATE_FIELD(x) NVOC_PRIVATE_FIELD(x) 255 #endif 256 struct ThirdPartyP2P { 257 const struct NVOC_RTTI *__nvoc_rtti; 258 struct GpuResource __nvoc_base_GpuResource; 259 struct Object *__nvoc_pbase_Object; 260 struct RsResource *__nvoc_pbase_RsResource; 261 struct RmResourceCommon *__nvoc_pbase_RmResourceCommon; 262 struct RmResource *__nvoc_pbase_RmResource; 263 struct GpuResource *__nvoc_pbase_GpuResource; 264 struct ThirdPartyP2P *__nvoc_pbase_ThirdPartyP2P; 265 NV_STATUS (*__thirdpartyp2pCtrlCmdRegisterVaSpace__)(struct ThirdPartyP2P *, NV503C_CTRL_REGISTER_VA_SPACE_PARAMS *); 266 NV_STATUS (*__thirdpartyp2pCtrlCmdUnregisterVaSpace__)(struct ThirdPartyP2P *, NV503C_CTRL_UNREGISTER_VA_SPACE_PARAMS *); 267 NV_STATUS (*__thirdpartyp2pCtrlCmdRegisterVidmem__)(struct ThirdPartyP2P *, NV503C_CTRL_REGISTER_VIDMEM_PARAMS *); 268 NV_STATUS (*__thirdpartyp2pCtrlCmdUnregisterVidmem__)(struct ThirdPartyP2P *, NV503C_CTRL_UNREGISTER_VIDMEM_PARAMS *); 269 NV_STATUS (*__thirdpartyp2pCtrlCmdRegisterPid__)(struct ThirdPartyP2P *, NV503C_CTRL_REGISTER_PID_PARAMS *); 270 NvBool (*__thirdpartyp2pShareCallback__)(struct ThirdPartyP2P *, struct RsClient *, struct RsResourceRef *, RS_SHARE_POLICY *); 271 NV_STATUS (*__thirdpartyp2pCheckMemInterUnmap__)(struct ThirdPartyP2P *, NvBool); 272 NV_STATUS (*__thirdpartyp2pMapTo__)(struct ThirdPartyP2P *, RS_RES_MAP_TO_PARAMS *); 273 NV_STATUS (*__thirdpartyp2pGetMapAddrSpace__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, NvU32, NV_ADDRESS_SPACE *); 274 NvU32 (*__thirdpartyp2pGetRefCount__)(struct ThirdPartyP2P *); 275 void (*__thirdpartyp2pAddAdditionalDependants__)(struct RsClient *, struct ThirdPartyP2P *, RsResourceRef *); 276 NV_STATUS (*__thirdpartyp2pControl_Prologue__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 277 NV_STATUS (*__thirdpartyp2pGetRegBaseOffsetAndSize__)(struct ThirdPartyP2P *, struct OBJGPU *, NvU32 *, NvU32 *); 278 NV_STATUS (*__thirdpartyp2pInternalControlForward__)(struct ThirdPartyP2P *, NvU32, void *, NvU32); 279 NV_STATUS (*__thirdpartyp2pUnmapFrom__)(struct ThirdPartyP2P *, RS_RES_UNMAP_FROM_PARAMS *); 280 void (*__thirdpartyp2pControl_Epilogue__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 281 NV_STATUS (*__thirdpartyp2pControlLookup__)(struct ThirdPartyP2P *, struct RS_RES_CONTROL_PARAMS_INTERNAL *, const struct NVOC_EXPORTED_METHOD_DEF **); 282 NvHandle (*__thirdpartyp2pGetInternalObjectHandle__)(struct ThirdPartyP2P *); 283 NV_STATUS (*__thirdpartyp2pControl__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 284 NV_STATUS (*__thirdpartyp2pUnmap__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RsCpuMapping *); 285 NV_STATUS (*__thirdpartyp2pGetMemInterMapParams__)(struct ThirdPartyP2P *, RMRES_MEM_INTER_MAP_PARAMS *); 286 NV_STATUS (*__thirdpartyp2pGetMemoryMappingDescriptor__)(struct ThirdPartyP2P *, struct MEMORY_DESCRIPTOR **); 287 NV_STATUS (*__thirdpartyp2pControlFilter__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 288 NV_STATUS (*__thirdpartyp2pControlSerialization_Prologue__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 289 NvBool (*__thirdpartyp2pCanCopy__)(struct ThirdPartyP2P *); 290 void (*__thirdpartyp2pPreDestruct__)(struct ThirdPartyP2P *); 291 NV_STATUS (*__thirdpartyp2pIsDuplicate__)(struct ThirdPartyP2P *, NvHandle, NvBool *); 292 void (*__thirdpartyp2pControlSerialization_Epilogue__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_RES_CONTROL_PARAMS_INTERNAL *); 293 NV_STATUS (*__thirdpartyp2pMap__)(struct ThirdPartyP2P *, struct CALL_CONTEXT *, struct RS_CPU_MAP_PARAMS *, struct RsCpuMapping *); 294 NvBool (*__thirdpartyp2pAccessCallback__)(struct ThirdPartyP2P *, struct RsClient *, void *, RsAccessRight); 295 NODE Node; 296 NvHandle hClient; 297 NvHandle hThirdPartyP2P; 298 CLI_THIRD_PARTY_P2P_TYPE type; 299 struct Subdevice *pSubdevice; 300 NvU32 peerIndex; 301 NvU32 flags; 302 NvU64 p2pToken; 303 CLI_THIRD_PARTY_P2P_PID_CLIENT_INFO pidClientList[256]; 304 CLI_THIRD_PARTY_P2P_VASPACE_INFO_MAP vaSpaceInfoMap; 305 THIRD_PARTY_P2P_DESTROY_CALLBACK *pDestroyCallback; 306 void *pData; 307 CLI_THIRD_PARTY_P2P_VIDMEM_INFO_MAP vidmemInfoMap; 308 struct P2PTokenShare *pTokenShare; 309 PNODE pAddressRangeTree; 310 }; 311 312 #ifndef __NVOC_CLASS_ThirdPartyP2P_TYPEDEF__ 313 #define __NVOC_CLASS_ThirdPartyP2P_TYPEDEF__ 314 typedef struct ThirdPartyP2P ThirdPartyP2P; 315 #endif /* __NVOC_CLASS_ThirdPartyP2P_TYPEDEF__ */ 316 317 #ifndef __nvoc_class_id_ThirdPartyP2P 318 #define __nvoc_class_id_ThirdPartyP2P 0x34d08b 319 #endif /* __nvoc_class_id_ThirdPartyP2P */ 320 321 extern const struct NVOC_CLASS_DEF __nvoc_class_def_ThirdPartyP2P; 322 323 #define __staticCast_ThirdPartyP2P(pThis) \ 324 ((pThis)->__nvoc_pbase_ThirdPartyP2P) 325 326 #ifdef __nvoc_third_party_p2p_h_disabled 327 #define __dynamicCast_ThirdPartyP2P(pThis) ((ThirdPartyP2P*)NULL) 328 #else //__nvoc_third_party_p2p_h_disabled 329 #define __dynamicCast_ThirdPartyP2P(pThis) \ 330 ((ThirdPartyP2P*)__nvoc_dynamicCast(staticCast((pThis), Dynamic), classInfo(ThirdPartyP2P))) 331 #endif //__nvoc_third_party_p2p_h_disabled 332 333 334 NV_STATUS __nvoc_objCreateDynamic_ThirdPartyP2P(ThirdPartyP2P**, Dynamic*, NvU32, va_list); 335 336 NV_STATUS __nvoc_objCreate_ThirdPartyP2P(ThirdPartyP2P**, Dynamic*, NvU32, struct CALL_CONTEXT * arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL * arg_pParams); 337 #define __objCreate_ThirdPartyP2P(ppNewObj, pParent, createFlags, arg_pCallContext, arg_pParams) \ 338 __nvoc_objCreate_ThirdPartyP2P((ppNewObj), staticCast((pParent), Dynamic), (createFlags), arg_pCallContext, arg_pParams) 339 340 #define thirdpartyp2pCtrlCmdRegisterVaSpace(pThirdPartyP2P, pRegisterVaSpaceParams) thirdpartyp2pCtrlCmdRegisterVaSpace_DISPATCH(pThirdPartyP2P, pRegisterVaSpaceParams) 341 #define thirdpartyp2pCtrlCmdUnregisterVaSpace(pThirdPartyP2P, pUnregisterVaSpaceParams) thirdpartyp2pCtrlCmdUnregisterVaSpace_DISPATCH(pThirdPartyP2P, pUnregisterVaSpaceParams) 342 #define thirdpartyp2pCtrlCmdRegisterVidmem(pThirdPartyP2P, pRegisterVidmemParams) thirdpartyp2pCtrlCmdRegisterVidmem_DISPATCH(pThirdPartyP2P, pRegisterVidmemParams) 343 #define thirdpartyp2pCtrlCmdUnregisterVidmem(pThirdPartyP2P, pUnregisterVidmemParams) thirdpartyp2pCtrlCmdUnregisterVidmem_DISPATCH(pThirdPartyP2P, pUnregisterVidmemParams) 344 #define thirdpartyp2pCtrlCmdRegisterPid(pThirdPartyP2P, pParams) thirdpartyp2pCtrlCmdRegisterPid_DISPATCH(pThirdPartyP2P, pParams) 345 #define thirdpartyp2pShareCallback(pGpuResource, pInvokingClient, pParentRef, pSharePolicy) thirdpartyp2pShareCallback_DISPATCH(pGpuResource, pInvokingClient, pParentRef, pSharePolicy) 346 #define thirdpartyp2pCheckMemInterUnmap(pRmResource, bSubdeviceHandleProvided) thirdpartyp2pCheckMemInterUnmap_DISPATCH(pRmResource, bSubdeviceHandleProvided) 347 #define thirdpartyp2pMapTo(pResource, pParams) thirdpartyp2pMapTo_DISPATCH(pResource, pParams) 348 #define thirdpartyp2pGetMapAddrSpace(pGpuResource, pCallContext, mapFlags, pAddrSpace) thirdpartyp2pGetMapAddrSpace_DISPATCH(pGpuResource, pCallContext, mapFlags, pAddrSpace) 349 #define thirdpartyp2pGetRefCount(pResource) thirdpartyp2pGetRefCount_DISPATCH(pResource) 350 #define thirdpartyp2pAddAdditionalDependants(pClient, pResource, pReference) thirdpartyp2pAddAdditionalDependants_DISPATCH(pClient, pResource, pReference) 351 #define thirdpartyp2pControl_Prologue(pResource, pCallContext, pParams) thirdpartyp2pControl_Prologue_DISPATCH(pResource, pCallContext, pParams) 352 #define thirdpartyp2pGetRegBaseOffsetAndSize(pGpuResource, pGpu, pOffset, pSize) thirdpartyp2pGetRegBaseOffsetAndSize_DISPATCH(pGpuResource, pGpu, pOffset, pSize) 353 #define thirdpartyp2pInternalControlForward(pGpuResource, command, pParams, size) thirdpartyp2pInternalControlForward_DISPATCH(pGpuResource, command, pParams, size) 354 #define thirdpartyp2pUnmapFrom(pResource, pParams) thirdpartyp2pUnmapFrom_DISPATCH(pResource, pParams) 355 #define thirdpartyp2pControl_Epilogue(pResource, pCallContext, pParams) thirdpartyp2pControl_Epilogue_DISPATCH(pResource, pCallContext, pParams) 356 #define thirdpartyp2pControlLookup(pResource, pParams, ppEntry) thirdpartyp2pControlLookup_DISPATCH(pResource, pParams, ppEntry) 357 #define thirdpartyp2pGetInternalObjectHandle(pGpuResource) thirdpartyp2pGetInternalObjectHandle_DISPATCH(pGpuResource) 358 #define thirdpartyp2pControl(pGpuResource, pCallContext, pParams) thirdpartyp2pControl_DISPATCH(pGpuResource, pCallContext, pParams) 359 #define thirdpartyp2pUnmap(pGpuResource, pCallContext, pCpuMapping) thirdpartyp2pUnmap_DISPATCH(pGpuResource, pCallContext, pCpuMapping) 360 #define thirdpartyp2pGetMemInterMapParams(pRmResource, pParams) thirdpartyp2pGetMemInterMapParams_DISPATCH(pRmResource, pParams) 361 #define thirdpartyp2pGetMemoryMappingDescriptor(pRmResource, ppMemDesc) thirdpartyp2pGetMemoryMappingDescriptor_DISPATCH(pRmResource, ppMemDesc) 362 #define thirdpartyp2pControlFilter(pResource, pCallContext, pParams) thirdpartyp2pControlFilter_DISPATCH(pResource, pCallContext, pParams) 363 #define thirdpartyp2pControlSerialization_Prologue(pResource, pCallContext, pParams) thirdpartyp2pControlSerialization_Prologue_DISPATCH(pResource, pCallContext, pParams) 364 #define thirdpartyp2pCanCopy(pResource) thirdpartyp2pCanCopy_DISPATCH(pResource) 365 #define thirdpartyp2pPreDestruct(pResource) thirdpartyp2pPreDestruct_DISPATCH(pResource) 366 #define thirdpartyp2pIsDuplicate(pResource, hMemory, pDuplicate) thirdpartyp2pIsDuplicate_DISPATCH(pResource, hMemory, pDuplicate) 367 #define thirdpartyp2pControlSerialization_Epilogue(pResource, pCallContext, pParams) thirdpartyp2pControlSerialization_Epilogue_DISPATCH(pResource, pCallContext, pParams) 368 #define thirdpartyp2pMap(pGpuResource, pCallContext, pParams, pCpuMapping) thirdpartyp2pMap_DISPATCH(pGpuResource, pCallContext, pParams, pCpuMapping) 369 #define thirdpartyp2pAccessCallback(pResource, pInvokingClient, pAllocParams, accessRight) thirdpartyp2pAccessCallback_DISPATCH(pResource, pInvokingClient, pAllocParams, accessRight) 370 NV_STATUS thirdpartyp2pCtrlCmdRegisterVaSpace_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_REGISTER_VA_SPACE_PARAMS *pRegisterVaSpaceParams); 371 372 static inline NV_STATUS thirdpartyp2pCtrlCmdRegisterVaSpace_DISPATCH(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_REGISTER_VA_SPACE_PARAMS *pRegisterVaSpaceParams) { 373 return pThirdPartyP2P->__thirdpartyp2pCtrlCmdRegisterVaSpace__(pThirdPartyP2P, pRegisterVaSpaceParams); 374 } 375 376 NV_STATUS thirdpartyp2pCtrlCmdUnregisterVaSpace_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_UNREGISTER_VA_SPACE_PARAMS *pUnregisterVaSpaceParams); 377 378 static inline NV_STATUS thirdpartyp2pCtrlCmdUnregisterVaSpace_DISPATCH(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_UNREGISTER_VA_SPACE_PARAMS *pUnregisterVaSpaceParams) { 379 return pThirdPartyP2P->__thirdpartyp2pCtrlCmdUnregisterVaSpace__(pThirdPartyP2P, pUnregisterVaSpaceParams); 380 } 381 382 NV_STATUS thirdpartyp2pCtrlCmdRegisterVidmem_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_REGISTER_VIDMEM_PARAMS *pRegisterVidmemParams); 383 384 static inline NV_STATUS thirdpartyp2pCtrlCmdRegisterVidmem_DISPATCH(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_REGISTER_VIDMEM_PARAMS *pRegisterVidmemParams) { 385 return pThirdPartyP2P->__thirdpartyp2pCtrlCmdRegisterVidmem__(pThirdPartyP2P, pRegisterVidmemParams); 386 } 387 388 NV_STATUS thirdpartyp2pCtrlCmdUnregisterVidmem_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_UNREGISTER_VIDMEM_PARAMS *pUnregisterVidmemParams); 389 390 static inline NV_STATUS thirdpartyp2pCtrlCmdUnregisterVidmem_DISPATCH(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_UNREGISTER_VIDMEM_PARAMS *pUnregisterVidmemParams) { 391 return pThirdPartyP2P->__thirdpartyp2pCtrlCmdUnregisterVidmem__(pThirdPartyP2P, pUnregisterVidmemParams); 392 } 393 394 NV_STATUS thirdpartyp2pCtrlCmdRegisterPid_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_REGISTER_PID_PARAMS *pParams); 395 396 static inline NV_STATUS thirdpartyp2pCtrlCmdRegisterPid_DISPATCH(struct ThirdPartyP2P *pThirdPartyP2P, NV503C_CTRL_REGISTER_PID_PARAMS *pParams) { 397 return pThirdPartyP2P->__thirdpartyp2pCtrlCmdRegisterPid__(pThirdPartyP2P, pParams); 398 } 399 400 static inline NvBool thirdpartyp2pShareCallback_DISPATCH(struct ThirdPartyP2P *pGpuResource, struct RsClient *pInvokingClient, struct RsResourceRef *pParentRef, RS_SHARE_POLICY *pSharePolicy) { 401 return pGpuResource->__thirdpartyp2pShareCallback__(pGpuResource, pInvokingClient, pParentRef, pSharePolicy); 402 } 403 404 static inline NV_STATUS thirdpartyp2pCheckMemInterUnmap_DISPATCH(struct ThirdPartyP2P *pRmResource, NvBool bSubdeviceHandleProvided) { 405 return pRmResource->__thirdpartyp2pCheckMemInterUnmap__(pRmResource, bSubdeviceHandleProvided); 406 } 407 408 static inline NV_STATUS thirdpartyp2pMapTo_DISPATCH(struct ThirdPartyP2P *pResource, RS_RES_MAP_TO_PARAMS *pParams) { 409 return pResource->__thirdpartyp2pMapTo__(pResource, pParams); 410 } 411 412 static inline NV_STATUS thirdpartyp2pGetMapAddrSpace_DISPATCH(struct ThirdPartyP2P *pGpuResource, struct CALL_CONTEXT *pCallContext, NvU32 mapFlags, NV_ADDRESS_SPACE *pAddrSpace) { 413 return pGpuResource->__thirdpartyp2pGetMapAddrSpace__(pGpuResource, pCallContext, mapFlags, pAddrSpace); 414 } 415 416 static inline NvU32 thirdpartyp2pGetRefCount_DISPATCH(struct ThirdPartyP2P *pResource) { 417 return pResource->__thirdpartyp2pGetRefCount__(pResource); 418 } 419 420 static inline void thirdpartyp2pAddAdditionalDependants_DISPATCH(struct RsClient *pClient, struct ThirdPartyP2P *pResource, RsResourceRef *pReference) { 421 pResource->__thirdpartyp2pAddAdditionalDependants__(pClient, pResource, pReference); 422 } 423 424 static inline NV_STATUS thirdpartyp2pControl_Prologue_DISPATCH(struct ThirdPartyP2P *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 425 return pResource->__thirdpartyp2pControl_Prologue__(pResource, pCallContext, pParams); 426 } 427 428 static inline NV_STATUS thirdpartyp2pGetRegBaseOffsetAndSize_DISPATCH(struct ThirdPartyP2P *pGpuResource, struct OBJGPU *pGpu, NvU32 *pOffset, NvU32 *pSize) { 429 return pGpuResource->__thirdpartyp2pGetRegBaseOffsetAndSize__(pGpuResource, pGpu, pOffset, pSize); 430 } 431 432 static inline NV_STATUS thirdpartyp2pInternalControlForward_DISPATCH(struct ThirdPartyP2P *pGpuResource, NvU32 command, void *pParams, NvU32 size) { 433 return pGpuResource->__thirdpartyp2pInternalControlForward__(pGpuResource, command, pParams, size); 434 } 435 436 static inline NV_STATUS thirdpartyp2pUnmapFrom_DISPATCH(struct ThirdPartyP2P *pResource, RS_RES_UNMAP_FROM_PARAMS *pParams) { 437 return pResource->__thirdpartyp2pUnmapFrom__(pResource, pParams); 438 } 439 440 static inline void thirdpartyp2pControl_Epilogue_DISPATCH(struct ThirdPartyP2P *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 441 pResource->__thirdpartyp2pControl_Epilogue__(pResource, pCallContext, pParams); 442 } 443 444 static inline NV_STATUS thirdpartyp2pControlLookup_DISPATCH(struct ThirdPartyP2P *pResource, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams, const struct NVOC_EXPORTED_METHOD_DEF **ppEntry) { 445 return pResource->__thirdpartyp2pControlLookup__(pResource, pParams, ppEntry); 446 } 447 448 static inline NvHandle thirdpartyp2pGetInternalObjectHandle_DISPATCH(struct ThirdPartyP2P *pGpuResource) { 449 return pGpuResource->__thirdpartyp2pGetInternalObjectHandle__(pGpuResource); 450 } 451 452 static inline NV_STATUS thirdpartyp2pControl_DISPATCH(struct ThirdPartyP2P *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 453 return pGpuResource->__thirdpartyp2pControl__(pGpuResource, pCallContext, pParams); 454 } 455 456 static inline NV_STATUS thirdpartyp2pUnmap_DISPATCH(struct ThirdPartyP2P *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RsCpuMapping *pCpuMapping) { 457 return pGpuResource->__thirdpartyp2pUnmap__(pGpuResource, pCallContext, pCpuMapping); 458 } 459 460 static inline NV_STATUS thirdpartyp2pGetMemInterMapParams_DISPATCH(struct ThirdPartyP2P *pRmResource, RMRES_MEM_INTER_MAP_PARAMS *pParams) { 461 return pRmResource->__thirdpartyp2pGetMemInterMapParams__(pRmResource, pParams); 462 } 463 464 static inline NV_STATUS thirdpartyp2pGetMemoryMappingDescriptor_DISPATCH(struct ThirdPartyP2P *pRmResource, struct MEMORY_DESCRIPTOR **ppMemDesc) { 465 return pRmResource->__thirdpartyp2pGetMemoryMappingDescriptor__(pRmResource, ppMemDesc); 466 } 467 468 static inline NV_STATUS thirdpartyp2pControlFilter_DISPATCH(struct ThirdPartyP2P *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 469 return pResource->__thirdpartyp2pControlFilter__(pResource, pCallContext, pParams); 470 } 471 472 static inline NV_STATUS thirdpartyp2pControlSerialization_Prologue_DISPATCH(struct ThirdPartyP2P *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 473 return pResource->__thirdpartyp2pControlSerialization_Prologue__(pResource, pCallContext, pParams); 474 } 475 476 static inline NvBool thirdpartyp2pCanCopy_DISPATCH(struct ThirdPartyP2P *pResource) { 477 return pResource->__thirdpartyp2pCanCopy__(pResource); 478 } 479 480 static inline void thirdpartyp2pPreDestruct_DISPATCH(struct ThirdPartyP2P *pResource) { 481 pResource->__thirdpartyp2pPreDestruct__(pResource); 482 } 483 484 static inline NV_STATUS thirdpartyp2pIsDuplicate_DISPATCH(struct ThirdPartyP2P *pResource, NvHandle hMemory, NvBool *pDuplicate) { 485 return pResource->__thirdpartyp2pIsDuplicate__(pResource, hMemory, pDuplicate); 486 } 487 488 static inline void thirdpartyp2pControlSerialization_Epilogue_DISPATCH(struct ThirdPartyP2P *pResource, struct CALL_CONTEXT *pCallContext, struct RS_RES_CONTROL_PARAMS_INTERNAL *pParams) { 489 pResource->__thirdpartyp2pControlSerialization_Epilogue__(pResource, pCallContext, pParams); 490 } 491 492 static inline NV_STATUS thirdpartyp2pMap_DISPATCH(struct ThirdPartyP2P *pGpuResource, struct CALL_CONTEXT *pCallContext, struct RS_CPU_MAP_PARAMS *pParams, struct RsCpuMapping *pCpuMapping) { 493 return pGpuResource->__thirdpartyp2pMap__(pGpuResource, pCallContext, pParams, pCpuMapping); 494 } 495 496 static inline NvBool thirdpartyp2pAccessCallback_DISPATCH(struct ThirdPartyP2P *pResource, struct RsClient *pInvokingClient, void *pAllocParams, RsAccessRight accessRight) { 497 return pResource->__thirdpartyp2pAccessCallback__(pResource, pInvokingClient, pAllocParams, accessRight); 498 } 499 500 NV_STATUS thirdpartyp2pConstruct_IMPL(struct ThirdPartyP2P *arg_pResource, struct CALL_CONTEXT *arg_pCallContext, struct RS_RES_ALLOC_PARAMS_INTERNAL *arg_pParams); 501 502 #define __nvoc_thirdpartyp2pConstruct(arg_pResource, arg_pCallContext, arg_pParams) thirdpartyp2pConstruct_IMPL(arg_pResource, arg_pCallContext, arg_pParams) 503 void thirdpartyp2pDestruct_IMPL(struct ThirdPartyP2P *pResource); 504 505 #define __nvoc_thirdpartyp2pDestruct(pResource) thirdpartyp2pDestruct_IMPL(pResource) 506 NvBool thirdpartyp2pIsValidClientPid_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NvU32 pid, NvHandle hClient); 507 508 #ifdef __nvoc_third_party_p2p_h_disabled 509 static inline NvBool thirdpartyp2pIsValidClientPid(struct ThirdPartyP2P *pThirdPartyP2P, NvU32 pid, NvHandle hClient) { 510 NV_ASSERT_FAILED_PRECOMP("ThirdPartyP2P was disabled!"); 511 return NV_FALSE; 512 } 513 #else //__nvoc_third_party_p2p_h_disabled 514 #define thirdpartyp2pIsValidClientPid(pThirdPartyP2P, pid, hClient) thirdpartyp2pIsValidClientPid_IMPL(pThirdPartyP2P, pid, hClient) 515 #endif //__nvoc_third_party_p2p_h_disabled 516 517 NV_STATUS thirdpartyp2pDelMappingInfoByKey_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, void *pKey, NvBool bIsRsyncNeeded); 518 519 #ifdef __nvoc_third_party_p2p_h_disabled 520 static inline NV_STATUS thirdpartyp2pDelMappingInfoByKey(struct ThirdPartyP2P *pThirdPartyP2P, void *pKey, NvBool bIsRsyncNeeded) { 521 NV_ASSERT_FAILED_PRECOMP("ThirdPartyP2P was disabled!"); 522 return NV_ERR_NOT_SUPPORTED; 523 } 524 #else //__nvoc_third_party_p2p_h_disabled 525 #define thirdpartyp2pDelMappingInfoByKey(pThirdPartyP2P, pKey, bIsRsyncNeeded) thirdpartyp2pDelMappingInfoByKey_IMPL(pThirdPartyP2P, pKey, bIsRsyncNeeded) 526 #endif //__nvoc_third_party_p2p_h_disabled 527 528 NV_STATUS thirdpartyp2pDelPersistentMappingInfoByKey_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, void *pKey, NvBool bIsRsyncNeeded); 529 530 #ifdef __nvoc_third_party_p2p_h_disabled 531 static inline NV_STATUS thirdpartyp2pDelPersistentMappingInfoByKey(struct ThirdPartyP2P *pThirdPartyP2P, void *pKey, NvBool bIsRsyncNeeded) { 532 NV_ASSERT_FAILED_PRECOMP("ThirdPartyP2P was disabled!"); 533 return NV_ERR_NOT_SUPPORTED; 534 } 535 #else //__nvoc_third_party_p2p_h_disabled 536 #define thirdpartyp2pDelPersistentMappingInfoByKey(pThirdPartyP2P, pKey, bIsRsyncNeeded) thirdpartyp2pDelPersistentMappingInfoByKey_IMPL(pThirdPartyP2P, pKey, bIsRsyncNeeded) 537 #endif //__nvoc_third_party_p2p_h_disabled 538 539 NV_STATUS thirdpartyp2pGetVASpaceInfoFromToken_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, NvU32 vaSpaceToken, PCLI_THIRD_PARTY_P2P_VASPACE_INFO *ppVASpaceInfo); 540 541 #ifdef __nvoc_third_party_p2p_h_disabled 542 static inline NV_STATUS thirdpartyp2pGetVASpaceInfoFromToken(struct ThirdPartyP2P *pThirdPartyP2P, NvU32 vaSpaceToken, PCLI_THIRD_PARTY_P2P_VASPACE_INFO *ppVASpaceInfo) { 543 NV_ASSERT_FAILED_PRECOMP("ThirdPartyP2P was disabled!"); 544 return NV_ERR_NOT_SUPPORTED; 545 } 546 #else //__nvoc_third_party_p2p_h_disabled 547 #define thirdpartyp2pGetVASpaceInfoFromToken(pThirdPartyP2P, vaSpaceToken, ppVASpaceInfo) thirdpartyp2pGetVASpaceInfoFromToken_IMPL(pThirdPartyP2P, vaSpaceToken, ppVASpaceInfo) 548 #endif //__nvoc_third_party_p2p_h_disabled 549 550 NV_STATUS thirdpartyp2pGetNextVASpaceInfo_IMPL(struct ThirdPartyP2P *pThirdPartyP2P, PCLI_THIRD_PARTY_P2P_VASPACE_INFO *arg0); 551 552 #ifdef __nvoc_third_party_p2p_h_disabled 553 static inline NV_STATUS thirdpartyp2pGetNextVASpaceInfo(struct ThirdPartyP2P *pThirdPartyP2P, PCLI_THIRD_PARTY_P2P_VASPACE_INFO *arg0) { 554 NV_ASSERT_FAILED_PRECOMP("ThirdPartyP2P was disabled!"); 555 return NV_ERR_NOT_SUPPORTED; 556 } 557 #else //__nvoc_third_party_p2p_h_disabled 558 #define thirdpartyp2pGetNextVASpaceInfo(pThirdPartyP2P, arg0) thirdpartyp2pGetNextVASpaceInfo_IMPL(pThirdPartyP2P, arg0) 559 #endif //__nvoc_third_party_p2p_h_disabled 560 561 #undef PRIVATE_FIELD 562 563 564 typedef struct ThirdPartyP2P *PCLI_THIRD_PARTY_P2P_INFO; // RS-TODO: Remove 565 566 // **************************************************************************** 567 // Functions prototypes 568 // **************************************************************************** 569 570 // Get registered third-party P2P info from pid. Also match the provided client handle if provided. 571 NV_STATUS CliNextThirdPartyP2PInfoWithPid (struct OBJGPU *, NvU32, NvHandle, struct RmClient**, PCLI_THIRD_PARTY_P2P_INFO *); 572 573 // Get third-party P2P info given a P2P token 574 NV_STATUS CliGetThirdPartyP2PInfoFromToken (NvU64, PCLI_THIRD_PARTY_P2P_INFO *); 575 576 // Register an address space with a third-party P2P object 577 NV_STATUS CliAddThirdPartyP2PVASpace (struct ThirdPartyP2P*, NvHandle, NvU32 *); 578 579 // Unregister an address space from a third-party P2P object 580 NV_STATUS CliDelThirdPartyP2PVASpace (struct ThirdPartyP2P*, NvHandle); 581 582 // Register video memory with a third-party P2P object 583 NV_STATUS CliAddThirdPartyP2PVidmemInfo (struct ThirdPartyP2P*, NvHandle, NvU64, NvU64, NvU64, struct Memory *); 584 585 // Unregister video memory from a third-party P2P object 586 NV_STATUS CliDelThirdPartyP2PVidmemInfo (struct ThirdPartyP2P*, NvHandle); 587 588 // Unregister video memory from a third-party P2P object only if the VidmemInfo is not used 589 void CliDelThirdPartyP2PVidmemInfoPersistent (struct ThirdPartyP2P*, CLI_THIRD_PARTY_P2P_VIDMEM_INFO*); 590 591 // Find registered video memory given an address 592 NV_STATUS CliGetThirdPartyP2PVidmemInfoFromAddress (struct ThirdPartyP2P*, NvU64, NvU64, NvU64 *, PCLI_THIRD_PARTY_P2P_VIDMEM_INFO *); 593 594 // Find registered video memory given a VidmemInfo ID 595 NV_STATUS CliGetThirdPartyP2PVidmemInfoFromId(struct ThirdPartyP2P*, NvU64, CLI_THIRD_PARTY_P2P_VIDMEM_INFO **); 596 597 // Find platformData given a P2PInfo object 598 NV_STATUS CliGetThirdPartyP2PPlatformData (PCLI_THIRD_PARTY_P2P_INFO, void *); 599 600 // Associate a P2P mapping with registered video memory 601 NV_STATUS CliAddThirdPartyP2PMappingInfo (struct ThirdPartyP2P*, NvHandle, void *, THIRD_PARTY_P2P_VIDMEM_FREE_CALLBACK *, void *, PCLI_THIRD_PARTY_P2P_MAPPING_INFO *); 602 603 // Find a P2P mapping given its platform specific data 604 NV_STATUS CliGetThirdPartyP2PMappingInfoFromKey (struct ThirdPartyP2P*, NvHandle, void *, PCLI_THIRD_PARTY_P2P_MAPPING_INFO *); 605 606 // Register pid & client with a third-party P2P Info object 607 NV_STATUS CliAddThirdPartyP2PClientPid (NvHandle, NvHandle, NvU32, NvU32); 608 609 // Unregister pid & client from a third-party P2P Info object 610 NV_STATUS CliDelThirdPartyP2PClientPid (struct RmClient*, NvHandle, NvU32, NvU32); 611 612 // Remove association of a client from any existing third-Party P2P Info object 613 NV_STATUS CliUnregisterFromThirdPartyP2P (struct RmClient*); 614 615 // Register a free callback 616 NV_STATUS CliRegisterThirdPartyP2PMappingCallback (struct ThirdPartyP2P*, NvHandle, void *, THIRD_PARTY_P2P_VIDMEM_FREE_CALLBACK *, void *); 617 618 // Unregister memory from a third-party P2P Info object 619 void CliUnregisterMemoryFromThirdPartyP2P(struct Memory *pMemory); 620 621 #endif // _THIRD_PARTY_P2P_H_ 622 623 #ifdef __cplusplus 624 } // extern "C" 625 #endif 626 627 #endif // _G_THIRD_PARTY_P2P_NVOC_H_ 628