Message ID | 20210315192722.35490-1-stephen@networkplumber.org (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4BA11A054F; Mon, 15 Mar 2021 20:27:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3731242798; Mon, 15 Mar 2021 20:27:32 +0100 (CET) Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by mails.dpdk.org (Postfix) with ESMTP id 780654069F for <dev@dpdk.org>; Mon, 15 Mar 2021 20:27:32 +0100 (CET) Received: by mail-pg1-f179.google.com with SMTP id n10so21060407pgl.10 for <dev@dpdk.org>; Mon, 15 Mar 2021 12:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KJ1DmCs5o+i7FBboT7I1OxK4XyqTHATvXjyCKGk/+mg=; b=ukROZc+LcOfkpjpLMK7sgW4ISakXKl+vYlt1OhYGIqrC7WxBZ8uEQjcAhRIKiLLWef WvO7vFri11zCGSh1qICdafUVgvsPoD7Bf5VbLaqWu7P0tYcta6NuJDZB+ae3Q9odshEf i+mwVUiCReNbq5hIly1kFTbQ+Qn0h5zIb3Ytzw/w4RE3sGnZap788DTGUG6vBdHgEKrp Ld+lG8s++l9HFziuMOo3TCrm/iuyRW0j/y8H54ElXx9WRG8MnIsAPcpHafGNiu9lLAHQ FPyQhEsH0k7VH6J+hH28DfKwm7SfoIIlHF0a0ufA5ZYAOkt9GpxN11U70dkNBJuI1Rww T3Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KJ1DmCs5o+i7FBboT7I1OxK4XyqTHATvXjyCKGk/+mg=; b=FRx0wz4wb7XUQ8t/x91XeK+/quHNhulW+hW1yxMiLLNC/+N57F2srDymZDK2MK/qnR iExNzRwlNpkyzfp5DL+AI5tmZeDvVUJXUZTmTgqA2oiM36X6cR/zhlnMlfHu7pNe4lJG S/INKzlKcP3fwwXmyvnKnr2AXBv+U8Is4tH6bhCW3sxJpX7FMzyo++Qzj1eRyeLvpLA6 MW9l7gcFEvbvWvNG2hay9Bad1mvjeOh5cQUBdRkLGS8lgjog4ZzLux8s9f+qKTuI5NkM ual4/CWKpfGANRFHEUWubFtxfizXINmUTkvj7pPHpnI76EoIjbBqHSyRtsR7MIMIeP0k KgVQ== X-Gm-Message-State: AOAM530FOm+39Gd/pucmmfuIfWqYvXtyFWr2NFn+j5PYwZkscz8A4MXr uTbTCpCphwHzEoqVcErjqi0xDCiMOeoPow== X-Google-Smtp-Source: ABdhPJx/XTqDXtzHpIaBE0/3/2cM4WtdiyxTnv3d1L8Q+AahAkojZ8ypJTTW827f8gkd6rSOmU90dw== X-Received: by 2002:a62:6413:0:b029:1f3:a5b4:d978 with SMTP id y19-20020a6264130000b02901f3a5b4d978mr11565714pfb.44.1615836450993; Mon, 15 Mar 2021 12:27:30 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id v26sm13729202pff.195.2021.03.15.12.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 12:27:30 -0700 (PDT) From: Stephen Hemminger <stephen@networkplumber.org> To: dev@dpdk.org Cc: Stephen Hemminger <stephen@networkplumber.org> Date: Mon, 15 Mar 2021 12:27:20 -0700 Message-Id: <20210315192722.35490-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 0/2] Mark shared pthread mutex X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
Mark shared pthread mutex
|
|
Message
Stephen Hemminger
March 15, 2021, 7:27 p.m. UTC
This fixes two places where pthread_mutex was being unsafely used between primary secondary process. These patches are necessary but not sufficient to address Bug 662 Stephen Hemminger (2): ethdev: make flow API primary/secondary process safe net/failsafe: fix primary/secondary mutex drivers/net/failsafe/failsafe.c | 5 +++++ lib/librte_ethdev/rte_ethdev.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-)
Comments
On Mon, 15 Mar 2021 12:27:20 -0700 Stephen Hemminger <stephen@networkplumber.org> wrote: > This fixes two places where pthread_mutex was being unsafely > used between primary secondary process. > > These patches are necessary but not sufficient to address Bug 662 > > Stephen Hemminger (2): > ethdev: make flow API primary/secondary process safe > net/failsafe: fix primary/secondary mutex > > drivers/net/failsafe/failsafe.c | 5 +++++ > lib/librte_ethdev/rte_ethdev.c | 6 +++++- > 2 files changed, 10 insertions(+), 1 deletion(-) Side note: While looking at the code, many places are checking for error conditions that can never occur.. RETURN VALUE pthread_mutex_init always returns 0. The other mutex functions return 0 on success and a non-zero error code on error.
On Mon, 15 Mar 2021 12:27:20 -0700 Stephen Hemminger <stephen@networkplumber.org> wrote: > This fixes two places where pthread_mutex was being unsafely > used between primary secondary process. > > These patches are necessary but not sufficient to address Bug 662 > > Stephen Hemminger (2): > ethdev: make flow API primary/secondary process safe > net/failsafe: fix primary/secondary mutex > > drivers/net/failsafe/failsafe.c | 5 +++++ > lib/librte_ethdev/rte_ethdev.c | 6 +++++- > 2 files changed, 10 insertions(+), 1 deletion(-) > The following drivers have the same kind of issue. Drivers with unsafe pthread_mutex: net/ af_xdp atlantic axgbe bnxt ena failsafe (see patch #2) hinic mlx5 qede vhost virtio raw/ ifpga vdpa/ ifc mlx5 Another alternative would be to create a DPDK wrapper (rte_mutex?) which had the proper semantics. That might make the Windows port easier. But it would make backport to stable harder. If this does not get fixed in April, we should change documentation to warn users.
On 3/16/2021 4:28 PM, Stephen Hemminger wrote: > On Mon, 15 Mar 2021 12:27:20 -0700 > Stephen Hemminger <stephen@networkplumber.org> wrote: > >> This fixes two places where pthread_mutex was being unsafely >> used between primary secondary process. >> >> These patches are necessary but not sufficient to address Bug 662 >> >> Stephen Hemminger (2): >> ethdev: make flow API primary/secondary process safe >> net/failsafe: fix primary/secondary mutex >> >> drivers/net/failsafe/failsafe.c | 5 +++++ >> lib/librte_ethdev/rte_ethdev.c | 6 +++++- >> 2 files changed, 10 insertions(+), 1 deletion(-) >> > > The following drivers have the same kind of issue. > > Drivers with unsafe pthread_mutex: > > net/ > af_xdp > atlantic > axgbe > bnxt > ena > failsafe (see patch #2) > hinic > mlx5 > qede > vhost > virtio > > raw/ > ifpga > vdpa/ > ifc > mlx5 > > > Another alternative would be to create a DPDK wrapper (rte_mutex?) > which had the proper semantics. That might make the Windows port easier. > But it would make backport to stable harder. > > > If this does not get fixed in April, we should change documentation > to warn users. > > +Anatoly as our multi process maintainer. And most of the above nics already doesn't claim the multi process support (in .ini files), the ones that claims the support: mlx[45] bnxt hinic qede virtio