2020-03-27 02:56:36 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2020 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ICE_DCF_ETHDEV_H_
|
|
|
|
#define _ICE_DCF_ETHDEV_H_
|
|
|
|
|
2020-03-27 02:56:40 +00:00
|
|
|
#include "base/ice_common.h"
|
|
|
|
#include "base/ice_adminq_cmd.h"
|
2021-07-01 11:41:21 +00:00
|
|
|
#include "base/ice_dcb.h"
|
|
|
|
#include "base/ice_sched.h"
|
2020-03-27 02:56:40 +00:00
|
|
|
|
2020-03-27 02:56:36 +00:00
|
|
|
#include "ice_ethdev.h"
|
|
|
|
#include "ice_dcf.h"
|
|
|
|
|
|
|
|
#define ICE_DCF_MAX_RINGS 1
|
2022-04-29 09:19:53 +00:00
|
|
|
#define DCF_NUM_MACADDR_MAX 64
|
2022-04-29 09:19:50 +00:00
|
|
|
#define ICE_DCF_FRAME_SIZE_MAX 9728
|
|
|
|
#define ICE_DCF_VLAN_TAG_SIZE 4
|
|
|
|
#define ICE_DCF_ETH_OVERHEAD \
|
|
|
|
(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)
|
|
|
|
#define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)
|
|
|
|
|
2020-03-27 02:56:36 +00:00
|
|
|
struct ice_dcf_queue {
|
|
|
|
uint64_t dummy;
|
|
|
|
};
|
|
|
|
|
2021-01-18 11:38:29 +00:00
|
|
|
struct ice_dcf_repr_info {
|
|
|
|
struct rte_eth_dev *vf_rep_eth_dev;
|
|
|
|
};
|
|
|
|
|
2020-03-27 02:56:36 +00:00
|
|
|
struct ice_dcf_adapter {
|
2020-03-27 02:56:40 +00:00
|
|
|
struct ice_adapter parent; /* Must be first */
|
2020-03-27 02:56:36 +00:00
|
|
|
struct ice_dcf_hw real_hw;
|
2021-01-18 11:38:29 +00:00
|
|
|
|
2022-04-29 09:19:52 +00:00
|
|
|
bool promisc_unicast_enabled;
|
|
|
|
bool promisc_multicast_enabled;
|
2022-04-29 09:19:53 +00:00
|
|
|
uint32_t mc_addrs_num;
|
|
|
|
struct rte_ether_addr mc_addrs[DCF_NUM_MACADDR_MAX];
|
2021-01-18 11:38:29 +00:00
|
|
|
int num_reprs;
|
|
|
|
struct ice_dcf_repr_info *repr_infos;
|
2020-03-27 02:56:36 +00:00
|
|
|
};
|
|
|
|
|
2021-01-12 08:13:01 +00:00
|
|
|
struct ice_dcf_vf_repr_param {
|
2021-01-18 11:38:29 +00:00
|
|
|
struct rte_eth_dev *dcf_eth_dev;
|
2021-01-12 08:13:01 +00:00
|
|
|
uint16_t switch_domain_id;
|
|
|
|
uint16_t vf_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ice_dcf_vlan {
|
2021-01-18 11:38:29 +00:00
|
|
|
bool port_vlan_ena;
|
|
|
|
bool stripping_ena;
|
|
|
|
|
2021-01-12 08:13:01 +00:00
|
|
|
uint16_t tpid;
|
|
|
|
uint16_t vid;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ice_dcf_vf_repr {
|
2021-01-18 11:38:29 +00:00
|
|
|
struct rte_eth_dev *dcf_eth_dev;
|
2021-01-12 08:13:01 +00:00
|
|
|
struct rte_ether_addr mac_addr;
|
|
|
|
uint16_t switch_domain_id;
|
|
|
|
uint16_t vf_id;
|
|
|
|
|
2021-01-18 11:38:29 +00:00
|
|
|
struct ice_dcf_vlan outer_vlan_info; /* DCF always handle outer VLAN */
|
2021-01-12 08:13:01 +00:00
|
|
|
};
|
|
|
|
|
2022-08-17 08:21:17 +00:00
|
|
|
enum ice_dcf_devrarg {
|
|
|
|
ICE_DCF_DEVARG_CAP,
|
|
|
|
ICE_DCF_DEVARG_ACL,
|
|
|
|
};
|
|
|
|
|
2021-07-01 11:41:21 +00:00
|
|
|
extern const struct rte_tm_ops ice_dcf_tm_ops;
|
2020-03-27 02:56:40 +00:00
|
|
|
void ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
|
|
|
|
uint8_t *msg, uint16_t msglen);
|
|
|
|
int ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev);
|
|
|
|
void ice_dcf_uninit_parent_adapter(struct rte_eth_dev *eth_dev);
|
|
|
|
|
2022-08-17 08:21:17 +00:00
|
|
|
int ice_devargs_check(struct rte_devargs *devargs, enum ice_dcf_devrarg devarg_type);
|
2021-01-18 11:38:29 +00:00
|
|
|
int ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param);
|
|
|
|
int ice_dcf_vf_repr_uninit(struct rte_eth_dev *vf_rep_eth_dev);
|
|
|
|
int ice_dcf_vf_repr_init_vlan(struct rte_eth_dev *vf_rep_eth_dev);
|
|
|
|
void ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter);
|
2021-11-24 08:12:20 +00:00
|
|
|
bool ice_dcf_adminq_need_retry(struct ice_adapter *ad);
|
2021-01-12 08:13:01 +00:00
|
|
|
|
2020-03-27 02:56:36 +00:00
|
|
|
#endif /* _ICE_DCF_ETHDEV_H_ */
|