From nobody Sat Nov 30 06:32:45 2024 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB7BA1A00C5 for ; Thu, 12 Sep 2024 10:08:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726135696; cv=none; b=eF5Wd2lHjx4Lr8FNuws0fji4ptegz8hwybcEszdENjla+BXvvBhBi9yk69ErpD/LZa6duQDXyeWcW9lx1SgLPeSHvoRZmd5bJi/ADK9MJx81RVLU2bguW5bt/5nd5gkLtjkX5XlGtqh+Lbp5nlnwtrcqDTlHZW9yJgdm84LpVNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726135696; c=relaxed/simple; bh=bGa4PmJzGB9kewoC30T211UZN3HCaTEaFMhaE0IBKR4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ux8zV+Ds3d+N7uwribCkvt+0AyMO+BVfuaRL0Z45eiTV3hYqiMfVFFcQIwmFfnlPA4syue+jKQwFozKerwKDQCRGXSscsoxxRLD8bRd4Dpno6Fl4p3p+Ny8gZCmnjQPvzmb+Y4aKFJss7ONM/bQFzKgnokZN32oxAl+DpbtpiS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com; spf=pass smtp.mailfrom=fastly.com; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b=gLcnY742; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fastly.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastly.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=fastly.com header.i=@fastly.com header.b="gLcnY742" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-20570b42f24so9058545ad.1 for ; Thu, 12 Sep 2024 03:08:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastly.com; s=google; t=1726135694; x=1726740494; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N1ZQwn8/7gDdmGCiwR/rNIphJ/ao5OLIORUttbLlJdI=; b=gLcnY742FGT5T5YaEU8pnPyxGguQGytoHSi64lGn0tVv3yNQyH1sJa6b6BYOKUAgKx KhUfNlUUDlZJgkKWnQcNqxwaxkQJBL3iCIxd2K/xGYdXXx5jYJGkz5y2ep7qoVIJnmZp 7AtjL9NUQRAa21gwNHhyLbu6IzQJ8g6y2Krag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726135694; x=1726740494; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N1ZQwn8/7gDdmGCiwR/rNIphJ/ao5OLIORUttbLlJdI=; b=rSvqeL5CJfqM7YDhkYuqZvaYjnl/Lm5WFP/BuduGl6Ns9Vq2uUYb4Rs1h0B74mBjaV ZbLk11OqlYLyT0nQz/othvoxIxi1BQY3JaNIedP9KcYY8zESWgGneDH8GY36dqbNg/ic AoIauUn6cSkYUp5LVAJ9lOQURRRPrB/zEHEJvP/MXXGJLZ4fxWmKc74BPq4t4Gl8YpkM qqZ3I/goPNKH0IRLaDaCiojxEmTVR+ru0mLe+upMqe/Q0WnNYwNfmqMBMr0MNOdBQ7DA wKSX7vfGyZ/O53Rws2CxCBO5CsjpeFbO6a8NJ9xiba+O631mafEEI0F4ti+cRQFTDrZW wyRg== X-Forwarded-Encrypted: i=1; AJvYcCUDEzgQzPHrq4w0Ia/mRSHm8czHEL1R7VeuyrjXs2IGZeYoLlD0Az1AylibirRF5LVNu+nvrJF3bIMoAvE=@vger.kernel.org X-Gm-Message-State: AOJu0Yzh/r5Viir1lAorKJ9lFtL2ytyoQXsGxNIUKlEpxC3xAY+waKJc WASWisEoUNtYx1V5NHgRu3jtS2xLEkM6m0D/5TZBY7MeMv9LqnCC65i4OqvLT4k= X-Google-Smtp-Source: AGHT+IGzJodF6HLtBaNWh2wOCh15vOg4b928UX54k0lGLfWvsqPi1igaQRhJqO8yUSbA4RsaQPk/wA== X-Received: by 2002:a17:902:db01:b0:205:410c:f3c2 with SMTP id d9443c01a7336-2076e3f8983mr35469005ad.41.1726135694147; Thu, 12 Sep 2024 03:08:14 -0700 (PDT) Received: from localhost.localdomain ([2620:11a:c019:0:65e:3115:2f58:c5fd]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2076afe9da3sm11583795ad.239.2024.09.12.03.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2024 03:08:13 -0700 (PDT) From: Joe Damato To: netdev@vger.kernel.org Cc: mkarsten@uwaterloo.ca, kuba@kernel.org, skhawaja@google.com, sdf@fomichev.me, bjorn@rivosinc.com, amritha.nambiar@intel.com, sridhar.samudrala@intel.com, Joe Damato , Donald Hunter , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jesper Dangaard Brouer , Xuan Zhuo , Daniel Jurgens , linux-kernel@vger.kernel.org (open list) Subject: [RFC net-next v3 2/9] netdev-genl: Dump napi_defer_hard_irqs Date: Thu, 12 Sep 2024 10:07:10 +0000 Message-Id: <20240912100738.16567-3-jdamato@fastly.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240912100738.16567-1-jdamato@fastly.com> References: <20240912100738.16567-1-jdamato@fastly.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Support dumping defer_hard_irqs for a NAPI ID. Signed-off-by: Joe Damato --- Documentation/netlink/specs/netdev.yaml | 8 ++++++++ include/uapi/linux/netdev.h | 1 + net/core/netdev-genl.c | 5 +++++ tools/include/uapi/linux/netdev.h | 1 + 4 files changed, 15 insertions(+) diff --git a/Documentation/netlink/specs/netdev.yaml b/Documentation/netlin= k/specs/netdev.yaml index 959755be4d7f..351d93994a66 100644 --- a/Documentation/netlink/specs/netdev.yaml +++ b/Documentation/netlink/specs/netdev.yaml @@ -244,6 +244,13 @@ attribute-sets: threaded mode. If NAPI is not in threaded mode (i.e. uses nor= mal softirq context), the attribute will be absent. type: u32 + - + name: defer-hard-irqs + doc: The number of consecutive empty polls before IRQ deferral ends + and hardware IRQs are re-enabled. + type: u32 + checks: + max: s32-max - name: queue attributes: @@ -593,6 +600,7 @@ operations: - ifindex - irq - pid + - defer-hard-irqs dump: request: attributes: diff --git a/include/uapi/linux/netdev.h b/include/uapi/linux/netdev.h index 43742ac5b00d..43bb1aad9611 100644 --- a/include/uapi/linux/netdev.h +++ b/include/uapi/linux/netdev.h @@ -121,6 +121,7 @@ enum { NETDEV_A_NAPI_ID, NETDEV_A_NAPI_IRQ, NETDEV_A_NAPI_PID, + NETDEV_A_NAPI_DEFER_HARD_IRQS, =20 __NETDEV_A_NAPI_MAX, NETDEV_A_NAPI_MAX =3D (__NETDEV_A_NAPI_MAX - 1) diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c index a17d7eaeb001..e67918dd97be 100644 --- a/net/core/netdev-genl.c +++ b/net/core/netdev-genl.c @@ -160,6 +160,7 @@ static int netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi, const struct genl_info *info) { + u32 napi_defer_hard_irqs; void *hdr; pid_t pid; =20 @@ -188,6 +189,10 @@ netdev_nl_napi_fill_one(struct sk_buff *rsp, struct na= pi_struct *napi, goto nla_put_failure; } =20 + napi_defer_hard_irqs =3D napi_get_defer_hard_irqs(napi); + if (nla_put_s32(rsp, NETDEV_A_NAPI_DEFER_HARD_IRQS, napi_defer_hard_irqs)) + goto nla_put_failure; + genlmsg_end(rsp, hdr); =20 return 0; diff --git a/tools/include/uapi/linux/netdev.h b/tools/include/uapi/linux/n= etdev.h index 43742ac5b00d..43bb1aad9611 100644 --- a/tools/include/uapi/linux/netdev.h +++ b/tools/include/uapi/linux/netdev.h @@ -121,6 +121,7 @@ enum { NETDEV_A_NAPI_ID, NETDEV_A_NAPI_IRQ, NETDEV_A_NAPI_PID, + NETDEV_A_NAPI_DEFER_HARD_IRQS, =20 __NETDEV_A_NAPI_MAX, NETDEV_A_NAPI_MAX =3D (__NETDEV_A_NAPI_MAX - 1) --=20 2.25.1