whitespace around keywords
cover whitespace around keywords
The DPDK standard now enforced through checkpatch is to use a space after keywords. Much of the older code that was grandfathered in doesn't follow that, so fix it.
No urgency to this patchset, and it might just be viewed as churn. But I prefer to read code that looks all the same.
“A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. He may as well concern himself with his shadow on the wall." -- Ralph Waldo Emerson
Stephen Hemminger (14):
eal: fix whitespace
cmdline: fix whitespace
timer: fix whitespace
ip_frag: fix whitespace
testpmd: fix whitspace
test: fix whitespace
examples/qos_sched: fix whitespace
examples/vhost: fix whitespace
l3fwd: fix whitespace
examples: fix whitespace
bus/pci: fix whitespace
net/e1000: fix whitespace
net/i40e: fix whitespace
net/bnx2x: fix whitespace
app/test-pmd/cmdline.c | 30 +++++++++++----------- app/test-pmd/parameters.c | 8 +++--- app/test-pmd/testpmd.c | 2 +- app/test/test_cmdline_cirbuf.c | 4 +-- app/test/test_debug.c | 4 +-- app/test/test_hash.c | 8 +++--- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++----- app/test/test_mbuf.c | 12 ++++----- app/test/test_spinlock.c | 2 +- drivers/bus/pci/bsd/pci.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/e1000/em_ethdev.c | 4 +-- drivers/net/e1000/igb_ethdev.c | 8 +++--- drivers/net/i40e/i40e_pf.c | 8 +++--- examples/cmdline/parse_obj_list.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/l3fwd-power/main.c | 6 ++--- examples/l3fwd/main.c | 6 ++--- examples/multi_process/symmetric_mp/main.c | 6 ++--- examples/qos_sched/app_thread.c | 6 ++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 +-- examples/vhost/main.c | 6 ++--- lib/cmdline/cmdline_parse_string.c | 10 ++++---- lib/cmdline/cmdline_rdline.c | 6 ++--- lib/eal/linux/eal_hugepage_info.c | 6 ++--- lib/eal/linux/eal_interrupts.c | 2 +- lib/ip_frag/rte_ipv4_reassembly.c | 2 +- lib/timer/rte_timer.c | 2 +- 31 files changed, 90 insertions(+), 90 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/14 eal: fix whitespace
Add space after keywords.
--- lib/eal/linux/eal_hugepage_info.c | 6 +++--- lib/eal/linux/eal_interrupts.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
lib/eal/linux/eal_hugepage_info.c +3 -3
@@ -180,8 +180,8 @@ get_default_hp_size(void)FILE *fd =fopen (proc_meminfo,"r" );if (fd ==NULL )rte_panic ("Cannot open %s\n" , proc_meminfo); -while (fgets (buffer,sizeof (buffer), fd)){ -if (strncmp (buffer, str_hugepagesz, hugepagesz_len) ==0 ){ +while (fgets (buffer,sizeof (buffer), fd)) { +if (strncmp (buffer, str_hugepagesz, hugepagesz_len) ==0 ) { size =rte_str_to_size (&buffer[hugepagesz_len]);break ; }
@@ -231,7 +231,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)if (default_size ==0 ) default_size =get_default_hp_size (); -while (fgets (buf,sizeof (buf), fd)){ +while (fgets (buf,sizeof (buf), fd)) {const char *pagesz_str; if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
lib/eal/linux/eal_interrupts.c +1 -1
@@ -1073,7 +1073,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)struct epoll_event events[totalfds];int nfds =0 ; -for (;;) { +for (;;) { nfds =epoll_wait (pfd, events, totalfds,EAL_INTR_EPOLL_WAIT_FOREVER );/* epoll_wait fail */
Signature · 1 line
2.35.1
PATCH 2/14 cmdline: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
Remove unnecessary spaces in if expressions.
--- lib/cmdline/cmdline_parse_string.c | 10 +++++----- lib/cmdline/cmdline_rdline.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
lib/cmdline/cmdline_parse_string.c +5 -5
@@ -77,16 +77,16 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,continue ; } -if (strncmp (buf, str, token_len) ) { +if (strncmp (buf, str, token_len)) {continue ; } -if ( !cmdline_isendoftoken (*(buf+token_len)) ) { +if (!cmdline_isendoftoken (*(buf+token_len))) {continue ; }break ; - }while ( (str =get_next_token (str)) !=NULL ); + }while ( (str =get_next_token (str)) !=NULL );if (!str)return -1 ;
@@ -108,7 +108,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,/* unspecified string (unknown single token) */ else { token_len =0 ; -while (!cmdline_isendoftoken (buf[token_len]) && +while (!cmdline_isendoftoken (buf[token_len]) && token_len < (STR_TOKEN_SIZE -1 )) token_len++;
@@ -149,7 +149,7 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)return 0 ; str = sd->str; -while ( (str =get_next_token (str)) !=NULL ) { +while ((str =get_next_token (str)) !=NULL ) { ret++; }return ret;
lib/cmdline/cmdline_rdline.c +3 -3
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)/* delete 1 char from the left */ case CMDLINE_KEY_BKSPACE :case CMDLINE_KEY_BKSPACE2 : -if (!cirbuf_del_tail_safe (&rdl->left)) { +if (!cirbuf_del_tail_safe (&rdl->left)) {rdline_puts (rdl, vt100_bs);display_right_buffer (rdl,1 ); }
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)/* paste contents of kill buffer to the left side of caret */ case CMDLINE_KEY_CTRL_Y : i=0 ; -while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) < +while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) <RDLINE_BUF_SIZE && i < rdl->kill_size) {cirbuf_add_tail (&rdl->left, rdl->kill_buf[i]);
@@ -404,7 +404,7 @@ rdline_char_in(struct rdline *rdl, char c)/* add chars */ if (ret ==RDLINE_RES_COMPLETE ) { i=0 ; -while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) < +while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) <RDLINE_BUF_SIZE && i < tmp_size) {cirbuf_add_tail (&rdl->left, tmp_buf[i]);
Signature · 1 line
2.35.1
PATCH 3/14 timer: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- lib/timer/rte_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/timer/rte_timer.c +1 -1
@@ -350,7 +350,7 @@ timer_get_prev_entries(uint64_t time_val, unsigned tim_lcore, {unsigned lvl = priv_timer[tim_lcore].curr_skiplist_depth; prev[lvl] = &priv_timer[tim_lcore].pending_head; -while (lvl !=0 ) { +while (lvl !=0 ) { lvl--; prev[lvl] = prev[lvl+1 ]; while (prev[lvl]->sl_next[lvl] &&
Signature · 1 line
2.35.1
PATCH 4/14 ip_frag: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- lib/ip_frag/rte_ipv4_reassembly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/ip_frag/rte_ipv4_reassembly.c +1 -1
@@ -34,7 +34,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)for (i = n; i !=IP_FIRST_FRAG_IDX && ofs != first_len; i--) {/* previous fragment found. */ -if (fp->frags[i].ofs + fp->frags[i].len == ofs) { +if (fp->frags[i].ofs + fp->frags[i].len == ofs) {RTE_ASSERT (curr_idx != i);
Signature · 1 line
2.35.1
PATCH 5/14 testpmd: fix whitspace
In reply to Stephen HemmingerAdd space after keywords.
--- app/test-pmd/cmdline.c | 30 +++++++++++++++--------------- app/test-pmd/parameters.c | 8 ++++---- app/test-pmd/testpmd.c | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-)
app/test-pmd/cmdline.c +15 -15
@@ -2730,11 +2730,11 @@ parse_reta_config(const char *str,while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) +if ((p0 =strchr (p,')' )) ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -3242,15 +3242,15 @@ cmd_config_thresh_parsed(void *parsed_result,if (!strcmp (res->name,"txpt" )) tx_pthresh = res->value; -else if (!strcmp (res->name,"txht" )) +else if (!strcmp (res->name,"txht" )) tx_hthresh = res->value; -else if (!strcmp (res->name,"txwt" )) +else if (!strcmp (res->name,"txwt" )) tx_wthresh = res->value; -else if (!strcmp (res->name,"rxpt" )) +else if (!strcmp (res->name,"rxpt" )) rx_pthresh = res->value; -else if (!strcmp (res->name,"rxht" )) +else if (!strcmp (res->name,"rxht" )) rx_hthresh = res->value; -else if (!strcmp (res->name,"rxwt" )) +else if (!strcmp (res->name,"rxwt" )) rx_wthresh = res->value;else {fprintf (stderr,"Unknown parameter\n" );
@@ -4088,8 +4088,8 @@ cmd_vlan_offload_parsed(void *parsed_result, len =strnlen (str,STR_TOKEN_SIZE ); i =0 ;/* Get port_id first */ -while (i < len){ -if (str[i] ==',' ) +while (i < len){ +if (str[i] ==',' )break ; i++;
@@ -4097,7 +4097,7 @@ cmd_vlan_offload_parsed(void *parsed_result, str[i]='\0' ; tmp =strtoul (str,NULL ,0 );/* If port_id greater that what portid_t can represent, return */ -if (tmp >=RTE_MAX_ETHPORTS ) +if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp;
@@ -4108,17 +4108,17 @@ cmd_vlan_offload_parsed(void *parsed_result,if (!strcmp (res->what,"strip" ))rx_vlan_strip_set (port_id, on); -else if (!strcmp (res->what,"stripq" )){ +else if (!strcmp (res->what,"stripq" )){uint16_t queue_id =0 ;/* No queue_id, return */ -if (i +1 >= len) { +if (i +1 >= len) {fprintf (stderr,"must specify (port,queue_id)\n" );return ; } tmp =strtoul (str + i +1 ,NULL ,0 );/* If queue_id greater that what 16-bits can represent, return */ -if (tmp >0xffff ) +if (tmp >0xffff )return ; queue_id = (uint16_t )tmp;
@@ -7207,7 +7207,7 @@ static void cmd_mac_addr_parsed(void *parsed_result, ret =rte_eth_dev_mac_addr_remove (res->port_num, &res->address);/* check the return value and print it if is < 0 */ -if (ret <0 ) +if (ret <0 )fprintf (stderr,"mac_addr_cmd error: (%s)\n" ,strerror (-ret)); }
@@ -7780,7 +7780,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result, res->vf_num);#endif -if (ret <0 ) +if (ret <0 )fprintf (stderr,"vf_mac_addr_cmd error: (%s)\n" ,strerror (-ret)); }
app/test-pmd/parameters.c +4 -4
@@ -306,11 +306,11 @@ parse_portnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) +if ((p0 =strchr (p,')' )) ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -366,11 +366,11 @@ parse_ringnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) +if ((p0 =strchr (p,')' )) ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
app/test-pmd/testpmd.c +1 -1
@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first) test_done =0 ; -if (!no_flush_rx) +if (!no_flush_rx)flush_fwd_rx_queues ();rxtx_config_display ();
Signature · 1 line
2.35.1
PATCH 6/14 test: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- app/test/test_cmdline_cirbuf.c | 4 ++-- app/test/test_debug.c | 4 ++-- app/test/test_hash.c | 8 ++++---- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++++------- app/test/test_mbuf.c | 12 ++++++------ app/test/test_spinlock.c | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-)
app/test/test_cmdline_cirbuf.c +2 -2
@@ -708,7 +708,7 @@ test_cirbuf_char_fill(void)return -1 ; }/* delete buffer from tail */ -for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++) +for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++)cirbuf_del_tail_safe (&cb);/* try to delete from an empty buffer */ if (cirbuf_del_tail_safe (&cb) >=0 ) {
@@ -737,7 +737,7 @@ test_cirbuf_char_fill(void)return -1 ; }/* delete buffer from head */ -for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++) +for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++)cirbuf_del_head_safe (&cb);/* try to delete from an empty buffer */ if (cirbuf_del_head_safe (&cb) >=0 ) {
app/test/test_debug.c +2 -2
@@ -53,7 +53,7 @@ test_panic(void)return -1 ; }wait (&status); -if (status ==0 ){ +if (status ==0 ){printf ("Child process terminated normally!\n" );return -1 ; }else
@@ -84,7 +84,7 @@ test_exit_val(int exit_val) }wait (&status);printf ("Child process status: %d\n" , status); -if (!WIFEXITED (status) ||WEXITSTATUS (status) != (uint8_t )exit_val){ +if (!WIFEXITED (status) ||WEXITSTATUS (status) != (uint8_t )exit_val){printf ("Child process terminated with incorrect status (expected = %d)!\n" , exit_val);return -1 ;
app/test/test_hash.c +4 -4
@@ -72,7 +72,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21,rte_free (g_qsv); \return -1 ; \ } \ -}while (0 ) +}while (0 )/* * 5-tuple key type.
@@ -724,12 +724,12 @@ static int test_five_keys(void) }/* Lookup */ -for (i =0 ; i <5 ; i++) +for (i =0 ; i <5 ; i++) key_array[i] = &keys[i]; ret =rte_hash_lookup_bulk (handle, &key_array[0 ],5 , (int32_t *)pos); -if (ret ==0 ) -for (i =0 ; i <5 ; i++) { +if (ret ==0 ) +for (i =0 ; i <5 ; i++) {print_key_info ("Lkp" , key_array[i], pos[i]);RETURN_IF_ERROR (pos[i] != expected_pos[i],"failed to find key (pos[%u]=%d)" , i, pos[i]);
app/test/test_lpm6_perf.c +1 -1
@@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)printf ("--------------------------- \n" );/* Count depths. */ -for (i =1 ; i <=128 ; i++) { +for (i =1 ; i <=128 ; i++) {unsigned depth_counter =0 ;double percent_hits;
app/test/test_malloc.c +7 -7
@@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg) ret =-1 ;break ; } -for (j =0 ; j <1000 ; j++) { -if ( *(char *)p1 !=0 ) { +for (j =0 ; j <1000 ; j++) { +if ( *(char *)p1 !=0 ) {printf ("rte_zmalloc didn't zero the allocated memory\n" ); ret =-1 ; }
@@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg) ret =-1 ;break ; } -for (j =0 ; j <1000 ; j++) { -if ( *(char *)p1 !=0 ) { +for (j =0 ; j <1000 ; j++) { +if ( *(char *)p1 !=0 ) {printf ("rte_zmalloc didn't zero the allocated memory\n" ); ret =-1 ; }
@@ -331,12 +331,12 @@ test_multi_alloc_statistics(void)/* After freeing both allocations check stats return to original */ rte_malloc_get_socket_stats (socket, &post_stats); -if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) { +if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {printf ("Incorrect heap statistics: Total size \n" );return -1 ; }/* Check allocated size is equal to two additions plus overhead */ -if (second_stats.heap_allocsz_bytes != +if (second_stats.heap_allocsz_bytes != size + overhead + first_stats.heap_allocsz_bytes) {printf ("Incorrect heap statistics: Allocated size \n" );return -1 ;
@@ -495,7 +495,7 @@ test_realloc_socket(int socket)return -1 ; }/* calc an alignment we don't already have */ -while (RTE_PTR_ALIGN (ptr7, new_align) == ptr7) +while (RTE_PTR_ALIGN (ptr7, new_align) == ptr7) new_align *=2 ;char *ptr8 =rte_realloc_socket (ptr7, size7, new_align, socket);if (!ptr8){
app/test/test_mbuf.c +6 -6
@@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE];printf ("mbuf test FAILED (l.%d): <" str">\n" , \ __LINE__, ##__VA_ARGS__); \ goto fail; \ -}while (0 ) +}while (0 )/* * test data manipulation in mbuf with non-ascii data
@@ -154,7 +154,7 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool)return 0 ; fail: -if (m) { +if (m) {rte_pktmbuf_free (m); }return -1 ;
@@ -701,12 +701,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool) }struct rte_mbuf *extra =NULL ; extra =rte_pktmbuf_alloc (pktmbuf_pool); -if (extra !=NULL ) { +if (extra !=NULL ) {printf ("Error pool not empty" ); ret =-1 ; } extra =rte_pktmbuf_clone (m[0 ], pktmbuf_pool); -if (extra !=NULL ) { +if (extra !=NULL ) {printf ("Error pool not empty" ); ret =-1 ; }
@@ -966,7 +966,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)struct rte_mbuf *mb, *mt; mb = m[i]; -while (mb !=NULL ) { +while (mb !=NULL ) { mt = mb; mb = mb->next;rte_pktmbuf_free_seg (mt);
@@ -1195,7 +1195,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)return -1 ; }wait (&status); -if (status ==0 ) +if (status ==0 )return -1 ;return 0 ;
app/test/test_spinlock.c +1 -1
@@ -237,7 +237,7 @@ test_spinlock(void)/* * Try to acquire a lock that we already own */ -if (!rte_spinlock_recursive_trylock (&slr)) { +if (!rte_spinlock_recursive_trylock (&slr)) {printf ("rte_spinlock_recursive_trylock failed on a lock that " "we already own\n" ); ret =-1 ;
Signature · 1 line
2.35.1
PATCH 7/14 examples/qos_sched: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/qos_sched/app_thread.c | 6 +++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
examples/qos_sched/app_thread.c +3 -3
@@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs)if (likely (nb_rx !=0 )) {APP_STATS_ADD (conf->stat.nb_rx, nb_rx); -for (i =0 ; i < nb_rx; i++) { +for (i =0 ; i < nb_rx; i++) {get_pkt_sched (rx_mbufs[i], &subport, &pipe, &traffic_class, &queue, &color); rte_sched_port_pkt_write(conf->sched_port,
@@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs)if (unlikely (rte_ring_sp_enqueue_bulk (conf->rx_ring, (void **)rx_mbufs, nb_rx,NULL ) ==0 )) { -for (i =0 ; i < nb_rx; i++) { +for (i =0 ; i < nb_rx; i++) {rte_pktmbuf_free (rx_mbufs[i]);APP_STATS_ADD (conf->stat.nb_drop,1 );
@@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nbuint32_t i, len; len = qconf->n_mbufs; -for (i =0 ; i < nb_pkt; i++) { +for (i =0 ; i < nb_pkt; i++) { qconf->m_table[len] = mbufs[i]; len++;/* enough pkts to be sent */
examples/qos_sched/args.c +1 -1
@@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv)/* sanity check for cores assignment */ nb_lcores =app_cpu_core_count (); -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {if (qos_conf[i].rx_core >= nb_lcores) {RTE_LOG (ERR ,APP ,"pfc %u: invalid RX lcore index %u\n" , i +1 , qos_conf[i].rx_core);
examples/qos_sched/init.c +1 -1
@@ -323,7 +323,7 @@ int app_init(void)rte_exit (EXIT_FAILURE ,"Invalid configuration profile\n" );/* Initialize each active flow */ -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {uint32_t socket =rte_lcore_to_socket_id (qos_conf[i].rx_core);struct rte_ring *ring;
examples/qos_sched/main.c +2 -2
@@ -152,7 +152,7 @@ app_stat(void)static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS ];/* print statistics */ -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {struct flow_conf *flow = &qos_conf[i];rte_eth_stats_get (flow->rx_port, &stats);
@@ -212,7 +212,7 @@ main(int argc, char **argv) }else {/* print statistics every second */ -while (1 ) { +while (1 ) {sleep (1 );app_stat (); }
Signature · 1 line
2.35.1
RE: [PATCH 07/14] examples/qos_sched: fix whitespace
Quoted 12 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Wednesday, November 9, 2022 7:15 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Dumitrescu, Cristian <[email protected]>
Subject: [PATCH 07/14] examples/qos_sched: fix whitespaceAdd space after keywords.
Quoted 8 lines
Signed-off-by Stephen Hemminger <[email protected]>--- examples/qos_sched/app_thread.c | 6 +++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
PATCH 8/14 examples/vhost: fix whitespace
In reply to Stephen HemmingerAdd space after keywords
--- examples/vhost/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
examples/vhost/main.c +3 -3
@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused) } } -while (1 ) { +while (1 ) {drain_mbuf_table (tx_q);drain_vhost_table ();/*
@@ -1583,7 +1583,7 @@ destroy_device(int vid)return ;/*set the remove flag. */ vdev->remove =1 ; -while (vdev->ready !=DEVICE_SAFE_REMOVE ) { +while (vdev->ready !=DEVICE_SAFE_REMOVE ) {rte_pause (); }
@@ -1816,7 +1816,7 @@ print_stats(__rte_unused void *arg)const char clr[] = {27 ,'[' ,'2' ,'J' ,'\0' };const char top_left[] = {27 ,'[' ,'1' ,';' ,'1' ,'H' ,'\0' }; -while (1 ) { +while (1 ) {sleep (enable_stats);/* Clear screen and move to top left */
Signature · 1 line
2.35.1
PATCH 9/14 l3fwd: fix whitespace
In reply to Stephen HemmingerAdd space after keywoords
--- examples/l3fwd-power/main.c | 6 +++--- examples/l3fwd/main.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
examples/l3fwd-power/main.c +3 -3
@@ -1787,11 +1787,11 @@ parse_config(const char *q_arg)while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) +if ((p0 =strchr (p,')' )) ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -2946,7 +2946,7 @@ main(int argc, char **argv)fflush (stdout);/* init RX queues */ -for (queue =0 ; queue < qconf->n_rx_queue; ++queue) { +for (queue =0 ; queue < qconf->n_rx_queue; ++queue) {struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id;
examples/l3fwd/main.c +3 -3
@@ -516,11 +516,11 @@ parse_config(const char *q_arg)while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) +if ((p0 =strchr (p,')' )) ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -1366,7 +1366,7 @@ l3fwd_poll_resource_setup(void)printf ("\nInitializing rx queues on lcore %u ... " , lcore_id );fflush (stdout);/* init RX queues */ -for (queue =0 ; queue < qconf->n_rx_queue; ++queue) { +for (queue =0 ; queue < qconf->n_rx_queue; ++queue) {struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id;
Signature · 1 line
2.35.1
PATCH 10/14 examples: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/cmdline/parse_obj_list.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/multi_process/symmetric_mp/main.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
examples/cmdline/parse_obj_list.c +1 -1
@@ -42,7 +42,7 @@ parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,if (res && ressize <sizeof (struct object *))return -1 ; -while (!cmdline_isendoftoken (buf[token_len])) +while (!cmdline_isendoftoken (buf[token_len])) token_len++; SLIST_FOREACH(o, tkd->list, next) {
examples/ip_reassembly/main.c +1 -1
@@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)TX_LCORE_STAT_UPDATE (&qconf->tx_stat, queue,1 ); txmb->m_table[txmb->head] = m; -if (++txmb->head == len) +if (++txmb->head == len) txmb->head =0 ;return 0 ;
examples/multi_process/symmetric_mp/main.c +3 -3
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)/* get the port numbers from the port mask */ RTE_ETH_FOREACH_DEV(i) - if(port_mask & (1 << i)) + if (port_mask & (1 << i)) ports[num_ports++] = (uint8_t )i; ret = optind-1 ;
@@ -470,8 +470,8 @@ main(int argc, char **argv)/* Primary instance initialized. 8< */ if (num_ports &1 )rte_exit (EXIT_FAILURE ,"Application must use an even number of ports\n" ); -for (i =0 ; i < num_ports; i++){ -if (proc_type ==RTE_PROC_PRIMARY ) +for (i =0 ; i < num_ports; i++){ +if (proc_type ==RTE_PROC_PRIMARY )if (smp_port_init (ports[i], mp, (uint16_t )num_procs) <0 )rte_exit (EXIT_FAILURE ,"Error initialising ports\n" ); }
Signature · 1 line
2.35.1
PATCH 11/14 bus/pci: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/bus/pci/bsd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -368,7 +368,7 @@ rte_pci_scan(void) } dev_count += conf_io.num_matches; - }while (conf_io.status ==PCI_GETCONF_MORE_DEVS ); + }while (conf_io.status ==PCI_GETCONF_MORE_DEVS );close (fd);
Signature · 1 line
2.35.1
PATCH 12/14 net/e1000: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/e1000/em_ethdev.c | 4 ++-- drivers/net/e1000/igb_ethdev.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/e1000/em_ethdev.c +2 -2
@@ -872,8 +872,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)E1000_DEV_PRIVATE_TO_STATS (dev->data->dev_private);int pause_frames; -if (hw->phy.media_type == e1000_media_type_copper || - (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { +if (hw->phy.media_type == e1000_media_type_copper || + (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { stats->symerrs +=E1000_READ_REG (hw,E1000_SYMERRS ); stats->sec +=E1000_READ_REG (hw,E1000_SEC ); }
drivers/net/e1000/igb_ethdev.c +4 -4
@@ -1683,7 +1683,7 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)uint64_t old_rpthc = stats->rpthc;uint64_t old_hgptc = stats->hgptc; -if (hw->phy.media_type == e1000_media_type_copper || +if (hw->phy.media_type == e1000_media_type_copper || (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { stats->symerrs +=E1000_READ_REG (hw,E1000_SYMERRS );
@@ -3500,10 +3500,10 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)for (i =0 ; i <IGB_VFTA_SIZE ; i++){ vfta = shadow_vfta->vfta[i]; -if (vfta){ +if (vfta){ mask =1 ;for (j =0 ; j <32 ; j++){ -if (vfta & mask) +if (vfta & mask)igbvf_set_vfta (hw, (uint16_t )((i<<5 )+j), on); mask<<=1 ;
@@ -3528,7 +3528,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)/*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/ ret =igbvf_set_vfta (hw, vlan_id, !!on); -if (ret){ +if (ret){PMD_INIT_LOG (ERR ,"Unable to set VF vlan" );return ret; }
Signature · 1 line
2.35.1
PATCH 13/14 net/i40e: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/i40e/i40e_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_pf.c +4 -4
@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_add_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }
@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf, vid = vlan_filter_list->vlan_id;for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_delete_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }
@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)* return if SRIOV not enabled, VF number not configured or * no queue assigned. */ -if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 ) +if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 )return I40E_SUCCESS ;/* Allocate memory to store VF structure */ pf->vfs =rte_zmalloc ("i40e_pf_vf" ,sizeof (*pf->vfs) * pf->vf_num,0 ); -if (pf->vfs ==NULL ) +if (pf->vfs ==NULL )return -ENOMEM ;/* Disable irq0 for VFR event */
Signature · 1 line
2.35.1
PATCH 14/14 net/bnx2x: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/bnx2x/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnx2x/bnx2x.h +1 -1
@@ -96,7 +96,7 @@ int bnx2x_ilog2(int x)int log =0 ; x >>=1 ; -while (x) { +while (x) { log++; x >>=1 ; }
Signature · 1 line
2.35.1
v2 cover whitespace after keywords
In reply to Stephen HemmingerThe DPDK standard now enforced through checkpatch is to use a space after keywords. Much of the older code that was grandfathered in doesn't follow that, so fix it.
No urgency to this patchset, and it might just be viewed as churn. But I prefer to read code that looks all the same.
“A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. He may as well concern himself with his shadow on the wall." -- Ralph Waldo Emerson
v2 - fix related complaints from checkpatch
if you touch a line, then it wants to make all the rules apply.
Stephen Hemminger (14):
eal: fix whitespace
cmdline: fix whitespace
timer: fix whitespace
ip_frag: fix whitespace
testpmd: fix whitespace
test: fix whitespace
examples/qos_sched: fix whitespace
examples/vhost: fix whitespace
l3fwd: fix whitespace
examples: fix whitespace
bus/pci: fix whitespace
net/e1000: fix whitespace
net/i40e: fix whitespace
net/bnx2x: fix whitespace
app/test-pmd/cmdline.c | 31 +++++++++++----------- app/test-pmd/parameters.c | 10 ++++--- app/test-pmd/testpmd.c | 2 +- app/test/test_cmdline_cirbuf.c | 4 +-- app/test/test_debug.c | 4 +-- app/test/test_hash.c | 6 ++--- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++----- app/test/test_mbuf.c | 14 +++++----- app/test/test_spinlock.c | 2 +- drivers/bus/pci/bsd/pci.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/e1000/em_ethdev.c | 4 +-- drivers/net/e1000/igb_ethdev.c | 8 +++--- drivers/net/i40e/i40e_pf.c | 8 +++--- examples/cmdline/parse_obj_list.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/l3fwd-power/main.c | 7 ++--- examples/l3fwd/main.c | 7 ++--- examples/multi_process/symmetric_mp/main.c | 6 ++--- examples/qos_sched/app_thread.c | 6 ++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 +-- examples/vhost/main.c | 7 +++-- lib/cmdline/cmdline_parse_string.c | 16 +++++------ lib/cmdline/cmdline_rdline.c | 12 ++++----- lib/eal/linux/eal_hugepage_info.c | 6 ++--- lib/eal/linux/eal_interrupts.c | 2 +- lib/ip_frag/rte_ipv4_reassembly.c | 2 +- lib/timer/rte_timer.c | 2 +- 31 files changed, 99 insertions(+), 99 deletions(-)
Signature · 1 line
2.35.1
PATCH v2 1/14 eal: fix whitespace
Add space after keywords.
--- lib/eal/linux/eal_hugepage_info.c | 6 +++--- lib/eal/linux/eal_interrupts.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
lib/eal/linux/eal_hugepage_info.c +3 -3
@@ -180,8 +180,8 @@ get_default_hp_size(void)FILE *fd =fopen (proc_meminfo,"r" );if (fd ==NULL )rte_panic ("Cannot open %s\n" , proc_meminfo); -while (fgets (buffer,sizeof (buffer), fd)){ -if (strncmp (buffer, str_hugepagesz, hugepagesz_len) ==0 ){ +while (fgets (buffer,sizeof (buffer), fd)) { +if (strncmp (buffer, str_hugepagesz, hugepagesz_len) ==0 ) { size =rte_str_to_size (&buffer[hugepagesz_len]);break ; }
@@ -231,7 +231,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)if (default_size ==0 ) default_size =get_default_hp_size (); -while (fgets (buf,sizeof (buf), fd)){ +while (fgets (buf,sizeof (buf), fd)) {const char *pagesz_str; if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
lib/eal/linux/eal_interrupts.c +1 -1
@@ -1073,7 +1073,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)struct epoll_event events[totalfds];int nfds =0 ; -for (;;) { +for (;;) { nfds =epoll_wait (pfd, events, totalfds,EAL_INTR_EPOLL_WAIT_FOREVER );/* epoll_wait fail */
Signature · 1 line
2.35.1
PATCH v2 2/14 cmdline: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
Remove unnecessary spaces in if expressions.
--- lib/cmdline/cmdline_parse_string.c | 16 +++++++--------- lib/cmdline/cmdline_rdline.c | 12 ++++++------ 2 files changed, 13 insertions(+), 15 deletions(-)
lib/cmdline/cmdline_parse_string.c +7 -9
@@ -73,20 +73,18 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res, token_len =get_token_len (str);/* if token is too big... */ -if (token_len >=STR_TOKEN_SIZE -1 ) { +if (token_len >=STR_TOKEN_SIZE -1 )continue ; } -if (strncmp (buf, str, token_len) ) { +if (strncmp (buf, str, token_len))continue ; - } -if ( !cmdline_isendoftoken (*(buf+token_len)) ) { +if (!cmdline_isendoftoken (*(buf+token_len)))continue ; - }break ; - }while ( (str =get_next_token (str)) !=NULL ); + }while ((str =get_next_token (str)) !=NULL );if (!str)return -1 ;
@@ -108,7 +106,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,/* unspecified string (unknown single token) */ else { token_len =0 ; -while (!cmdline_isendoftoken (buf[token_len]) && +while (!cmdline_isendoftoken (buf[token_len]) && token_len < (STR_TOKEN_SIZE -1 )) token_len++;
@@ -149,9 +147,9 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)return 0 ; str = sd->str; -while ( (str =get_next_token (str)) !=NULL ) { +while ((str =get_next_token (str)) !=NULL ) ret++; - } +return ret; }
lib/cmdline/cmdline_rdline.c +6 -6
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)/* delete 1 char from the left */ case CMDLINE_KEY_BKSPACE :case CMDLINE_KEY_BKSPACE2 : -if (!cirbuf_del_tail_safe (&rdl->left)) { +if (!cirbuf_del_tail_safe (&rdl->left)) {rdline_puts (rdl, vt100_bs);display_right_buffer (rdl,1 ); }
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)/* paste contents of kill buffer to the left side of caret */ case CMDLINE_KEY_CTRL_Y : i=0 ; -while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) < +while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) <RDLINE_BUF_SIZE && i < rdl->kill_size) {cirbuf_add_tail (&rdl->left, rdl->kill_buf[i]);
@@ -403,10 +403,10 @@ rdline_char_in(struct rdline *rdl, char c) tmp_size =strnlen (tmp_buf,sizeof (tmp_buf));/* add chars */ if (ret ==RDLINE_RES_COMPLETE ) { - i=0 ; -while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) < -RDLINE_BUF_SIZE && - i < tmp_size) { + i =0 ; +while (CIRBUF_GET_LEN (&rdl->right) + +CIRBUF_GET_LEN (&rdl->left) < +RDLINE_BUF_SIZE && i < tmp_size) {cirbuf_add_tail (&rdl->left, tmp_buf[i]); rdl->write_char (rdl, tmp_buf[i]); i++;
Signature · 1 line
2.35.1
PATCH v2 3/14 timer: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- lib/timer/rte_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/timer/rte_timer.c +1 -1
@@ -350,7 +350,7 @@ timer_get_prev_entries(uint64_t time_val, unsigned tim_lcore, {unsigned lvl = priv_timer[tim_lcore].curr_skiplist_depth; prev[lvl] = &priv_timer[tim_lcore].pending_head; -while (lvl !=0 ) { +while (lvl !=0 ) { lvl--; prev[lvl] = prev[lvl+1 ]; while (prev[lvl]->sl_next[lvl] &&
Signature · 1 line
2.35.1
PATCH v2 4/14 ip_frag: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- lib/ip_frag/rte_ipv4_reassembly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/ip_frag/rte_ipv4_reassembly.c +1 -1
@@ -34,7 +34,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)for (i = n; i !=IP_FIRST_FRAG_IDX && ofs != first_len; i--) {/* previous fragment found. */ -if (fp->frags[i].ofs + fp->frags[i].len == ofs) { +if (fp->frags[i].ofs + fp->frags[i].len == ofs) {RTE_ASSERT (curr_idx != i);
Signature · 1 line
2.35.1
PATCH v2 5/14 testpmd: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- app/test-pmd/cmdline.c | 31 ++++++++++++++++--------------- app/test-pmd/parameters.c | 10 ++++++---- app/test-pmd/testpmd.c | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-)
app/test-pmd/cmdline.c +16 -15
@@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -3242,15 +3243,15 @@ cmd_config_thresh_parsed(void *parsed_result,if (!strcmp (res->name,"txpt" )) tx_pthresh = res->value; -else if (!strcmp (res->name,"txht" )) +else if (!strcmp (res->name,"txht" )) tx_hthresh = res->value; -else if (!strcmp (res->name,"txwt" )) +else if (!strcmp (res->name,"txwt" )) tx_wthresh = res->value; -else if (!strcmp (res->name,"rxpt" )) +else if (!strcmp (res->name,"rxpt" )) rx_pthresh = res->value; -else if (!strcmp (res->name,"rxht" )) +else if (!strcmp (res->name,"rxht" )) rx_hthresh = res->value; -else if (!strcmp (res->name,"rxwt" )) +else if (!strcmp (res->name,"rxwt" )) rx_wthresh = res->value;else {fprintf (stderr,"Unknown parameter\n" );
@@ -4088,8 +4089,8 @@ cmd_vlan_offload_parsed(void *parsed_result, len =strnlen (str,STR_TOKEN_SIZE ); i =0 ;/* Get port_id first */ -while (i < len){ -if (str[i] ==',' ) +while (i < len) { +if (str[i] ==',' )break ; i++;
@@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result, str[i]='\0' ; tmp =strtoul (str,NULL ,0 );/* If port_id greater that what portid_t can represent, return */ -if (tmp >=RTE_MAX_ETHPORTS ) +if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp;
@@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,if (!strcmp (res->what,"strip" ))rx_vlan_strip_set (port_id, on); -else if (!strcmp (res->what,"stripq" )){ +else if (!strcmp (res->what,"stripq" )) {uint16_t queue_id =0 ;/* No queue_id, return */ -if (i +1 >= len) { +if (i +1 >= len) {fprintf (stderr,"must specify (port,queue_id)\n" );return ; } tmp =strtoul (str + i +1 ,NULL ,0 );/* If queue_id greater that what 16-bits can represent, return */ -if (tmp >0xffff ) +if (tmp >0xffff )return ; queue_id = (uint16_t )tmp;
@@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void *parsed_result, ret =rte_eth_dev_mac_addr_remove (res->port_num, &res->address);/* check the return value and print it if is < 0 */ -if (ret <0 ) +if (ret <0 )fprintf (stderr,"mac_addr_cmd error: (%s)\n" ,strerror (-ret)); }
@@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result, res->vf_num);#endif -if (ret <0 ) +if (ret <0 )fprintf (stderr,"vf_mac_addr_cmd error: (%s)\n" ,strerror (-ret)); }
app/test-pmd/parameters.c +6 -4
@@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -366,11 +367,12 @@ parse_ringnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
app/test-pmd/testpmd.c +1 -1
@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first) test_done =0 ; -if (!no_flush_rx) +if (!no_flush_rx)flush_fwd_rx_queues ();rxtx_config_display ();
Signature · 1 line
2.35.1
PATCH v2 6/14 test: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- app/test/test_cmdline_cirbuf.c | 4 ++-- app/test/test_debug.c | 4 ++-- app/test/test_hash.c | 6 +++--- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++++------- app/test/test_mbuf.c | 14 ++++++-------- app/test/test_spinlock.c | 2 +- 7 files changed, 22 insertions(+), 24 deletions(-)
app/test/test_cmdline_cirbuf.c +2 -2
@@ -708,7 +708,7 @@ test_cirbuf_char_fill(void)return -1 ; }/* delete buffer from tail */ -for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++) +for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++)cirbuf_del_tail_safe (&cb);/* try to delete from an empty buffer */ if (cirbuf_del_tail_safe (&cb) >=0 ) {
@@ -737,7 +737,7 @@ test_cirbuf_char_fill(void)return -1 ; }/* delete buffer from head */ -for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++) +for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++)cirbuf_del_head_safe (&cb);/* try to delete from an empty buffer */ if (cirbuf_del_head_safe (&cb) >=0 ) {
app/test/test_debug.c +2 -2
@@ -53,7 +53,7 @@ test_panic(void)return -1 ; }wait (&status); -if (status ==0 ){ +if (status ==0 ) {printf ("Child process terminated normally!\n" );return -1 ; }else
@@ -84,7 +84,7 @@ test_exit_val(int exit_val) }wait (&status);printf ("Child process status: %d\n" , status); -if (!WIFEXITED (status) ||WEXITSTATUS (status) != (uint8_t )exit_val){ +if (!WIFEXITED (status) ||WEXITSTATUS (status) != (uint8_t )exit_val) {printf ("Child process terminated with incorrect status (expected = %d)!\n" , exit_val);return -1 ;
app/test/test_hash.c +3 -3
@@ -724,12 +724,12 @@ static int test_five_keys(void) }/* Lookup */ -for (i =0 ; i <5 ; i++) +for (i =0 ; i <5 ; i++) key_array[i] = &keys[i]; ret =rte_hash_lookup_bulk (handle, &key_array[0 ],5 , (int32_t *)pos); -if (ret ==0 ) -for (i =0 ; i <5 ; i++) { +if (ret ==0 ) +for (i =0 ; i <5 ; i++) {print_key_info ("Lkp" , key_array[i], pos[i]);RETURN_IF_ERROR (pos[i] != expected_pos[i],"failed to find key (pos[%u]=%d)" , i, pos[i]);
app/test/test_lpm6_perf.c +1 -1
@@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)printf ("--------------------------- \n" );/* Count depths. */ -for (i =1 ; i <=128 ; i++) { +for (i =1 ; i <=128 ; i++) {unsigned depth_counter =0 ;double percent_hits;
app/test/test_malloc.c +7 -7
@@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg) ret =-1 ;break ; } -for (j =0 ; j <1000 ; j++) { -if ( *(char *)p1 !=0 ) { +for (j =0 ; j <1000 ; j++) { +if (*(char *)p1 !=0 ) {printf ("rte_zmalloc didn't zero the allocated memory\n" ); ret =-1 ; }
@@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg) ret =-1 ;break ; } -for (j =0 ; j <1000 ; j++) { -if ( *(char *)p1 !=0 ) { +for (j =0 ; j <1000 ; j++) { +if (*(char *)p1 !=0 ) {printf ("rte_zmalloc didn't zero the allocated memory\n" ); ret =-1 ; }
@@ -331,12 +331,12 @@ test_multi_alloc_statistics(void)/* After freeing both allocations check stats return to original */ rte_malloc_get_socket_stats (socket, &post_stats); -if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) { +if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {printf ("Incorrect heap statistics: Total size \n" );return -1 ; }/* Check allocated size is equal to two additions plus overhead */ -if (second_stats.heap_allocsz_bytes != +if (second_stats.heap_allocsz_bytes != size + overhead + first_stats.heap_allocsz_bytes) {printf ("Incorrect heap statistics: Allocated size \n" );return -1 ;
@@ -495,7 +495,7 @@ test_realloc_socket(int socket)return -1 ; }/* calc an alignment we don't already have */ -while (RTE_PTR_ALIGN (ptr7, new_align) == ptr7) +while (RTE_PTR_ALIGN (ptr7, new_align) == ptr7) new_align *=2 ;char *ptr8 =rte_realloc_socket (ptr7, size7, new_align, socket);if (!ptr8){
app/test/test_mbuf.c +6 -8
@@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE];printf ("mbuf test FAILED (l.%d): <" str">\n" , \ __LINE__, ##__VA_ARGS__); \ goto fail; \ -}while (0 ) +}while (0 )/* * test data manipulation in mbuf with non-ascii data
@@ -154,9 +154,7 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool)return 0 ; fail: -if (m) { -rte_pktmbuf_free (m); - } +rte_pktmbuf_free (m);return -1 ; }
@@ -701,12 +699,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool) }struct rte_mbuf *extra =NULL ; extra =rte_pktmbuf_alloc (pktmbuf_pool); -if (extra !=NULL ) { +if (extra !=NULL ) {printf ("Error pool not empty" ); ret =-1 ; } extra =rte_pktmbuf_clone (m[0 ], pktmbuf_pool); -if (extra !=NULL ) { +if (extra !=NULL ) {printf ("Error pool not empty" ); ret =-1 ; }
@@ -966,7 +964,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)struct rte_mbuf *mb, *mt; mb = m[i]; -while (mb !=NULL ) { +while (mb !=NULL ) { mt = mb; mb = mb->next;rte_pktmbuf_free_seg (mt);
@@ -1195,7 +1193,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)return -1 ; }wait (&status); -if (status ==0 ) +if (status ==0 )return -1 ;return 0 ;
app/test/test_spinlock.c +1 -1
@@ -237,7 +237,7 @@ test_spinlock(void)/* * Try to acquire a lock that we already own */ -if (!rte_spinlock_recursive_trylock (&slr)) { +if (!rte_spinlock_recursive_trylock (&slr)) {printf ("rte_spinlock_recursive_trylock failed on a lock that " "we already own\n" ); ret =-1 ;
Signature · 1 line
2.35.1
PATCH v2 7/14 examples/qos_sched: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/qos_sched/app_thread.c | 6 +++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
examples/qos_sched/app_thread.c +3 -3
@@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs)if (likely (nb_rx !=0 )) {APP_STATS_ADD (conf->stat.nb_rx, nb_rx); -for (i =0 ; i < nb_rx; i++) { +for (i =0 ; i < nb_rx; i++) {get_pkt_sched (rx_mbufs[i], &subport, &pipe, &traffic_class, &queue, &color); rte_sched_port_pkt_write(conf->sched_port,
@@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs)if (unlikely (rte_ring_sp_enqueue_bulk (conf->rx_ring, (void **)rx_mbufs, nb_rx,NULL ) ==0 )) { -for (i =0 ; i < nb_rx; i++) { +for (i =0 ; i < nb_rx; i++) {rte_pktmbuf_free (rx_mbufs[i]);APP_STATS_ADD (conf->stat.nb_drop,1 );
@@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nbuint32_t i, len; len = qconf->n_mbufs; -for (i =0 ; i < nb_pkt; i++) { +for (i =0 ; i < nb_pkt; i++) { qconf->m_table[len] = mbufs[i]; len++;/* enough pkts to be sent */
examples/qos_sched/args.c +1 -1
@@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv)/* sanity check for cores assignment */ nb_lcores =app_cpu_core_count (); -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {if (qos_conf[i].rx_core >= nb_lcores) {RTE_LOG (ERR ,APP ,"pfc %u: invalid RX lcore index %u\n" , i +1 , qos_conf[i].rx_core);
examples/qos_sched/init.c +1 -1
@@ -323,7 +323,7 @@ int app_init(void)rte_exit (EXIT_FAILURE ,"Invalid configuration profile\n" );/* Initialize each active flow */ -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {uint32_t socket =rte_lcore_to_socket_id (qos_conf[i].rx_core);struct rte_ring *ring;
examples/qos_sched/main.c +2 -2
@@ -152,7 +152,7 @@ app_stat(void)static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS ];/* print statistics */ -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {struct flow_conf *flow = &qos_conf[i];rte_eth_stats_get (flow->rx_port, &stats);
@@ -212,7 +212,7 @@ main(int argc, char **argv) }else {/* print statistics every second */ -while (1 ) { +while (1 ) {sleep (1 );app_stat (); }
Signature · 1 line
2.35.1
PATCH v2 8/14 examples/vhost: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/vhost/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
examples/vhost/main.c +3 -4
@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused) } } -while (1 ) { +while (1 ) {drain_mbuf_table (tx_q);drain_vhost_table ();/*
@@ -1583,9 +1583,8 @@ destroy_device(int vid)return ;/*set the remove flag. */ vdev->remove =1 ; -while (vdev->ready !=DEVICE_SAFE_REMOVE ) { +while (vdev->ready !=DEVICE_SAFE_REMOVE )rte_pause (); - }for (i =0 ; i <RTE_MAX_LCORE ; i++)rte_free (vhost_txbuff[i *RTE_MAX_VHOST_DEVICE + vid]);
@@ -1816,7 +1815,7 @@ print_stats(__rte_unused void *arg)const char clr[] = {27 ,'[' ,'2' ,'J' ,'\0' };const char top_left[] = {27 ,'[' ,'1' ,';' ,'1' ,'H' ,'\0' }; -while (1 ) { +while (1 ) {sleep (enable_stats);/* Clear screen and move to top left */
Signature · 1 line
2.35.1
PATCH v2 9/14 l3fwd: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/l3fwd-power/main.c | 7 ++++--- examples/l3fwd/main.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
examples/l3fwd-power/main.c +4 -3
@@ -1787,11 +1787,12 @@ parse_config(const char *q_arg)while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -2946,7 +2947,7 @@ main(int argc, char **argv)fflush (stdout);/* init RX queues */ -for (queue =0 ; queue < qconf->n_rx_queue; ++queue) { +for (queue =0 ; queue < qconf->n_rx_queue; ++queue) {struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id;
examples/l3fwd/main.c +4 -3
@@ -516,11 +516,12 @@ parse_config(const char *q_arg)while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -1366,7 +1367,7 @@ l3fwd_poll_resource_setup(void)printf ("\nInitializing rx queues on lcore %u ... " , lcore_id );fflush (stdout);/* init RX queues */ -for (queue =0 ; queue < qconf->n_rx_queue; ++queue) { +for (queue =0 ; queue < qconf->n_rx_queue; ++queue) {struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id;
Signature · 1 line
2.35.1
PATCH v2 10/14 examples: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/cmdline/parse_obj_list.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/multi_process/symmetric_mp/main.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
examples/cmdline/parse_obj_list.c +1 -1
@@ -42,7 +42,7 @@ parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,if (res && ressize <sizeof (struct object *))return -1 ; -while (!cmdline_isendoftoken (buf[token_len])) +while (!cmdline_isendoftoken (buf[token_len])) token_len++; SLIST_FOREACH(o, tkd->list, next) {
examples/ip_reassembly/main.c +1 -1
@@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)TX_LCORE_STAT_UPDATE (&qconf->tx_stat, queue,1 ); txmb->m_table[txmb->head] = m; -if (++txmb->head == len) +if (++txmb->head == len) txmb->head =0 ;return 0 ;
examples/multi_process/symmetric_mp/main.c +3 -3
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)/* get the port numbers from the port mask */ RTE_ETH_FOREACH_DEV(i) - if(port_mask & (1 << i)) + if (port_mask & (1 << i)) ports[num_ports++] = (uint8_t )i; ret = optind-1 ;
@@ -470,8 +470,8 @@ main(int argc, char **argv)/* Primary instance initialized. 8< */ if (num_ports &1 )rte_exit (EXIT_FAILURE ,"Application must use an even number of ports\n" ); -for (i =0 ; i < num_ports; i++){ -if (proc_type ==RTE_PROC_PRIMARY ) +for (i =0 ; i < num_ports; i++) { +if (proc_type ==RTE_PROC_PRIMARY )if (smp_port_init (ports[i], mp, (uint16_t )num_procs) <0 )rte_exit (EXIT_FAILURE ,"Error initialising ports\n" ); }
Signature · 1 line
2.35.1
PATCH v2 11/14 bus/pci: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/bus/pci/bsd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -368,7 +368,7 @@ rte_pci_scan(void) } dev_count += conf_io.num_matches; - }while (conf_io.status ==PCI_GETCONF_MORE_DEVS ); + }while (conf_io.status ==PCI_GETCONF_MORE_DEVS );close (fd);
Signature · 1 line
2.35.1
PATCH v2 12/14 net/e1000: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/e1000/em_ethdev.c | 4 ++-- drivers/net/e1000/igb_ethdev.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/e1000/em_ethdev.c +2 -2
@@ -872,8 +872,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)E1000_DEV_PRIVATE_TO_STATS (dev->data->dev_private);int pause_frames; -if (hw->phy.media_type == e1000_media_type_copper || - (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { +if (hw->phy.media_type == e1000_media_type_copper || + (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { stats->symerrs +=E1000_READ_REG (hw,E1000_SYMERRS ); stats->sec +=E1000_READ_REG (hw,E1000_SEC ); }
drivers/net/e1000/igb_ethdev.c +4 -4
@@ -1683,7 +1683,7 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)uint64_t old_rpthc = stats->rpthc;uint64_t old_hgptc = stats->hgptc; -if (hw->phy.media_type == e1000_media_type_copper || +if (hw->phy.media_type == e1000_media_type_copper || (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { stats->symerrs +=E1000_READ_REG (hw,E1000_SYMERRS );
@@ -3500,10 +3500,10 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)for (i =0 ; i <IGB_VFTA_SIZE ; i++){ vfta = shadow_vfta->vfta[i]; -if (vfta){ +if (vfta) { mask =1 ;for (j =0 ; j <32 ; j++){ -if (vfta & mask) +if (vfta & mask)igbvf_set_vfta (hw, (uint16_t )((i<<5 )+j), on); mask<<=1 ;
@@ -3528,7 +3528,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)/*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/ ret =igbvf_set_vfta (hw, vlan_id, !!on); -if (ret){ +if (ret) {PMD_INIT_LOG (ERR ,"Unable to set VF vlan" );return ret; }
Signature · 1 line
2.35.1
PATCH v2 13/14 net/i40e: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/i40e/i40e_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_pf.c +4 -4
@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_add_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }
@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf, vid = vlan_filter_list->vlan_id;for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_delete_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }
@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)* return if SRIOV not enabled, VF number not configured or * no queue assigned. */ -if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 ) +if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 )return I40E_SUCCESS ;/* Allocate memory to store VF structure */ pf->vfs =rte_zmalloc ("i40e_pf_vf" ,sizeof (*pf->vfs) * pf->vf_num,0 ); -if (pf->vfs ==NULL ) +if (pf->vfs ==NULL )return -ENOMEM ;/* Disable irq0 for VFR event */
Signature · 1 line
2.35.1
PATCH v2 14/14 net/bnx2x: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/bnx2x/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnx2x/bnx2x.h +1 -1
@@ -96,7 +96,7 @@ int bnx2x_ilog2(int x)int log =0 ; x >>=1 ; -while (x) { +while (x) { log++; x >>=1 ; }
Signature · 1 line
2.35.1
v3 cover whitespace after keywords
In reply to Stephen HemmingerThe DPDK standard now enforced through checkpatch is to use a space after keywords. Much of the older code that was grandfathered in doesn't follow that, so fix it.
No urgency to this patchset, and it might just be viewed as churn. But I prefer to read code that looks all the same.
“A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. He may as well concern himself with his shadow on the wall." -- Ralph Waldo Emerson
v3 - fix typo in previous version (forgot to remove one brace)
and find a few more leftover uses of "for(" and "while("
Stephen Hemminger (14):
eal: fix whitespace
cmdline: fix whitespace
timer: fix whitespace
ip_frag: fix whitespace
testpmd: fix whitespace
test: fix whitespace
examples/qos_sched: fix whitespace
examples/vhost: fix whitespace
l3fwd: fix whitespace
examples: fix whitespace
bus/pci: fix whitespace
net/e1000: fix whitespace
net/i40e: fix whitespace
net/bnx2x: fix whitespace
app/test-pmd/cmdline.c | 31 +++++++++++----------- app/test-pmd/parameters.c | 10 ++++--- app/test-pmd/testpmd.c | 2 +- app/test/test_cmdline_cirbuf.c | 4 +-- app/test/test_debug.c | 4 +-- app/test/test_hash.c | 6 ++--- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++----- app/test/test_mbuf.c | 14 +++++----- app/test/test_ring_perf.c | 2 +- app/test/test_spinlock.c | 2 +- drivers/bus/pci/bsd/pci.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/e1000/em_ethdev.c | 4 +-- drivers/net/e1000/igb_ethdev.c | 8 +++--- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/e1000/igb_rxtx.c | 2 +- drivers/net/i40e/i40e_pf.c | 8 +++--- examples/cmdline/parse_obj_list.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/l3fwd-power/main.c | 7 ++--- examples/l3fwd/main.c | 7 ++--- examples/multi_process/symmetric_mp/main.c | 6 ++--- examples/qos_sched/app_thread.c | 6 ++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 +-- examples/vhost/main.c | 7 +++-- lib/cmdline/cmdline_parse_string.c | 17 +++++------- lib/cmdline/cmdline_rdline.c | 12 ++++----- lib/eal/include/generic/rte_cycles.h | 4 +-- lib/eal/linux/eal_hugepage_info.c | 6 ++--- lib/eal/linux/eal_interrupts.c | 2 +- lib/ip_frag/rte_ipv4_reassembly.c | 2 +- lib/timer/rte_timer.c | 2 +- 35 files changed, 104 insertions(+), 105 deletions(-)
Signature · 1 line
2.35.1
PATCH v3 1/14 eal: fix whitespace
Add space after keywords.
--- lib/eal/include/generic/rte_cycles.h | 4 ++-- lib/eal/linux/eal_hugepage_info.c | 6 +++--- lib/eal/linux/eal_interrupts.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
lib/eal/include/generic/rte_cycles.h +2 -2
@@ -94,7 +94,7 @@ static inline uint64_trte_get_timer_cycles (void) {#ifdef RTE_LIBEAL_USE_HPET -switch (eal_timer_source) { +switch (eal_timer_source) {case EAL_TIMER_TSC :#endif return rte_get_tsc_cycles ();
@@ -116,7 +116,7 @@ static inline uint64_trte_get_timer_hz (void) {#ifdef RTE_LIBEAL_USE_HPET -switch (eal_timer_source) { +switch (eal_timer_source) {case EAL_TIMER_TSC :#endif return rte_get_tsc_hz ();
lib/eal/linux/eal_hugepage_info.c +3 -3
@@ -180,8 +180,8 @@ get_default_hp_size(void)FILE *fd =fopen (proc_meminfo,"r" );if (fd ==NULL )rte_panic ("Cannot open %s\n" , proc_meminfo); -while (fgets (buffer,sizeof (buffer), fd)){ -if (strncmp (buffer, str_hugepagesz, hugepagesz_len) ==0 ){ +while (fgets (buffer,sizeof (buffer), fd)) { +if (strncmp (buffer, str_hugepagesz, hugepagesz_len) ==0 ) { size =rte_str_to_size (&buffer[hugepagesz_len]);break ; }
@@ -231,7 +231,7 @@ get_hugepage_dir(uint64_t hugepage_sz, char *hugedir, int len)if (default_size ==0 ) default_size =get_default_hp_size (); -while (fgets (buf,sizeof (buf), fd)){ +while (fgets (buf,sizeof (buf), fd)) {const char *pagesz_str; if (rte_strsplit(buf, sizeof(buf), splitstr, _FIELDNAME_MAX,
lib/eal/linux/eal_interrupts.c +1 -1
@@ -1073,7 +1073,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)struct epoll_event events[totalfds];int nfds =0 ; -for (;;) { +for (;;) { nfds =epoll_wait (pfd, events, totalfds,EAL_INTR_EPOLL_WAIT_FOREVER );/* epoll_wait fail */
Signature · 1 line
2.35.1
PATCH v3 2/14 cmdline: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
Remove unnecessary spaces in if expressions.
--- lib/cmdline/cmdline_parse_string.c | 17 +++++++---------- lib/cmdline/cmdline_rdline.c | 12 ++++++------ 2 files changed, 13 insertions(+), 16 deletions(-)
lib/cmdline/cmdline_parse_string.c +7 -10
@@ -73,20 +73,17 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res, token_len =get_token_len (str);/* if token is too big... */ -if (token_len >=STR_TOKEN_SIZE -1 ) { +if (token_len >=STR_TOKEN_SIZE -1 )continue ; - } -if (strncmp (buf, str, token_len) ) { +if (strncmp (buf, str, token_len))continue ; - } -if ( !cmdline_isendoftoken (*(buf+token_len)) ) { +if (!cmdline_isendoftoken (*(buf+token_len)))continue ; - }break ; - }while ( (str =get_next_token (str)) !=NULL ); + }while ((str =get_next_token (str)) !=NULL );if (!str)return -1 ;
@@ -108,7 +105,7 @@ cmdline_parse_string(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,/* unspecified string (unknown single token) */ else { token_len =0 ; -while (!cmdline_isendoftoken (buf[token_len]) && +while (!cmdline_isendoftoken (buf[token_len]) && token_len < (STR_TOKEN_SIZE -1 )) token_len++;
@@ -149,9 +146,9 @@ int cmdline_complete_get_nb_string(cmdline_parse_token_hdr_t *tk)return 0 ; str = sd->str; -while ( (str =get_next_token (str)) !=NULL ) { +while ((str =get_next_token (str)) !=NULL ) ret++; - } +return ret; }
lib/cmdline/cmdline_rdline.c +6 -6
@@ -301,7 +301,7 @@ rdline_char_in(struct rdline *rdl, char c)/* delete 1 char from the left */ case CMDLINE_KEY_BKSPACE :case CMDLINE_KEY_BKSPACE2 : -if (!cirbuf_del_tail_safe (&rdl->left)) { +if (!cirbuf_del_tail_safe (&rdl->left)) {rdline_puts (rdl, vt100_bs);display_right_buffer (rdl,1 ); }
@@ -354,7 +354,7 @@ rdline_char_in(struct rdline *rdl, char c)/* paste contents of kill buffer to the left side of caret */ case CMDLINE_KEY_CTRL_Y : i=0 ; -while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) < +while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) <RDLINE_BUF_SIZE && i < rdl->kill_size) {cirbuf_add_tail (&rdl->left, rdl->kill_buf[i]);
@@ -403,10 +403,10 @@ rdline_char_in(struct rdline *rdl, char c) tmp_size =strnlen (tmp_buf,sizeof (tmp_buf));/* add chars */ if (ret ==RDLINE_RES_COMPLETE ) { - i=0 ; -while (CIRBUF_GET_LEN (&rdl->right) +CIRBUF_GET_LEN (&rdl->left) < -RDLINE_BUF_SIZE && - i < tmp_size) { + i =0 ; +while (CIRBUF_GET_LEN (&rdl->right) + +CIRBUF_GET_LEN (&rdl->left) < +RDLINE_BUF_SIZE && i < tmp_size) {cirbuf_add_tail (&rdl->left, tmp_buf[i]); rdl->write_char (rdl, tmp_buf[i]); i++;
Signature · 1 line
2.35.1
PATCH v3 3/14 timer: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- lib/timer/rte_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/timer/rte_timer.c +1 -1
@@ -350,7 +350,7 @@ timer_get_prev_entries(uint64_t time_val, unsigned tim_lcore, {unsigned lvl = priv_timer[tim_lcore].curr_skiplist_depth; prev[lvl] = &priv_timer[tim_lcore].pending_head; -while (lvl !=0 ) { +while (lvl !=0 ) { lvl--; prev[lvl] = prev[lvl+1 ]; while (prev[lvl]->sl_next[lvl] &&
Signature · 1 line
2.35.1
PATCH v3 4/14 ip_frag: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- lib/ip_frag/rte_ipv4_reassembly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/ip_frag/rte_ipv4_reassembly.c +1 -1
@@ -34,7 +34,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)for (i = n; i !=IP_FIRST_FRAG_IDX && ofs != first_len; i--) {/* previous fragment found. */ -if (fp->frags[i].ofs + fp->frags[i].len == ofs) { +if (fp->frags[i].ofs + fp->frags[i].len == ofs) {RTE_ASSERT (curr_idx != i);
Signature · 1 line
2.35.1
PATCH v3 5/14 testpmd: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- app/test-pmd/cmdline.c | 31 ++++++++++++++++--------------- app/test-pmd/parameters.c | 10 ++++++---- app/test-pmd/testpmd.c | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-)
app/test-pmd/cmdline.c +16 -15
@@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -3242,15 +3243,15 @@ cmd_config_thresh_parsed(void *parsed_result,if (!strcmp (res->name,"txpt" )) tx_pthresh = res->value; -else if (!strcmp (res->name,"txht" )) +else if (!strcmp (res->name,"txht" )) tx_hthresh = res->value; -else if (!strcmp (res->name,"txwt" )) +else if (!strcmp (res->name,"txwt" )) tx_wthresh = res->value; -else if (!strcmp (res->name,"rxpt" )) +else if (!strcmp (res->name,"rxpt" )) rx_pthresh = res->value; -else if (!strcmp (res->name,"rxht" )) +else if (!strcmp (res->name,"rxht" )) rx_hthresh = res->value; -else if (!strcmp (res->name,"rxwt" )) +else if (!strcmp (res->name,"rxwt" )) rx_wthresh = res->value;else {fprintf (stderr,"Unknown parameter\n" );
@@ -4088,8 +4089,8 @@ cmd_vlan_offload_parsed(void *parsed_result, len =strnlen (str,STR_TOKEN_SIZE ); i =0 ;/* Get port_id first */ -while (i < len){ -if (str[i] ==',' ) +while (i < len) { +if (str[i] ==',' )break ; i++;
@@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result, str[i]='\0' ; tmp =strtoul (str,NULL ,0 );/* If port_id greater that what portid_t can represent, return */ -if (tmp >=RTE_MAX_ETHPORTS ) +if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp;
@@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,if (!strcmp (res->what,"strip" ))rx_vlan_strip_set (port_id, on); -else if (!strcmp (res->what,"stripq" )){ +else if (!strcmp (res->what,"stripq" )) {uint16_t queue_id =0 ;/* No queue_id, return */ -if (i +1 >= len) { +if (i +1 >= len) {fprintf (stderr,"must specify (port,queue_id)\n" );return ; } tmp =strtoul (str + i +1 ,NULL ,0 );/* If queue_id greater that what 16-bits can represent, return */ -if (tmp >0xffff ) +if (tmp >0xffff )return ; queue_id = (uint16_t )tmp;
@@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void *parsed_result, ret =rte_eth_dev_mac_addr_remove (res->port_num, &res->address);/* check the return value and print it if is < 0 */ -if (ret <0 ) +if (ret <0 )fprintf (stderr,"mac_addr_cmd error: (%s)\n" ,strerror (-ret)); }
@@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result, res->vf_num);#endif -if (ret <0 ) +if (ret <0 )fprintf (stderr,"vf_mac_addr_cmd error: (%s)\n" ,strerror (-ret)); }
app/test-pmd/parameters.c +6 -4
@@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -366,11 +367,12 @@ parse_ringnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
app/test-pmd/testpmd.c +1 -1
@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first) test_done =0 ; -if (!no_flush_rx) +if (!no_flush_rx)flush_fwd_rx_queues ();rxtx_config_display ();
Signature · 1 line
2.35.1
RE: [PATCH v3 05/14] testpmd: fix whitespace
Quoted 10 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: 2022年11月10日 7:25
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Singh, Aman Deep <[email protected]>; Zhang, Yuying <[email protected]>
Subject: [PATCH v3 05/14] testpmd: fix whitespace
Quoted 3 lines
Add space after keywords.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 157 lines
--- app/test-pmd/cmdline.c | 31 ++++++++++++++++--------------- app/test-pmd/parameters.c | 10 ++++++---- app/test-pmd/testpmd.c | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-)app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0
-0
8dc60e938830..7721006cc310100644app/test-pmd/cmdline.c +3
-2@@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ; snprintf(s, sizeof(s), "%.*s", size, p); @@ -3242,15 +3243,15@@ cmd_config_thresh_parsed(void
*parsed_result,app/test-pmd/cmdline.c +5
-5if (!strcmp (res->name,"txpt" )) tx_pthresh = res->value; -else if (!strcmp (res->name,"txht" )) +else if (!strcmp (res->name,"txht" )) tx_hthresh = res->value; -else if (!strcmp (res->name,"txwt" )) +else if (!strcmp (res->name,"txwt" )) tx_wthresh = res->value; -else if (!strcmp (res->name,"rxpt" )) +else if (!strcmp (res->name,"rxpt" )) rx_pthresh = res->value; -else if (!strcmp (res->name,"rxht" )) +else if (!strcmp (res->name,"rxht" )) rx_hthresh = res->value; -else if (!strcmp (res->name,"rxwt" )) +else if (!strcmp (res->name,"rxwt" )) rx_wthresh = res->value;else { fprintf(stderr, "Unknown parameter\n"); @@ -4088,8 +4089,8@@ cmd_vlan_offload_parsed(void
*parsed_result,app/test-pmd/cmdline.c +7
-7len =strnlen (str,STR_TOKEN_SIZE ); i =0 ;/* Get port_id first */ -while (i < len){ -if (str[i] ==',' ) +while (i < len) { +if (str[i] ==',' )break ; i++;@@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result, str[i]='\0' ; tmp =strtoul (str,NULL ,0 );/* If port_id greater that what portid_t can represent, return */ -if (tmp >=RTE_MAX_ETHPORTS ) +if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp;@@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,if (!strcmp (res->what,"strip" ))rx_vlan_strip_set (port_id, on); -else if (!strcmp (res->what,"stripq" )){ +else if (!strcmp (res->what,"stripq" )) {uint16_t queue_id =0 ;/* No queue_id, return */ -if (i +1 >= len) { +if (i +1 >= len) {fprintf (stderr,"must specify (port,queue_id)\n" );return ; } tmp =strtoul (str + i +1 ,NULL ,0 );/* If queue_id greater that what 16-bits can represent, return */ -if (tmp >0xffff ) +if (tmp >0xffff )return ; queue_id = (uint16_t )tmp;@@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void *parsed_result, ret =rte_eth_dev_mac_addr_remove (res->port_num, &res- >address);/* check the return value and print it if is < 0 */ -if (ret <0 ) +if (ret <0 )fprintf (stderr,"mac_addr_cmd error: (%s)\n" ,strerror (-ret));}
app/test-pmd/cmdline.c +1
-1@@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result, res->vf_num);#endif -if (ret <0 ) +if (ret <0 )fprintf (stderr,"vf_mac_addr_cmd error: (%s)\n" ,strerror (-ret));}
app/test-pmd/parameters.c index renamed from app/test-pmd/parameters.c +0
-0
aed4cdcb8485..7fc6d91f0210100644app/test-pmd/parameters.c +3
-2@@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ; snprintf(s, sizeof(s), "%.*s", size, p); @@ -366,11 +367,12 @@
parse_ringnuma_config(const char *q_arg)app/test-pmd/parameters.c +3
-2/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ; snprintf(s, sizeof(s), "%.*s", size, p); diff --git a/app/test-
pmd/testpmd.cb/app/test-pmd/testpmd.cindexaa7ea29f15ba..04b078a2938b100644app/test-pmd/testpmd.c +1
-2@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first) test_done =0 ; -if (!no_flush_rx) +if (!no_flush_rx)flush_fwd_rx_queues ();rxtx_config_display (); --2.35.1
Zhang, Yuying
Reviewed-byRE: [PATCH v3 05/14] testpmd: fix whitespace
fix
Quoted 20 lines
-----Original Message-----
From: Zhang, Yuying
Sent: 2022年11月11日 14:30
To: Stephen Hemminger <[email protected]>; [email protected]
Cc: Singh, Aman Deep <[email protected]>
Subject: RE: [PATCH v3 05/14] testpmd: fix whitespaceQuoted 11 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: 2022年11月10日 7:25
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Singh, Aman Deep <[email protected]>; Zhang, Yuying <[email protected]>
Subject: [PATCH v3 05/14] testpmd: fix whitespaceAdd space after keywords.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 161 lines
Quoted 15 lines
--- app/test-pmd/cmdline.c | 31 ++++++++++++++++--------------- app/test-pmd/parameters.c | 10 ++++++---- app/test-pmd/testpmd.c | 2 +- 3 files changed, 23 insertions(+), 20 deletions(-)app/test-pmd/cmdline.c index renamed from app/test-pmd/cmdline.c +0
-0
8dc60e938830..7721006cc310100644app/test-pmd/cmdline.c +0
-1@@ -2730,11 +2730,12 @@ parse_reta_config(const char *str,while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL )app/test-pmd/cmdline.c parse_reta_config(const char *str, · line 2741
Quoted 10 lines
app/test-pmd/cmdline.c +3
-1+ p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ; snprintf(s, sizeof(s), "%.*s", size, p); @@ -3242,15 +3243,15@@
Quoted 11 lines
cmd_config_thresh_parsed(void
*parsed_result,app/test-pmd/cmdline.c +2
-3if (!strcmp (res->name,"txpt" )) tx_pthresh = res->value; -else if (!strcmp (res->name,"txht" )) +else if (!strcmp (res->name,"txht" )) tx_hthresh = res->value; -else if (!strcmp (res->name,"txwt" )) +else if (!strcmp (res->name,"txwt" )) tx_wthresh = res->value; -else if (!strcmp (res->name,"rxpt" ))app/test-pmd/cmdline.c cmd_config_thresh_parsed(void *parsed_result,
Quoted 10 lines
app/test-pmd/cmdline.c +3
-2+else if (!strcmp (res->name,"rxpt" )) rx_pthresh = res->value; - else if(!strcmp(res->name, "rxht")) +else if (!strcmp (res->name,"rxht" )) rx_hthresh = res->value; - else if(!strcmp(res->name, "rxwt")) +else if (!strcmp (res->name,"rxwt" )) rx_wthresh = res->value;else { fprintf(stderr, "Unknown parameter\n"); @@ -4088,8 +4089,8@@
Quoted 113 lines
cmd_vlan_offload_parsed(void
*parsed_result,app/test-pmd/cmdline.c +7
-7len =strnlen (str,STR_TOKEN_SIZE ); i =0 ;/* Get port_id first */ -while (i < len){ -if (str[i] ==',' ) +while (i < len) { +if (str[i] ==',' )break ; i++;@@ -4097,7 +4098,7 @@ cmd_vlan_offload_parsed(void *parsed_result, str[i]='\0' ; tmp =strtoul (str,NULL ,0 );/* If port_id greater that what portid_t can represent, return */ -if (tmp >=RTE_MAX_ETHPORTS ) +if (tmp >=RTE_MAX_ETHPORTS )return ; port_id = (portid_t )tmp;@@ -4108,17 +4109,17 @@ cmd_vlan_offload_parsed(void *parsed_result,if (!strcmp (res->what,"strip" ))rx_vlan_strip_set (port_id, on); -else if (!strcmp (res->what,"stripq" )){ +else if (!strcmp (res->what,"stripq" )) {uint16_t queue_id =0 ;/* No queue_id, return */ -if (i +1 >= len) { +if (i +1 >= len) {fprintf (stderr,"must specify (port,queue_id)\n" );return ; } tmp =strtoul (str + i +1 ,NULL ,0 );/* If queue_id greater that what 16-bits can represent, return */ -if (tmp >0xffff ) +if (tmp >0xffff )return ; queue_id = (uint16_t )tmp;@@ -7207,7 +7208,7 @@ static void cmd_mac_addr_parsed(void *parsed_result, ret =rte_eth_dev_mac_addr_remove (res->port_num, &res- >address);/* check the return value and print it if is < 0 */ -if (ret <0 ) +if (ret <0 )fprintf (stderr,"mac_addr_cmd error: (%s)\n" ,strerror (-ret));}
app/test-pmd/cmdline.c +1
-1@@ -7780,7 +7781,7 @@ static void cmd_vf_mac_addr_parsed(void *parsed_result, res->vf_num);#endif -if (ret <0 ) +if (ret <0 )fprintf (stderr,"vf_mac_addr_cmd error: (%s)\n" ,strerror (-ret));}
app/test-pmd/parameters.c +0
-0index
aed4cdcb8485..7fc6d91f0210100644app/test-pmd/parameters.c +3
-2@@ -306,11 +306,12 @@ parse_portnuma_config(const char *q_arg)/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ; snprintf(s, sizeof(s), "%.*s", size, p); @@ -366,11 +367,12 @@
parse_ringnuma_config(const char *q_arg)app/test-pmd/parameters.c +3
-2/* reset from value set at definition */ while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ; snprintf(s, sizeof(s), "%.*s", size, p); diff --git a/app/test-
pmd/testpmd.cb/app/test-pmd/testpmd.cindexaa7ea29f15ba..04b078a2938b
100644app/test-pmd/testpmd.c +1
-2@@ -2406,7 +2406,7 @@ start_packet_forwarding(int with_tx_first) test_done =0 ; -if (!no_flush_rx) +if (!no_flush_rx)flush_fwd_rx_queues ();rxtx_config_display (); --2.35.1
PATCH v3 6/14 test: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- app/test/test_cmdline_cirbuf.c | 4 ++-- app/test/test_debug.c | 4 ++-- app/test/test_hash.c | 6 +++--- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++++------- app/test/test_mbuf.c | 14 ++++++-------- app/test/test_ring_perf.c | 2 +- app/test/test_spinlock.c | 2 +- 8 files changed, 23 insertions(+), 25 deletions(-)
app/test/test_cmdline_cirbuf.c +2 -2
@@ -708,7 +708,7 @@ test_cirbuf_char_fill(void)return -1 ; }/* delete buffer from tail */ -for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++) +for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++)cirbuf_del_tail_safe (&cb);/* try to delete from an empty buffer */ if (cirbuf_del_tail_safe (&cb) >=0 ) {
@@ -737,7 +737,7 @@ test_cirbuf_char_fill(void)return -1 ; }/* delete buffer from head */ -for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++) +for (i =0 ; i <CMDLINE_TEST_BUFSIZE ; i++)cirbuf_del_head_safe (&cb);/* try to delete from an empty buffer */ if (cirbuf_del_head_safe (&cb) >=0 ) {
app/test/test_debug.c +2 -2
@@ -53,7 +53,7 @@ test_panic(void)return -1 ; }wait (&status); -if (status ==0 ){ +if (status ==0 ) {printf ("Child process terminated normally!\n" );return -1 ; }else
@@ -84,7 +84,7 @@ test_exit_val(int exit_val) }wait (&status);printf ("Child process status: %d\n" , status); -if (!WIFEXITED (status) ||WEXITSTATUS (status) != (uint8_t )exit_val){ +if (!WIFEXITED (status) ||WEXITSTATUS (status) != (uint8_t )exit_val) {printf ("Child process terminated with incorrect status (expected = %d)!\n" , exit_val);return -1 ;
app/test/test_hash.c +3 -3
@@ -724,12 +724,12 @@ static int test_five_keys(void) }/* Lookup */ -for (i =0 ; i <5 ; i++) +for (i =0 ; i <5 ; i++) key_array[i] = &keys[i]; ret =rte_hash_lookup_bulk (handle, &key_array[0 ],5 , (int32_t *)pos); -if (ret ==0 ) -for (i =0 ; i <5 ; i++) { +if (ret ==0 ) +for (i =0 ; i <5 ; i++) {print_key_info ("Lkp" , key_array[i], pos[i]);RETURN_IF_ERROR (pos[i] != expected_pos[i],"failed to find key (pos[%u]=%d)" , i, pos[i]);
app/test/test_lpm6_perf.c +1 -1
@@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n)printf ("--------------------------- \n" );/* Count depths. */ -for (i =1 ; i <=128 ; i++) { +for (i =1 ; i <=128 ; i++) {unsigned depth_counter =0 ;double percent_hits;
app/test/test_malloc.c +7 -7
@@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg) ret =-1 ;break ; } -for (j =0 ; j <1000 ; j++) { -if ( *(char *)p1 !=0 ) { +for (j =0 ; j <1000 ; j++) { +if (*(char *)p1 !=0 ) {printf ("rte_zmalloc didn't zero the allocated memory\n" ); ret =-1 ; }
@@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg) ret =-1 ;break ; } -for (j =0 ; j <1000 ; j++) { -if ( *(char *)p1 !=0 ) { +for (j =0 ; j <1000 ; j++) { +if (*(char *)p1 !=0 ) {printf ("rte_zmalloc didn't zero the allocated memory\n" ); ret =-1 ; }
@@ -331,12 +331,12 @@ test_multi_alloc_statistics(void)/* After freeing both allocations check stats return to original */ rte_malloc_get_socket_stats (socket, &post_stats); -if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) { +if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) {printf ("Incorrect heap statistics: Total size \n" );return -1 ; }/* Check allocated size is equal to two additions plus overhead */ -if (second_stats.heap_allocsz_bytes != +if (second_stats.heap_allocsz_bytes != size + overhead + first_stats.heap_allocsz_bytes) {printf ("Incorrect heap statistics: Allocated size \n" );return -1 ;
@@ -495,7 +495,7 @@ test_realloc_socket(int socket)return -1 ; }/* calc an alignment we don't already have */ -while (RTE_PTR_ALIGN (ptr7, new_align) == ptr7) +while (RTE_PTR_ALIGN (ptr7, new_align) == ptr7) new_align *=2 ;char *ptr8 =rte_realloc_socket (ptr7, size7, new_align, socket);if (!ptr8){
app/test/test_mbuf.c +6 -8
@@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE];printf ("mbuf test FAILED (l.%d): <" str">\n" , \ __LINE__, ##__VA_ARGS__); \ goto fail; \ -}while (0 ) +}while (0 )/* * test data manipulation in mbuf with non-ascii data
@@ -154,9 +154,7 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool)return 0 ; fail: -if (m) { -rte_pktmbuf_free (m); - } +rte_pktmbuf_free (m);return -1 ; }
@@ -701,12 +699,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool) }struct rte_mbuf *extra =NULL ; extra =rte_pktmbuf_alloc (pktmbuf_pool); -if (extra !=NULL ) { +if (extra !=NULL ) {printf ("Error pool not empty" ); ret =-1 ; } extra =rte_pktmbuf_clone (m[0 ], pktmbuf_pool); -if (extra !=NULL ) { +if (extra !=NULL ) {printf ("Error pool not empty" ); ret =-1 ; }
@@ -966,7 +964,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)struct rte_mbuf *mb, *mt; mb = m[i]; -while (mb !=NULL ) { +while (mb !=NULL ) { mt = mb; mb = mb->next;rte_pktmbuf_free_seg (mt);
@@ -1195,7 +1193,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf)return -1 ; }wait (&status); -if (status ==0 ) +if (status ==0 )return -1 ;return 0 ;
app/test/test_ring_perf.c +1 -1
@@ -190,7 +190,7 @@ enqueue_dequeue_bulk_helper(const unsigned int flag, const int esize,#else if (__sync_add_and_fetch(&lcore_count, 1) != 2)#endif -while (lcore_count !=2 ) +while (lcore_count !=2 )rte_pause (); burst =test_ring_calloc (MAX_BURST , esize);
app/test/test_spinlock.c +1 -1
@@ -237,7 +237,7 @@ test_spinlock(void)/* * Try to acquire a lock that we already own */ -if (!rte_spinlock_recursive_trylock (&slr)) { +if (!rte_spinlock_recursive_trylock (&slr)) {printf ("rte_spinlock_recursive_trylock failed on a lock that " "we already own\n" ); ret =-1 ;
Signature · 1 line
2.35.1
PATCH v3 7/14 examples/qos_sched: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/qos_sched/app_thread.c | 6 +++--- examples/qos_sched/args.c | 2 +- examples/qos_sched/init.c | 2 +- examples/qos_sched/main.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-)
examples/qos_sched/app_thread.c +3 -3
@@ -79,7 +79,7 @@ app_rx_thread(struct thread_conf **confs)if (likely (nb_rx !=0 )) {APP_STATS_ADD (conf->stat.nb_rx, nb_rx); -for (i =0 ; i < nb_rx; i++) { +for (i =0 ; i < nb_rx; i++) {get_pkt_sched (rx_mbufs[i], &subport, &pipe, &traffic_class, &queue, &color); rte_sched_port_pkt_write(conf->sched_port,
@@ -91,7 +91,7 @@ app_rx_thread(struct thread_conf **confs)if (unlikely (rte_ring_sp_enqueue_bulk (conf->rx_ring, (void **)rx_mbufs, nb_rx,NULL ) ==0 )) { -for (i =0 ; i < nb_rx; i++) { +for (i =0 ; i < nb_rx; i++) {rte_pktmbuf_free (rx_mbufs[i]);APP_STATS_ADD (conf->stat.nb_drop,1 );
@@ -137,7 +137,7 @@ app_send_packets(struct thread_conf *qconf, struct rte_mbuf **mbufs, uint32_t nbuint32_t i, len; len = qconf->n_mbufs; -for (i =0 ; i < nb_pkt; i++) { +for (i =0 ; i < nb_pkt; i++) { qconf->m_table[len] = mbufs[i]; len++;/* enough pkts to be sent */
examples/qos_sched/args.c +1 -1
@@ -451,7 +451,7 @@ app_parse_args(int argc, char **argv)/* sanity check for cores assignment */ nb_lcores =app_cpu_core_count (); -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {if (qos_conf[i].rx_core >= nb_lcores) {RTE_LOG (ERR ,APP ,"pfc %u: invalid RX lcore index %u\n" , i +1 , qos_conf[i].rx_core);
examples/qos_sched/init.c +1 -1
@@ -323,7 +323,7 @@ int app_init(void)rte_exit (EXIT_FAILURE ,"Invalid configuration profile\n" );/* Initialize each active flow */ -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {uint32_t socket =rte_lcore_to_socket_id (qos_conf[i].rx_core);struct rte_ring *ring;
examples/qos_sched/main.c +2 -2
@@ -152,7 +152,7 @@ app_stat(void)static struct rte_eth_stats tx_stats[MAX_DATA_STREAMS ];/* print statistics */ -for (i =0 ; i < nb_pfc; i++) { +for (i =0 ; i < nb_pfc; i++) {struct flow_conf *flow = &qos_conf[i];rte_eth_stats_get (flow->rx_port, &stats);
@@ -212,7 +212,7 @@ main(int argc, char **argv) }else {/* print statistics every second */ -while (1 ) { +while (1 ) {sleep (1 );app_stat (); }
Signature · 1 line
2.35.1
PATCH v3 8/14 examples/vhost: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/vhost/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
examples/vhost/main.c +3 -4
@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused) } } -while (1 ) { +while (1 ) {drain_mbuf_table (tx_q);drain_vhost_table ();/*
@@ -1583,9 +1583,8 @@ destroy_device(int vid)return ;/*set the remove flag. */ vdev->remove =1 ; -while (vdev->ready !=DEVICE_SAFE_REMOVE ) { +while (vdev->ready !=DEVICE_SAFE_REMOVE )rte_pause (); - }for (i =0 ; i <RTE_MAX_LCORE ; i++)rte_free (vhost_txbuff[i *RTE_MAX_VHOST_DEVICE + vid]);
@@ -1816,7 +1815,7 @@ print_stats(__rte_unused void *arg)const char clr[] = {27 ,'[' ,'2' ,'J' ,'\0' };const char top_left[] = {27 ,'[' ,'1' ,';' ,'1' ,'H' ,'\0' }; -while (1 ) { +while (1 ) {sleep (enable_stats);/* Clear screen and move to top left */
Signature · 1 line
2.35.1
RE: [PATCH v3 08/14] examples/vhost: fix whitespace
Quoted 49 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, November 10, 2022 7:25 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Maxime Coquelin <[email protected]>; Xia, Chenbo <[email protected]>
Subject: [PATCH v3 08/14] examples/vhost: fix whitespaceAdd space after keywords.
Signed-off-by Stephen Hemminger <[email protected]>--- examples/vhost/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)examples/vhost/main.c +3
-5@@ -1491,7 +1491,7 @@ switch_worker(void *arg __rte_unused) } } -while (1 ) { +while (1 ) {drain_mbuf_table (tx_q);drain_vhost_table ();/* @@ -1583,9 +1583,8 @@ destroy_device(int vid)return ;/*set the remove flag. */ vdev->remove =1 ; -while (vdev->ready !=DEVICE_SAFE_REMOVE ) { +while (vdev->ready !=DEVICE_SAFE_REMOVE )rte_pause (); - }for (i =0 ; i <RTE_MAX_LCORE ; i++)rte_free (vhost_txbuff[i *RTE_MAX_VHOST_DEVICE + vid]);@@ -1816,7 +1815,7 @@ print_stats(__rte_unused void *arg)const char clr[] = {27 ,'[' ,'2' ,'J' ,'\0' };const char top_left[] = {27 ,'[' ,'1' ,';' ,'1' ,'H' ,'\0' }; -while (1 ) { +while (1 ) {sleep (enable_stats);/* Clear screen and move to top left */ --
Quoted 1 line
2.35.1
PATCH v3 9/14 l3fwd: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/l3fwd-power/main.c | 7 ++++--- examples/l3fwd/main.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
examples/l3fwd-power/main.c +4 -3
@@ -1787,11 +1787,12 @@ parse_config(const char *q_arg)while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -2946,7 +2947,7 @@ main(int argc, char **argv)fflush (stdout);/* init RX queues */ -for (queue =0 ; queue < qconf->n_rx_queue; ++queue) { +for (queue =0 ; queue < qconf->n_rx_queue; ++queue) {struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id;
examples/l3fwd/main.c +4 -3
@@ -516,11 +516,12 @@ parse_config(const char *q_arg)while ((p =strchr (p0,'(' )) !=NULL ) { ++p; -if ((p0 =strchr (p,')' )) ==NULL ) + p0 =strchr (p,')' ); +if (p0 ==NULL )return -1 ; size = p0 - p; -if (size >=sizeof (s)) +if (size >=sizeof (s))return -1 ;snprintf (s,sizeof (s),"%.*s" , size, p);
@@ -1366,7 +1367,7 @@ l3fwd_poll_resource_setup(void)printf ("\nInitializing rx queues on lcore %u ... " , lcore_id );fflush (stdout);/* init RX queues */ -for (queue =0 ; queue < qconf->n_rx_queue; ++queue) { +for (queue =0 ; queue < qconf->n_rx_queue; ++queue) {struct rte_eth_rxconf rxq_conf; portid = qconf->rx_queue_list[queue].port_id;
Signature · 1 line
2.35.1
PATCH v3 10/14 examples: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- examples/cmdline/parse_obj_list.c | 2 +- examples/ip_reassembly/main.c | 2 +- examples/multi_process/symmetric_mp/main.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
examples/cmdline/parse_obj_list.c +1 -1
@@ -42,7 +42,7 @@ parse_obj_list(cmdline_parse_token_hdr_t *tk, const char *buf, void *res,if (res && ressize <sizeof (struct object *))return -1 ; -while (!cmdline_isendoftoken (buf[token_len])) +while (!cmdline_isendoftoken (buf[token_len])) token_len++; SLIST_FOREACH(o, tkd->list, next) {
examples/ip_reassembly/main.c +1 -1
@@ -300,7 +300,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)TX_LCORE_STAT_UPDATE (&qconf->tx_stat, queue,1 ); txmb->m_table[txmb->head] = m; -if (++txmb->head == len) +if (++txmb->head == len) txmb->head =0 ;return 0 ;
examples/multi_process/symmetric_mp/main.c +3 -3
@@ -156,7 +156,7 @@ smp_parse_args(int argc, char **argv)/* get the port numbers from the port mask */ RTE_ETH_FOREACH_DEV(i) - if(port_mask & (1 << i)) + if (port_mask & (1 << i)) ports[num_ports++] = (uint8_t )i; ret = optind-1 ;
@@ -470,8 +470,8 @@ main(int argc, char **argv)/* Primary instance initialized. 8< */ if (num_ports &1 )rte_exit (EXIT_FAILURE ,"Application must use an even number of ports\n" ); -for (i =0 ; i < num_ports; i++){ -if (proc_type ==RTE_PROC_PRIMARY ) +for (i =0 ; i < num_ports; i++) { +if (proc_type ==RTE_PROC_PRIMARY )if (smp_port_init (ports[i], mp, (uint16_t )num_procs) <0 )rte_exit (EXIT_FAILURE ,"Error initialising ports\n" ); }
Signature · 1 line
2.35.1
PATCH v3 11/14 bus/pci: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/bus/pci/bsd/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/pci/bsd/pci.c +1 -1
@@ -368,7 +368,7 @@ rte_pci_scan(void) } dev_count += conf_io.num_matches; - }while (conf_io.status ==PCI_GETCONF_MORE_DEVS ); + }while (conf_io.status ==PCI_GETCONF_MORE_DEVS );close (fd);
Signature · 1 line
2.35.1
PATCH v3 12/14 net/e1000: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/e1000/em_ethdev.c | 4 ++-- drivers/net/e1000/igb_ethdev.c | 8 ++++---- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/e1000/igb_rxtx.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/e1000/em_ethdev.c +2 -2
@@ -872,8 +872,8 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)E1000_DEV_PRIVATE_TO_STATS (dev->data->dev_private);int pause_frames; -if (hw->phy.media_type == e1000_media_type_copper || - (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { +if (hw->phy.media_type == e1000_media_type_copper || + (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { stats->symerrs +=E1000_READ_REG (hw,E1000_SYMERRS ); stats->sec +=E1000_READ_REG (hw,E1000_SEC ); }
drivers/net/e1000/igb_ethdev.c +4 -4
@@ -1683,7 +1683,7 @@ igb_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)uint64_t old_rpthc = stats->rpthc;uint64_t old_hgptc = stats->hgptc; -if (hw->phy.media_type == e1000_media_type_copper || +if (hw->phy.media_type == e1000_media_type_copper || (E1000_READ_REG (hw,E1000_STATUS ) &E1000_STATUS_LU )) { stats->symerrs +=E1000_READ_REG (hw,E1000_SYMERRS );
@@ -3500,10 +3500,10 @@ static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on)for (i =0 ; i <IGB_VFTA_SIZE ; i++){ vfta = shadow_vfta->vfta[i]; -if (vfta){ +if (vfta) { mask =1 ;for (j =0 ; j <32 ; j++){ -if (vfta & mask) +if (vfta & mask)igbvf_set_vfta (hw, (uint16_t )((i<<5 )+j), on); mask<<=1 ;
@@ -3528,7 +3528,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)/*vind is not used in VF driver, set to 0, check ixgbe_set_vfta_vf*/ ret =igbvf_set_vfta (hw, vlan_id, !!on); -if (ret){ +if (ret) {PMD_INIT_LOG (ERR ,"Unable to set VF vlan" );return ret; }
drivers/net/e1000/igb_pf.c +1 -1
@@ -78,7 +78,7 @@ void igb_pf_host_init(struct rte_eth_dev *eth_dev)if (hw->mac.type == e1000_i350) nb_queue =1 ; -else if (hw->mac.type == e1000_82576) +else if (hw->mac.type == e1000_82576)/* per datasheet, it should be 2, but 1 seems correct */ nb_queue =1 ;else
drivers/net/e1000/igb_rxtx.c +1 -1
@@ -2276,7 +2276,7 @@ igb_dev_mq_rx_configure(struct rte_eth_dev *dev)/* 011b Def_Q ignore, according to VT_CTL.DEF_PL */ mrqc |=0x3 <<E1000_MRQC_DEF_Q_SHIFT ;E1000_WRITE_REG (hw,E1000_MRQC , mrqc); - }else if (RTE_ETH_DEV_SRIOV (dev).active ==0 ) { + }else if (RTE_ETH_DEV_SRIOV (dev).active ==0 ) {/* * SRIOV inactive scheme */
Signature · 1 line
2.35.1
PATCH v3 13/14 net/i40e: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/i40e/i40e_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_pf.c +4 -4
@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf,for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_add_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }
@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf, vid = vlan_filter_list->vlan_id;for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_delete_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }
@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)* return if SRIOV not enabled, VF number not configured or * no queue assigned. */ -if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 ) +if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 )return I40E_SUCCESS ;/* Allocate memory to store VF structure */ pf->vfs =rte_zmalloc ("i40e_pf_vf" ,sizeof (*pf->vfs) * pf->vf_num,0 ); -if (pf->vfs ==NULL ) +if (pf->vfs ==NULL )return -ENOMEM ;/* Disable irq0 for VFR event */
Signature · 1 line
2.35.1
RE: [PATCH v3 13/14] net/i40e: fix whitespace
Hi,
Could you add fix line and Cc: [email protected]?
The fix looks good to me.
Quoted 11 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: 2022年11月10日 7:25
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH v3 13/14] net/i40e: fix whitespaceAdd space after keywords.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 46 lines
--- drivers/net/i40e/i40e_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/net/i40e/i40e_pf.c index renamed from drivers/net/i40e/i40e_pf.c +0
-0
15d9ff868f3a..7050e0057d8e100644drivers/net/i40e/i40e_pf.c +5
-5@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf, for (i = 0; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_add_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(struct i40e_pf_vf *vf, vid = vlan_filter_list->vlan_id;for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_delete_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)* return if SRIOV not enabled, VF number not configured or * no queue assigned. */ -if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 ) +if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps == +0 )return I40E_SUCCESS ;/* Allocate memory to store VF structure */ pf->vfs =rte_zmalloc ("i40e_pf_vf" ,sizeof (*pf->vfs) * pf->vf_num,0 ); -if (pf->vfs ==NULL ) +if (pf->vfs ==NULL )return -ENOMEM ;/* Disable irq0 for VFR event */ --2.35.1
Zhang, Yuying
Reviewed-byRE: [PATCH v3 13/14] net/i40e: fix whitespace
fix
Quoted 7 lines
-----Original Message-----
From: Zhang, Yuying
Sent: 2022年11月11日 14:24
To: Stephen Hemminger <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>
Subject: RE: [PATCH v3 13/14] net/i40e: fix whitespace
Quoted 16 lines
Hi,
Could you add fix line and Cc: [email protected]?
The fix looks good to me.Quoted 11 lines
-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: 2022年11月10日 7:25
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>
Subject: [PATCH v3 13/14] net/i40e: fix whitespaceAdd space after keywords.
Signed-off-by Stephen Hemminger <[email protected]>
Quoted 46 lines
Quoted 46 lines
--- drivers/net/i40e/i40e_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/net/i40e/i40e_pf.c +5
-5@@ -956,7 +956,7 @@ i40e_pf_host_process_cmd_add_vlan(struct i40e_pf_vf *vf, for (i = 0; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_add_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }@@ -996,7 +996,7 @@ i40e_pf_host_process_cmd_del_vlan(structi40e_pf_vf *vf, vid = vlan_filter_list->vlan_id;for (i =0 ; i < vlan_filter_list->num_elements; i++) { ret =i40e_vsi_delete_vlan (vf->vsi, vid[i]); -if (ret !=I40E_SUCCESS ) +if (ret !=I40E_SUCCESS ) goto send_msg; }@@ -1577,12 +1577,12 @@ i40e_pf_host_init(struct rte_eth_dev *dev)* return if SRIOV not enabled, VF number not configured or * no queue assigned. */ -if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps ==0 ) +if (!hw->func_caps.sr_iov_1_1 || pf->vf_num ==0 || pf->vf_nb_qps == +0 )return I40E_SUCCESS ;/* Allocate memory to store VF structure */ pf->vfs =rte_zmalloc ("i40e_pf_vf" ,sizeof (*pf->vfs) * pf->vf_num,0 ); -if (pf->vfs ==NULL ) +if (pf->vfs ==NULL )return -ENOMEM ;/* Disable irq0 for VFR event */ --2.35.1
Re: [PATCH v3 13/14] net/i40e: fix whitespace
In reply to Zhang, YuyingQuoted 4 lines · Yuying
Hi,
Could you add fix line and Cc: [email protected]?
The fix looks good to me.
Whitespace changes don't belong in stable unless they are prerequisite for another change.
PATCH v3 14/14 net/bnx2x: fix whitespace
In reply to Stephen HemmingerAdd space after keywords.
--- drivers/net/bnx2x/bnx2x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bnx2x/bnx2x.h +1 -1
@@ -96,7 +96,7 @@ int bnx2x_ilog2(int x)int log =0 ; x >>=1 ; -while (x) { +while (x) { log++; x >>=1 ; }
Signature · 1 line
2.35.1