automatic DPDK test reports
 help / color / mirror / Atom feed
* [dpdk-test-report] |WARNING| pw93016 [PATCH v3 11/22] net/ena/base: adjust changes to lastest ena-com
       [not found] <20210506142526.28245-12-mk@semihalf.com>
@ 2021-05-06 14:27 ` checkpatch
  0 siblings, 0 replies; only message in thread
From: checkpatch @ 2021-05-06 14:27 UTC (permalink / raw)
  To: test-report; +Cc: Michal Krawczyk

Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/93016

_coding style issues_


WARNING:TYPO_SPELLING: 'lastest' may be misspelled - perhaps 'latest'?
#67: 
Subject: [dpdk-dev] [PATCH v3 11/22] net/ena/base: adjust changes to lastest

CHECK:CAMELCASE: Avoid CamelCase: <ENA_PRIu64>
#113: FILE: drivers/net/ena/base/ena_plat_dpdk.h:42:
+#define ENA_PRIu64 PRIu64

CHECK:CAMELCASE: Avoid CamelCase: <PRIu64>
#113: FILE: drivers/net/ena/base/ena_plat_dpdk.h:42:
+#define ENA_PRIu64 PRIu64

WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#131: FILE: drivers/net/ena/base/ena_plat_dpdk.h:100:
+#define GENMASK_ULL(h, l) (((~0ULL) - (1ULL << (l)) + 1) & ^I^I       \$

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'spinlock' may be better as '(spinlock)' to avoid precedence issues
#172: FILE: drivers/net/ena/base/ena_plat_dpdk.h:134:
+#define ENA_SPINLOCK_LOCK(spinlock, flags)				       \
 	({(void)flags; rte_spinlock_lock(&spinlock); })

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'waitqueue' - possible side-effects?
#195: FILE: drivers/net/ena/base/ena_plat_dpdk.h:148:
+#define ENA_WAIT_EVENT_INIT(waitqueue)					       \
+	do {								       \
+		pthread_mutex_init(&(waitqueue).mutex, NULL);		       \
+		pthread_cond_init(&(waitqueue).cond, NULL);		       \
 	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'waitevent' - possible side-effects?
#214: FILE: drivers/net/ena/base/ena_plat_dpdk.h:154:
+#define ENA_WAIT_EVENT_WAIT(waitevent, timeout)				       \
+	do {								       \
+		struct timespec wait;					       \
+		struct timeval now;					       \
+		unsigned long timeout_us;				       \
+		gettimeofday(&now, NULL);				       \
+		wait.tv_sec = now.tv_sec + timeout / 1000000UL;		       \
+		timeout_us = timeout % 1000000UL;			       \
+		wait.tv_nsec = (now.tv_usec + timeout_us) * 1000UL;	       \
+		pthread_mutex_lock(&waitevent.mutex);			       \
+		pthread_cond_timedwait(&waitevent.cond,			       \
+				&waitevent.mutex, &wait);		       \
+		pthread_mutex_unlock(&waitevent.mutex);			       \
 	} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'waitevent' may be better as '(waitevent)' to avoid precedence issues
#214: FILE: drivers/net/ena/base/ena_plat_dpdk.h:154:
+#define ENA_WAIT_EVENT_WAIT(waitevent, timeout)				       \
+	do {								       \
+		struct timespec wait;					       \
+		struct timeval now;					       \
+		unsigned long timeout_us;				       \
+		gettimeofday(&now, NULL);				       \
+		wait.tv_sec = now.tv_sec + timeout / 1000000UL;		       \
+		timeout_us = timeout % 1000000UL;			       \
+		wait.tv_nsec = (now.tv_usec + timeout_us) * 1000UL;	       \
+		pthread_mutex_lock(&waitevent.mutex);			       \
+		pthread_cond_timedwait(&waitevent.cond,			       \
+				&waitevent.mutex, &wait);		       \
+		pthread_mutex_unlock(&waitevent.mutex);			       \
 	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'timeout' - possible side-effects?
#214: FILE: drivers/net/ena/base/ena_plat_dpdk.h:154:
+#define ENA_WAIT_EVENT_WAIT(waitevent, timeout)				       \
+	do {								       \
+		struct timespec wait;					       \
+		struct timeval now;					       \
+		unsigned long timeout_us;				       \
+		gettimeofday(&now, NULL);				       \
+		wait.tv_sec = now.tv_sec + timeout / 1000000UL;		       \
+		timeout_us = timeout % 1000000UL;			       \
+		wait.tv_nsec = (now.tv_usec + timeout_us) * 1000UL;	       \
+		pthread_mutex_lock(&waitevent.mutex);			       \
+		pthread_cond_timedwait(&waitevent.cond,			       \
+				&waitevent.mutex, &wait);		       \
+		pthread_mutex_unlock(&waitevent.mutex);			       \
 	} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'timeout' may be better as '(timeout)' to avoid precedence issues
#214: FILE: drivers/net/ena/base/ena_plat_dpdk.h:154:
+#define ENA_WAIT_EVENT_WAIT(waitevent, timeout)				       \
+	do {								       \
+		struct timespec wait;					       \
+		struct timeval now;					       \
+		unsigned long timeout_us;				       \
+		gettimeofday(&now, NULL);				       \
+		wait.tv_sec = now.tv_sec + timeout / 1000000UL;		       \
+		timeout_us = timeout % 1000000UL;			       \
+		wait.tv_nsec = (now.tv_usec + timeout_us) * 1000UL;	       \
+		pthread_mutex_lock(&waitevent.mutex);			       \
+		pthread_cond_timedwait(&waitevent.cond,			       \
+				&waitevent.mutex, &wait);		       \
+		pthread_mutex_unlock(&waitevent.mutex);			       \
 	} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'timeout_us' may be better as '(timeout_us)' to avoid precedence issues
#236: FILE: drivers/net/ena/base/ena_plat_dpdk.h:178:
+#define ENA_GET_SYSTEM_TIMEOUT(timeout_us)				       \
+	(timeout_us * rte_get_timer_hz() / 1000000 + rte_get_timer_cycles())

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'size' - possible side-effects?
#271: FILE: drivers/net/ena/base/ena_plat_dpdk.h:187:
+#define ENA_MEM_ALLOC_COHERENT_ALIGNED(					       \
+	dmadev, size, virt, phys, mem_handle, alignment)		       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev);					       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt,	1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+					SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG,\
+					alignment);			       \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'size' may be better as '(size)' to avoid precedence issues
#271: FILE: drivers/net/ena/base/ena_plat_dpdk.h:187:
+#define ENA_MEM_ALLOC_COHERENT_ALIGNED(					       \
+	dmadev, size, virt, phys, mem_handle, alignment)		       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev);					       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt,	1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+					SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG,\
+					alignment);			       \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'virt' - possible side-effects?
#271: FILE: drivers/net/ena/base/ena_plat_dpdk.h:187:
+#define ENA_MEM_ALLOC_COHERENT_ALIGNED(					       \
+	dmadev, size, virt, phys, mem_handle, alignment)		       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev);					       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt,	1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+					SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG,\
+					alignment);			       \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'phys' - possible side-effects?
#271: FILE: drivers/net/ena/base/ena_plat_dpdk.h:187:
+#define ENA_MEM_ALLOC_COHERENT_ALIGNED(					       \
+	dmadev, size, virt, phys, mem_handle, alignment)		       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev);					       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt,	1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+					SOCKET_ID_ANY, RTE_MEMZONE_IOVA_CONTIG,\
+					alignment);			       \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:CAMELCASE: Avoid CamelCase: <PRIi64>
#278: FILE: drivers/net/ena/base/ena_plat_dpdk.h:194:
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#278: FILE: drivers/net/ena/base/ena_plat_dpdk.h:194:
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\

WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#332: FILE: drivers/net/ena/base/ena_plat_dpdk.h:213:
+#define ENA_MEM_FREE_COHERENT(dmadev, size, virt, phys, mem_handle) ^I       \$

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'size' - possible side-effects?
#336: FILE: drivers/net/ena/base/ena_plat_dpdk.h:217:
+#define ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED(				       \
+	dmadev, size, virt, phys, mem_handle, node, dev_node, alignment)       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev); ENA_TOUCH(dev_node);			       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt, 1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+				node, RTE_MEMZONE_IOVA_CONTIG, alignment);     \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'size' may be better as '(size)' to avoid precedence issues
#336: FILE: drivers/net/ena/base/ena_plat_dpdk.h:217:
+#define ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED(				       \
+	dmadev, size, virt, phys, mem_handle, node, dev_node, alignment)       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev); ENA_TOUCH(dev_node);			       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt, 1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+				node, RTE_MEMZONE_IOVA_CONTIG, alignment);     \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'virt' - possible side-effects?
#336: FILE: drivers/net/ena/base/ena_plat_dpdk.h:217:
+#define ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED(				       \
+	dmadev, size, virt, phys, mem_handle, node, dev_node, alignment)       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev); ENA_TOUCH(dev_node);			       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt, 1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+				node, RTE_MEMZONE_IOVA_CONTIG, alignment);     \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'phys' - possible side-effects?
#336: FILE: drivers/net/ena/base/ena_plat_dpdk.h:217:
+#define ENA_MEM_ALLOC_COHERENT_NODE_ALIGNED(				       \
+	dmadev, size, virt, phys, mem_handle, node, dev_node, alignment)       \
+	do {								       \
+		const struct rte_memzone *mz = NULL;			       \
+		ENA_TOUCH(dmadev); ENA_TOUCH(dev_node);			       \
+		if (size > 0) {						       \
+			char z_name[RTE_MEMZONE_NAMESIZE];		       \
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
+				rte_atomic64_add_return(&ena_alloc_cnt, 1));   \
+			mz = rte_memzone_reserve_aligned(z_name, size,	       \
+				node, RTE_MEMZONE_IOVA_CONTIG, alignment);     \
+			mem_handle = mz;				       \
+		}							       \
+		if (mz == NULL) {					       \
+			virt = NULL;					       \
+			phys = 0;					       \
+		} else {						       \
+			memset(mz->addr, 0, size);			       \
+			virt = mz->addr;				       \
+			phys = mz->iova;				       \
+		}							       \
 	} while (0)

CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#343: FILE: drivers/net/ena/base/ena_plat_dpdk.h:224:
+			snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'timeout_us' may be better as '(timeout_us)' to avoid precedence issues
#406: FILE: drivers/net/ena/base/ena_plat_dpdk.h:285:
+#define ENA_GET_SYSTEM_TIMEOUT(timeout_us)				       \
     (timeout_us * rte_get_timer_hz() / 1000000 + rte_get_timer_cycles())

total: 0 errors, 3 warnings, 21 checks, 337 lines checked

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-06 14:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210506142526.28245-12-mk@semihalf.com>
2021-05-06 14:27 ` [dpdk-test-report] |WARNING| pw93016 [PATCH v3 11/22] net/ena/base: adjust changes to lastest ena-com checkpatch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).