ice: finish virtchnl.c split into queues.c

Move queue configuration functions out of virtchnl.c to queues.c.

Technically the move was started by an earlier commit of the series,
that was duplicating virtchnl.c as queues.c (what forces git to nicely
show blame when asked), followed by a couple of cleanup commits (that
removed stuff that is not moved from the new file, again - multiple
commits, to avoid git saving on changes lines by reusing removed lines
as a content of some kept function), with this final commit actually
enabling compilation of the new file, removing stuff from the virtchnl.c,
and making some moved functions visible (via static keyword removal).

Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
Przemek Kitszel 2025-08-21 13:18:41 +02:00
parent cfee454ca1
commit c762b0a537
4 changed files with 31 additions and 973 deletions

View File

@ -49,6 +49,7 @@ ice-$(CONFIG_PCI_IOV) += \
ice_sriov.o \
virt/allowlist.o \
virt/fdir.o \
virt/queues.o \
virt/virtchnl.o \
ice_vf_mbx.o \
ice_vf_vsi_vlan_ops.o \

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2022, Intel Corporation. */
#include "virtchnl.h"
#include "queues.h"
#include "ice_vf_lib_private.h"
#include "ice.h"
#include "ice_base.h"
@ -16,7 +17,7 @@
* it's in a port VLAN so the PF needs to account for this in max frame size
* checks and sending the max frame size to the VF.
*/
static u16 ice_vc_get_max_frame_size(struct ice_vf *vf)
u16 ice_vc_get_max_frame_size(struct ice_vf *vf)
{
struct ice_port_info *pi = ice_vf_get_port_info(vf);
u16 max_frame_size;
@ -230,7 +231,7 @@ void ice_vf_ena_rxq_interrupt(struct ice_vsi *vsi, u32 q_idx)
*
* called from the VF to enable all or specific queue(s)
*/
static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg)
int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg)
{
enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
struct virtchnl_queue_select *vqs =
@ -357,7 +358,7 @@ int ice_vf_vsi_dis_single_txq(struct ice_vf *vf, struct ice_vsi *vsi, u16 q_id)
*
* called from the VF to disable all or specific queue(s)
*/
static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)
int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)
{
enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
struct virtchnl_queue_select *vqs =
@ -509,7 +510,7 @@ ice_cfg_interrupt(struct ice_vf *vf, struct ice_vsi *vsi,
*
* called from the VF to configure the IRQ to queue map
*/
static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
{
enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
u16 num_q_vectors_mapped, vsi_id, vector_id;
@ -589,7 +590,7 @@ static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)
*
* Return: 0 on success or negative error value.
*/
static int ice_vc_cfg_q_bw(struct ice_vf *vf, u8 *msg)
int ice_vc_cfg_q_bw(struct ice_vf *vf, u8 *msg)
{
enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
struct virtchnl_queues_bw_cfg *qbw =
@ -673,7 +674,7 @@ static int ice_vc_cfg_q_bw(struct ice_vf *vf, u8 *msg)
*
* Return: 0 on success or negative error value.
*/
static int ice_vc_cfg_q_quanta(struct ice_vf *vf, u8 *msg)
int ice_vc_cfg_q_quanta(struct ice_vf *vf, u8 *msg)
{
u16 quanta_prof_id, quanta_size, start_qid, num_queues, end_qid, i;
enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
@ -745,7 +746,7 @@ static int ice_vc_cfg_q_quanta(struct ice_vf *vf, u8 *msg)
*
* called from the VF to configure the Rx/Tx queues
*/
static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
{
struct virtchnl_vsi_queue_config_info *qci =
(struct virtchnl_vsi_queue_config_info *)msg;
@ -922,7 +923,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
* return 0. If unsuccessful, PF will send message informing VF of number of
* available queue pairs via virtchnl message response to VF.
*/
static int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg)
int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg)
{
enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
struct virtchnl_vf_res_request *vfres =

View File

@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2022, Intel Corporation. */
#ifndef _ICE_VIRT_QUEUES_H_
#define _ICE_VIRT_QUEUES_H_
#include <linux/types.h>
struct ice_vf;
u16 ice_vc_get_max_frame_size(struct ice_vf *vf);
int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg);
int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg);
int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg);
int ice_vc_cfg_q_bw(struct ice_vf *vf, u8 *msg);
int ice_vc_cfg_q_quanta(struct ice_vf *vf, u8 *msg);
int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg);
int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg);
#endif /* _ICE_VIRT_QUEUES_H_ */

File diff suppressed because it is too large Load Diff