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 7BD3345AAF; Fri, 4 Oct 2024 18:25:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B00E442EA0; Fri, 4 Oct 2024 18:24:42 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id C2D7442DE9 for ; Fri, 4 Oct 2024 18:24:34 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-71dc4451fffso2303279b3a.2 for ; Fri, 04 Oct 2024 09:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728059074; x=1728663874; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=btj4lyd/9T1OnaBbXB4nFXW5eNT9ioL8mIcFVtpOKXM=; b=NUsMkTIbonHbqNyezK7B76IaAjAPBCplHH4nvceWFvVamIkcUivunNpBStlk3hCRWY MrSIUOo/7v1SnKt7y7avo/7HvoQiiL3wTu4kCWGTyaPv1b6ffQrqObrCBMyc9VF8EKiQ Sfk7/h8jmEerkwaXhkX+KRm9gUi6PCwNOFtxGNcCeCE9+fSP+VMoHVRLo80uEHf4REiR uNAUDKfIcLGRj1MYC8g32VqV+goGBmxsgxBbZjw2d5yDRGBSBlC/1t7z54RNv4xjUWR9 oPsSgydYiF7EbYXR7M4dsuVB9bZ+IrIzmtA3hDqUwgzap9L0NhejjMgBhKYLweFdlITa fkLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059074; x=1728663874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=btj4lyd/9T1OnaBbXB4nFXW5eNT9ioL8mIcFVtpOKXM=; b=uHHUyqTQJ+6YHJkCYDzS4gdooyGUAOi85oM23tFG6Sxxv7M2R9ioTVKzJ5x5odcwgr PhXSoDeAm5f0zJDqPagnKikmUpm0VqvP9DwXj6rTLI+BEUrvokmYotLyBhtSPpR5hlCU Fr2nAvTp2GEY7R48y33nd99zkItVfN53JhZoN0vnDHRTdrVWSiQSVfEMCmxqL00g5RHF nTUjkBRo3RIWwtMjMDeJYFcc8plNp3RG42pNxyXBLPUcxrG9y8GVqg4XHE2E3QpEtAuW b4uU9Zhvs0xxFz7wqRpjhM5PZyQCcmBLqLw8+STCeMhsXuPqY/ZI7WHsGnqGu83xGJIG JK1Q== X-Gm-Message-State: AOJu0Yw97+8cD7TkIVC2a1kqeIqnopG40qM4MfUePEMyN0QwRhrKOZzV 3UiHXoKNlcatyGyeq2RuMlX/yq6RUoFxulWAtQrJsDPkuurDRUWSu4FdflCWQDCxSsgAFn1bMJL WIxTD6A== X-Google-Smtp-Source: AGHT+IFpnlCzcG9vv4au14uKLIe2tCLWWJY8Rs90bqALjKHoDI1mJwM23EWhidmVrH834Z9dd6Vxrg== X-Received: by 2002:a05:6a00:23ce:b0:710:da27:f176 with SMTP id d2e1a72fcca58-71de23c7352mr4983560b3a.12.1728059073821; Fri, 04 Oct 2024 09:24:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 09:24:33 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , xiaoyun.li@intel.com, Jingjing Wu Subject: [PATCH 06/10] examples/ntb: always check return value Date: Fri, 4 Oct 2024 09:21:53 -0700 Message-ID: <20241004162418.52940-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162418.52940-1-stephen@networkplumber.org> References: <20241004162418.52940-1-stephen@networkplumber.org> 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 The ethdev_info is only valid if rte_eth_dev_info_get returns success. Fixes: 5194299d6ef5 ("examples/ntb: support more functions") Cc: xiaoyun.li@intel.com Signed-off-by: Stephen Hemminger --- examples/ntb/ntb_fwd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c index 56c7672392..37d60208e3 100644 --- a/examples/ntb/ntb_fwd.c +++ b/examples/ntb/ntb_fwd.c @@ -1285,7 +1285,10 @@ main(int argc, char **argv) eth_port_id = rte_eth_find_next(0); if (eth_port_id < RTE_MAX_ETHPORTS) { - rte_eth_dev_info_get(eth_port_id, ðdev_info); + ret = rte_eth_dev_info_get(eth_port_id, ðdev_info); + if (ret) + rte_exit(EXIT_FAILURE, "Can't get info for port %u\n", eth_port_id); + eth_pconf.rx_adv_conf.rss_conf.rss_hf &= ethdev_info.flow_type_rss_offloads; ret = rte_eth_dev_configure(eth_port_id, num_queues, -- 2.45.2