1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2019-2021, Intel Corporation. */
7 #include <net/dst_metadata.h>
9 struct ice_repr_pcpu_stats {
10 struct u64_stats_sync syncp;
24 struct ice_vsi *src_vsi;
25 struct net_device *netdev;
26 struct metadata_dst *dst;
27 struct ice_esw_br_port *br_port;
28 struct ice_repr_pcpu_stats __percpu *stats;
30 u8 parent_mac[ETH_ALEN];
31 enum ice_repr_type type;
34 struct ice_dynamic_port *sf;
37 int (*add)(struct ice_repr *repr);
38 void (*rem)(struct ice_repr *repr);
39 int (*ready)(struct ice_repr *repr);
43 struct ice_repr *ice_repr_create_vf(struct ice_vf *vf);
44 struct ice_repr *ice_repr_create_sf(struct ice_dynamic_port *sf);
46 void ice_repr_destroy(struct ice_repr *repr);
48 void ice_repr_start_tx_queues(struct ice_repr *repr);
49 void ice_repr_stop_tx_queues(struct ice_repr *repr);
51 struct ice_repr *ice_netdev_to_repr(const struct net_device *netdev);
52 bool ice_is_port_repr_netdev(const struct net_device *netdev);
54 void ice_repr_inc_tx_stats(struct ice_repr *repr, unsigned int len,
56 void ice_repr_inc_rx_stats(struct net_device *netdev, unsigned int len);
57 struct ice_repr *ice_repr_get(struct ice_pf *pf, u32 id);