* |WARNING| pw143877 [PATCH 23/33] net/cnxk: support Tx burst scalar for cn20k
[not found] <20240910085909.1514457-24-ndabilpuram@marvell.com>
@ 2024-09-10 9:35 ` checkpatch
0 siblings, 0 replies; only message in thread
From: checkpatch @ 2024-09-10 9:35 UTC (permalink / raw)
To: test-report; +Cc: Nithin Dabilpuram
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/143877
_coding style issues_
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#258: FILE: drivers/net/cnxk/cn20k_tx.h:35:
+#define NIX_XMIT_FC_OR_RETURN(txq, pkts) \
+ do { \
+ int64_t avail; \
+ /* Cached value is low, Update the fc_cache_pkts */ \
+ if (unlikely((txq)->fc_cache_pkts < (pkts))) { \
+ avail = txq->nb_sqb_bufs_adj - *txq->fc_mem; \
+ /* Multiply with sqe_per_sqb to express in pkts */ \
+ (txq)->fc_cache_pkts = (avail << (txq)->sqes_per_sqb_log2) - avail; \
+ /* Check it again for the room */ \
+ if (unlikely((txq)->fc_cache_pkts < (pkts))) \
+ return 0; \
+ } \
+ } while (0)
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'pkts' - possible side-effects?
#258: FILE: drivers/net/cnxk/cn20k_tx.h:35:
+#define NIX_XMIT_FC_OR_RETURN(txq, pkts) \
+ do { \
+ int64_t avail; \
+ /* Cached value is low, Update the fc_cache_pkts */ \
+ if (unlikely((txq)->fc_cache_pkts < (pkts))) { \
+ avail = txq->nb_sqb_bufs_adj - *txq->fc_mem; \
+ /* Multiply with sqe_per_sqb to express in pkts */ \
+ (txq)->fc_cache_pkts = (avail << (txq)->sqes_per_sqb_log2) - avail; \
+ /* Check it again for the room */ \
+ if (unlikely((txq)->fc_cache_pkts < (pkts))) \
+ return 0; \
+ } \
+ } while (0)
WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#258: FILE: drivers/net/cnxk/cn20k_tx.h:35:
+#define NIX_XMIT_FC_OR_RETURN(txq, pkts) \
+ do { \
+ int64_t avail; \
+ /* Cached value is low, Update the fc_cache_pkts */ \
+ if (unlikely((txq)->fc_cache_pkts < (pkts))) { \
+ avail = txq->nb_sqb_bufs_adj - *txq->fc_mem; \
+ /* Multiply with sqe_per_sqb to express in pkts */ \
+ (txq)->fc_cache_pkts = (avail << (txq)->sqes_per_sqb_log2) - avail; \
+ /* Check it again for the room */ \
+ if (unlikely((txq)->fc_cache_pkts < (pkts))) \
+ return 0; \
+ } \
+ } while (0)
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#272: FILE: drivers/net/cnxk/cn20k_tx.h:49:
+#define NIX_XMIT_FC_OR_RETURN_MTS(txq, pkts) \
+ do { \
+ int64_t *fc_cache = &(txq)->fc_cache_pkts; \
+ uint8_t retry_count = 8; \
+ int64_t val, newval; \
+ retry: \
+ /* Reduce the cached count */ \
+ val = (int64_t)__atomic_fetch_sub(fc_cache, pkts, __ATOMIC_RELAXED); \
+ val -= pkts; \
+ /* Cached value is low, Update the fc_cache_pkts */ \
+ if (unlikely(val < 0)) { \
+ /* Multiply with sqe_per_sqb to express in pkts */ \
+ newval = txq->nb_sqb_bufs_adj - \
+ __atomic_load_n(txq->fc_mem, __ATOMIC_RELAXED); \
+ newval = (newval << (txq)->sqes_per_sqb_log2) - newval; \
+ newval -= pkts; \
+ if (!__atomic_compare_exchange_n(fc_cache, &val, newval, false, \
+ __ATOMIC_RELAXED, __ATOMIC_RELAXED)) { \
+ if (retry_count) { \
+ retry_count--; \
+ goto retry; \
+ } else \
+ return 0; \
+ } \
+ /* Update and check it again for the room */ \
+ if (unlikely(newval < 0)) \
+ return 0; \
+ } \
+ } while (0)
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'pkts' - possible side-effects?
#272: FILE: drivers/net/cnxk/cn20k_tx.h:49:
+#define NIX_XMIT_FC_OR_RETURN_MTS(txq, pkts) \
+ do { \
+ int64_t *fc_cache = &(txq)->fc_cache_pkts; \
+ uint8_t retry_count = 8; \
+ int64_t val, newval; \
+ retry: \
+ /* Reduce the cached count */ \
+ val = (int64_t)__atomic_fetch_sub(fc_cache, pkts, __ATOMIC_RELAXED); \
+ val -= pkts; \
+ /* Cached value is low, Update the fc_cache_pkts */ \
+ if (unlikely(val < 0)) { \
+ /* Multiply with sqe_per_sqb to express in pkts */ \
+ newval = txq->nb_sqb_bufs_adj - \
+ __atomic_load_n(txq->fc_mem, __ATOMIC_RELAXED); \
+ newval = (newval << (txq)->sqes_per_sqb_log2) - newval; \
+ newval -= pkts; \
+ if (!__atomic_compare_exchange_n(fc_cache, &val, newval, false, \
+ __ATOMIC_RELAXED, __ATOMIC_RELAXED)) { \
+ if (retry_count) { \
+ retry_count--; \
+ goto retry; \
+ } else \
+ return 0; \
+ } \
+ /* Update and check it again for the room */ \
+ if (unlikely(newval < 0)) \
+ return 0; \
+ } \
+ } while (0)
WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#272: FILE: drivers/net/cnxk/cn20k_tx.h:49:
+#define NIX_XMIT_FC_OR_RETURN_MTS(txq, pkts) \
+ do { \
+ int64_t *fc_cache = &(txq)->fc_cache_pkts; \
+ uint8_t retry_count = 8; \
+ int64_t val, newval; \
+ retry: \
+ /* Reduce the cached count */ \
+ val = (int64_t)__atomic_fetch_sub(fc_cache, pkts, __ATOMIC_RELAXED); \
+ val -= pkts; \
+ /* Cached value is low, Update the fc_cache_pkts */ \
+ if (unlikely(val < 0)) { \
+ /* Multiply with sqe_per_sqb to express in pkts */ \
+ newval = txq->nb_sqb_bufs_adj - \
+ __atomic_load_n(txq->fc_mem, __ATOMIC_RELAXED); \
+ newval = (newval << (txq)->sqes_per_sqb_log2) - newval; \
+ newval -= pkts; \
+ if (!__atomic_compare_exchange_n(fc_cache, &val, newval, false, \
+ __ATOMIC_RELAXED, __ATOMIC_RELAXED)) { \
+ if (retry_count) { \
+ retry_count--; \
+ goto retry; \
+ } else \
+ return 0; \
+ } \
+ /* Update and check it again for the room */ \
+ if (unlikely(newval < 0)) \
+ return 0; \
+ } \
+ } while (0)
WARNING:INDENTED_LABEL: labels should not be indented
#277: FILE: drivers/net/cnxk/cn20k_tx.h:54:
+ retry: \
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'txq' - possible side-effects?
#302: FILE: drivers/net/cnxk/cn20k_tx.h:79:
+#define NIX_XMIT_FC_CHECK_RETURN(txq, pkts) \
+ do { \
+ if (unlikely((txq)->flag)) \
+ NIX_XMIT_FC_OR_RETURN_MTS(txq, pkts); \
+ else { \
+ NIX_XMIT_FC_OR_RETURN(txq, pkts); \
+ /* Reduce the cached count */ \
+ txq->fc_cache_pkts -= pkts; \
+ } \
+ } while (0)
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'pkts' - possible side-effects?
#302: FILE: drivers/net/cnxk/cn20k_tx.h:79:
+#define NIX_XMIT_FC_CHECK_RETURN(txq, pkts) \
+ do { \
+ if (unlikely((txq)->flag)) \
+ NIX_XMIT_FC_OR_RETURN_MTS(txq, pkts); \
+ else { \
+ NIX_XMIT_FC_OR_RETURN(txq, pkts); \
+ /* Reduce the cached count */ \
+ txq->fc_cache_pkts -= pkts; \
+ } \
+ } while (0)
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#376: FILE: drivers/net/cnxk/cn20k_tx.h:153:
+ " ldxr %[pkts], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#377: FILE: drivers/net/cnxk/cn20k_tx.h:154:
+ " tbz %[pkts], 63, .Ldne%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#378: FILE: drivers/net/cnxk/cn20k_tx.h:155:
+ " sevl
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#379: FILE: drivers/net/cnxk/cn20k_tx.h:156:
+ ".Lrty%=: wfe
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#380: FILE: drivers/net/cnxk/cn20k_tx.h:157:
+ " ldxr %[pkts], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#381: FILE: drivers/net/cnxk/cn20k_tx.h:158:
+ " tbnz %[pkts], 63, .Lrty%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#382: FILE: drivers/net/cnxk/cn20k_tx.h:159:
+ ".Ldne%=:
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#401: FILE: drivers/net/cnxk/cn20k_tx.h:178:
+ " ldxr %[val], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#402: FILE: drivers/net/cnxk/cn20k_tx.h:179:
+ " sub %[val], %[adj], %[val]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#403: FILE: drivers/net/cnxk/cn20k_tx.h:180:
+ " lsl %[refill], %[val], %[shft]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#404: FILE: drivers/net/cnxk/cn20k_tx.h:181:
+ " sub %[refill], %[refill], %[val]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#405: FILE: drivers/net/cnxk/cn20k_tx.h:182:
+ " sub %[refill], %[refill], %[sub]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#406: FILE: drivers/net/cnxk/cn20k_tx.h:183:
+ " cmp %[refill], #0x0
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#407: FILE: drivers/net/cnxk/cn20k_tx.h:184:
+ " b.ge .Ldne%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#408: FILE: drivers/net/cnxk/cn20k_tx.h:185:
+ " sevl
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#409: FILE: drivers/net/cnxk/cn20k_tx.h:186:
+ ".Lrty%=: wfe
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#410: FILE: drivers/net/cnxk/cn20k_tx.h:187:
+ " ldxr %[val], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#411: FILE: drivers/net/cnxk/cn20k_tx.h:188:
+ " sub %[val], %[adj], %[val]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#412: FILE: drivers/net/cnxk/cn20k_tx.h:189:
+ " lsl %[refill], %[val], %[shft]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#413: FILE: drivers/net/cnxk/cn20k_tx.h:190:
+ " sub %[refill], %[refill], %[val]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#414: FILE: drivers/net/cnxk/cn20k_tx.h:191:
+ " sub %[refill], %[refill], %[sub]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#415: FILE: drivers/net/cnxk/cn20k_tx.h:192:
+ " cmp %[refill], #0x0
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#416: FILE: drivers/net/cnxk/cn20k_tx.h:193:
+ " b.lt .Lrty%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#417: FILE: drivers/net/cnxk/cn20k_tx.h:194:
+ ".Ldne%=:
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#517: FILE: drivers/net/cnxk/cn20k_tx.h:294:
+ " ldxr %w[pkts], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#518: FILE: drivers/net/cnxk/cn20k_tx.h:295:
+ " tbz %w[pkts], 31, .Ldne%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#519: FILE: drivers/net/cnxk/cn20k_tx.h:296:
+ " sevl
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#520: FILE: drivers/net/cnxk/cn20k_tx.h:297:
+ ".Lrty%=: wfe
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#521: FILE: drivers/net/cnxk/cn20k_tx.h:298:
+ " ldxr %w[pkts], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#522: FILE: drivers/net/cnxk/cn20k_tx.h:299:
+ " tbnz %w[pkts], 31, .Lrty%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#523: FILE: drivers/net/cnxk/cn20k_tx.h:300:
+ ".Ldne%=:
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#541: FILE: drivers/net/cnxk/cn20k_tx.h:318:
+ " ldxr %[refill], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#542: FILE: drivers/net/cnxk/cn20k_tx.h:319:
+ " sub %[refill], %[desc], %[refill]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#543: FILE: drivers/net/cnxk/cn20k_tx.h:320:
+ " sub %[refill], %[refill], %[pkts]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#544: FILE: drivers/net/cnxk/cn20k_tx.h:321:
+ " cmp %[refill], #0x0
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#545: FILE: drivers/net/cnxk/cn20k_tx.h:322:
+ " b.ge .Ldne%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#546: FILE: drivers/net/cnxk/cn20k_tx.h:323:
+ " sevl
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#547: FILE: drivers/net/cnxk/cn20k_tx.h:324:
+ ".Lrty%=: wfe
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#548: FILE: drivers/net/cnxk/cn20k_tx.h:325:
+ " ldxr %[refill], [%[addr]]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#549: FILE: drivers/net/cnxk/cn20k_tx.h:326:
+ " sub %[refill], %[desc], %[refill]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#550: FILE: drivers/net/cnxk/cn20k_tx.h:327:
+ " sub %[refill], %[refill], %[pkts]
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#551: FILE: drivers/net/cnxk/cn20k_tx.h:328:
+ " cmp %[refill], #0x0
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#552: FILE: drivers/net/cnxk/cn20k_tx.h:329:
+ " b.lt .Lrty%=
"
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#553: FILE: drivers/net/cnxk/cn20k_tx.h:330:
+ ".Ldne%=:
"
CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
#691: FILE: drivers/net/cnxk/cn20k_tx.h:468:
+ cmd23 = vsetq_lane_u64(
total: 0 errors, 47 warnings, 7 checks, 1150 lines checked
Warning in drivers/net/cnxk/cn20k_tx.h:
Using __atomic_xxx/__ATOMIC_XXX built-ins, prefer rte_atomic_xxx/rte_memory_order_xxx
^ permalink raw reply [flat|nested] only message in thread