Commit 5a21bf5b authored by David S. Miller's avatar David S. Miller

Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
100GbE Intel Wired LAN Driver Updates 2021-12-14

This series contains updates to ice driver only.

Haiyue adds support to query hardware for supported PTYPEs.

Jeff changes PTYPE validation to utilize the capabilities queried from
the hardware instead of maintaining a per DDP support list.

Brett refactors promiscuous functions to provide common and clear
interfaces to call for configuration.

Wojciech modifies DDP package load to simplify determining the final
state of the load.

Tony removes the use of ice_status from the driver. This involves
removing string conversion functions, converting variables and values to
standard errors, and clean up. He also removes an unused define.

Dan Carpenter removes unneeded casts.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0b6f65c7 f8a3bcce
...@@ -848,7 +848,6 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup); ...@@ -848,7 +848,6 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
int ice_plug_aux_dev(struct ice_pf *pf); int ice_plug_aux_dev(struct ice_pf *pf);
void ice_unplug_aux_dev(struct ice_pf *pf); void ice_unplug_aux_dev(struct ice_pf *pf);
int ice_init_rdma(struct ice_pf *pf); int ice_init_rdma(struct ice_pf *pf);
const char *ice_stat_str(enum ice_status stat_err);
const char *ice_aq_str(enum ice_aq_err aq_err); const char *ice_aq_str(enum ice_aq_err aq_err);
bool ice_is_wol_supported(struct ice_hw *hw); bool ice_is_wol_supported(struct ice_hw *hw);
int int
......
...@@ -759,7 +759,7 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, ...@@ -759,7 +759,7 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring,
struct ice_channel *ch = ring->ch; struct ice_channel *ch = ring->ch;
struct ice_pf *pf = vsi->back; struct ice_pf *pf = vsi->back;
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
enum ice_status status; int status;
u16 pf_q; u16 pf_q;
u8 tc; u8 tc;
...@@ -804,9 +804,9 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, ...@@ -804,9 +804,9 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring,
ring->q_handle, 1, qg_buf, buf_len, ring->q_handle, 1, qg_buf, buf_len,
NULL); NULL);
if (status) { if (status) {
dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %s\n", dev_err(ice_pf_to_dev(pf), "Failed to set LAN Tx queue context, error: %d\n",
ice_stat_str(status)); status);
return -ENODEV; return status;
} }
/* Add Tx Queue TEID into the VSI Tx ring from the /* Add Tx Queue TEID into the VSI Tx ring from the
...@@ -929,7 +929,7 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, ...@@ -929,7 +929,7 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
struct ice_pf *pf = vsi->back; struct ice_pf *pf = vsi->back;
struct ice_q_vector *q_vector; struct ice_q_vector *q_vector;
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
enum ice_status status; int status;
u32 val; u32 val;
/* clear cause_ena bit for disabled queues */ /* clear cause_ena bit for disabled queues */
...@@ -953,18 +953,18 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, ...@@ -953,18 +953,18 @@ ice_vsi_stop_tx_ring(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src,
rel_vmvf_num, NULL); rel_vmvf_num, NULL);
/* if the disable queue command was exercised during an /* if the disable queue command was exercised during an
* active reset flow, ICE_ERR_RESET_ONGOING is returned. * active reset flow, -EBUSY is returned.
* This is not an error as the reset operation disables * This is not an error as the reset operation disables
* queues at the hardware level anyway. * queues at the hardware level anyway.
*/ */
if (status == ICE_ERR_RESET_ONGOING) { if (status == -EBUSY) {
dev_dbg(ice_pf_to_dev(vsi->back), "Reset in progress. LAN Tx queues already disabled\n"); dev_dbg(ice_pf_to_dev(vsi->back), "Reset in progress. LAN Tx queues already disabled\n");
} else if (status == ICE_ERR_DOES_NOT_EXIST) { } else if (status == -ENOENT) {
dev_dbg(ice_pf_to_dev(vsi->back), "LAN Tx queues do not exist, nothing to disable\n"); dev_dbg(ice_pf_to_dev(vsi->back), "LAN Tx queues do not exist, nothing to disable\n");
} else if (status) { } else if (status) {
dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %s\n", dev_dbg(ice_pf_to_dev(vsi->back), "Failed to disable LAN Tx queues, error: %d\n",
ice_stat_str(status)); status);
return -ENODEV; return status;
} }
return 0; return 0;
......
This diff is collapsed.
...@@ -14,108 +14,108 @@ ...@@ -14,108 +14,108 @@
#define ICE_SQ_SEND_DELAY_TIME_MS 10 #define ICE_SQ_SEND_DELAY_TIME_MS 10
#define ICE_SQ_SEND_MAX_EXECUTE 3 #define ICE_SQ_SEND_MAX_EXECUTE 3
enum ice_status ice_init_hw(struct ice_hw *hw); int ice_init_hw(struct ice_hw *hw);
void ice_deinit_hw(struct ice_hw *hw); void ice_deinit_hw(struct ice_hw *hw);
enum ice_status ice_check_reset(struct ice_hw *hw); int ice_check_reset(struct ice_hw *hw);
enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req); int ice_reset(struct ice_hw *hw, enum ice_reset_req req);
enum ice_status ice_create_all_ctrlq(struct ice_hw *hw); int ice_create_all_ctrlq(struct ice_hw *hw);
enum ice_status ice_init_all_ctrlq(struct ice_hw *hw); int ice_init_all_ctrlq(struct ice_hw *hw);
void ice_shutdown_all_ctrlq(struct ice_hw *hw); void ice_shutdown_all_ctrlq(struct ice_hw *hw);
void ice_destroy_all_ctrlq(struct ice_hw *hw); void ice_destroy_all_ctrlq(struct ice_hw *hw);
enum ice_status int
ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq, ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,
struct ice_rq_event_info *e, u16 *pending); struct ice_rq_event_info *e, u16 *pending);
enum ice_status int
ice_get_link_status(struct ice_port_info *pi, bool *link_up); ice_get_link_status(struct ice_port_info *pi, bool *link_up);
enum ice_status ice_update_link_info(struct ice_port_info *pi); int ice_update_link_info(struct ice_port_info *pi);
enum ice_status int
ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res, ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res,
enum ice_aq_res_access_type access, u32 timeout); enum ice_aq_res_access_type access, u32 timeout);
void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res); void ice_release_res(struct ice_hw *hw, enum ice_aq_res_ids res);
enum ice_status int
ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool btm, u16 *res); ice_alloc_hw_res(struct ice_hw *hw, u16 type, u16 num, bool btm, u16 *res);
enum ice_status int
ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res); ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res);
enum ice_status int
ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries, ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size, struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size,
enum ice_adminq_opc opc, struct ice_sq_cd *cd); enum ice_adminq_opc opc, struct ice_sq_cd *cd);
bool ice_is_sbq_supported(struct ice_hw *hw); bool ice_is_sbq_supported(struct ice_hw *hw);
struct ice_ctl_q_info *ice_get_sbq(struct ice_hw *hw); struct ice_ctl_q_info *ice_get_sbq(struct ice_hw *hw);
enum ice_status int
ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq, ice_sq_send_cmd(struct ice_hw *hw, struct ice_ctl_q_info *cq,
struct ice_aq_desc *desc, void *buf, u16 buf_size, struct ice_aq_desc *desc, void *buf, u16 buf_size,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
void ice_clear_pxe_mode(struct ice_hw *hw); void ice_clear_pxe_mode(struct ice_hw *hw);
enum ice_status ice_get_caps(struct ice_hw *hw); int ice_get_caps(struct ice_hw *hw);
void ice_set_safe_mode_caps(struct ice_hw *hw); void ice_set_safe_mode_caps(struct ice_hw *hw);
enum ice_status int
ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx, ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,
u32 rxq_index); u32 rxq_index);
enum ice_status int
ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params); ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params);
enum ice_status int
ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params); ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params);
enum ice_status int
ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle, ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle,
struct ice_aqc_get_set_rss_keys *keys); struct ice_aqc_get_set_rss_keys *keys);
enum ice_status int
ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_handle, ice_aq_set_rss_key(struct ice_hw *hw, u16 vsi_handle,
struct ice_aqc_get_set_rss_keys *keys); struct ice_aqc_get_set_rss_keys *keys);
bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq); bool ice_check_sq_alive(struct ice_hw *hw, struct ice_ctl_q_info *cq);
enum ice_status ice_aq_q_shutdown(struct ice_hw *hw, bool unloading); int ice_aq_q_shutdown(struct ice_hw *hw, bool unloading);
void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode); void ice_fill_dflt_direct_cmd_desc(struct ice_aq_desc *desc, u16 opcode);
extern const struct ice_ctx_ele ice_tlan_ctx_info[]; extern const struct ice_ctx_ele ice_tlan_ctx_info[];
enum ice_status int
ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx,
const struct ice_ctx_ele *ce_info); const struct ice_ctx_ele *ce_info);
extern struct mutex ice_global_cfg_lock_sw; extern struct mutex ice_global_cfg_lock_sw;
enum ice_status int
ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc,
void *buf, u16 buf_size, struct ice_sq_cd *cd); void *buf, u16 buf_size, struct ice_sq_cd *cd);
enum ice_status ice_aq_get_fw_ver(struct ice_hw *hw, struct ice_sq_cd *cd); int ice_aq_get_fw_ver(struct ice_hw *hw, struct ice_sq_cd *cd);
enum ice_status int
ice_aq_send_driver_ver(struct ice_hw *hw, struct ice_driver_ver *dv, ice_aq_send_driver_ver(struct ice_hw *hw, struct ice_driver_ver *dv,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int
ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
struct ice_aqc_get_phy_caps_data *caps, struct ice_aqc_get_phy_caps_data *caps,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int
ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count, ice_aq_list_caps(struct ice_hw *hw, void *buf, u16 buf_size, u32 *cap_count,
enum ice_adminq_opc opc, struct ice_sq_cd *cd); enum ice_adminq_opc opc, struct ice_sq_cd *cd);
enum ice_status int
ice_discover_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_caps); ice_discover_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_caps);
void void
ice_update_phy_type(u64 *phy_type_low, u64 *phy_type_high, ice_update_phy_type(u64 *phy_type_low, u64 *phy_type_high,
u16 link_speeds_bitmap); u16 link_speeds_bitmap);
enum ice_status int
ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags, ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
bool ice_is_e810(struct ice_hw *hw); bool ice_is_e810(struct ice_hw *hw);
enum ice_status ice_clear_pf_cfg(struct ice_hw *hw); int ice_clear_pf_cfg(struct ice_hw *hw);
enum ice_status int
ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi, ice_aq_set_phy_cfg(struct ice_hw *hw, struct ice_port_info *pi,
struct ice_aqc_set_phy_cfg_data *cfg, struct ice_sq_cd *cd); struct ice_aqc_set_phy_cfg_data *cfg, struct ice_sq_cd *cd);
bool ice_fw_supports_link_override(struct ice_hw *hw); bool ice_fw_supports_link_override(struct ice_hw *hw);
enum ice_status int
ice_get_link_default_override(struct ice_link_default_override_tlv *ldo, ice_get_link_default_override(struct ice_link_default_override_tlv *ldo,
struct ice_port_info *pi); struct ice_port_info *pi);
bool ice_is_phy_caps_an_enabled(struct ice_aqc_get_phy_caps_data *caps); bool ice_is_phy_caps_an_enabled(struct ice_aqc_get_phy_caps_data *caps);
enum ice_fc_mode ice_caps_to_fc_mode(u8 caps); enum ice_fc_mode ice_caps_to_fc_mode(u8 caps);
enum ice_fec_mode ice_caps_to_fec_mode(u8 caps, u8 fec_options); enum ice_fec_mode ice_caps_to_fec_mode(u8 caps, u8 fec_options);
enum ice_status int
ice_set_fc(struct ice_port_info *pi, u8 *aq_failures, ice_set_fc(struct ice_port_info *pi, u8 *aq_failures,
bool ena_auto_link_update); bool ena_auto_link_update);
enum ice_status int
ice_cfg_phy_fc(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, ice_cfg_phy_fc(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
enum ice_fc_mode fc); enum ice_fc_mode fc);
bool bool
...@@ -125,27 +125,27 @@ void ...@@ -125,27 +125,27 @@ void
ice_copy_phy_caps_to_cfg(struct ice_port_info *pi, ice_copy_phy_caps_to_cfg(struct ice_port_info *pi,
struct ice_aqc_get_phy_caps_data *caps, struct ice_aqc_get_phy_caps_data *caps,
struct ice_aqc_set_phy_cfg_data *cfg); struct ice_aqc_set_phy_cfg_data *cfg);
enum ice_status int
ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
enum ice_fec_mode fec); enum ice_fec_mode fec);
enum ice_status int
ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int
ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd); ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd);
enum ice_status int
ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse,
struct ice_link_status *link, struct ice_sq_cd *cd); struct ice_link_status *link, struct ice_sq_cd *cd);
enum ice_status int
ice_aq_set_event_mask(struct ice_hw *hw, u8 port_num, u16 mask, ice_aq_set_event_mask(struct ice_hw *hw, u8 port_num, u16 mask,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int
ice_aq_set_mac_loopback(struct ice_hw *hw, bool ena_lpbk, struct ice_sq_cd *cd); ice_aq_set_mac_loopback(struct ice_hw *hw, bool ena_lpbk, struct ice_sq_cd *cd);
enum ice_status int
ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode, ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int
ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr, ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr,
u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length, u16 mem_addr, u8 page, u8 set_page, u8 *data, u8 length,
bool write, struct ice_sq_cd *cd); bool write, struct ice_sq_cd *cd);
...@@ -159,19 +159,19 @@ ice_ena_vsi_rdma_qset(struct ice_port_info *pi, u16 vsi_handle, u8 tc, ...@@ -159,19 +159,19 @@ ice_ena_vsi_rdma_qset(struct ice_port_info *pi, u16 vsi_handle, u8 tc,
int int
ice_dis_vsi_rdma_qset(struct ice_port_info *pi, u16 count, u32 *qset_teid, ice_dis_vsi_rdma_qset(struct ice_port_info *pi, u16 count, u32 *qset_teid,
u16 *q_id); u16 *q_id);
enum ice_status int
ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues, ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues,
u16 *q_handle, u16 *q_ids, u32 *q_teids, u16 *q_handle, u16 *q_ids, u32 *q_teids,
enum ice_disq_rst_src rst_src, u16 vmvf_num, enum ice_disq_rst_src rst_src, u16 vmvf_num,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int
ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap, ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,
u16 *max_lanqs); u16 *max_lanqs);
enum ice_status int
ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,
u8 num_qgrps, struct ice_aqc_add_tx_qgrp *buf, u16 buf_size, u8 num_qgrps, struct ice_aqc_add_tx_qgrp *buf, u16 buf_size,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle); int ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
void ice_replay_post(struct ice_hw *hw); void ice_replay_post(struct ice_hw *hw);
void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf); void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);
struct ice_q_ctx * struct ice_q_ctx *
...@@ -184,7 +184,7 @@ void ...@@ -184,7 +184,7 @@ void
ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded, ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
u64 *prev_stat, u64 *cur_stat); u64 *prev_stat, u64 *cur_stat);
bool ice_is_e810t(struct ice_hw *hw); bool ice_is_e810t(struct ice_hw *hw);
enum ice_status int
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid, ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
struct ice_aqc_txsched_elem_data *buf); struct ice_aqc_txsched_elem_data *buf);
int int
...@@ -199,11 +199,11 @@ ice_aq_set_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value, ...@@ -199,11 +199,11 @@ ice_aq_set_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, bool value,
int int
ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx, ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,
bool *value, struct ice_sq_cd *cd); bool *value, struct ice_sq_cd *cd);
enum ice_status int
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size, ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw); bool ice_fw_supports_lldp_fltr_ctrl(struct ice_hw *hw);
enum ice_status int
ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add); ice_lldp_fltr_add_remove(struct ice_hw *hw, u16 vsi_num, bool add);
bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw); bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw);
#endif /* _ICE_COMMON_H_ */ #endif /* _ICE_COMMON_H_ */
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
/* Copyright (c) 2019, Intel Corporation. */ /* Copyright (c) 2019, Intel Corporation. */
#include "ice_common.h" #include "ice_common.h"
#include "ice_lib.h"
#include "ice_sched.h" #include "ice_sched.h"
#include "ice_dcb.h" #include "ice_dcb.h"
...@@ -19,19 +18,19 @@ ...@@ -19,19 +18,19 @@
* *
* Requests the complete LLDP MIB (entire packet). (0x0A00) * Requests the complete LLDP MIB (entire packet). (0x0A00)
*/ */
static enum ice_status static int
ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf, ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,
u16 buf_size, u16 *local_len, u16 *remote_len, u16 buf_size, u16 *local_len, u16 *remote_len,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
struct ice_aqc_lldp_get_mib *cmd; struct ice_aqc_lldp_get_mib *cmd;
struct ice_aq_desc desc; struct ice_aq_desc desc;
enum ice_status status; int status;
cmd = &desc.params.lldp_get_mib; cmd = &desc.params.lldp_get_mib;
if (buf_size == 0 || !buf) if (buf_size == 0 || !buf)
return ICE_ERR_PARAM; return -EINVAL;
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_get_mib); ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_get_mib);
...@@ -61,7 +60,7 @@ ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf, ...@@ -61,7 +60,7 @@ ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,
* Enable or Disable posting of an event on ARQ when LLDP MIB * Enable or Disable posting of an event on ARQ when LLDP MIB
* associated with the interface changes (0x0A01) * associated with the interface changes (0x0A01)
*/ */
static enum ice_status static int
ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update, ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
...@@ -89,7 +88,7 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update, ...@@ -89,7 +88,7 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,
* *
* Stop or Shutdown the embedded LLDP Agent (0x0A05) * Stop or Shutdown the embedded LLDP Agent (0x0A05)
*/ */
enum ice_status int
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist, ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
...@@ -117,8 +116,7 @@ ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist, ...@@ -117,8 +116,7 @@ ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
* *
* Start the embedded LLDP Agent on all ports. (0x0A06) * Start the embedded LLDP Agent on all ports. (0x0A06)
*/ */
enum ice_status int ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)
ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)
{ {
struct ice_aqc_lldp_start *cmd; struct ice_aqc_lldp_start *cmd;
struct ice_aq_desc desc; struct ice_aq_desc desc;
...@@ -598,18 +596,17 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg) ...@@ -598,18 +596,17 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
* *
* Parse DCB configuration from the LLDPDU * Parse DCB configuration from the LLDPDU
*/ */
static enum ice_status static int ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
{ {
struct ice_lldp_org_tlv *tlv; struct ice_lldp_org_tlv *tlv;
enum ice_status ret = 0;
u16 offset = 0; u16 offset = 0;
int ret = 0;
u16 typelen; u16 typelen;
u16 type; u16 type;
u16 len; u16 len;
if (!lldpmib || !dcbcfg) if (!lldpmib || !dcbcfg)
return ICE_ERR_PARAM; return -EINVAL;
/* set to the start of LLDPDU */ /* set to the start of LLDPDU */
lldpmib += ETH_HLEN; lldpmib += ETH_HLEN;
...@@ -649,17 +646,17 @@ ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg) ...@@ -649,17 +646,17 @@ ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
* *
* Query DCB configuration from the firmware * Query DCB configuration from the firmware
*/ */
enum ice_status int
ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,
struct ice_dcbx_cfg *dcbcfg) struct ice_dcbx_cfg *dcbcfg)
{ {
enum ice_status ret;
u8 *lldpmib; u8 *lldpmib;
int ret;
/* Allocate the LLDPDU */ /* Allocate the LLDPDU */
lldpmib = devm_kzalloc(ice_hw_to_dev(hw), ICE_LLDPDU_SIZE, GFP_KERNEL); lldpmib = devm_kzalloc(ice_hw_to_dev(hw), ICE_LLDPDU_SIZE, GFP_KERNEL);
if (!lldpmib) if (!lldpmib)
return ICE_ERR_NO_MEMORY; return -ENOMEM;
ret = ice_aq_get_lldp_mib(hw, bridgetype, mib_type, (void *)lldpmib, ret = ice_aq_get_lldp_mib(hw, bridgetype, mib_type, (void *)lldpmib,
ICE_LLDPDU_SIZE, NULL, NULL, NULL); ICE_LLDPDU_SIZE, NULL, NULL, NULL);
...@@ -684,17 +681,17 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, ...@@ -684,17 +681,17 @@ ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,
* @cd: pointer to command details structure or NULL * @cd: pointer to command details structure or NULL
* *
* Start/Stop the embedded dcbx Agent. In case that this wrapper function * Start/Stop the embedded dcbx Agent. In case that this wrapper function
* returns ICE_SUCCESS, caller will need to check if FW returns back the same * returns 0, caller will need to check if FW returns back the same
* value as stated in dcbx_agent_status, and react accordingly. (0x0A09) * value as stated in dcbx_agent_status, and react accordingly. (0x0A09)
*/ */
enum ice_status int
ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent, ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
bool *dcbx_agent_status, struct ice_sq_cd *cd) bool *dcbx_agent_status, struct ice_sq_cd *cd)
{ {
struct ice_aqc_lldp_stop_start_specific_agent *cmd; struct ice_aqc_lldp_stop_start_specific_agent *cmd;
enum ice_status status;
struct ice_aq_desc desc; struct ice_aq_desc desc;
u16 opcode; u16 opcode;
int status;
cmd = &desc.params.lldp_agent_ctrl; cmd = &desc.params.lldp_agent_ctrl;
...@@ -724,7 +721,7 @@ ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent, ...@@ -724,7 +721,7 @@ ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
* *
* Get CEE DCBX mode operational configuration from firmware (0x0A07) * Get CEE DCBX mode operational configuration from firmware (0x0A07)
*/ */
static enum ice_status static int
ice_aq_get_cee_dcb_cfg(struct ice_hw *hw, ice_aq_get_cee_dcb_cfg(struct ice_hw *hw,
struct ice_aqc_get_cee_dcb_cfg_resp *buff, struct ice_aqc_get_cee_dcb_cfg_resp *buff,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
...@@ -749,7 +746,7 @@ int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd) ...@@ -749,7 +746,7 @@ int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd)
{ {
struct ice_aqc_set_query_pfc_mode *cmd; struct ice_aqc_set_query_pfc_mode *cmd;
struct ice_aq_desc desc; struct ice_aq_desc desc;
enum ice_status status; int status;
if (pfc_mode > ICE_AQC_PFC_DSCP_BASED_PFC) if (pfc_mode > ICE_AQC_PFC_DSCP_BASED_PFC)
return -EINVAL; return -EINVAL;
...@@ -762,7 +759,7 @@ int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd) ...@@ -762,7 +759,7 @@ int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd)
status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd); status = ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
if (status) if (status)
return ice_status_to_errno(status); return status;
/* FW will write the PFC mode set back into cmd->pfc_mode, but if DCB is /* FW will write the PFC mode set back into cmd->pfc_mode, but if DCB is
* disabled, FW will write back 0 to cmd->pfc_mode. After the AQ has * disabled, FW will write back 0 to cmd->pfc_mode. After the AQ has
...@@ -903,14 +900,13 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg, ...@@ -903,14 +900,13 @@ ice_cee_to_dcb_cfg(struct ice_aqc_get_cee_dcb_cfg_resp *cee_cfg,
* *
* Get IEEE or CEE mode DCB configuration from the Firmware * Get IEEE or CEE mode DCB configuration from the Firmware
*/ */
static enum ice_status static int ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode)
ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode)
{ {
struct ice_dcbx_cfg *dcbx_cfg = NULL; struct ice_dcbx_cfg *dcbx_cfg = NULL;
enum ice_status ret; int ret;
if (!pi) if (!pi)
return ICE_ERR_PARAM; return -EINVAL;
if (dcbx_mode == ICE_DCBX_MODE_IEEE) if (dcbx_mode == ICE_DCBX_MODE_IEEE)
dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg;
...@@ -943,14 +939,14 @@ ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode) ...@@ -943,14 +939,14 @@ ice_get_ieee_or_cee_dcb_cfg(struct ice_port_info *pi, u8 dcbx_mode)
* *
* Get DCB configuration from the Firmware * Get DCB configuration from the Firmware
*/ */
enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi) int ice_get_dcb_cfg(struct ice_port_info *pi)
{ {
struct ice_aqc_get_cee_dcb_cfg_resp cee_cfg; struct ice_aqc_get_cee_dcb_cfg_resp cee_cfg;
struct ice_dcbx_cfg *dcbx_cfg; struct ice_dcbx_cfg *dcbx_cfg;
enum ice_status ret; int ret;
if (!pi) if (!pi)
return ICE_ERR_PARAM; return -EINVAL;
ret = ice_aq_get_cee_dcb_cfg(pi->hw, &cee_cfg, NULL); ret = ice_aq_get_cee_dcb_cfg(pi->hw, &cee_cfg, NULL);
if (!ret) { if (!ret) {
...@@ -974,13 +970,13 @@ enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi) ...@@ -974,13 +970,13 @@ enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi)
* *
* Update DCB configuration from the Firmware * Update DCB configuration from the Firmware
*/ */
enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change) int ice_init_dcb(struct ice_hw *hw, bool enable_mib_change)
{ {
struct ice_qos_cfg *qos_cfg = &hw->port_info->qos_cfg; struct ice_qos_cfg *qos_cfg = &hw->port_info->qos_cfg;
enum ice_status ret = 0; int ret = 0;
if (!hw->func_caps.common_cap.dcb) if (!hw->func_caps.common_cap.dcb)
return ICE_ERR_NOT_SUPPORTED; return -EOPNOTSUPP;
qos_cfg->is_sw_lldp = true; qos_cfg->is_sw_lldp = true;
...@@ -996,7 +992,7 @@ enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change) ...@@ -996,7 +992,7 @@ enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change)
return ret; return ret;
qos_cfg->is_sw_lldp = false; qos_cfg->is_sw_lldp = false;
} else if (qos_cfg->dcbx_status == ICE_DCBX_STATUS_DIS) { } else if (qos_cfg->dcbx_status == ICE_DCBX_STATUS_DIS) {
return ICE_ERR_NOT_READY; return -EBUSY;
} }
/* Configure the LLDP MIB change event */ /* Configure the LLDP MIB change event */
...@@ -1016,19 +1012,19 @@ enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change) ...@@ -1016,19 +1012,19 @@ enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change)
* *
* Configure (disable/enable) MIB * Configure (disable/enable) MIB
*/ */
enum ice_status ice_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_mib) int ice_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_mib)
{ {
struct ice_qos_cfg *qos_cfg = &hw->port_info->qos_cfg; struct ice_qos_cfg *qos_cfg = &hw->port_info->qos_cfg;
enum ice_status ret; int ret;
if (!hw->func_caps.common_cap.dcb) if (!hw->func_caps.common_cap.dcb)
return ICE_ERR_NOT_SUPPORTED; return -EOPNOTSUPP;
/* Get DCBX status */ /* Get DCBX status */
qos_cfg->dcbx_status = ice_get_dcbx_status(hw); qos_cfg->dcbx_status = ice_get_dcbx_status(hw);
if (qos_cfg->dcbx_status == ICE_DCBX_STATUS_DIS) if (qos_cfg->dcbx_status == ICE_DCBX_STATUS_DIS)
return ICE_ERR_NOT_READY; return -EBUSY;
ret = ice_aq_cfg_lldp_mib_change(hw, ena_mib, NULL); ret = ice_aq_cfg_lldp_mib_change(hw, ena_mib, NULL);
if (!ret) if (!ret)
...@@ -1469,16 +1465,16 @@ ice_dcb_cfg_to_lldp(u8 *lldpmib, u16 *miblen, struct ice_dcbx_cfg *dcbcfg) ...@@ -1469,16 +1465,16 @@ ice_dcb_cfg_to_lldp(u8 *lldpmib, u16 *miblen, struct ice_dcbx_cfg *dcbcfg)
* *
* Set DCB configuration to the Firmware * Set DCB configuration to the Firmware
*/ */
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi) int ice_set_dcb_cfg(struct ice_port_info *pi)
{ {
u8 mib_type, *lldpmib = NULL; u8 mib_type, *lldpmib = NULL;
struct ice_dcbx_cfg *dcbcfg; struct ice_dcbx_cfg *dcbcfg;
enum ice_status ret;
struct ice_hw *hw; struct ice_hw *hw;
u16 miblen; u16 miblen;
int ret;
if (!pi) if (!pi)
return ICE_ERR_PARAM; return -EINVAL;
hw = pi->hw; hw = pi->hw;
...@@ -1487,7 +1483,7 @@ enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi) ...@@ -1487,7 +1483,7 @@ enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi)
/* Allocate the LLDPDU */ /* Allocate the LLDPDU */
lldpmib = devm_kzalloc(ice_hw_to_dev(hw), ICE_LLDPDU_SIZE, GFP_KERNEL); lldpmib = devm_kzalloc(ice_hw_to_dev(hw), ICE_LLDPDU_SIZE, GFP_KERNEL);
if (!lldpmib) if (!lldpmib)
return ICE_ERR_NO_MEMORY; return -ENOMEM;
mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB; mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB;
if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING) if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING)
...@@ -1511,17 +1507,17 @@ enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi) ...@@ -1511,17 +1507,17 @@ enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi)
* *
* query current port ETS configuration * query current port ETS configuration
*/ */
static enum ice_status static int
ice_aq_query_port_ets(struct ice_port_info *pi, ice_aq_query_port_ets(struct ice_port_info *pi,
struct ice_aqc_port_ets_elem *buf, u16 buf_size, struct ice_aqc_port_ets_elem *buf, u16 buf_size,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
struct ice_aqc_query_port_ets *cmd; struct ice_aqc_query_port_ets *cmd;
struct ice_aq_desc desc; struct ice_aq_desc desc;
enum ice_status status; int status;
if (!pi) if (!pi)
return ICE_ERR_PARAM; return -EINVAL;
cmd = &desc.params.port_ets; cmd = &desc.params.port_ets;
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_port_ets); ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_query_port_ets);
cmd->port_teid = pi->root->info.node_teid; cmd->port_teid = pi->root->info.node_teid;
...@@ -1537,18 +1533,18 @@ ice_aq_query_port_ets(struct ice_port_info *pi, ...@@ -1537,18 +1533,18 @@ ice_aq_query_port_ets(struct ice_port_info *pi,
* *
* update the SW DB with the new TC changes * update the SW DB with the new TC changes
*/ */
static enum ice_status static int
ice_update_port_tc_tree_cfg(struct ice_port_info *pi, ice_update_port_tc_tree_cfg(struct ice_port_info *pi,
struct ice_aqc_port_ets_elem *buf) struct ice_aqc_port_ets_elem *buf)
{ {
struct ice_sched_node *node, *tc_node; struct ice_sched_node *node, *tc_node;
struct ice_aqc_txsched_elem_data elem; struct ice_aqc_txsched_elem_data elem;
enum ice_status status = 0;
u32 teid1, teid2; u32 teid1, teid2;
int status = 0;
u8 i, j; u8 i, j;
if (!pi) if (!pi)
return ICE_ERR_PARAM; return -EINVAL;
/* suspend the missing TC nodes */ /* suspend the missing TC nodes */
for (i = 0; i < pi->root->num_children; i++) { for (i = 0; i < pi->root->num_children; i++) {
teid1 = le32_to_cpu(pi->root->children[i]->info.node_teid); teid1 = le32_to_cpu(pi->root->children[i]->info.node_teid);
...@@ -1605,12 +1601,12 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi, ...@@ -1605,12 +1601,12 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi,
* query current port ETS configuration and update the * query current port ETS configuration and update the
* SW DB with the TC changes * SW DB with the TC changes
*/ */
enum ice_status int
ice_query_port_ets(struct ice_port_info *pi, ice_query_port_ets(struct ice_port_info *pi,
struct ice_aqc_port_ets_elem *buf, u16 buf_size, struct ice_aqc_port_ets_elem *buf, u16 buf_size,
struct ice_sq_cd *cd) struct ice_sq_cd *cd)
{ {
enum ice_status status; int status;
mutex_lock(&pi->sched_lock); mutex_lock(&pi->sched_lock);
status = ice_aq_query_port_ets(pi, buf, buf_size, cd); status = ice_aq_query_port_ets(pi, buf, buf_size, cd);
......
...@@ -138,28 +138,27 @@ struct ice_cee_app_prio { ...@@ -138,28 +138,27 @@ struct ice_cee_app_prio {
} __packed; } __packed;
int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd); int ice_aq_set_pfc_mode(struct ice_hw *hw, u8 pfc_mode, struct ice_sq_cd *cd);
enum ice_status int
ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype, ice_aq_get_dcb_cfg(struct ice_hw *hw, u8 mib_type, u8 bridgetype,
struct ice_dcbx_cfg *dcbcfg); struct ice_dcbx_cfg *dcbcfg);
enum ice_status ice_get_dcb_cfg(struct ice_port_info *pi); int ice_get_dcb_cfg(struct ice_port_info *pi);
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi); int ice_set_dcb_cfg(struct ice_port_info *pi);
enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change); int ice_init_dcb(struct ice_hw *hw, bool enable_mib_change);
enum ice_status int
ice_query_port_ets(struct ice_port_info *pi, ice_query_port_ets(struct ice_port_info *pi,
struct ice_aqc_port_ets_elem *buf, u16 buf_size, struct ice_aqc_port_ets_elem *buf, u16 buf_size,
struct ice_sq_cd *cmd_details); struct ice_sq_cd *cmd_details);
#ifdef CONFIG_DCB #ifdef CONFIG_DCB
enum ice_status int
ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist, ice_aq_stop_lldp(struct ice_hw *hw, bool shutdown_lldp_agent, bool persist,
struct ice_sq_cd *cd); struct ice_sq_cd *cd);
enum ice_status int ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd);
ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd); int
enum ice_status
ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent, ice_aq_start_stop_dcbx(struct ice_hw *hw, bool start_dcbx_agent,
bool *dcbx_agent_status, struct ice_sq_cd *cd); bool *dcbx_agent_status, struct ice_sq_cd *cd);
enum ice_status ice_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_mib); int ice_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_mib);
#else /* CONFIG_DCB */ #else /* CONFIG_DCB */
static inline enum ice_status static inline int
ice_aq_stop_lldp(struct ice_hw __always_unused *hw, ice_aq_stop_lldp(struct ice_hw __always_unused *hw,
bool __always_unused shutdown_lldp_agent, bool __always_unused shutdown_lldp_agent,
bool __always_unused persist, bool __always_unused persist,
...@@ -168,7 +167,7 @@ ice_aq_stop_lldp(struct ice_hw __always_unused *hw, ...@@ -168,7 +167,7 @@ ice_aq_stop_lldp(struct ice_hw __always_unused *hw,
return 0; return 0;
} }
static inline enum ice_status static inline int
ice_aq_start_lldp(struct ice_hw __always_unused *hw, ice_aq_start_lldp(struct ice_hw __always_unused *hw,
bool __always_unused persist, bool __always_unused persist,
struct ice_sq_cd __always_unused *cd) struct ice_sq_cd __always_unused *cd)
...@@ -176,7 +175,7 @@ ice_aq_start_lldp(struct ice_hw __always_unused *hw, ...@@ -176,7 +175,7 @@ ice_aq_start_lldp(struct ice_hw __always_unused *hw,
return 0; return 0;
} }
static inline enum ice_status static inline int
ice_aq_start_stop_dcbx(struct ice_hw __always_unused *hw, ice_aq_start_stop_dcbx(struct ice_hw __always_unused *hw,
bool __always_unused start_dcbx_agent, bool __always_unused start_dcbx_agent,
bool *dcbx_agent_status, bool *dcbx_agent_status,
...@@ -187,7 +186,7 @@ ice_aq_start_stop_dcbx(struct ice_hw __always_unused *hw, ...@@ -187,7 +186,7 @@ ice_aq_start_stop_dcbx(struct ice_hw __always_unused *hw,
return 0; return 0;
} }
static inline enum ice_status static inline int
ice_cfg_lldp_mib_change(struct ice_hw __always_unused *hw, ice_cfg_lldp_mib_change(struct ice_hw __always_unused *hw,
bool __always_unused ena_mib) bool __always_unused ena_mib)
{ {
......
...@@ -528,7 +528,7 @@ void ice_dcb_rebuild(struct ice_pf *pf) ...@@ -528,7 +528,7 @@ void ice_dcb_rebuild(struct ice_pf *pf)
struct ice_aqc_port_ets_elem buf = { 0 }; struct ice_aqc_port_ets_elem buf = { 0 };
struct device *dev = ice_pf_to_dev(pf); struct device *dev = ice_pf_to_dev(pf);
struct ice_dcbx_cfg *err_cfg; struct ice_dcbx_cfg *err_cfg;
enum ice_status ret; int ret;
ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
if (ret) { if (ret) {
......
...@@ -39,13 +39,13 @@ static void ice_info_get_dsn(struct ice_pf *pf, struct ice_info_ctx *ctx) ...@@ -39,13 +39,13 @@ static void ice_info_get_dsn(struct ice_pf *pf, struct ice_info_ctx *ctx)
static void ice_info_pba(struct ice_pf *pf, struct ice_info_ctx *ctx) static void ice_info_pba(struct ice_pf *pf, struct ice_info_ctx *ctx)
{ {
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
enum ice_status status; int status;
status = ice_read_pba_string(hw, (u8 *)ctx->buf, sizeof(ctx->buf)); status = ice_read_pba_string(hw, (u8 *)ctx->buf, sizeof(ctx->buf));
if (status) if (status)
/* We failed to locate the PBA, so just skip this entry */ /* We failed to locate the PBA, so just skip this entry */
dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string, status %s\n", dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string, status %d\n",
ice_stat_str(status)); status);
} }
static void ice_info_fw_mgmt(struct ice_pf *pf, struct ice_info_ctx *ctx) static void ice_info_fw_mgmt(struct ice_pf *pf, struct ice_info_ctx *ctx)
...@@ -251,7 +251,6 @@ static int ice_devlink_info_get(struct devlink *devlink, ...@@ -251,7 +251,6 @@ static int ice_devlink_info_get(struct devlink *devlink,
struct device *dev = ice_pf_to_dev(pf); struct device *dev = ice_pf_to_dev(pf);
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
struct ice_info_ctx *ctx; struct ice_info_ctx *ctx;
enum ice_status status;
size_t i; size_t i;
int err; int err;
...@@ -266,20 +265,19 @@ static int ice_devlink_info_get(struct devlink *devlink, ...@@ -266,20 +265,19 @@ static int ice_devlink_info_get(struct devlink *devlink,
return -ENOMEM; return -ENOMEM;
/* discover capabilities first */ /* discover capabilities first */
status = ice_discover_dev_caps(hw, &ctx->dev_caps); err = ice_discover_dev_caps(hw, &ctx->dev_caps);
if (status) { if (err) {
dev_dbg(dev, "Failed to discover device capabilities, status %s aq_err %s\n", dev_dbg(dev, "Failed to discover device capabilities, status %d aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities"); NL_SET_ERR_MSG_MOD(extack, "Unable to discover device capabilities");
err = -EIO;
goto out_free_ctx; goto out_free_ctx;
} }
if (ctx->dev_caps.common_cap.nvm_update_pending_orom) { if (ctx->dev_caps.common_cap.nvm_update_pending_orom) {
status = ice_get_inactive_orom_ver(hw, &ctx->pending_orom); err = ice_get_inactive_orom_ver(hw, &ctx->pending_orom);
if (status) { if (err) {
dev_dbg(dev, "Unable to read inactive Option ROM version data, status %s aq_err %s\n", dev_dbg(dev, "Unable to read inactive Option ROM version data, status %d aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
/* disable display of pending Option ROM */ /* disable display of pending Option ROM */
ctx->dev_caps.common_cap.nvm_update_pending_orom = false; ctx->dev_caps.common_cap.nvm_update_pending_orom = false;
...@@ -287,10 +285,10 @@ static int ice_devlink_info_get(struct devlink *devlink, ...@@ -287,10 +285,10 @@ static int ice_devlink_info_get(struct devlink *devlink,
} }
if (ctx->dev_caps.common_cap.nvm_update_pending_nvm) { if (ctx->dev_caps.common_cap.nvm_update_pending_nvm) {
status = ice_get_inactive_nvm_ver(hw, &ctx->pending_nvm); err = ice_get_inactive_nvm_ver(hw, &ctx->pending_nvm);
if (status) { if (err) {
dev_dbg(dev, "Unable to read inactive NVM version data, status %s aq_err %s\n", dev_dbg(dev, "Unable to read inactive NVM version data, status %d aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
/* disable display of pending Option ROM */ /* disable display of pending Option ROM */
ctx->dev_caps.common_cap.nvm_update_pending_nvm = false; ctx->dev_caps.common_cap.nvm_update_pending_nvm = false;
...@@ -298,10 +296,10 @@ static int ice_devlink_info_get(struct devlink *devlink, ...@@ -298,10 +296,10 @@ static int ice_devlink_info_get(struct devlink *devlink,
} }
if (ctx->dev_caps.common_cap.nvm_update_pending_netlist) { if (ctx->dev_caps.common_cap.nvm_update_pending_netlist) {
status = ice_get_inactive_netlist_ver(hw, &ctx->pending_netlist); err = ice_get_inactive_netlist_ver(hw, &ctx->pending_netlist);
if (status) { if (err) {
dev_dbg(dev, "Unable to read inactive Netlist version data, status %s aq_err %s\n", dev_dbg(dev, "Unable to read inactive Netlist version data, status %d aq_err %s\n",
ice_stat_str(status), ice_aq_str(hw->adminq.sq_last_status)); err, ice_aq_str(hw->adminq.sq_last_status));
/* disable display of pending Option ROM */ /* disable display of pending Option ROM */
ctx->dev_caps.common_cap.nvm_update_pending_netlist = false; ctx->dev_caps.common_cap.nvm_update_pending_netlist = false;
...@@ -762,9 +760,9 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink, ...@@ -762,9 +760,9 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
struct ice_pf *pf = devlink_priv(devlink); struct ice_pf *pf = devlink_priv(devlink);
struct device *dev = ice_pf_to_dev(pf); struct device *dev = ice_pf_to_dev(pf);
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
enum ice_status status;
void *nvm_data; void *nvm_data;
u32 nvm_size; u32 nvm_size;
int status;
nvm_size = hw->flash.flash_size; nvm_size = hw->flash.flash_size;
nvm_data = vzalloc(nvm_size); nvm_data = vzalloc(nvm_size);
...@@ -777,7 +775,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink, ...@@ -777,7 +775,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
status, hw->adminq.sq_last_status); status, hw->adminq.sq_last_status);
NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore"); NL_SET_ERR_MSG_MOD(extack, "Failed to acquire NVM semaphore");
vfree(nvm_data); vfree(nvm_data);
return -EIO; return status;
} }
status = ice_read_flat_nvm(hw, 0, &nvm_size, nvm_data, false); status = ice_read_flat_nvm(hw, 0, &nvm_size, nvm_data, false);
...@@ -787,7 +785,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink, ...@@ -787,7 +785,7 @@ static int ice_devlink_nvm_snapshot(struct devlink *devlink,
NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents"); NL_SET_ERR_MSG_MOD(extack, "Failed to read NVM contents");
ice_release_nvm(hw); ice_release_nvm(hw);
vfree(nvm_data); vfree(nvm_data);
return -EIO; return status;
} }
ice_release_nvm(hw); ice_release_nvm(hw);
...@@ -819,8 +817,8 @@ ice_devlink_devcaps_snapshot(struct devlink *devlink, ...@@ -819,8 +817,8 @@ ice_devlink_devcaps_snapshot(struct devlink *devlink,
struct ice_pf *pf = devlink_priv(devlink); struct ice_pf *pf = devlink_priv(devlink);
struct device *dev = ice_pf_to_dev(pf); struct device *dev = ice_pf_to_dev(pf);
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
enum ice_status status;
void *devcaps; void *devcaps;
int status;
devcaps = vzalloc(ICE_AQ_MAX_BUF_LEN); devcaps = vzalloc(ICE_AQ_MAX_BUF_LEN);
if (!devcaps) if (!devcaps)
...@@ -833,7 +831,7 @@ ice_devlink_devcaps_snapshot(struct devlink *devlink, ...@@ -833,7 +831,7 @@ ice_devlink_devcaps_snapshot(struct devlink *devlink,
status, hw->adminq.sq_last_status); status, hw->adminq.sq_last_status);
NL_SET_ERR_MSG_MOD(extack, "Failed to read device capabilities"); NL_SET_ERR_MSG_MOD(extack, "Failed to read device capabilities");
vfree(devcaps); vfree(devcaps);
return -EIO; return status;
} }
*data = (u8 *)devcaps; *data = (u8 *)devcaps;
......
...@@ -530,7 +530,6 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg, ...@@ -530,7 +530,6 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
struct ice_flow_prof *prof = NULL; struct ice_flow_prof *prof = NULL;
struct ice_fd_hw_prof *hw_prof; struct ice_fd_hw_prof *hw_prof;
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
enum ice_status status;
u64 entry1_h = 0; u64 entry1_h = 0;
u64 entry2_h = 0; u64 entry2_h = 0;
u64 prof_id; u64 prof_id;
...@@ -581,24 +580,20 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg, ...@@ -581,24 +580,20 @@ ice_fdir_set_hw_fltr_rule(struct ice_pf *pf, struct ice_flow_seg_info *seg,
* actions (NULL) and zero actions 0. * actions (NULL) and zero actions 0.
*/ */
prof_id = flow + tun * ICE_FLTR_PTYPE_MAX; prof_id = flow + tun * ICE_FLTR_PTYPE_MAX;
status = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id, seg, err = ice_flow_add_prof(hw, ICE_BLK_FD, ICE_FLOW_RX, prof_id, seg,
TNL_SEG_CNT(tun), &prof); TNL_SEG_CNT(tun), &prof);
if (status) if (err)
return ice_status_to_errno(status); return err;
status = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx, err = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
main_vsi->idx, ICE_FLOW_PRIO_NORMAL, main_vsi->idx, ICE_FLOW_PRIO_NORMAL,
seg, &entry1_h); seg, &entry1_h);
if (status) { if (err)
err = ice_status_to_errno(status);
goto err_prof; goto err_prof;
} err = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
status = ice_flow_add_entry(hw, ICE_BLK_FD, prof_id, main_vsi->idx,
ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL, ctrl_vsi->idx, ICE_FLOW_PRIO_NORMAL,
seg, &entry2_h); seg, &entry2_h);
if (status) { if (err)
err = ice_status_to_errno(status);
goto err_entry; goto err_entry;
}
hw_prof->fdir_seg[tun] = seg; hw_prof->fdir_seg[tun] = seg;
hw_prof->entry_h[0][tun] = entry1_h; hw_prof->entry_h[0][tun] = entry1_h;
...@@ -1190,7 +1185,6 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add, ...@@ -1190,7 +1185,6 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
struct ice_fltr_desc desc; struct ice_fltr_desc desc;
struct ice_vsi *ctrl_vsi; struct ice_vsi *ctrl_vsi;
enum ice_status status;
u8 *pkt, *frag_pkt; u8 *pkt, *frag_pkt;
bool has_frag; bool has_frag;
int err; int err;
...@@ -1209,11 +1203,9 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add, ...@@ -1209,11 +1203,9 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
} }
ice_fdir_get_prgm_desc(hw, input, &desc, add); ice_fdir_get_prgm_desc(hw, input, &desc, add);
status = ice_fdir_get_gen_prgm_pkt(hw, input, pkt, false, is_tun); err = ice_fdir_get_gen_prgm_pkt(hw, input, pkt, false, is_tun);
if (status) { if (err)
err = ice_status_to_errno(status);
goto err_free_all; goto err_free_all;
}
err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, pkt); err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, pkt);
if (err) if (err)
goto err_free_all; goto err_free_all;
...@@ -1223,12 +1215,10 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add, ...@@ -1223,12 +1215,10 @@ ice_fdir_write_fltr(struct ice_pf *pf, struct ice_fdir_fltr *input, bool add,
if (has_frag) { if (has_frag) {
/* does not return error */ /* does not return error */
ice_fdir_get_prgm_desc(hw, input, &desc, add); ice_fdir_get_prgm_desc(hw, input, &desc, add);
status = ice_fdir_get_gen_prgm_pkt(hw, input, frag_pkt, true, err = ice_fdir_get_gen_prgm_pkt(hw, input, frag_pkt, true,
is_tun); is_tun);
if (status) { if (err)
err = ice_status_to_errno(status);
goto err_frag; goto err_frag;
}
err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, frag_pkt); err = ice_prgm_fdir_fltr(ctrl_vsi, &desc, frag_pkt);
if (err) if (err)
goto err_frag; goto err_frag;
......
...@@ -712,7 +712,7 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, ...@@ -712,7 +712,7 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
* @cntr_id: returns counter index * @cntr_id: returns counter index
*/ */
enum ice_status ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id) int ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id)
{ {
return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK, return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK,
ICE_AQC_RES_TYPE_FLAG_DEDICATED, 1, cntr_id); ICE_AQC_RES_TYPE_FLAG_DEDICATED, 1, cntr_id);
...@@ -723,7 +723,7 @@ enum ice_status ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id) ...@@ -723,7 +723,7 @@ enum ice_status ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id)
* @hw: pointer to the hardware structure * @hw: pointer to the hardware structure
* @cntr_id: counter index to be freed * @cntr_id: counter index to be freed
*/ */
enum ice_status ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id) int ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id)
{ {
return ice_free_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK, return ice_free_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_COUNTER_BLOCK,
ICE_AQC_RES_TYPE_FLAG_DEDICATED, 1, cntr_id); ICE_AQC_RES_TYPE_FLAG_DEDICATED, 1, cntr_id);
...@@ -735,8 +735,7 @@ enum ice_status ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id) ...@@ -735,8 +735,7 @@ enum ice_status ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id)
* @cntr_id: returns counter index * @cntr_id: returns counter index
* @num_fltr: number of filter entries to be allocated * @num_fltr: number of filter entries to be allocated
*/ */
enum ice_status int ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)
ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)
{ {
return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES, return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_GUARANTEED_ENTRIES,
ICE_AQC_RES_TYPE_FLAG_DEDICATED, num_fltr, ICE_AQC_RES_TYPE_FLAG_DEDICATED, num_fltr,
...@@ -749,8 +748,7 @@ ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr) ...@@ -749,8 +748,7 @@ ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)
* @cntr_id: returns counter index * @cntr_id: returns counter index
* @num_fltr: number of filter entries to be allocated * @num_fltr: number of filter entries to be allocated
*/ */
enum ice_status int ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)
ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr)
{ {
return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES, return ice_alloc_res_cntr(hw, ICE_AQC_RES_TYPE_FDIR_SHARED_ENTRIES,
ICE_AQC_RES_TYPE_FLAG_DEDICATED, num_fltr, ICE_AQC_RES_TYPE_FLAG_DEDICATED, num_fltr,
...@@ -872,7 +870,7 @@ static void ice_pkt_insert_mac_addr(u8 *pkt, u8 *addr) ...@@ -872,7 +870,7 @@ static void ice_pkt_insert_mac_addr(u8 *pkt, u8 *addr)
* @frag: generate a fragment packet * @frag: generate a fragment packet
* @tun: true implies generate a tunnel packet * @tun: true implies generate a tunnel packet
*/ */
enum ice_status int
ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
u8 *pkt, bool frag, bool tun) u8 *pkt, bool frag, bool tun)
{ {
...@@ -919,15 +917,15 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ...@@ -919,15 +917,15 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
if (ice_fdir_pkt[idx].flow == flow) if (ice_fdir_pkt[idx].flow == flow)
break; break;
if (idx == ICE_FDIR_NUM_PKT) if (idx == ICE_FDIR_NUM_PKT)
return ICE_ERR_PARAM; return -EINVAL;
if (!tun) { if (!tun) {
memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len); memcpy(pkt, ice_fdir_pkt[idx].pkt, ice_fdir_pkt[idx].pkt_len);
loc = pkt; loc = pkt;
} else { } else {
if (!ice_get_open_tunnel_port(hw, &tnl_port, TNL_ALL)) if (!ice_get_open_tunnel_port(hw, &tnl_port, TNL_ALL))
return ICE_ERR_DOES_NOT_EXIST; return -ENOENT;
if (!ice_fdir_pkt[idx].tun_pkt) if (!ice_fdir_pkt[idx].tun_pkt)
return ICE_ERR_PARAM; return -EINVAL;
memcpy(pkt, ice_fdir_pkt[idx].tun_pkt, memcpy(pkt, ice_fdir_pkt[idx].tun_pkt,
ice_fdir_pkt[idx].tun_pkt_len); ice_fdir_pkt[idx].tun_pkt_len);
ice_pkt_insert_u16(pkt, ICE_IPV4_UDP_DST_PORT_OFFSET, ice_pkt_insert_u16(pkt, ICE_IPV4_UDP_DST_PORT_OFFSET,
...@@ -1111,7 +1109,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ...@@ -1111,7 +1109,7 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac); ice_pkt_insert_mac_addr(loc, input->ext_data.dst_mac);
break; break;
default: default:
return ICE_ERR_PARAM; return -EINVAL;
} }
if (input->flex_fltr) if (input->flex_fltr)
......
...@@ -201,16 +201,14 @@ struct ice_fdir_base_pkt { ...@@ -201,16 +201,14 @@ struct ice_fdir_base_pkt {
const u8 *tun_pkt; const u8 *tun_pkt;
}; };
enum ice_status ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id); int ice_alloc_fd_res_cntr(struct ice_hw *hw, u16 *cntr_id);
enum ice_status ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id); int ice_free_fd_res_cntr(struct ice_hw *hw, u16 cntr_id);
enum ice_status int ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr);
ice_alloc_fd_guar_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr); int ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr);
enum ice_status
ice_alloc_fd_shrd_item(struct ice_hw *hw, u16 *cntr_id, u16 num_fltr);
void void
ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
struct ice_fltr_desc *fdesc, bool add); struct ice_fltr_desc *fdesc, bool add);
enum ice_status int
ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
u8 *pkt, bool frag, bool tun); u8 *pkt, bool frag, bool tun);
int ice_get_fdir_cnt_all(struct ice_hw *hw); int ice_get_fdir_cnt_all(struct ice_hw *hw);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -203,6 +203,8 @@ void ...@@ -203,6 +203,8 @@ void
ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event); ice_vf_lan_overflow_event(struct ice_pf *pf, struct ice_rq_event_info *event);
void ice_print_vfs_mdd_events(struct ice_pf *pf); void ice_print_vfs_mdd_events(struct ice_pf *pf);
void ice_print_vf_rx_mdd_event(struct ice_vf *vf); void ice_print_vf_rx_mdd_event(struct ice_vf *vf);
bool
ice_vc_validate_pattern(struct ice_vf *vf, struct virtchnl_proto_hdrs *proto);
struct ice_vsi *ice_vf_ctrl_vsi_setup(struct ice_vf *vf); struct ice_vsi *ice_vf_ctrl_vsi_setup(struct ice_vf *vf);
int int
ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode, ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment