Skip to content

Commit fab168e

Browse files
committed
dpdk: suppress warning unused variable 'gather_len'
1 parent fafab22 commit fab168e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pcap-dpdk.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,14 @@ static inline void calculate_timestamp(struct dpdk_ts_helper *helper,struct time
280280
timeradd(&(helper->start_time), &cur_time, ts);
281281
}
282282

283-
static uint32_t dpdk_gather_data(unsigned char *data, uint32_t len, struct rte_mbuf *mbuf)
283+
static void dpdk_gather_data(unsigned char *data, uint32_t len, struct rte_mbuf *mbuf)
284284
{
285285
uint32_t total_len = 0;
286286
while (mbuf && (total_len+mbuf->data_len) < len ){
287287
rte_memcpy(data+total_len, rte_pktmbuf_mtod(mbuf,void *),mbuf->data_len);
288288
total_len+=mbuf->data_len;
289289
mbuf=mbuf->next;
290290
}
291-
return total_len;
292291
}
293292

294293

@@ -334,7 +333,6 @@ static int pcap_dpdk_dispatch(pcap_t *p, int max_cnt, pcap_handler cb, u_char *c
334333
uint32_t caplen = 0;
335334
u_char *bp = NULL;
336335
int i=0;
337-
unsigned int gather_len =0;
338336
int pkt_cnt = 0;
339337
u_char *large_buffer=NULL;
340338
int timeout_ms = p->opt.timeout;
@@ -403,12 +401,12 @@ static int pcap_dpdk_dispatch(pcap_t *p, int max_cnt, pcap_handler cb, u_char *c
403401
// use fast buffer pcap_tmp_buf if pkt_len is small, no need to call malloc and free
404402
if ( pkt_len <= RTE_ETH_PCAP_SNAPLEN)
405403
{
406-
gather_len = dpdk_gather_data(pd->pcap_tmp_buf, RTE_ETH_PCAP_SNAPLEN, m);
404+
dpdk_gather_data(pd->pcap_tmp_buf, RTE_ETH_PCAP_SNAPLEN, m);
407405
bp = pd->pcap_tmp_buf;
408406
}else{
409407
// need call free later
410408
large_buffer = (u_char *)malloc(caplen*sizeof(u_char));
411-
gather_len = dpdk_gather_data(large_buffer, caplen, m);
409+
dpdk_gather_data(large_buffer, caplen, m);
412410
bp = large_buffer;
413411
}
414412

0 commit comments

Comments
 (0)