From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BEE3845AAF; Fri, 4 Oct 2024 18:24:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A47A14279F; Fri, 4 Oct 2024 18:24:30 +0200 (CEST) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id 7392B4025F for ; Fri, 4 Oct 2024 18:24:29 +0200 (CEST) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-71de9e1f431so652991b3a.3 for ; Fri, 04 Oct 2024 09:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728059068; x=1728663868; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Nun3DRB2IPfpndY68hFSg/Yjs1zmvsvrj1HCj88NAb0=; b=xUoJ6/OmxrcbcMxPAw+nIJcn/LdsA35TI2uPlxWhy7C/XVl6X1WB+oeSHjPS0Ku3rC 4onJRgZ02nQcatYWnO8zl8XAhUniLLjz7VFAu7SWu8lFPh/ye33Z7yuStdphaqPbmYpH /XW+75h2iLS8QjvT3OkvRBolk93rCf6ULyFwlOcwBmmkRjg0o/5v6RauRjKGk2iLWJQK aQqFOqu8xPcevIdsy8+NkR8e0AtZPd52vjZ0H9sa+f3+C1pt2MLr57WzGubAG9o/f2Oh Z2ICcslo8AsrbzmeE7vt7mlwxJt4soNz3jeOhVYR6Zuak7jkEC3OwtJkwvJgbipgmO8x leTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059068; x=1728663868; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nun3DRB2IPfpndY68hFSg/Yjs1zmvsvrj1HCj88NAb0=; b=w9v2iwWfK8dB2pRUBjdraicZngFZ64incFaYLC/Y5iqEYSICPCTVxsY0+TRMyzQkK+ 0aFm0AW8vdUome852udF6Sld0j6CJYMv+Pn0ZgIiIB6XM8rp16Dnv2y87tBSFNhM6wkJ 75dUFYd+PGD2XisqPPRBaXXPf4vZc3GsubkVkQqfeRxB6OzbsNSvvwwhiAZDI9KpTHYE bL4Ctj4f+TN4MWHHryOrts/8pJ3YV/jxMrMv3n7efRwifvoNdhRIOgz2dIuR1be6z90+ XtM7KH3o50irzVrZ3PEtDvBtiUiuXt7b8g4EqROcKpUQF2jNNV4S6R466QJBSsakd5LZ 55cQ== X-Gm-Message-State: AOJu0YwDbaEBdQJwzbet19MsoKcYa/3NyKPq8xcm50VDiWX/7cUpMSgF mD9T+pry9DsGVoVF3HfrpThQTflhvKG9Jv/Z+5Px+Ecpcg8fsmxLEC4EZFqLNGEtFyqEJgO+xug 3WHdEwQ== X-Google-Smtp-Source: AGHT+IE/Zo9hRjHbyzTMFCNaibIJi/pqiUqUouqCNPZgrr5+XcakBcfxae8QXo+CCc7LOsrnYtuOvg== X-Received: by 2002:a05:6a21:78c:b0:1ce:f6b2:d5a2 with SMTP id adf61e73a8af0-1d6dfaef31emr5926585637.41.1728059068408; Fri, 04 Oct 2024 09:24:28 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9f680d7a1sm139231a12.19.2024.10.04.09.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 09:24:28 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 00/10] require checking ethdev get return value Date: Fri, 4 Oct 2024 09:21:47 -0700 Message-ID: <20241004162418.52940-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Several places flagged by Coverity and Codeql are from code that calls rte_eth_dev_info_get() but does not check the return value. If rte_eth_dev_info_get() returns an error, the device info is garbage. This patch series uses the function attribute to force code to check the result or there will be a compiler warning. The series is ordered to fix the current warnings first before enabling it. Stephen Hemminger (10): app/test: remove redundant call net/memif: check return value from rte_eth_dev_info_get graph: check return value from rte_eth_dev_info_get examples/ethtool: handle devices without registers examples/l3fwd: check return value from ethdev info examples/ntb: always check return value examples/pipeline: check return value of ethdev functions examples/qos_sched: check return value from rte_eth_link_get ethdev: check return value from rte_eth_dev_info_get ethdev: require checking results of info_get functions app/graph/ethdev.c | 20 ++++++++++++---- app/test/test_link_bonding_rssconf.c | 1 - drivers/net/memif/rte_eth_memif.c | 12 ++++++++-- examples/ethtool/lib/rte_ethtool.c | 6 ++--- examples/l3fwd-graph/main.c | 12 ++++++++-- examples/l3fwd/l3fwd_fib.c | 16 +++++++++---- examples/l3fwd/l3fwd_lpm.c | 14 ++++++++---- examples/ntb/ntb_fwd.c | 5 +++- examples/pipeline/cli.c | 7 +++--- examples/qos_sched/init.c | 13 +++++++++-- lib/ethdev/rte_class_eth.c | 4 +++- lib/ethdev/rte_ethdev.h | 34 +++++++++++++++++----------- 12 files changed, 103 insertions(+), 41 deletions(-) -- 2.45.2