From: Stephen Hemminger <stephen@networkplumber.org>
To: Jakub Grajciar <jgrajcia@cisco.com>, dev@dpdk.org
Subject: [dpdk-dev] memif: extra link_get in secondary
Date: Thu, 21 Nov 2019 10:40:01 -0800 [thread overview]
Message-ID: <20191121104001.5be6c77b@hermes.lan> (raw)
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) {
reply other threads:[~2019-11-21 18:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191121104001.5be6c77b@hermes.lan \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=jgrajcia@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.