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 56057A034C for ; Mon, 12 Dec 2022 17:26:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5EAE40687; Mon, 12 Dec 2022 17:26:54 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 52ACF40684 for ; Mon, 12 Dec 2022 17:26:54 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id m4so12608569pls.4 for ; Mon, 12 Dec 2022 08:26:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; 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=cM4LUKZYLo5b/0LnF9z2B+4PJf3PW35ekitTAsRsRS8=; b=v7moB/YrxNNEXGi7MhA/zKpTHFV3S9N/kvRbtfrpDJHAa+ru/qb/UusmjFuapIm4UN cjKk/Cvknm4kt6W/26NRvGj2pWr/7D5ZyzCmhC1MXmLJhM7j5hekacVrn8/YRoW30QMY aA10MocFSM3pzdzXOozERQRY5RE74bBFOy2+9ogqdwl6ZSfybGhxVNpZnMjwna0LRbZ/ riMDJTbZn6jikNGDYl5EBJxiXeZu4g48HAxr4nqhvCnGRRg6oqofxBtaaPTLq4pWPRm8 I+gqemv98m/LlOAqHvfShUA5CR09yVCS8mlK2Bk3IbAeSXxgiz99Xt1+0o12cZw7BDXI Ul6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=cM4LUKZYLo5b/0LnF9z2B+4PJf3PW35ekitTAsRsRS8=; b=OnDjU8Aq3C6eafWKh+6/HqOT1UCgcALjZUpyhUqJM4dS6rbMysiPxamSr2DS3R/xTw 1zGSzbJVjniN2Kkfdo94R8TUJt1kFbfzcOa8AfIPM0Rqq5Bxoh+xYRKKLXukYysodTcR 2Kznq/SuBxSneUV6RAwCKThD11LbgO6lBhLS09oaaKUpTFT+y/FimwRtmOEVX+7s+cQQ wTSjuEkNHJBATCbrYXE04771tlRsMjVyqEpIaxiOV0eZE9bkm+0mOX7bveSc7w20v2Zi uW2rptKXpUFbW9k/YIqv/dMYB5tNGgib3u3z2k3tNywqSG4XoSX4mEGoWzUk0iwAayl7 Fu8Q== X-Gm-Message-State: ANoB5plmDJsUHZL1x5Eweu3Pz5qvxTdvBc21vAUl7nuyY6zHGcY3OjnA odG50AqVVnv01H+bSleHfpjaYQ== X-Google-Smtp-Source: AA0mqf6tTgk/Gzg9AlOjKVv0TbuWAte3rLntgJKNNIxxSESmD3a+hea6CPvrM4xJa+H9bQZHnSU7ww== X-Received: by 2002:a17:902:8c8d:b0:187:262a:7955 with SMTP id t13-20020a1709028c8d00b00187262a7955mr15664027plo.9.1670862413320; Mon, 12 Dec 2022 08:26:53 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id l16-20020a170902f69000b00172fad607b3sm6564458plg.207.2022.12.12.08.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 08:26:52 -0800 (PST) Date: Mon, 12 Dec 2022 08:26:51 -0800 From: Stephen Hemminger To: "Ciprian Pascu (Nokia)" Cc: "users@dpdk.org" , "bruce.richardson@intel.com" Subject: Re: DPDK issue with reading the eth interface status? Message-ID: <20221212082651.36a5d902@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On Wed, 7 Dec 2022 14:12:36 +0000 "Ciprian Pascu (Nokia)" wrote: > It seems that in the Linux kernel some locking has been added with this c= ommit: https://github.com/torvalds/linux/commit/83d0feffc5695d7dc24c6b8dac9= ab265533beb78: >=20 > spin_lock_irqsave(&adapter->cmd_lock, flags); >=20 > VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK); >=20 > ret =3D VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); > spin_unlock_irqrestore(&adapter->cmd_lock, flags); >=20 >=20 > Ciprian. >=20 >=20 > ________________________________ > L=C3=A4hett=C3=A4j=C3=A4: Ciprian Pascu (Nokia) > L=C3=A4hetetty: keskiviikko 7. joulukuuta 2022 15.57 > Vastaanottaja: users@dpdk.org ; bruce.richardson@intel.co= m > Aihe: DPDK issue with reading the eth interface status? >=20 >=20 > Hi, >=20 > I encountered an issue while using dpdk-20.05 in our VMware based VMs: at= times, when sysstat data is collected, dpdk signals that some eth interfac= e is down; this happens occasionally; after sysstat data has been collected= , eth interface is signaled as up; I was wondering about these lines in '__= vmxnet3_dev_link_update' function: >=20 >=20 >=20 > 1251 =C2=BB=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7VMXNET3_WRITE_BAR1_R= EG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK); >=20 > 1252 =C2=BB=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7ret =3D VMXNET3_READ= _BAR1_REG(hw, VMXNET3_REG_CMD); >=20 >=20 >=20 > Is this atomic? Could this lead to problems if some other module tries to= read something else at about the same time and overwrites the command? >=20 The kernel allows any thread to do control operations at any time. The DPDK assumes only one thread at a time will do control operations. Coor= dination is up to the application. You didn't send the full call stack, but I assume this is from thread calling rte_eth_link_get(). There is no documentation about thread safety f= or that function. Several drivers do things that are not thread safe there.