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 97823A04FD; Fri, 8 Apr 2022 17:15:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30BF04067E; Fri, 8 Apr 2022 17:15:58 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id B55464003F for ; Fri, 8 Apr 2022 17:15:57 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id n18so8132494plg.5 for ; Fri, 08 Apr 2022 08:15:57 -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=AuiiQ1uB7pzJuTovZxLsVAemeHQpWdcAKQ9dr4bdlHY=; b=ndBbvwqR6al2Bp30Ha1JIWwdBFF8oPEjI2FwGX4Ru7qiD/92QklesxB9klZfZ+tzkP gT2OH7gAcyD3lNNS9YoPMZF/EGrJKkRtn47LSJaBxOGGVd8ybDHyAwiQqkU+uosrAUc2 zFwszuNQYUBMCtYgY9c+5Nk9uZGT8AOpOSavh7KjDk/dmCzEA3815/DBqSqQAmmYa5JU 5yBdreWDBmbvuFBYD6sGAZyQ98Y7N0jEnv/DlrAr0kmzBJR618dl90WJOPPGMSgWHSNF 4BBlaqFm88LOnudWV30SHe0ZULM1gw2ZXAFlhbDwsPXVNXSOUPlKhuZJpFLegE4sLVWE EyGw== 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=AuiiQ1uB7pzJuTovZxLsVAemeHQpWdcAKQ9dr4bdlHY=; b=s04j1JwgfgUsb7cuQtOqKlpAO5IX2/EtvWoalBtBGCgLQAxwrow0KjETwYzXjLwAJp FSRVDAGhofqymZ3axuDHBQKazOCoiCzh3K5gUI8HnJun8OnrugDW6IErVhEo0K9xn5K5 m/HNw58o3C6IQce/bogGYDaQ/YKwap3xZjTWt5IErPtrsXRUYuR+eM3GFBpoxLuadxZo vdg+pYipf0vail6VPIaynP8amqyiJSgQyBGoxlJjNvOVeJb5Pysl5g2wmI/jNP+OMGKd xwKm30n104n2eJXSIhgKqBgRB0k5p0HUTmNNHJl3IHJYh1+ssDuqK+vlo22IlQlJ2fHN kg6g== X-Gm-Message-State: AOAM530QnfXGsQlLwnZHOecKT1HERfSxTgHSp9zuqLYm3jzTdnf/oAbB ZEi0fMSSIYEOfhb6UKkbxMEVpA== X-Google-Smtp-Source: ABdhPJywcTnnhvMQ5z+M3XDfBk4H+hI6FFenC8CqS+RSee3ugiUW7IKgku9L+CYv/Dbb6y1o36WtPg== X-Received: by 2002:a17:902:b488:b0:156:509c:5c42 with SMTP id y8-20020a170902b48800b00156509c5c42mr19939789plr.2.1649430956761; Fri, 08 Apr 2022 08:15:56 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id j9-20020aa78009000000b004fde2dd78b0sm21323454pfi.109.2022.04.08.08.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 08:15:56 -0700 (PDT) Date: Fri, 8 Apr 2022 08:15:52 -0700 From: Stephen Hemminger To: Tianli Lai Cc: dev@dpdk.org Subject: Re: [PATCH v3] examples/kni: add interrupt mode to receive packets Message-ID: <20220408081552.7ba2f9f1@hermes.local> In-Reply-To: <20220408091206.4411-1-laitianli@tom.com> References: <20220407161205.8633-1-laitianli@tom.com> <20220408091206.4411-1-laitianli@tom.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 Fri, 8 Apr 2022 17:12:06 +0800 Tianli Lai wrote: > + if (status[lcore].wakeup) { > + RTE_LOG(INFO, APP, > + "lcore %u sleeps until interrupt triggers\n", > + rte_lcore_id()); > + } Shouldn't the be at DEBUG level. > + /* initialize spinlock for each port */ > + rte_spinlock_init(&(locks[i])); This comment seems rather obvious and unneeded. > +static void > +turn_on_off_intr(uint16_t port_id, uint16_t queue_id, bool on) > +{ > + rte_spinlock_lock(&(locks[port_id])); > + if (on) > + rte_eth_dev_rx_intr_enable(port_id, queue_id); > + else > + rte_eth_dev_rx_intr_disable(port_id, queue_id); > + rte_spinlock_unlock(&(locks[port_id])); > +} Since Rx queue can not safely shared between cores, why do you need lock at all?