[PATCH v7 1/1] gpu/cuda: introduce CUDA driver

Thomas Monjalon thomas at monjalon.net
Tue Nov 16 17:40:24 CET 2021


16/11/2021 16:58, Stephen Hemminger:
> Minor comments, overall looks fine.
> 
> 
> +/* CUDA Driver functions loaded with dlsym() */
> +CUresult CUDAAPI (*sym_cuInit)(unsigned int flags) = NULL;
> +CUresult CUDAAPI (*sym_cuDriverGetVersion)(int *driverVersion) = NULL;
> +CUresult CUDAAPI (*sym_cuGetProcAddress)(const char *symbol,
> +		void **pfn, int cudaVersion, uint64_t flags) = NULL;
> +
> 
> Can these be local (static) since not prefixed with driver specific name.
> Also global variables are always loaded as zero so NULL initialization is
> unnecessary. For other types checkpatch would complain.
> 
> 
> > +/* NVIDIA GPU address map */
> > +static struct rte_pci_id pci_id_cuda_map[] = {
> 
> Can this be const?

On a separate note, Elena did what you suggested for the logtype variable:
	static RTE_LOG_REGISTER_DEFAULT(cuda_logtype, NOTICE);
So cuda_logtype is static.
I think we should do the same for all DPDK logtypes.
Volunteer for a patch?




More information about the dev mailing list