From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f201.google.com (mail-qk1-f201.google.com [209.85.222.201]) (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 90F5632720C for ; Sun, 1 Mar 2026 18:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772388910; cv=none; b=eSIf5zXtgDFVSIwULdxOWFXdfDxTwQuxMcRYicI0ndcEuNZTd4/jWeLwhIQvhXnIMK3Dl0xtFG3Zc7/IHFCHoWPf6/A6HjxouDEkAN01gxqwo3xbZbH9/znSUi3mDuPQpWKaOcERGYYj965BXyKv3V3wK8OHl0SgRkYL7cgWLTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772388910; c=relaxed/simple; bh=i0s2jMnm3hYZngJv4K/QTbRjAuGsVclPA1pNuEwKiNI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=jZnJFQ8QTlV1Ovd9lyKRuacjVo74Oj/YMZn+yzuN/5pYRKKhdKYXWRm+ktM1y7pdiHaKspjH9ays39z+GzNBUyXh3dd1jiA9trNm83rTlVzgJxXw0WO4n7u1vKf8/FjKHdaM/ahA7jchiH49rHLJI29TBCooYDrZlboZTiokQm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=kMN39a+5; arc=none smtp.client-ip=209.85.222.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edumazet.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="kMN39a+5" Received: by mail-qk1-f201.google.com with SMTP id af79cd13be357-8c882774f0dso3074038785a.2 for ; Sun, 01 Mar 2026 10:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772388908; x=1772993708; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NVYacPiJSJO5cSbY5SOeRlsCxSqadtlsMm00j720Rbk=; b=kMN39a+52oi7Lh6ykg6l3gdy8lTIXR16yPQqcAvFHlhOVxEtYmhCTD46/Gg3/MU967 HZLKAU8vywzD4tGyKueFFP0QZFHra+IOvul3NuyXXGga4Bb4vf84qgOwghXnUS19SYCj vPeBnkKpyvNL382MA23aHn6V3yfFw6fKfYVeGQ3OQxqr6rYwZTNeHOye8ukW6QJxyRB9 q35lGJbCbkWJU9ZfCHCUmogiFhpd2Ask4zboSgutZZQz3Dp5TnlM5lDfMMj+52PVfrTI OJoPlZYGv5oxJ85j14yIDHsK8IVyo/m1RzJJT1FX9ATgSQbT+OfALrV5Ve6eeJmkn3Mf g5SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772388908; x=1772993708; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NVYacPiJSJO5cSbY5SOeRlsCxSqadtlsMm00j720Rbk=; b=rntQKgYhlS8SRCq3fOsID5HmPyDWelu8kOxaLzEK4gbzR34Or6S9ooNGXa3qnqWR/0 JHzqucT45xniuYyltNtld3oOw2qFGa8xPmDskhS2PgUDlyizldY8VbT/70w9xL1T6f4c 9+U/VtFcRcV7POrvxeo+ZCQFhaaGPAG4Gl9wUSjyXN524yBp0oj24xhiP3XqlsGLs6XA +v10cEjTY8zr6wrVZ8sg0IUHqLE+4p7MWuuAS7saAGXWwvTEJM30VxtfmQ93ihQhqrpH mR1EfnMlCJYI1KZJ3e0KjdcWoK9vBrmaiGNKHEqqXqxp8iRMdhkOnhJ2jO4Ax+nLmvvn PBLg== X-Forwarded-Encrypted: i=1; AJvYcCVU/BMcLvgbkkX2CMTDJU8xnl36Q94eO4yCDohmW7D/EwctTC3ZpW08n4so6BbbZnU64p44lBQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxXz1BlIyRbBac0D8LJlCf/2pSU6dGS0B5nd7Hea71rXuKz+rKx DCNDQVMAOBOJhyIkG6Fh1LClVLS/sw0aHdUijSFhLjgMaRfd6l1Xwj2heYxC1foj0a/+oNDOsKy JCw07i5hZoC5MtQ== X-Received: from qkbde5.prod.google.com ([2002:a05:620a:3705:b0:8cb:bdbd:fecd]) (user=edumazet job=prod-delivery.src-stubby-dispatcher) by 2002:a05:620a:1aa8:b0:8b2:f26e:3220 with SMTP id af79cd13be357-8cbc8d72817mr1073813085a.8.1772388908414; Sun, 01 Mar 2026 10:15:08 -0800 (PST) Date: Sun, 1 Mar 2026 18:14:56 +0000 In-Reply-To: <20260301181457.3539105-1-edumazet@google.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260301181457.3539105-1-edumazet@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260301181457.3539105-7-edumazet@google.com> Subject: [PATCH v2 net-next 6/7] net-sysfs: remove rcu field from 'struct rps_dev_flow_table' From: Eric Dumazet To: "David S . Miller" , Jakub Kicinski , Paolo Abeni Cc: Simon Horman , Kuniyuki Iwashima , netdev@vger.kernel.org, eric.dumazet@gmail.com, Eric Dumazet Content-Type: text/plain; charset="UTF-8" Remove rps_dev_flow_table_release() in favor of kvfree_rcu_mightsleep(). In the following pach, we will remove "u8 @log" field and 'struct rps_dev_flow_table' size will be a power-of-two. Signed-off-by: Eric Dumazet --- include/net/rps.h | 1 - net/core/net-sysfs.c | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/net/rps.h b/include/net/rps.h index dee930d9dd38e0e975e78d938bc7adc96048b724..e900480e828b487c721b3ef392f4abb427ad442c 100644 --- a/include/net/rps.h +++ b/include/net/rps.h @@ -44,7 +44,6 @@ struct rps_dev_flow { */ struct rps_dev_flow_table { u8 log; - struct rcu_head rcu; struct rps_dev_flow flows[]; }; #define RPS_DEV_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_dev_flow_table) + \ diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 52fcf7fa58a808e79c1a17c8719830bcfb7c1674..fd6f81930bc6437957f32206c84db87ee242fede 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -1072,13 +1072,6 @@ static ssize_t show_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, return sysfs_emit(buf, "%lu\n", val); } -static void rps_dev_flow_table_release(struct rcu_head *rcu) -{ - struct rps_dev_flow_table *table = container_of(rcu, - struct rps_dev_flow_table, rcu); - vfree(table); -} - static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, const char *buf, size_t len) { @@ -1131,7 +1124,7 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue, RCU_INITIALIZER(table))); if (old_table) - call_rcu(&old_table->rcu, rps_dev_flow_table_release); + kvfree_rcu_mightsleep(old_table); return len; } @@ -1168,7 +1161,7 @@ static void rx_queue_release(struct kobject *kobj) old_table = unrcu_pointer(xchg(&queue->rps_flow_table, NULL)); if (old_table) - call_rcu(&old_table->rcu, rps_dev_flow_table_release); + kvfree_rcu_mightsleep(old_table); #endif memset(kobj, 0, sizeof(*kobj)); -- 2.53.0.473.g4a7958ca14-goog