Fixes for clang 15
cover Fixes for clang 15
Fedora 37 has just been released with clang 15.
The latter seems more picky wrt unused variable.
Fixes have been tested in GHA with a simple patch I used in my own repo:
https://github.com/david-marchand/dpdk/commit/82cd57ae5490
https://github.com/david-marchand/dpdk/actions/runs/3495454457
Signature · 31 lines
David Marchand David Marchand (11): service: fix build with clang 15 vhost: fix build with clang 15 bus/dpaa: fix build with clang 15 net/atlantic: fix build with clang 15 net/dpaa2: fix build with clang 15 net/ice: fix build with clang 15 app/testpmd: fix build with clang 15 app/testpmd: fix build with clang 15 in flow code test/efd: fix build with clang 15 test/member: fix build with clang 15 test/event: fix build with clang 15 app/test-pmd/config.c | 14 -------------- app/test-pmd/noisy_vnf.c | 2 +- app/test/test_efd_perf.c | 1 - app/test/test_event_timer_adapter.c | 2 -- app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - drivers/bus/dpaa/base/qbman/bman.h | 4 +--- drivers/net/atlantic/atl_rxtx.c | 5 ++--- drivers/net/dpaa2/dpaa2_rxtx.c | 4 +--- drivers/net/ice/ice_ddp_package.c | 3 --- lib/eal/common/rte_service.c | 2 -- lib/vhost/virtio_net.c | 2 -- 12 files changed, 5 insertions(+), 36 deletions(-) -- 2.38.1
PATCH 1/11 service: fix build with clang 15
This variable is not used.
Bugzilla ID: 1130
--- lib/eal/common/rte_service.c | 2 -- 1 file changed, 2 deletions(-)
lib/eal/common/rte_service.c +0 -2
@@ -107,14 +107,12 @@ rte_service_init(void) }int i; -int count =0 ;struct rte_config *cfg =rte_eal_get_configuration ();for (i =0 ; i <RTE_MAX_LCORE ; i++) {if (lcore_config[i].core_role ==ROLE_SERVICE ) {if ((unsigned int )i == cfg->main_lcore)continue ;rte_service_lcore_add (i); - count++; } }
Signature · 1 line
2.38.1
RE: [PATCH 01/11] service: fix build with clang 15
Quoted 8 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, November 18, 2022 8:53 AM
To: [email protected]
Cc: [email protected]; Van Haaren, Harry <[email protected]>; Jerin Jacob <[email protected]>
Subject: [PATCH 01/11] service: fix build with clang 15
Quoted 7 lines
This variable is not used.
Bugzilla ID: 1130
Fixes 21698354c832 ("service: introduce service cores concept")Signed-off-by David Marchand <[email protected]>
PATCH 2/11 vhost: fix build with clang 15
In reply to David MarchandThis variable is not used.
--- lib/vhost/virtio_net.c | 2 -- 1 file changed, 2 deletions(-)
lib/vhost/virtio_net.c +0 -2
@@ -1877,7 +1877,6 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev, struct vhost_virtqueue struct rte_mbuf **pkts, uint32_t count, int16_t dma_id, uint16_t vchan_id) { uint32_t pkt_idx = 0; -uint32_t remained = count;uint16_t n_xfer;uint16_t num_buffers;uint16_t num_descs;
@@ -1903,7 +1902,6 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev, struct vhost_virtqueue pkts_info[slot_idx].mbuf = pkts[pkt_idx]; pkt_idx++; - remained--;vq_inc_last_avail_packed (vq, num_descs); }while (pkt_idx < count);
Signature · 1 line
2.38.1
Re: [PATCH 02/11] vhost: fix build with clang 15
Quoted 23 lines · David Marchand
This variable is not used.
Fixes abeb86525577 ("vhost: remove copy threshold for async path")Signed-off-by David Marchand <[email protected]>--- lib/vhost/virtio_net.c | 2 -- 1 file changed, 2 deletions(-)lib/vhost/virtio_net.c +0
-1@@ -1877,7 +1877,6 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev, struct vhost_virtqueue struct rte_mbuf **pkts, uint32_t count, int16_t dma_id, uint16_t vchan_id) { uint32_t pkt_idx = 0; -uint32_t remained = count;uint16_t n_xfer;uint16_t num_buffers;uint16_t num_descs;
lib/vhost/virtio_net.c virtio_dev_rx_async_submit_packed(struct virtio_net *dev, struct vhost_virtqueue · line 1907
Quoted 7 lines
lib/vhost/virtio_net.c +0
-1@@ -1903,7 +1902,6 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev, struct vhost_virtqueue pkts_info[slot_idx].mbuf = pkts[pkt_idx]; pkt_idx++; - remained--;vq_inc_last_avail_packed (vq, num_descs); }while (pkt_idx < count);
Thanks,
Maxime
PATCH 3/11 bus/dpaa: fix build with clang 15
In reply to David MarchandThis variable is not used.
--- drivers/bus/dpaa/base/qbman/bman.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/bus/dpaa/base/qbman/bman.h +1 -3
@@ -519,7 +519,6 @@ static inline int bm_shutdown_pool(struct bm_portal *p, u32 bpid)struct bm_mc_command *bm_cmd;struct bm_mc_result *bm_res; -int aq_count =0 ;bool stop = false;while (!stop) {
@@ -532,8 +531,7 @@ static inline int bm_shutdown_pool(struct bm_portal *p, u32 bpid)if (!(bm_res->verb &BM_MCR_VERB_ACQUIRE_BUFCOUNT )) {/* Pool is empty */ stop = true; - }else - ++aq_count; + } };return 0 ; }
Signature · 1 line
2.38.1
PATCH 4/11 net/atlantic: fix build with clang 15
In reply to David MarchandThis variable is not used.
--- drivers/net/atlantic/atl_rxtx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/atlantic/atl_rxtx.c +2 -3
@@ -1127,10 +1127,9 @@ atl_xmit_cleanup(struct atl_tx_queue *txq)if (txq !=NULL ) { sw_ring = txq->sw_ring;int head = txq->tx_head; -int cnt; -int i; +int cnt = head; -for (i =0 , cnt = head; ; i++) { +while (true) { txd = &txq->hw_ring[cnt];if (txd->dd)
Signature · 1 line
2.38.1
PATCH 5/11 net/dpaa2: fix build with clang 15
In reply to David MarchandThis variable is not used.
--- drivers/net/dpaa2/dpaa2_rxtx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_rxtx.c +1 -3
@@ -620,7 +620,7 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q)/* Function receive frames for a given device and VQ */ struct qbman_result *dq_storage;uint32_t fqid = dpaa2_q->fqid; -int ret, num_rx =0 , num_pulled; +int ret, num_rx =0 ;uint8_t pending, status;struct qbman_swp *swp;const struct qbman_fd *fd;
@@ -660,7 +660,6 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q)while (!qbman_check_command_complete (dq_storage)) ; - num_pulled =0 ; pending =1 ; do { /* Loop until the dq_storage is updated with
@@ -695,7 +694,6 @@ dump_err_pkts(struct dpaa2_queue *dpaa2_q) dq_storage++; num_rx++; - num_pulled++; }while (pending); dpaa2_q->err_pkts += num_rx;
Signature · 1 line
2.38.1
PATCH 6/11 net/ice: fix build with clang 15
In reply to David MarchandThis variable is not used.
--- drivers/net/ice/ice_ddp_package.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ice/ice_ddp_package.c +0 -3
@@ -439,7 +439,6 @@ ice_dump_switch(struct rte_eth_dev *dev, uint8_t **buff2, uint32_t *size)int i =0 ;uint16_t tbl_id =0 ;uint32_t tbl_idx =0 ; -int tbl_cnt =0 ;uint8_t *buffer = *buff2; hw =ICE_DEV_PRIVATE_TO_HW (dev->data->dev_private);
@@ -481,10 +480,8 @@ ice_dump_switch(struct rte_eth_dev *dev, uint8_t **buff2, uint32_t *size)free (buff); - tbl_cnt++;if (tbl_idx ==0xffffffff ) { tbl_idx =0 ; - tbl_cnt =0 ;memset (buffer,'\n' ,sizeof (char )); buffer++; offset =0 ;
Signature · 1 line
2.38.1
PATCH 7/11 app/testpmd: fix build with clang 15
In reply to David MarchandThis variable is used to create some artificial load.
--- app/test-pmd/noisy_vnf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/noisy_vnf.c +1 -1
@@ -57,8 +57,8 @@ do_write(char *vnf_mem)static inline void do_read (char *vnf_mem) { + uint64_t r __rte_unused;uint64_t i =rte_rand (); -uint64_t r; r = vnf_mem[i % ((noisy_lkup_mem_sz *1024 *1024 ) /RTE_CACHE_LINE_SIZE )];
Signature · 1 line
2.38.1
PATCH 8/11 app/testpmd: fix build with clang 15 in flow code
In reply to David MarchandThis variable is not used and has been copy/pasted in a lot of other code.
--- app/test-pmd/config.c | 14 -------------- 1 file changed, 14 deletions(-)
app/test-pmd/config.c +0 -14
@@ -1787,7 +1787,6 @@ port_action_handle_destroy(portid_t port_id, {struct rte_port *port;struct port_indirect_action **tmp; -uint32_t c =0 ;int ret =0 ; if (port_id_is_invalid(port_id, ENABLED_WARN) ||
@@ -1822,7 +1821,6 @@ port_action_handle_destroy(portid_t port_id, }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
@@ -2251,7 +2249,6 @@ port_flow_pattern_template_destroy(portid_t port_id, uint32_t n, {struct rte_port *port;struct port_template **tmp; -uint32_t c =0 ;int ret =0 ; if (port_id_is_invalid(port_id, ENABLED_WARN) ||
@@ -2288,7 +2285,6 @@ port_flow_pattern_template_destroy(portid_t port_id, uint32_t n, }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
@@ -2368,7 +2364,6 @@ port_flow_actions_template_destroy(portid_t port_id, uint32_t n, {struct rte_port *port;struct port_template **tmp; -uint32_t c =0 ;int ret =0 ; if (port_id_is_invalid(port_id, ENABLED_WARN) ||
@@ -2404,7 +2399,6 @@ port_flow_actions_template_destroy(portid_t port_id, uint32_t n, }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
@@ -2534,7 +2528,6 @@ port_flow_template_table_destroy(portid_t port_id, {struct rte_port *port;struct port_table **tmp; -uint32_t c =0 ;int ret =0 ; if (port_id_is_invalid(port_id, ENABLED_WARN) ||
@@ -2571,7 +2564,6 @@ port_flow_template_table_destroy(portid_t port_id, }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
@@ -2719,7 +2711,6 @@ port_queue_flow_destroy(portid_t port_id, queueid_t queue_id,struct rte_flow_op_attr op_attr = { .postpone = postpone };struct rte_port *port;struct port_flow **tmp; -uint32_t c =0 ;int ret =0 ;struct queue_job *job;
@@ -2768,7 +2759,6 @@ port_queue_flow_destroy(portid_t port_id, queueid_t queue_id, }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
@@ -2836,7 +2826,6 @@ port_queue_action_handle_destroy(portid_t port_id,const struct rte_flow_op_attr attr = { .postpone = postpone};struct rte_port *port;struct port_indirect_action **tmp; -uint32_t c =0 ;int ret =0 ;struct queue_job *job;
@@ -2886,7 +2875,6 @@ port_queue_action_handle_destroy(portid_t port_id, }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
@@ -3304,7 +3292,6 @@ port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule) {struct rte_port *port;struct port_flow **tmp; -uint32_t c =0 ;int ret =0 ; if (port_id_is_invalid(port_id, ENABLED_WARN) ||
@@ -3337,7 +3324,6 @@ port_flow_destroy(portid_t port_id, uint32_t n, const uint32_t *rule) }if (i == n) tmp = &(*tmp)->next; - ++c; }return ret; }
Signature · 1 line
2.38.1
PATCH 9/11 test/efd: fix build with clang 15
In reply to David MarchandThis local variable hides the more global one. The original intent was probably to use the global one.
--- app/test/test_efd_perf.c | 1 - 1 file changed, 1 deletion(-)
app/test/test_efd_perf.c +0 -1
@@ -153,7 +153,6 @@ setup_keys_and_data(struct efd_perf_params *params, unsigned int cycle)qsort (keys,KEYS_TO_ADD ,MAX_KEYSIZE , key_compare);/* Sift through the list of keys and look for duplicates */ -int num_duplicates =0 ;for (i =0 ; i <KEYS_TO_ADD -1 ; i++) {if (memcmp (keys[i], keys[i +1 ], params->key_size) ==0 ) {/* This key already exists, try again */
Signature · 1 line
2.38.1
PATCH 10/11 test/member: fix build with clang 15
In reply to David MarchandThis local variable hides the more global one. The original intent was probably to use the global one.
--- app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - 2 files changed, 2 deletions(-)
app/test/test_member.c +0 -1
@@ -573,7 +573,6 @@ setup_keys_and_data(void)qsort (generated_keys,MAX_ENTRIES ,KEY_SIZE , key_compare);/* Sift through the list of keys and look for duplicates */ -int num_duplicates =0 ;for (i =0 ; i <MAX_ENTRIES -1 ; i++) {if (memcmp (generated_keys[i], generated_keys[i +1 ],KEY_SIZE ) ==0 ) {
app/test/test_member_perf.c +0 -1
@@ -178,7 +178,6 @@ setup_keys_and_data(struct member_perf_params *params, unsigned int cycle,qsort (keys,KEYS_TO_ADD ,MAX_KEYSIZE , key_compare);/* Sift through the list of keys and look for duplicates */ -int num_duplicates =0 ;for (i =0 ; i <KEYS_TO_ADD -1 ; i++) {if (memcmp (keys[i], keys[i +1 ], params->key_size) ==0 ) {
Signature · 1 line
2.38.1
PATCH 11/11 test/event: fix build with clang 15
In reply to David MarchandThis variable is not used.
--- app/test/test_event_timer_adapter.c | 2 -- 1 file changed, 2 deletions(-)
app/test/test_event_timer_adapter.c +0 -2
@@ -911,7 +911,6 @@ _cancel_thread(void *args) {RTE_SET_USED (args);struct rte_event_timer *ev_tim =NULL ; -uint64_t cancel_count =0 ;uint16_t ret;while (!arm_done ||rte_ring_count (timer_producer_ring) >0 ) {
@@ -921,7 +920,6 @@ _cancel_thread(void *args) ret =rte_event_timer_cancel_burst (timdev, &ev_tim,1 );TEST_ASSERT_EQUAL (ret,1 ,"Failed to cancel timer" );rte_mempool_put (eventdev_test_mempool, (void *)ev_tim); - cancel_count++; }return TEST_SUCCESS ;
Signature · 1 line
2.38.1
RE: [PATCH 11/11] test/event: fix build with clang 15
Quoted 8 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: 2022年11月18日 16:53
To: [email protected]
Cc: [email protected]; Carrillo, Erik G <[email protected]>; Pavan Nikhilesh <[email protected]>
Subject: [PATCH 11/11] test/event: fix build with clang 15
Quoted 6 lines
This variable is not used.
Fixes d1f3385d0076 ("test: add event timer adapter auto-test")Signed-off-by David Marchand <[email protected]>
A message that is not in the archive (sent off-list or not yet received): 20221119001318.GA16784@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net
Quoted 5 lines · Tyler Retzlaff
Quoted 3 lines · David Marchand
Fedora 37 has just been released with clang 15.
The latter seems more picky wrt unused variable.
Quoted 7 lines
Quoted 5 lines
Fixes have been tested in GHA with a simple patch I used in my own repo:
https://github.com/david-marchand/dpdk/commit/82cd57ae5490
https://github.com/david-marchand/dpdk/actions/runs/3495454457--
Series-Acked-By Tyler Retzlaff <[email protected]>
Thanks for the ack.
Re-adding dev@.
Signature · 1 line
David Marchand
Quoted 24 lines · David Marchand
Fedora 37 has just been released with clang 15.
The latter seems more picky wrt unused variable.Fixes have been tested in GHA with a simple patch I used in my own repo:
https://github.com/david-marchand/dpdk/commit/82cd57ae5490
https://github.com/david-marchand/dpdk/actions/runs/3495454457--
David MarchandDavid Marchand (11):
service: fix build with clang 15
vhost: fix build with clang 15
bus/dpaa: fix build with clang 15 net/atlantic: fix build with clang 15 net/dpaa2: fix build with clang 15 net/ice: fix build with clang 15 app/testpmd: fix build with clang 15 app/testpmd: fix build with clang 15 in flow code test/efd: fix build with clang 15 test/member: fix build with clang 15 test/event: fix build with clang 15
Quoted 13 lines
app/test-pmd/config.c | 14 -------------- app/test-pmd/noisy_vnf.c | 2 +- app/test/test_efd_perf.c | 1 - app/test/test_event_timer_adapter.c | 2 -- app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - drivers/bus/dpaa/base/qbman/bman.h | 4 +--- drivers/net/atlantic/atl_rxtx.c | 5 ++--- drivers/net/dpaa2/dpaa2_rxtx.c | 4 +--- drivers/net/ice/ice_ddp_package.c | 3 --- lib/eal/common/rte_service.c | 2 -- lib/vhost/virtio_net.c | 2 -- 12 files changed, 5 insertions(+), 36 deletions(-)
Series applied for rc4, thanks.
Signature · 1 line
David Marchand