automatic DPDK test reports
 help / color / mirror / Atom feed
From: checkpatch@dpdk.org
To: test-report@dpdk.org
Cc: Nithin Dabilpuram <ndabilpuram@marvell.com>
Subject: |WARNING| pw143877 [PATCH 23/33] net/cnxk: support Tx burst scalar for cn20k
Date: Tue, 10 Sep 2024 11:35:37 +0200 (CEST)	[thread overview]
Message-ID: <20240910093537.7A7C3121D10@dpdk.org> (raw)
In-Reply-To: <20240910085909.1514457-24-ndabilpuram@marvell.com>

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

           reply	other threads:[~2024-09-10  9:35 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20240910085909.1514457-24-ndabilpuram@marvell.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=20240910093537.7A7C3121D10@dpdk.org \
    --to=checkpatch@dpdk.org \
    --cc=ndabilpuram@marvell.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).