Skip to content

Commit 32dfef6

Browse files
intmcherbertx
authored andcommitted
crypto: qat - share adf_enable_pf2vf_comms() from adf_pf2vf_msg.c
The PFVF protocol "enable" functions are direction specific but not device specific. Move the protocol enable function for the PF into the PF specific protocol file for better file organization and duplicated code reduction. NOTE: the patch keeps gen4 disabled as it doesn't have full PFVF support yet. Signed-off-by: Marco Chiappero <[email protected]> Co-developed-by: Giovanni Cabiddu <[email protected]> Signed-off-by: Giovanni Cabiddu <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent aa3c686 commit 32dfef6

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static int adf_init_device(struct adf_accel_dev *accel_dev)
191191
return ret;
192192
}
193193

194-
static int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev)
194+
static int pfvf_comms_disabled(struct adf_accel_dev *accel_dev)
195195
{
196196
return 0;
197197
}
@@ -253,7 +253,7 @@ void adf_init_hw_data_4xxx(struct adf_hw_device_data *hw_data)
253253
hw_data->uof_get_ae_mask = uof_get_ae_mask;
254254
hw_data->set_msix_rttable = set_msix_default_rttable;
255255
hw_data->set_ssm_wdtimer = adf_gen4_set_ssm_wdtimer;
256-
hw_data->enable_pfvf_comms = adf_enable_pf2vf_comms;
256+
hw_data->enable_pfvf_comms = pfvf_comms_disabled;
257257
hw_data->disable_iov = adf_disable_sriov;
258258
hw_data->min_iov_compat_ver = ADF_PFVF_COMPAT_THIS_VERSION;
259259

drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@ static void adf_enable_ints(struct adf_accel_dev *accel_dev)
9191
ADF_C3XXX_SMIA1_MASK);
9292
}
9393

94-
static int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev)
95-
{
96-
spin_lock_init(&accel_dev->pf.vf2pf_ints_lock);
97-
98-
return 0;
99-
}
100-
10194
static void configure_iov_threads(struct adf_accel_dev *accel_dev, bool enable)
10295
{
10396
adf_gen2_cfg_iov_thds(accel_dev, enable,

drivers/crypto/qat/qat_c62x/adf_c62x_hw_data.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ static void adf_enable_ints(struct adf_accel_dev *accel_dev)
9393
ADF_C62X_SMIA1_MASK);
9494
}
9595

96-
static int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev)
97-
{
98-
spin_lock_init(&accel_dev->pf.vf2pf_ints_lock);
99-
100-
return 0;
101-
}
102-
10396
static void configure_iov_threads(struct adf_accel_dev *accel_dev, bool enable)
10497
{
10598
adf_gen2_cfg_iov_thds(accel_dev, enable,

drivers/crypto/qat/qat_common/adf_common_drv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ void adf_disable_vf2pf_interrupts_irq(struct adf_accel_dev *accel_dev,
196196
u32 vf_mask);
197197
void adf_enable_vf2pf_interrupts(struct adf_accel_dev *accel_dev,
198198
u32 vf_mask);
199+
int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev);
199200
void adf_enable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
200201
void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
201202
void adf_schedule_vf2pf_handler(struct adf_accel_vf_info *vf_info);
@@ -210,6 +211,11 @@ void adf_flush_vf_wq(struct adf_accel_dev *accel_dev);
210211
#else
211212
#define adf_sriov_configure NULL
212213

214+
static inline int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev)
215+
{
216+
return 0;
217+
}
218+
213219
static inline void adf_disable_sriov(struct adf_accel_dev *accel_dev)
214220
{
215221
}

drivers/crypto/qat/qat_common/adf_pf2vf_msg.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,21 @@ int adf_enable_vf2pf_comms(struct adf_accel_dev *accel_dev)
396396
return adf_vf2pf_request_version(accel_dev);
397397
}
398398
EXPORT_SYMBOL_GPL(adf_enable_vf2pf_comms);
399+
400+
/**
401+
* adf_enable_pf2vf_comms() - Function enables communication from pf to vf
402+
*
403+
* @accel_dev: Pointer to acceleration device virtual function.
404+
*
405+
* This function carries out the necessary steps to setup and start the PFVF
406+
* communication channel, if any.
407+
*
408+
* Return: 0 on success, error code otherwise.
409+
*/
410+
int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev)
411+
{
412+
spin_lock_init(&accel_dev->pf.vf2pf_ints_lock);
413+
414+
return 0;
415+
}
416+
EXPORT_SYMBOL_GPL(adf_enable_pf2vf_comms);

drivers/crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,6 @@ static void disable_vf2pf_interrupts(void __iomem *pmisc_addr, u32 vf_mask)
158158
}
159159
}
160160

161-
static int adf_enable_pf2vf_comms(struct adf_accel_dev *accel_dev)
162-
{
163-
spin_lock_init(&accel_dev->pf.vf2pf_ints_lock);
164-
165-
return 0;
166-
}
167-
168161
static void configure_iov_threads(struct adf_accel_dev *accel_dev, bool enable)
169162
{
170163
adf_gen2_cfg_iov_thds(accel_dev, enable,

0 commit comments

Comments
 (0)