Commit 871cf386 authored by Pedro Tammela's avatar Pedro Tammela Committed by David S. Miller
Browse files

net/sched: avoid indirect act functions on retpoline kernels



Expose the necessary tc act functions and wire up act_api to use
direct calls in retpoline kernels.

Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: default avatarVictor Nogueira <victor@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7f0e8102
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <net/act_api.h>
#include <net/netlink.h>
#include <net/flow_offload.h>
#include <net/tc_wrapper.h>

#ifdef CONFIG_INET
DEFINE_STATIC_KEY_FALSE(tcf_frag_xmit_count);
@@ -1080,7 +1081,7 @@ int tcf_action_exec(struct sk_buff *skb, struct tc_action **actions,

		repeat_ttl = 32;
repeat:
		ret = a->ops->act(skb, a, res);
		ret = tc_act(skb, a, res);
		if (unlikely(ret == TC_ACT_REPEAT)) {
			if (--repeat_ttl != 0)
				goto repeat;
+4 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <linux/tc_act/tc_bpf.h>
#include <net/tc_act/tc_bpf.h>
#include <net/tc_wrapper.h>

#define ACT_BPF_NAME_LEN	256

@@ -31,7 +32,8 @@ struct tcf_bpf_cfg {

static struct tc_action_ops act_bpf_ops;

static int tcf_bpf_act(struct sk_buff *skb, const struct tc_action *act,
TC_INDIRECT_SCOPE int tcf_bpf_act(struct sk_buff *skb,
				  const struct tc_action *act,
				  struct tcf_result *res)
{
	bool at_ingress = skb_at_tc_ingress(skb);
+4 −2
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <net/pkt_cls.h>
#include <uapi/linux/tc_act/tc_connmark.h>
#include <net/tc_act/tc_connmark.h>
#include <net/tc_wrapper.h>

#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_core.h>
@@ -27,7 +28,8 @@

static struct tc_action_ops act_connmark_ops;

static int tcf_connmark_act(struct sk_buff *skb, const struct tc_action *a,
TC_INDIRECT_SCOPE int tcf_connmark_act(struct sk_buff *skb,
				       const struct tc_action *a,
				       struct tcf_result *res)
{
	const struct nf_conntrack_tuple_hash *thash;
+4 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@

#include <linux/tc_act/tc_csum.h>
#include <net/tc_act/tc_csum.h>
#include <net/tc_wrapper.h>

static const struct nla_policy csum_policy[TCA_CSUM_MAX + 1] = {
	[TCA_CSUM_PARMS] = { .len = sizeof(struct tc_csum), },
@@ -563,7 +564,8 @@ static int tcf_csum_ipv6(struct sk_buff *skb, u32 update_flags)
	return 0;
}

static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a,
TC_INDIRECT_SCOPE int tcf_csum_act(struct sk_buff *skb,
				   const struct tc_action *a,
				   struct tcf_result *res)
{
	struct tcf_csum *p = to_tcf_csum(a);
+3 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <net/ipv6_frag.h>
#include <uapi/linux/tc_act/tc_ct.h>
#include <net/tc_act/tc_ct.h>
#include <net/tc_wrapper.h>

#include <net/netfilter/nf_flow_table.h>
#include <net/netfilter/nf_conntrack.h>
@@ -1038,7 +1039,7 @@ static int tcf_ct_act_nat(struct sk_buff *skb,
#endif
}

static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
TC_INDIRECT_SCOPE int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
				 struct tcf_result *res)
{
	struct net *net = dev_net(skb->dev);
Loading