DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] memif: extra link_get in secondary
@ 2019-11-21 18:40 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2019-11-21 18:40 UTC (permalink / raw)
  To: Jakub Grajciar, dev

What is this code doing (why query link status)?

static uint16_t
eth_memif_rx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
{
...
	struct rte_eth_link link;

	if (unlikely((pmd->flags & ETH_MEMIF_FLAG_CONNECTED) == 0))
		return 0;

	if (unlikely(ring == NULL)) {
		/* Secondary process will attempt to request regions. */
		rte_eth_link_get(mq->in_port, &link);  <<< Why??
		return 0;
	}

It causes Coverity warning:
*** CID 351057:  Error handling issues  (CHECKED_RETURN)
/drivers/net/memif/rte_eth_memif.c: 436 in eth_memif_rx_zc()
430     	struct rte_eth_link link;
431     
432     	if (unlikely((pmd->flags & ETH_MEMIF_FLAG_CONNECTED) == 0))
433     		return 0;
434     	if (unlikely(ring == NULL)) {
435     		/* Secondary process will attempt to request regions. */
>>>     CID 351057:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "rte_eth_link_get" without checking return value (as is done elsewhere 14 out of 17 times).  
436     		rte_eth_link_get(mq->in_port, &link);
437     		return 0;
438     	}
439     
440     	/* consume interrupt */
441     	if ((ring->flags & MEMIF_RING_FLAG_MASK_INT) == 0) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-21 18:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 18:40 [dpdk-dev] memif: extra link_get in secondary Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).