aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Martin KaFai Lau <kafai@fb.com> 2017-06-15 17:29:09 -0700
committerGravatar David S. Miller <davem@davemloft.net> 2017-06-16 11:58:36 -0400
commit58038695e62b4473e4d70e1503933579c640cd52 (patch)
tree3fe505510deddba8dcd85ba5eb1cca4df7a0a539 /include
parentMerge branch 'skb-accessor-cleanups' (diff)
downloadlinux-58038695e62b4473e4d70e1503933579c640cd52.tar.gz
linux-58038695e62b4473e4d70e1503933579c640cd52.tar.bz2
linux-58038695e62b4473e4d70e1503933579c640cd52.zip
net: Add IFLA_XDP_PROG_ID
Expose prog_id through IFLA_XDP_PROG_ID. This patch makes modification to generic_xdp. The later patches will modify other xdp-supported drivers. prog_id is added to struct net_dev_xdp. iproute2 patch will be followed. Here is how the 'ip link' will look like: > ip link show eth0 3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdp(prog_id:1) qdisc fq_codel state UP mode DEFAULT group default qlen 1000 Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h7
-rw-r--r--include/uapi/linux/if_link.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ad98a83f1332..7c7118b3bd69 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -824,7 +824,10 @@ struct netdev_xdp {
struct netlink_ext_ack *extack;
};
/* XDP_QUERY_PROG */
- bool prog_attached;
+ struct {
+ bool prog_attached;
+ u32 prog_id;
+ };
};
};
@@ -3302,7 +3305,7 @@ struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
typedef int (*xdp_op_t)(struct net_device *dev, struct netdev_xdp *xdp);
int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
int fd, u32 flags);
-bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op);
+bool __dev_xdp_attached(struct net_device *dev, xdp_op_t xdp_op, u32 *prog_id);
int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
int dev_forward_skb(struct net_device *dev, struct sk_buff *skb);
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 8ed679fe603f..dd88375a6580 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -907,6 +907,7 @@ enum {
IFLA_XDP_FD,
IFLA_XDP_ATTACHED,
IFLA_XDP_FLAGS,
+ IFLA_XDP_PROG_ID,
__IFLA_XDP_MAX,
};