summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qede/qede.h
diff options
context:
space:
mode:
authorMintz, Yuval <Yuval.Mintz@cavium.com>2016-11-29 16:47:09 +0200
committerDavid S. Miller <davem@davemloft.net>2016-11-30 14:32:05 -0500
commit496e051709588f832d7a6a420f44f8642b308a87 (patch)
tree0fb0f95e94c387d1073ad2e26c8c97149e88fff8 /drivers/net/ethernet/qlogic/qede/qede.h
parent9eb22357d568aee18f7ce4d0797d96fe7fcd2f71 (diff)
downloadlinux-496e051709588f832d7a6a420f44f8642b308a87.tar.bz2
qede: Add basic XDP support
Add support for the ndo_xdp callback. This patch would support XDP_PASS, XDP_DROP and XDP_ABORTED commands. This also adds a per Rx queue statistic which counts number of packets which didn't reach the stack [due to XDP]. Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qede/qede.h')
-rw-r--r--drivers/net/ethernet/qlogic/qede/qede.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede.h b/drivers/net/ethernet/qlogic/qede/qede.h
index ec372daeba6b..cc14aed5f16e 100644
--- a/drivers/net/ethernet/qlogic/qede/qede.h
+++ b/drivers/net/ethernet/qlogic/qede/qede.h
@@ -16,6 +16,7 @@
#include <linux/bitmap.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
+#include <linux/bpf.h>
#include <linux/io.h>
#include <linux/qed/common_hsi.h>
#include <linux/qed/eth_common.h>
@@ -187,6 +188,8 @@ struct qede_dev {
bool wol_enabled;
struct qede_rdma_dev rdma_info;
+
+ struct bpf_prog *xdp_prog;
};
enum QEDE_STATE {
@@ -249,6 +252,8 @@ struct qede_rx_queue {
/* Required for the allocation of replacement buffers */
struct device *dev;
+ struct bpf_prog *xdp_prog;
+
u16 sw_rx_cons;
u16 sw_rx_prod;
@@ -271,6 +276,8 @@ struct qede_rx_queue {
u64 rx_alloc_errors;
u64 rx_ip_frags;
+ u64 xdp_no_pass;
+
void *handle;
};
@@ -325,6 +332,7 @@ struct qede_fastpath {
struct qede_dev *edev;
#define QEDE_FASTPATH_TX BIT(0)
#define QEDE_FASTPATH_RX BIT(1)
+#define QEDE_FASTPATH_XDP BIT(2)
#define QEDE_FASTPATH_COMBINED (QEDE_FASTPATH_TX | QEDE_FASTPATH_RX)
u8 type;
u8 id;
@@ -358,6 +366,7 @@ struct qede_reload_args {
void (*func)(struct qede_dev *edev, struct qede_reload_args *args);
union {
netdev_features_t features;
+ struct bpf_prog *new_prog;
u16 mtu;
} u;
};