mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-24 01:54:03 -04:00
Add new VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC flag, opcode VIRTCHNL_OP_GET_SUPPORTED_RXDIDS and add member rxdid in struct virtchnl_rxq_info to support AVF Flex RXD extension. Add support to allow VF to query flexible descriptor RXDIDs supported by DDP package and configure Rx queues with selected RXDID for IAVF. Add code to allow VIRTCHNL_OP_GET_SUPPORTED_RXDIDS message to be processed. Add necessary macros for registers. Signed-off-by: Leyi Rong <leyi.rong@intel.com> Signed-off-by: Xu Ting <ting.xu@intel.com> Signed-off-by: Michal Jaron <michalx.jaron@intel.com> Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com> Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com> Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20221025161252.1952939-1-jacob.e.keller@intel.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
84 lines
3.2 KiB
C
84 lines
3.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (C) 2022, Intel Corporation. */
|
|
|
|
#ifndef _ICE_VIRTCHNL_H_
|
|
#define _ICE_VIRTCHNL_H_
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/if_ether.h>
|
|
#include <linux/avf/virtchnl.h>
|
|
#include "ice_vf_lib.h"
|
|
|
|
/* Restrict number of MAC Addr and VLAN that non-trusted VF can programmed */
|
|
#define ICE_MAX_VLAN_PER_VF 8
|
|
|
|
/* MAC filters: 1 is reserved for the VF's default/perm_addr/LAA MAC, 1 for
|
|
* broadcast, and 16 for additional unicast/multicast filters
|
|
*/
|
|
#define ICE_MAX_MACADDR_PER_VF 18
|
|
#define ICE_FLEX_DESC_RXDID_MAX_NUM 64
|
|
|
|
struct ice_virtchnl_ops {
|
|
int (*get_ver_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*get_vf_res_msg)(struct ice_vf *vf, u8 *msg);
|
|
void (*reset_vf)(struct ice_vf *vf);
|
|
int (*add_mac_addr_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*del_mac_addr_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*cfg_qs_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*ena_qs_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*dis_qs_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*request_qs_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*cfg_irq_map_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*config_rss_key)(struct ice_vf *vf, u8 *msg);
|
|
int (*config_rss_lut)(struct ice_vf *vf, u8 *msg);
|
|
int (*get_stats_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*cfg_promiscuous_mode_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*add_vlan_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*remove_vlan_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*query_rxdid)(struct ice_vf *vf);
|
|
int (*ena_vlan_stripping)(struct ice_vf *vf);
|
|
int (*dis_vlan_stripping)(struct ice_vf *vf);
|
|
int (*handle_rss_cfg_msg)(struct ice_vf *vf, u8 *msg, bool add);
|
|
int (*add_fdir_fltr_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*del_fdir_fltr_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*get_offload_vlan_v2_caps)(struct ice_vf *vf);
|
|
int (*add_vlan_v2_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*remove_vlan_v2_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*ena_vlan_stripping_v2_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*dis_vlan_stripping_v2_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*ena_vlan_insertion_v2_msg)(struct ice_vf *vf, u8 *msg);
|
|
int (*dis_vlan_insertion_v2_msg)(struct ice_vf *vf, u8 *msg);
|
|
};
|
|
|
|
#ifdef CONFIG_PCI_IOV
|
|
void ice_virtchnl_set_dflt_ops(struct ice_vf *vf);
|
|
void ice_virtchnl_set_repr_ops(struct ice_vf *vf);
|
|
void ice_vc_notify_vf_link_state(struct ice_vf *vf);
|
|
void ice_vc_notify_link_state(struct ice_pf *pf);
|
|
void ice_vc_notify_reset(struct ice_pf *pf);
|
|
int
|
|
ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,
|
|
enum virtchnl_status_code v_retval, u8 *msg, u16 msglen);
|
|
bool ice_vc_isvalid_vsi_id(struct ice_vf *vf, u16 vsi_id);
|
|
#else /* CONFIG_PCI_IOV */
|
|
static inline void ice_virtchnl_set_dflt_ops(struct ice_vf *vf) { }
|
|
static inline void ice_virtchnl_set_repr_ops(struct ice_vf *vf) { }
|
|
static inline void ice_vc_notify_vf_link_state(struct ice_vf *vf) { }
|
|
static inline void ice_vc_notify_link_state(struct ice_pf *pf) { }
|
|
static inline void ice_vc_notify_reset(struct ice_pf *pf) { }
|
|
|
|
static inline int
|
|
ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,
|
|
enum virtchnl_status_code v_retval, u8 *msg, u16 msglen)
|
|
{
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
static inline bool ice_vc_isvalid_vsi_id(struct ice_vf *vf, u16 vsi_id)
|
|
{
|
|
return false;
|
|
}
|
|
#endif /* !CONFIG_PCI_IOV */
|
|
|
|
#endif /* _ICE_VIRTCHNL_H_ */
|