From: checkpatch@dpdk.org
To: test-report@dpdk.org
Cc: Michal Krawczyk <mk@semihalf.com>
Subject: [dpdk-test-report] |WARNING| pw92500 [PATCH 11/22] net/ena/base: adjust changes to lastest ena-com
Date: Fri, 30 Apr 2021 15:00:22 +0200 (CEST) [thread overview]
Message-ID: <20210430130022.AFB1D121159@dpdk.org> (raw)
In-Reply-To: <20210430125725.28796-12-mk@semihalf.com>
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/92500
_coding style issues_
WARNING:TYPO_SPELLING: 'lastest' may be misspelled - perhaps 'latest'?
#65:
Subject: [dpdk-dev] [PATCH 11/22] net/ena/base: adjust changes to lastest
CHECK:CAMELCASE: Avoid CamelCase: <ENA_PRIu64>
#111: FILE: drivers/net/ena/base/ena_plat_dpdk.h:42:
+#define ENA_PRIu64 PRIu64
CHECK:CAMELCASE: Avoid CamelCase: <PRIu64>
#111: FILE: drivers/net/ena/base/ena_plat_dpdk.h:42:
+#define ENA_PRIu64 PRIu64
WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#129: FILE: drivers/net/ena/base/ena_plat_dpdk.h:97:
+#define GENMASK_ULL(h, l) (((~0ULL) - (1ULL << (l)) + 1) & ^I^I \$
ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#134: FILE: drivers/net/ena/base/ena_plat_dpdk.h:101:
+#define ena_trc_log(dev, level, fmt, arg...) \
(
WARNING:LINE_CONTINUATIONS: Avoid unnecessary line continuations
#139: FILE: drivers/net/ena/base/ena_plat_dpdk.h:103:
+ ENA_TOUCH(dev), \
CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'spinlock' may be better as '(spinlock)' to avoid precedence issues
#169: FILE: drivers/net/ena/base/ena_plat_dpdk.h:131:
+#define ENA_SPINLOCK_LOCK(spinlock, flags) \
({(void)flags; rte_spinlock_lock(&spinlock); })
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'waitqueue' - possible side-effects?
#192: FILE: drivers/net/ena/base/ena_plat_dpdk.h:145:
+#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?
#211: FILE: drivers/net/ena/base/ena_plat_dpdk.h:151:
+#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
#211: FILE: drivers/net/ena/base/ena_plat_dpdk.h:151:
+#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?
#211: FILE: drivers/net/ena/base/ena_plat_dpdk.h:151:
+#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
#211: FILE: drivers/net/ena/base/ena_plat_dpdk.h:151:
+#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
#233: FILE: drivers/net/ena/base/ena_plat_dpdk.h:175:
+#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?
#268: FILE: drivers/net/ena/base/ena_plat_dpdk.h:184:
+#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
#268: FILE: drivers/net/ena/base/ena_plat_dpdk.h:184:
+#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?
#268: FILE: drivers/net/ena/base/ena_plat_dpdk.h:184:
+#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?
#268: FILE: drivers/net/ena/base/ena_plat_dpdk.h:184:
+#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>
#275: FILE: drivers/net/ena/base/ena_plat_dpdk.h:191:
+ snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
CHECK:CONCATENATED_STRING: Concatenated strings should use spaces between elements
#275: FILE: drivers/net/ena/base/ena_plat_dpdk.h:191:
+ snprintf(z_name, sizeof(z_name), "ena_alloc_%"PRIi64"",\
WARNING:SPACE_BEFORE_TAB: please, no space before tabs
#329: FILE: drivers/net/ena/base/ena_plat_dpdk.h:210:
+#define ENA_MEM_FREE_COHERENT(dmadev, size, virt, phys, mem_handle) ^I \$
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'size' - possible side-effects?
#333: FILE: drivers/net/ena/base/ena_plat_dpdk.h:214:
+#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
#333: FILE: drivers/net/ena/base/ena_plat_dpdk.h:214:
+#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?
#333: FILE: drivers/net/ena/base/ena_plat_dpdk.h:214:
+#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?
#333: FILE: drivers/net/ena/base/ena_plat_dpdk.h:214:
+#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
#340: FILE: drivers/net/ena/base/ena_plat_dpdk.h:221:
+ 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
#403: FILE: drivers/net/ena/base/ena_plat_dpdk.h:282:
+#define ENA_GET_SYSTEM_TIMEOUT(timeout_us) \
(timeout_us * rte_get_timer_hz() / 1000000 + rte_get_timer_cycles())
total: 1 errors, 4 warnings, 21 checks, 336 lines checked
parent reply other threads:[~2021-04-30 13:00 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20210430125725.28796-12-mk@semihalf.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210430130022.AFB1D121159@dpdk.org \
--to=checkpatch@dpdk.org \
--cc=mk@semihalf.com \
--cc=test-report@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).