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 93FC8A0503; Thu, 19 May 2022 05:13:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6877C40150; Thu, 19 May 2022 05:13:12 +0200 (CEST) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 734F440140 for ; Thu, 19 May 2022 05:13:08 +0200 (CEST) Received: by mail-pj1-f43.google.com with SMTP id l20-20020a17090a409400b001dd2a9d555bso4002111pjg.0 for ; Wed, 18 May 2022 20:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8fkEBnlgxIh1bohhKU4kp5D4JWiGsA3NonWXMpNfuiE=; b=2p2NpTm9uPEjzoiAWhDyKTP4c8J76mpN7+roN4+2zux4/YtzIpAR2H8rQZncR3teB4 cErDORP05uP8ZG1X7ep76DWmfItoOzByC6WQLP9CIU0ELrNQ4NKtMbcD7tJxmDUE3HSK uGZClJnvgvflU2Ky3UoLVIE8dHlm1/y7Ueg3HX4ctyYY26/YTPvZSuf9g1W0jkoCQApq pNJaDH5htv2rnzxyIzqtBi9JmMlXDFW1MenfbcM4Iv8146ES8R6AnUXn5gUiKeEu72lJ YGtWY/OnAoldj5advx2rDxGZz9vmnC6xINB++g0Rjx0VAlZ9TWxmRnXjbahe99/FyRTM 2nRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8fkEBnlgxIh1bohhKU4kp5D4JWiGsA3NonWXMpNfuiE=; b=QWZ15US5hBjCbZXSGqtnQdqeew0399bmtaBpeJS8qQVJ6pn4srraVsLHpiKZv9uvpE OwRnbG810qslk7qmWrYOGeetYRC1IZ+o9qTRpJxbZRVLOmYey5HFP70BycrkAX8I92vI ol0iMCTWGHZ7BuudkKUeHYRxZrxMa4kuYuF4ERdu1O180tqL9RlrXiwJp3fE7VifoEEP ZMii1MEatCa7si/BEJGS/L4XcFVcPHWG+V/PdpvKM4xu0v751EzYO9vaEtnFJTHjLPjE SxC2b+rqiYVoi74lMJM+8E9TZYGRiOG+8WlVH4L7I3nJUoQUH3ybbfeK5xHW3E1N5dX/ edSQ== X-Gm-Message-State: AOAM532IoNSmD1nZuqby93Bl5eO86vqBs7bfh+E2sh0j8RaQ4Yu3lDsI p3pVUB/wIj252aSiS8xde/mIpQ== X-Google-Smtp-Source: ABdhPJwFNN3gk9LWLRwZqxAV72Ss1NlCwQYsk9a9AZygDo1T9DaSGZZFYohZcvIcsmqGH4EJs+gSvQ== X-Received: by 2002:a17:90b:4b42:b0:1dc:15f8:821b with SMTP id mi2-20020a17090b4b4200b001dc15f8821bmr3419276pjb.131.1652929987557; Wed, 18 May 2022 20:13:07 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id j11-20020a63ec0b000000b003db88f80c4asm2223189pgh.71.2022.05.18.20.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 20:13:07 -0700 (PDT) Date: Wed, 18 May 2022 20:13:04 -0700 From: Stephen Hemminger To: Wenjun Wu Cc: dev@dpdk.org, jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, simei.su@intel.com Subject: Re: [PATCH v1] net/iavf: fix race condition for multi-cores Message-ID: <20220518201304.0d74228c@hermes.local> In-Reply-To: <20220519011959.613966-1-wenjun1.wu@intel.com> References: <20220519011959.613966-1-wenjun1.wu@intel.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 Thu, 19 May 2022 09:19:59 +0800 Wenjun Wu wrote: > if (dev->data->dev_conf.rxmode.offloads & > - RTE_ETH_RX_OFFLOAD_TIMESTAMP) { > - if (iavf_get_phc_time(adapter)) { > - PMD_DRV_LOG(ERR, "get physical time failed"); > - goto err_mac; > - } > - adapter->hw_time_update = rte_get_timer_cycles() / (rte_get_timer_hz() / 1000); > - } > + RTE_ETH_RX_OFFLOAD_TIMESTAMP) > + rte_spinlock_init(&vf->phc_time_aq_lock); Be safe just always init the spin_lock. It is just a simple assignment.