bnx2x: add vlan filtering offload
Current driver always uses vlan-promisc mode, i.e., it receives both tagged and untagged traffic and lets the network stack drop packets tagged with unrequested vlan tags. This patch implements vlan-filtering offload in the driver - Unless explicitly configured to promisc mode, only untagged packets or packets tagged with requested vlans would reach the Rx flow. Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
e82a08b058
commit
05cc5a39dd
@@ -1228,6 +1228,10 @@ struct bnx2x_slowpath {
|
||||
struct eth_classify_rules_ramrod_data e2;
|
||||
} mac_rdata;
|
||||
|
||||
union {
|
||||
struct eth_classify_rules_ramrod_data e2;
|
||||
} vlan_rdata;
|
||||
|
||||
union {
|
||||
struct tstorm_eth_mac_filter_config e1x;
|
||||
struct eth_filter_rules_ramrod_data e2;
|
||||
@@ -1410,6 +1414,9 @@ struct bnx2x_sp_objs {
|
||||
|
||||
/* Queue State object */
|
||||
struct bnx2x_queue_sp_obj q_obj;
|
||||
|
||||
/* VLANs object */
|
||||
struct bnx2x_vlan_mac_obj vlan_obj;
|
||||
};
|
||||
|
||||
struct bnx2x_fp_stats {
|
||||
@@ -1427,6 +1434,12 @@ enum {
|
||||
SUB_MF_MODE_BD,
|
||||
};
|
||||
|
||||
struct bnx2x_vlan_entry {
|
||||
struct list_head link;
|
||||
u16 vid;
|
||||
bool hw;
|
||||
};
|
||||
|
||||
struct bnx2x {
|
||||
/* Fields used in the tx and intr/napi performance paths
|
||||
* are grouped together in the beginning of the structure
|
||||
@@ -1865,8 +1878,6 @@ struct bnx2x {
|
||||
int dcb_version;
|
||||
|
||||
/* CAM credit pools */
|
||||
|
||||
/* used only in sriov */
|
||||
struct bnx2x_credit_pool_obj vlans_pool;
|
||||
|
||||
struct bnx2x_credit_pool_obj macs_pool;
|
||||
@@ -1929,6 +1940,11 @@ struct bnx2x {
|
||||
u16 rx_filter;
|
||||
|
||||
struct bnx2x_link_report_data vf_link_vars;
|
||||
struct list_head vlan_reg;
|
||||
u16 vlan_cnt;
|
||||
u16 vlan_credit;
|
||||
u16 vxlan_dst_port;
|
||||
bool accept_any_vlan;
|
||||
};
|
||||
|
||||
/* Tx queues may be less or equal to Rx queues */
|
||||
@@ -1956,23 +1972,14 @@ extern int num_queues;
|
||||
#define RSS_IPV6_TCP_CAP_MASK \
|
||||
TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY
|
||||
|
||||
/* func init flags */
|
||||
#define FUNC_FLG_RSS 0x0001
|
||||
#define FUNC_FLG_STATS 0x0002
|
||||
/* removed FUNC_FLG_UNMATCHED 0x0004 */
|
||||
#define FUNC_FLG_TPA 0x0008
|
||||
#define FUNC_FLG_SPQ 0x0010
|
||||
#define FUNC_FLG_LEADING 0x0020 /* PF only */
|
||||
#define FUNC_FLG_LEADING_STATS 0x0040
|
||||
struct bnx2x_func_init_params {
|
||||
/* dma */
|
||||
dma_addr_t fw_stat_map; /* valid iff FUNC_FLG_STATS */
|
||||
dma_addr_t spq_map; /* valid iff FUNC_FLG_SPQ */
|
||||
bool spq_active;
|
||||
dma_addr_t spq_map;
|
||||
u16 spq_prod;
|
||||
|
||||
u16 func_flgs;
|
||||
u16 func_id; /* abs fid */
|
||||
u16 pf_id;
|
||||
u16 spq_prod; /* valid iff FUNC_FLG_SPQ */
|
||||
};
|
||||
|
||||
#define for_each_cnic_queue(bp, var) \
|
||||
@@ -2082,6 +2089,11 @@ struct bnx2x_func_init_params {
|
||||
int bnx2x_set_mac_one(struct bnx2x *bp, u8 *mac,
|
||||
struct bnx2x_vlan_mac_obj *obj, bool set,
|
||||
int mac_type, unsigned long *ramrod_flags);
|
||||
|
||||
int bnx2x_set_vlan_one(struct bnx2x *bp, u16 vlan,
|
||||
struct bnx2x_vlan_mac_obj *obj, bool set,
|
||||
unsigned long *ramrod_flags);
|
||||
|
||||
/**
|
||||
* bnx2x_del_all_macs - delete all MACs configured for the specific MAC object
|
||||
*
|
||||
@@ -2486,6 +2498,7 @@ void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
|
||||
#define VF_ACQUIRE_THRESH 3
|
||||
#define VF_ACQUIRE_MAC_FILTERS 1
|
||||
#define VF_ACQUIRE_MC_FILTERS 10
|
||||
#define VF_ACQUIRE_VLAN_FILTERS 2 /* VLAN0 + 'real' VLAN */
|
||||
|
||||
#define GOOD_ME_REG(me_reg) (((me_reg) & ME_REG_VF_VALID) && \
|
||||
(!((me_reg) & ME_REG_VF_ERR)))
|
||||
@@ -2596,4 +2609,9 @@ void bnx2x_set_rx_ts(struct bnx2x *bp, struct sk_buff *skb);
|
||||
#define BNX2X_MAX_PHC_DRIFT 31000000
|
||||
#define BNX2X_PTP_TX_TIMEOUT
|
||||
|
||||
/* Re-configure all previously configured vlan filters.
|
||||
* Meant for implicit re-load flows.
|
||||
*/
|
||||
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp);
|
||||
|
||||
#endif /* bnx2x.h */
|
||||
|
Reference in New Issue
Block a user