/* Broadcom NetXtreme-C/E network driver. * * Copyright (c) 2017 Broadcom Limited * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation.
*/
#ifndef BNXT_TC_H #define BNXT_TC_H
#ifdef CONFIG_BNXT_FLOWER_OFFLOAD
#include <net/ip_tunnels.h>
/* Structs used for storing the filter/actions of the TC cmd.
*/ struct bnxt_tc_l2_key {
u8 dmac[ETH_ALEN];
u8 smac[ETH_ALEN];
__be16 inner_vlan_tpid;
__be16 inner_vlan_tci;
__be16 ether_type;
u8 num_vlans;
u8 dir; #define BNXT_DIR_RX 1 #define BNXT_DIR_TX 0
};
/* updated stats accounting for hw-counter wrap-around */ struct bnxt_tc_flow_stats stats; /* previous snap-shot of stats */ struct bnxt_tc_flow_stats prev_stats; unsignedlong lastused; /* jiffies */ /* for calculating delta from prev_stats and * updating prev_stats atomically.
*/
spinlock_t stats_lock;
};
/* Tunnel encap/decap hash table * This table is used to maintain a list of flows that use * the same tunnel encap/decap params (ip_daddrs, vni, udp_dport) * and the FW returned handle. * A separate table is maintained for encap and decap
*/ struct bnxt_tc_tunnel_node { struct ip_tunnel_key key; struct rhash_head node;
/* tunnel l2 info */ struct bnxt_tc_l2_key l2_info;
#define INVALID_TUNNEL_HANDLE cpu_to_le32(0xffffffff) /* tunnel handle returned by FW */
__le32 tunnel_handle;
u32 refcount; struct rcu_head rcu;
};
/* L2 hash table * The same data-struct is used for L2-flow table and L2-tunnel table. * The L2 part of a flow or tunnel is stored in a hash table. * A flow that shares the same L2 key/mask with an * already existing flow/tunnel must refer to it's flow handle or * decap_filter_id respectively.
*/ struct bnxt_tc_l2_node { /* hash key: first 16b of key */ #define BNXT_TC_L2_KEY_LEN 16 struct bnxt_tc_l2_key key; struct rhash_head node;
/* a linked list of flows that share the same l2 key */ struct list_head common_l2_flows;
/* number of flows/tunnels sharing the l2 key */
u16 refcount;
/* L2 node in l2 hashtable that shares flow's l2 key */ struct bnxt_tc_l2_node *l2_node; /* for the shared_flows list maintained in l2_node */ struct list_head l2_list_node;
/* tunnel encap related */ struct bnxt_tc_tunnel_node *encap_node;
/* tunnel decap related */ struct bnxt_tc_tunnel_node *decap_node; /* L2 node in tunnel-l2 hashtable that shares flow's tunnel l2 key */ struct bnxt_tc_l2_node *decap_l2_node; /* for the shared_flows list maintained in tunnel decap l2_node */ struct list_head decap_l2_list_node;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.