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 C31C3460D6; Tue, 21 Jan 2025 19:24:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72639402CB; Tue, 21 Jan 2025 19:24:24 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 53EAD4026C for ; Tue, 21 Jan 2025 19:24:23 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21636268e43so132532565ad.2 for ; Tue, 21 Jan 2025 10:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1737483862; x=1738088662; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=lOFHf+o/CEeqt5TQJqFm+bPalQOli3w0jnBI7hKnN/Y=; b=2SFODlCMxWwwtvYGQ1AyNV9Sj5FNflMq5oZjMqW652HnIGh3MQEwoX238ozJFXSQkz Jp88dJU9XFvYuBs9fqCNnEe9Aa6gFjz1iQpf0Z62cd6D2rkvswTIFzfsnJTrOOOwLY9D 21LT/QV+t1WjpzmAYSXPxQrJG7lSbmkvbxNadq/ots87xdz0cr22EhdwQ/FzZFaT+2UD JVKNtDe+82jvvYwZWoPCFRjbXtJ5ZWWFV/UMO+g3/QBJuUfB4hx6HG7f+/VWuw+kcn2n +4jH8mzu0bqxaYoC2BfH4861FbQt4wkMvTkT77BLlxe7nArUaQDtx+XKAkGuEWgWUZvj qdPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737483862; x=1738088662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lOFHf+o/CEeqt5TQJqFm+bPalQOli3w0jnBI7hKnN/Y=; b=pcE/SP+gS/FH9J40JY2sNBGlNEnUdKtaUq4b6N/b9808XeD4gNXwx02ODISoABZNvi AqasqkxI01bKTYtiz2qWv2SdI2W4MKBoc3ab+bP6WBHfzdxRYxPhESbixLgEQK1/MAKS mObNdgbhklv9+zMUn/pTlYWSnbke+GryuPMnu5bBWVWcnNN2rFXqVmswSNTDVMvLwMSJ ARx8Dqsuf0qIG8z2MlqVlbRZUsLxRM5HWNBLV1r9F90cOgal6eE/h9XmQYYZJTFOSOuj UTmkkfJ7HWqK/CJX6RqW/tijhXhz1yUbrG4A6UBHLmaDhvzT529h/t/1Ns3kebnCiD4K zmXw== X-Gm-Message-State: AOJu0Yz8IUhVqexydZX3MLAzHZO0Td3Aum8me7gTNridvjSOKcAJ+GzA rnzO+oFaRsV2ZyAo9dnK8B7gvfEtzNstA0FYlN7DAu5NRRj5qWDqo2od0hqd3btdjgjbWUwMTx7 X X-Gm-Gg: ASbGncvmtYjGg/crQ0c/4gcXDEnfZP273ym9FSR4NP9GAGDl7Quj6vOYVPDYYNQSapW YAQH9MQDtEKJ//jifluHoRgdTxGwhCMaTTHPXo7Skl4mmkUFyNyuPYRNHZeORASr2v3SLtg6UKr rrmtPEC0pAVHYQ5NxmHN4RnEdcuF3XuKNa/UvWC0zEDn2b7e6syFDoj8YKguQp4S6SsygLyIOqC JLJW17HjPqKxk7NsFuSpuKV3Ii+q13IsKqx3cDDmhut67VxN1hA0CgWlv0b2TaBGCtea/qOtT4J Z4iTLSxv1582WFH9s18P4DEu3ul66omj+Smu9ti+pRvy6mo= X-Google-Smtp-Source: AGHT+IG2OD8S/3xBWkh9L+Yc7UBtn9ovuYMhD/gmvclZNxzVr7Wj3Bytb+zy1ofUpU+QFGIb8bfe1g== X-Received: by 2002:a17:903:2a8b:b0:216:6769:9eea with SMTP id d9443c01a7336-21c355bf8dcmr253300265ad.37.1737483862188; Tue, 21 Jan 2025 10:24:22 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3b841bsm80717285ad.146.2025.01.21.10.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 10:24:21 -0800 (PST) Date: Tue, 21 Jan 2025 10:24:19 -0800 From: Stephen Hemminger To: Serhii Iliushyk Cc: dev@dpdk.org, mko-plv@napatech.com, ckm@napatech.com, Danylo Vodopianov Subject: Re: [PATCH v1 02/31] net/ntnic: add thread check return code Message-ID: <20250121102419.242d474f@hermes.local> In-Reply-To: <20250121170814.3252171-3-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> <20250121170814.3252171-3-sil-plv@napatech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Tue, 21 Jan 2025 18:07:40 +0100 Serhii Iliushyk wrote: > From: Danylo Vodopianov > > CI found couple coverity problems which were fixed in this commit. > > CID: 448965 Error handling issues (CHECKED_RETURN). > > Thread return code check was added. > > Coverity issue: 448965 > Fixes: a1ba8c473f5c ("net/ntnic: add statistics poll") > > Signed-off-by: Danylo Vodopianov > --- > drivers/net/ntnic/ntnic_ethdev.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c > index 2a2643a106..620d023a71 100644 > --- a/drivers/net/ntnic/ntnic_ethdev.c > +++ b/drivers/net/ntnic/ntnic_ethdev.c > @@ -2516,8 +2516,11 @@ static int init_shutdown(void) > NT_LOG(DBG, NTNIC, "Starting shutdown handler"); > kill_pmd = 0; > previous_handler = signal(SIGINT, signal_handler_func_int); > - THREAD_CREATE(&shutdown_tid, shutdown_thread, NULL); > - > + int ret = THREAD_CREATE(&shutdown_tid, shutdown_thread, NULL); > + if (ret != 0) { > + NT_LOG(ERR, NTNIC, "Failed to create shutdown thread, error code: %d", ret); > + return -1; > + } > /* > * 1 time calculation of 1 sec stat update rtc cycles to prevent stat poll > * flooding by OVS from multiple virtual port threads - no need to be precise > -- The whole thread, SIGINT stuff is a big mistake. You are making all sorts of assumptions about application environment such as SIGINT won't be used by other things, drivers creating internal threads is a bad idea. Also access to the flag kill_pmd is not being done in a thread safe manner. What is it really trying to do? IMHO, The driver should have never been merged with this stuff.