net-sysfs: remove rcu field from 'struct rps_dev_flow_table'

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 <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260302181432.1836150-7-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
master
Eric Dumazet 2026-03-02 18:14:31 +00:00 committed by Jakub Kicinski
parent 68b6394a22
commit b2cc61857e
2 changed files with 2 additions and 10 deletions

View File

@ -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) + \

View File

@ -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));