Commit f631ef39 authored by Asbjørn Sloth Tønnesen's avatar Asbjørn Sloth Tønnesen Committed by David S. Miller
Browse files

net: sched: cls_api: add skip_sw counter



Maintain a count of skip_sw filters.

This counter is protected by the cb_lock, and is updated
at the same time as offloadcnt.

Signed-off-by: default avatarAsbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fd2162a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -471,6 +471,7 @@ struct tcf_block {
	struct flow_block flow_block;
	struct list_head owner_list;
	bool keep_dst;
	atomic_t skipswcnt; /* Number of skip_sw filters */
	atomic_t offloadcnt; /* Number of oddloaded filters */
	unsigned int nooffloaddevcnt; /* Number of devs unable to do offload */
	unsigned int lockeddevcnt; /* Number of devs that require rtnl lock. */
+4 −0
Original line number Diff line number Diff line
@@ -3483,6 +3483,8 @@ static void tcf_block_offload_inc(struct tcf_block *block, u32 *flags)
	if (*flags & TCA_CLS_FLAGS_IN_HW)
		return;
	*flags |= TCA_CLS_FLAGS_IN_HW;
	if (tc_skip_sw(*flags))
		atomic_inc(&block->skipswcnt);
	atomic_inc(&block->offloadcnt);
}

@@ -3491,6 +3493,8 @@ static void tcf_block_offload_dec(struct tcf_block *block, u32 *flags)
	if (!(*flags & TCA_CLS_FLAGS_IN_HW))
		return;
	*flags &= ~TCA_CLS_FLAGS_IN_HW;
	if (tc_skip_sw(*flags))
		atomic_dec(&block->skipswcnt);
	atomic_dec(&block->offloadcnt);
}