Linux Audio

Check our new training course

Loading...
v6.13.7
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright (C) 2019-2021, Intel Corporation. */
 3
 4#ifndef _ICE_REPR_H_
 5#define _ICE_REPR_H_
 6
 7#include <net/dst_metadata.h>
 8
 9struct ice_repr_pcpu_stats {
10	struct u64_stats_sync syncp;
11	u64 rx_packets;
12	u64 rx_bytes;
13	u64 tx_packets;
14	u64 tx_bytes;
15	u64 tx_drops;
16};
17
18enum ice_repr_type {
19	ICE_REPR_TYPE_VF,
20	ICE_REPR_TYPE_SF,
21};
22
23struct ice_repr {
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;
29	u32 id;
30	u8 parent_mac[ETH_ALEN];
31	enum ice_repr_type type;
32	union {
33		struct ice_vf *vf;
34		struct ice_dynamic_port *sf;
35	};
36	struct {
37		int (*add)(struct ice_repr *repr);
38		void (*rem)(struct ice_repr *repr);
39		int (*ready)(struct ice_repr *repr);
40	} ops;
41};
42
43struct ice_repr *ice_repr_create_vf(struct ice_vf *vf);
44struct ice_repr *ice_repr_create_sf(struct ice_dynamic_port *sf);
45
46void ice_repr_destroy(struct ice_repr *repr);
47
48void ice_repr_start_tx_queues(struct ice_repr *repr);
49void ice_repr_stop_tx_queues(struct ice_repr *repr);
50
51struct ice_repr *ice_netdev_to_repr(const struct net_device *netdev);
 
 
52bool ice_is_port_repr_netdev(const struct net_device *netdev);
53
54void ice_repr_inc_tx_stats(struct ice_repr *repr, unsigned int len,
55			   int xmit_status);
56void ice_repr_inc_rx_stats(struct net_device *netdev, unsigned int len);
57struct ice_repr *ice_repr_get(struct ice_pf *pf, u32 id);
58#endif
v6.9.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright (C) 2019-2021, Intel Corporation. */
 3
 4#ifndef _ICE_REPR_H_
 5#define _ICE_REPR_H_
 6
 7#include <net/dst_metadata.h>
 8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 9struct ice_repr {
10	struct ice_vsi *src_vsi;
11	struct ice_vf *vf;
12	struct ice_q_vector *q_vector;
13	struct net_device *netdev;
14	struct metadata_dst *dst;
15	struct ice_esw_br_port *br_port;
16	int q_id;
17	u32 id;
18	u8 parent_mac[ETH_ALEN];
19#ifdef CONFIG_ICE_SWITCHDEV
20	/* info about slow path rule */
21	struct ice_rule_query_data sp_rule;
22#endif
 
 
 
 
 
 
23};
24
25struct ice_repr *ice_repr_add_vf(struct ice_vf *vf);
26void ice_repr_rem_vf(struct ice_repr *repr);
 
 
27
28void ice_repr_start_tx_queues(struct ice_repr *repr);
29void ice_repr_stop_tx_queues(struct ice_repr *repr);
30
31void ice_repr_set_traffic_vsi(struct ice_repr *repr, struct ice_vsi *vsi);
32
33struct ice_repr *ice_netdev_to_repr(struct net_device *netdev);
34bool ice_is_port_repr_netdev(const struct net_device *netdev);
35
36struct ice_repr *ice_repr_get_by_vsi(struct ice_vsi *vsi);
 
 
 
37#endif