From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7753EA04C1; Thu, 21 Nov 2019 19:40:13 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6811B2BA2; Thu, 21 Nov 2019 19:40:12 +0100 (CET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by dpdk.org (Postfix) with ESMTP id 8885E237 for ; Thu, 21 Nov 2019 19:40:10 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id p24so2146403pfn.4 for ; Thu, 21 Nov 2019 10:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=1uKtxVfQA6qjjfMpOwUZvytMWCFPZUrQsT+U1B2o+h0=; b=kHM6tNKFSEm26VskPiBZ2yxiNljz3OJinfWARS+WKrvBGkRgCgw3IjMnZZDFGxOGt0 PY5BXXI4UltzIOFtaFffLa4aRjsHLzEQZLAGoZLb7s0AWP5lZKREDtdzRD9IkyQLpbSy LFxal/Y7oBHAZ1DT6kqdZ1Ap5wQR8nrAdSYFa/2TOfRTHKw2PdB83Pd4lsiOqb/1vXSl ce56PQfQwzEBghP3fROodOfAfif0SzFYJSuUHy72Bkxukl/+jdgbHO2Sp4hnjWbYJoSM pN6rP+WiAIFyBDr95K1SjKnFkwOehleE2vIIb0JO8nHlfZh+T5vL2rt9bC7jN3mISgWW TbfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=1uKtxVfQA6qjjfMpOwUZvytMWCFPZUrQsT+U1B2o+h0=; b=GwJQAZ0u7/uPe9rxYMEMha2VKzLTK2er6cKm+5GK/KDpfVKnWEDnSnTGwO4rfymcWE UMat+2a8J+9tHWJ1uMW+2Mmm51mpuzHetzapEMRgYpoQKbPun6HE+czs9/mvc951d5Dj k6bmYLPMt40MY4tM7IAIfWwlJVnlfpckERo89kOgFfAL8f60XDIR8/is2eCs/Ri79vru xqG4fQ/hk2JqsQQ0Oxdd5dWwQnB8/AJnredbTeE1DneYZIHeXcurjqdKjtnza6u2z7Yc 1nSqmR6YlrJN4tOZuavudwH1UwWR1Sn8LiWvE3LQP+0bNo3sTGVWzfbEkSbysNTBz1rh mJ1g== X-Gm-Message-State: APjAAAVzxUw4dOT2w/fHodF9HCjIA0UeG9zNT6iePtQYLM9m9D0jQsT3 BIi6Bjb34uAFkDsF1YLkxamYLw== X-Google-Smtp-Source: APXvYqyDumN6+FUUjjZ22YndT+Lj6dJp2myVZPuozTT2Cwwm5vkwV1kckphXNcghfilSufptL9vZhA== X-Received: by 2002:a62:180a:: with SMTP id 10mr12790936pfy.40.1574361609650; Thu, 21 Nov 2019 10:40:09 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x190sm4369711pfc.89.2019.11.21.10.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 10:40:09 -0800 (PST) Date: Thu, 21 Nov 2019 10:40:01 -0800 From: Stephen Hemminger To: Jakub Grajciar , dev@dpdk.org Message-ID: <20191121104001.5be6c77b@hermes.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [dpdk-dev] memif: extra link_get in secondary X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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) {