From patchwork Fri Apr 22 12:24:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 1620811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HreGJjm0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KlDBd49k7z9s2R for ; Fri, 22 Apr 2022 22:25:13 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 2029740CDB; Fri, 22 Apr 2022 12:25:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ogbBK4pdaVtk; Fri, 22 Apr 2022 12:25:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 54F80400EF; Fri, 22 Apr 2022 12:25:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 273ABC0039; Fri, 22 Apr 2022 12:25:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id A7944C002D for ; Fri, 22 Apr 2022 12:25:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A3CFE409EB for ; Fri, 22 Apr 2022 12:25:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iUx-6CptSSfU for ; Fri, 22 Apr 2022 12:25:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id D865340992 for ; Fri, 22 Apr 2022 12:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650630306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYkVqD7c7//yuf3FAQ1mEvmrCd11M7WIHOhwg3K3wx4=; b=HreGJjm0lP+qEHOMocGyLRUG5hqKs7td4eynIGorTq9KRZc2TiO7dYPVLQCpG8AnXtbHOt 7qwQMC0RGn0oJNlfYmbfLWTYlLj1OskfhoMLlN38rQ+M/fi1wiAmCKQfcE49/quMeJYvxE NiZJolM2vqMVn0VRecTm6FUqfLZ4S3g= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-98-w-xq76bFPWSmgE4Bqop4pg-1; Fri, 22 Apr 2022 08:25:05 -0400 X-MC-Unique: w-xq76bFPWSmgE4Bqop4pg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9192281AF30; Fri, 22 Apr 2022 12:25:04 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id E266740885A1; Fri, 22 Apr 2022 12:25:03 +0000 (UTC) From: David Marchand To: dev@openvswitch.org Date: Fri, 22 Apr 2022 14:24:59 +0200 Message-Id: <20220422122459.22055-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH] netdev-dpdk: Fix tx drops statistic for a down netdev. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Dropped packets were not counted as tx_dropped when a DPDK netdev is down (like after calling netdev-dpdk/set-admin-state dpdk1 down). Fixes: 3b1fb0779b87 ("netdev-dpdk: Don't call rte_dev_stop() in update_flags().") Signed-off-by: David Marchand Acked-by: Sunil Pai G --- lib/netdev-dpdk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index c9ef2be855..42aa6b188d 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2843,6 +2843,9 @@ netdev_dpdk_send__(struct netdev_dpdk *dev, int qid, bool concurrent_txq) { if (OVS_UNLIKELY(!(dev->flags & NETDEV_UP))) { + rte_spinlock_lock(&dev->stats_lock); + dev->stats.tx_dropped += dp_packet_batch_size(batch); + rte_spinlock_unlock(&dev->stats_lock); dp_packet_delete_batch(batch, true); return; }