/** * struct nfp_fl_tunnel_offloads - priv data for tunnel offloads * @offloaded_macs: Hashtable of the offloaded MAC addresses * @ipv4_off_list: List of IPv4 addresses to offload * @ipv6_off_list: List of IPv6 addresses to offload * @ipv4_off_lock: Lock for the IPv4 address list * @ipv6_off_lock: Lock for the IPv6 address list * @mac_off_ids: IDA to manage id assignment for offloaded MACs * @neigh_nb: Notifier to monitor neighbour state
*/ struct nfp_fl_tunnel_offloads { struct rhashtable offloaded_macs; struct list_head ipv4_off_list; struct list_head ipv6_off_list; struct mutex ipv4_off_lock; struct mutex ipv6_off_lock; struct ida mac_off_ids; struct notifier_block neigh_nb;
};
/** * struct nfp_tun_neigh_lag - lag info * @lag_version: lag version * @lag_instance: lag instance
*/ struct nfp_tun_neigh_lag {
u8 lag_version[3];
u8 lag_instance;
};
/** * struct nfp_tun_neigh - basic neighbour data * @dst_addr: Destination MAC address * @src_addr: Source MAC address * @port_id: NFP port to output packet on - associated with source IPv4
*/ struct nfp_tun_neigh {
u8 dst_addr[ETH_ALEN];
u8 src_addr[ETH_ALEN];
__be32 port_id;
};
/** * struct nfp_tun_neigh_ext - extended neighbour data * @vlan_tpid: VLAN_TPID match field * @vlan_tci: VLAN_TCI match field * @host_ctx: Host context ID to be saved here
*/ struct nfp_tun_neigh_ext {
__be16 vlan_tpid;
__be16 vlan_tci;
__be32 host_ctx;
};
/** * struct nfp_tun_neigh_v4 - neighbour/route entry on the NFP for IPv4 * @dst_ipv4: Destination IPv4 address * @src_ipv4: Source IPv4 address * @common: Neighbour/route common info * @ext: Neighbour/route extended info * @lag: lag port info
*/ struct nfp_tun_neigh_v4 {
__be32 dst_ipv4;
__be32 src_ipv4; struct nfp_tun_neigh common; struct nfp_tun_neigh_ext ext; struct nfp_tun_neigh_lag lag;
};
/** * struct nfp_tun_neigh_v6 - neighbour/route entry on the NFP for IPv6 * @dst_ipv6: Destination IPv6 address * @src_ipv6: Source IPv6 address * @common: Neighbour/route common info * @ext: Neighbour/route extended info * @lag: lag port info
*/ struct nfp_tun_neigh_v6 { struct in6_addr dst_ipv6; struct in6_addr src_ipv6; struct nfp_tun_neigh common; struct nfp_tun_neigh_ext ext; struct nfp_tun_neigh_lag lag;
};
/** * struct nfp_neigh_entry * @neigh_cookie: Cookie for hashtable lookup * @ht_node: rhash_head entry for hashtable * @list_head: Needed as member of linked_nn_entries list * @payload: The neighbour info payload * @flow: Linked flow rule * @is_ipv6: Flag to indicate if payload is ipv6 or ipv4
*/ struct nfp_neigh_entry { unsignedlong neigh_cookie; struct rhash_head ht_node; struct list_head list_head; char *payload; struct nfp_predt_entry *flow; bool is_ipv6;
};
/** * struct nfp_predt_entry * @list_head: List head to attach to predt_list * @flow_pay: Direct link to flow_payload * @nn_list: List of linked nfp_neigh_entries
*/ struct nfp_predt_entry { struct list_head list_head; struct nfp_fl_payload *flow_pay; struct list_head nn_list;
};
/** * struct nfp_mtu_conf - manage MTU setting * @portnum: NFP port number of repr with requested MTU change * @requested_val: MTU value requested for repr * @ack: Received ack that MTU has been correctly set * @wait_q: Wait queue for MTU acknowledgements * @lock: Lock for setting/reading MTU variables
*/ struct nfp_mtu_conf {
u32 portnum; unsignedint requested_val; bool ack;
wait_queue_head_t wait_q;
spinlock_t lock;
};
/** * struct nfp_fl_lag - Flower APP priv data for link aggregation * @work: Work queue for writing configs to the HW * @lock: Lock to protect lag_group_list * @group_list: List of all master/slave groups offloaded * @ida_handle: IDA to handle group ids * @pkt_num: Incremented for each config packet sent * @batch_ver: Incremented for each batch of config packets * @global_inst: Instance allocator for groups * @rst_cfg: Marker to reset HW LAG config * @retrans_skbs: Cmsgs that could not be processed by HW and require * retransmission
*/ struct nfp_fl_lag { struct delayed_work work; struct mutex lock; struct list_head group_list; struct ida ida_handle; unsignedint pkt_num; unsignedint batch_ver;
u8 global_inst; bool rst_cfg; struct sk_buff_head retrans_skbs;
};
/** * struct nfp_fl_internal_ports - Flower APP priv data for additional ports * @port_ids: Assignment of ids to any additional ports * @lock: Lock for extra ports list
*/ struct nfp_fl_internal_ports { struct idr port_ids;
spinlock_t lock;
};
/** * struct nfp_flower_priv - Flower APP per-vNIC priv data * @app: Back pointer to app * @nn: Pointer to vNIC * @mask_id_seed: Seed used for mask hash table * @flower_version: HW version of flower * @flower_ext_feats: Bitmap of extra features the HW supports * @flower_en_feats: Bitmap of features enabled by HW * @stats_ids: List of free stats ids * @mask_ids: List of free mask ids * @mask_table: Hash table used to store masks * @stats_ring_size: Maximum number of allowed stats ids * @flow_table: Hash table used to store flower rules * @stats: Stored stats updates for flower rules * @stats_lock: Lock for flower rule stats updates * @stats_ctx_table: Hash table to map stats contexts to its flow rule * @cmsg_work: Workqueue for control messages processing * @cmsg_skbs_high: List of higher priority skbs for control message * processing * @cmsg_skbs_low: List of lower priority skbs for control message * processing * @tun: Tunnel offload data * @reify_replies: atomically stores the number of replies received * from firmware for repr reify * @reify_wait_queue: wait queue for repr reify response counting * @mtu_conf: Configuration of repr MTU value * @nfp_lag: Link aggregation data block * @indr_block_cb_priv: List of priv data passed to indirect block cbs * @non_repr_priv: List of offloaded non-repr ports and their priv data * @active_mem_unit: Current active memory unit for flower rules * @total_mem_units: Total number of available memory units for flower rules * @internal_ports: Internal port ids used in offloaded rules * @qos_stats_work: Workqueue for qos stats processing * @qos_rate_limiters: Current active qos rate limiters * @qos_stats_lock: Lock on qos stats updates * @meter_stats_lock: Lock on meter stats updates * @meter_table: Hash table used to store the meter table * @pre_tun_rule_cnt: Number of pre-tunnel rules offloaded * @merge_table: Hash table to store merged flows * @ct_zone_table: Hash table used to store the different zones * @ct_zone_wc: Special zone entry for wildcarded zone matches * @ct_map_table: Hash table used to referennce ct flows * @predt_list: List to keep track of decap pretun flows * @neigh_table: Table to keep track of neighbor entries * @predt_lock: Lock to serialise predt/neigh table updates * @nfp_fl_lock: Lock to protect the flow offload operation
*/ struct nfp_flower_priv { struct nfp_app *app; struct nfp_net *nn;
u32 mask_id_seed;
u64 flower_version;
u64 flower_ext_feats;
u8 flower_en_feats; struct nfp_fl_stats_id stats_ids; struct nfp_fl_mask_id mask_ids;
DECLARE_HASHTABLE(mask_table, NFP_FLOWER_MASK_HASH_BITS);
u32 stats_ring_size; struct rhashtable flow_table; struct nfp_fl_stats *stats;
spinlock_t stats_lock; /* lock stats */ struct rhashtable stats_ctx_table; struct work_struct cmsg_work; struct sk_buff_head cmsg_skbs_high; struct sk_buff_head cmsg_skbs_low; struct nfp_fl_tunnel_offloads tun;
atomic_t reify_replies;
wait_queue_head_t reify_wait_queue; struct nfp_mtu_conf mtu_conf; struct nfp_fl_lag nfp_lag; struct list_head indr_block_cb_priv; struct list_head non_repr_priv; unsignedint active_mem_unit; unsignedint total_mem_units; struct nfp_fl_internal_ports internal_ports; struct delayed_work qos_stats_work; unsignedint qos_rate_limiters;
spinlock_t qos_stats_lock; /* Protect the qos stats */ struct mutex meter_stats_lock; /* Protect the meter stats */ struct rhashtable meter_table; int pre_tun_rule_cnt; struct rhashtable merge_table; struct rhashtable ct_zone_table; struct nfp_fl_ct_zone_entry *ct_zone_wc; struct rhashtable ct_map_table; struct list_head predt_list; struct rhashtable neigh_table;
spinlock_t predt_lock; /* Lock to serialise predt/neigh table updates */ struct mutex nfp_fl_lock; /* Protect the flow operation */
};
/** * struct nfp_fl_qos - Flower APP priv data for quality of service * @netdev_port_id: NFP port number of repr with qos info * @curr_stats: Currently stored stats updates for qos info * @prev_stats: Previously stored updates for qos info * @last_update: Stored time when last stats were updated
*/ struct nfp_fl_qos {
u32 netdev_port_id; struct nfp_stat_pair curr_stats; struct nfp_stat_pair prev_stats;
u64 last_update;
};
/** * struct nfp_flower_repr_priv - Flower APP per-repr priv data * @nfp_repr: Back pointer to nfp_repr * @lag_port_flags: Extended port flags to record lag state of repr * @mac_offloaded: Flag indicating a MAC address is offloaded for repr * @offloaded_mac_addr: MAC address that has been offloaded for repr * @block_shared: Flag indicating if offload applies to shared blocks * @mac_list: List entry of reprs that share the same offloaded MAC * @qos_table: Stored info on filters implementing qos * @on_bridge: Indicates if the repr is attached to a bridge
*/ struct nfp_flower_repr_priv { struct nfp_repr *nfp_repr; unsignedlong lag_port_flags; bool mac_offloaded;
u8 offloaded_mac_addr[ETH_ALEN]; bool block_shared; struct list_head mac_list; struct nfp_fl_qos qos_table; bool on_bridge;
};
/** * struct nfp_flower_non_repr_priv - Priv data for non-repr offloaded ports * @list: List entry of offloaded reprs * @netdev: Pointer to non-repr net_device * @ref_count: Number of references held for this priv data * @mac_offloaded: Flag indicating a MAC address is offloaded for device * @offloaded_mac_addr: MAC address that has been offloaded for dev
*/ struct nfp_flower_non_repr_priv { struct list_head list; struct net_device *netdev; int ref_count; bool mac_offloaded;
u8 offloaded_mac_addr[ETH_ALEN];
};
struct nfp_fl_key_ls {
u32 key_layer_two;
u8 key_layer; int key_size;
};
/** * struct nfp_ipv6_addr_entry - cached IPv6 addresses * @ipv6_addr: IP address * @ref_count: number of rules currently using this IP * @list: list pointer
*/ struct nfp_ipv6_addr_entry { struct in6_addr ipv6_addr; int ref_count; struct list_head list;
};
struct nfp_fl_payload_link { /* A link contains a pointer to a merge flow and an associated sub_flow. * Each merge flow will feature in 2 links to its underlying sub_flows. * A sub_flow will have at least 1 link to a merge flow or more if it * has been used to create multiple merge flows. * * For a merge flow, 'linked_flows' in its nfp_fl_payload struct lists * all links to sub_flows (sub_flow.flow) via merge.list. * For a sub_flow, 'linked_flows' gives all links to merge flows it has * formed (merge_flow.flow) via sub_flow.list.
*/ struct { struct list_head list; struct nfp_fl_payload *flow;
} merge_flow, sub_flow;
};
if (!(app_priv->flower_en_feats & NFP_FL_ENABLE_FLOW_MERGE)) returnfalse; if (!netdev->rtnl_link_ops) returnfalse; if (!strcmp(netdev->rtnl_link_ops->kind, "openvswitch")) returntrue;
returnfalse;
}
/* The address of the merged flow acts as its cookie. * Cookies supplied to us by TC flower are also addresses to allocated * memory and thus this scheme should not generate any collisions.
*/ staticinlinebool nfp_flower_is_merge_flow(struct nfp_fl_payload *flow_pay)
{ return flow_pay->tc_flower_cookie == (unsignedlong)flow_pay;
}
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.