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 937CA46BE9 for ; Tue, 22 Jul 2025 16:30:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 823144065A; Tue, 22 Jul 2025 16:30:58 +0200 (CEST) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by mails.dpdk.org (Postfix) with ESMTP id 3AE4C40616 for ; Tue, 22 Jul 2025 16:30:56 +0200 (CEST) Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7e2e3108841so654045785a.3 for ; Tue, 22 Jul 2025 07:30:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uetpeshawar-edu-pk.20230601.gappssmtp.com; s=20230601; t=1753194655; x=1753799455; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+dWKRg0Wx+KWg2PJ1m0dWtjRduzSrtbJg4VuxDZPVN4=; b=arqHEHwCFY2wTCaLeeYv6VYN6BqOs2oSnYq7iA9U0BOlghJAoWm5EzJJ+yYUklHHiC 2v0MDqY/Y+BeFEs1e+thVkaXyleawsJsrcCc1GhSxt6MHNDovuaY6LDWy8CXmwoi+KFH MHbbe1PjMZWFKgCd55bVT378WuKqua4YyJwB0ItYX44Fb2G+hC/cyPxFodYy+x6MrN4i CK1QIGAWD+nsn9UVLEBdjqv7DmjXktknHQ58OuOzsRsasYYqqsJ+xa26Oo0FSYCaav5A JHjOQCPW80qviDCWkBh5mEkjuyL6oL3QMzZcuWyIa2O7FX3s24Nb2LhLbASw9+9Mz1Kx sMYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753194655; x=1753799455; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+dWKRg0Wx+KWg2PJ1m0dWtjRduzSrtbJg4VuxDZPVN4=; b=FrfaoQ9DY51DU+8f3MO6yaN9kMGLXmtELqL3f8YnNjlI/pmBML6lNa5Ky0tqN4UTOB 7104uaaCqJOo3W+0vNDkNTpFHWOdacFa+XDZz5t4Kl0wxN3f/VaAmLz8IK9RcvUwaqoV FeGTSbM+4WXcVTiB9k+jldUuVRpwgEHLiyNlWP0w2yeTA70aYEzM+Y2nUOOrRR7dSvfI lmHXWCqZacKjx2lCHTXLcMm6VC+jgJEr2XEQzu5eoxljY0ySOpN+d/pGlvK+401NO7lR vNQcvUwBtLLgl50Z2wwbAmnF7g2SOnTVQP4K8+navdLFZME67F0pB/6JZZJCy2i2OJ9F 8e5w== X-Forwarded-Encrypted: i=1; AJvYcCUdMQSYR+7IPTpWCDIAMwipTTRj6Kn3FUVl7X0wEh8KKyuGjjUa2BK9NUCuLvxsBUaWsHSk66o=@dpdk.org X-Gm-Message-State: AOJu0YxoeSv8z60ZSh5vOf36kt83EBvzgR0oXkkDOpCiTISSk0ct9qna Z3Fvbn1slYtuavE30wcXjpYVHQPeZD767DPb1ZRoP1EUgw2wSK/u6I4Lpwb/pGFqaNxvlRTKKfj BQvPOPNJ3HsS/HGjIMoEwhBzyy+JHowpYjqVKj8/erQ== X-Gm-Gg: ASbGncu7YAkww1Txl5QcYny7cURo5zSEu0n5SYxSbq7PdFvwNjKLH9zdVXcUUnBFwos bO70SBfJ29QIAEH1inGqkYJHcBGRxrp9NaB8EqnorDRmLNSEOnl0Lx4VKRF5RbcVT3LfPAGL/0v De3GKEKDFSANBNe8lr1MM7oybabdFCr+oJgbP83Z9kVNnDYlG9AtcykBbCB7+UmBXM2vPkA0E+b JgVmBoTGOdpkQ7pFRmr//14NBOZ9F+aweCQvEartA== X-Google-Smtp-Source: AGHT+IE8cSYKg4gIlB6ACsDYobsMpE336FXweiT51QB691r/oTDRwQLuUHfd4jZwD1XQBVdCq+pGq/LV7xXt8VyYRsk= X-Received: by 2002:a05:6214:21e9:b0:6fb:51c:395 with SMTP id 6a1803df08f44-704f6bd3b12mr305492156d6.41.1753194654982; Tue, 22 Jul 2025 07:30:54 -0700 (PDT) MIME-Version: 1.0 References: <20250722115439.1353573-1-14pwcse1224@uetpeshawar.edu.pk> <20250722063924.2f87f3f7@hermes.local> In-Reply-To: <20250722063924.2f87f3f7@hermes.local> From: Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> Date: Tue, 22 Jul 2025 19:30:41 +0500 X-Gm-Features: Ac12FXyZShmXEAmRQKyBOzztL7k_e2dGalkqK4GMV8rDK9x9KaEBMNrrfwHk9SE Message-ID: Subject: Re: [PATCH] lib/ethdev: fix segfault in secondary process by validating dev_private pointer To: Stephen Hemminger Cc: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , dev@dpdk.org, dpdk stable Content-Type: multipart/alternative; boundary="000000000000a200a3063a8570fa" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org --000000000000a200a3063a8570fa Content-Type: text/plain; charset="UTF-8" Hi Stephen, Can we add only the check that fixes the segfault, or do you mean that it should be fixed at the PMD level? Best regards, Khadem On Tue, Jul 22, 2025, 18:39 Stephen Hemminger wrote: > On Tue, 22 Jul 2025 07:54:39 -0400 > Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> wrote: > > > + if (rte_eal_process_type() == RTE_PROC_SECONDARY && > > + (dev == NULL || dev->data == NULL || > > + dev->data->dev_private == NULL || > > dev can't be NULL and checking it here will cause a Coverity warning. > > There are many other ethdev calls that will fail if primary dies. > stats, xstats, rx/tx burst, ... > > I don't think it is good idea to add checks here. > --000000000000a200a3063a8570fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Stephen,=C2=A0
Can we add only the ch= eck that fixes the segfault, or do you mean that it should be fixed at the = PMD level?

Best regards,
Khadem

On Tue, Jul 2= 2, 2025, 18:39 Stephen Hemminger <stephen@networkplumber.org> wrote:
On Tue, 22 Jul 2025 07:54:39 -0400
Khadem Ullah <14pwcse1224@uetpeshawar.edu.pk> wrote= :

> +=C2=A0 =C2=A0 =C2=A0if (rte_eal_process_type() =3D=3D RTE_PROC_SECOND= ARY &&
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dev =3D=3D NULL || d= ev->data =3D=3D NULL ||
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dev->data->dev_= private =3D=3D NULL ||

dev can't be NULL and checking it here will cause a Coverity warning.
There are many other ethdev calls that will fail if primary dies.
stats, xstats, rx/tx burst, ...

I don't think it is good idea to add checks here.
--000000000000a200a3063a8570fa--