* @rx_buf_sz: receive buffer size
* @return
* hw rx buffer size
- **/
+ */
static u16 get_hw_rx_buf_size(u32 rx_buf_sz)
{
u16 num_hw_types = sizeof(hinic_hw_rx_buf_size)
* @sq_depth: the depth of transmit queue
* @rx_buf_sz: receive buffer size from app
* Return: 0 on success, negative error value otherwise.
- **/
+ */
static int
hinic_set_root_ctxt(void *hwdev, u16 rq_depth, u16 sq_depth, int rx_buf_sz)
{
* @return
* 0 on success,
* negative error value otherwise.
- **/
+ */
static int hinic_clean_root_ctxt(void *hwdev)
{
struct hinic_root_ctxt root_ctxt;
goto err_init_nic_hwdev;
}
+ err = hinic_vf_func_init(hwdev);
+ if (err) {
+ PMD_DRV_LOG(ERR, "Failed to init nic mbox");
+ goto err_init_nic_hwdev;
+ }
+
err = hinic_set_fast_recycle_mode(hwdev, RECYCLE_MODE_DPDK);
if (err) {
PMD_DRV_LOG(ERR, "Failed to set fast recycle mode");
static void hinic_free_nic_hwdev(struct hinic_hwdev *hwdev)
{
+ hinic_vf_func_free(hwdev);
hwdev->nic_io = NULL;
}
static int hinic_alloc_nicio(struct hinic_hwdev *hwdev)
{
- int err;
- u16 max_qps, num_qp;
struct hinic_nic_io *nic_io = hwdev->nic_io;
+ struct rte_pci_device *pdev = hwdev->pcidev_hdl;
+ u16 max_qps, num_qp;
+ int err;
max_qps = hinic_func_max_qnum(hwdev);
if ((max_qps & (max_qps - 1))) {
goto alloc_qps_err;
}
- nic_io->ci_vaddr_base =
- dma_zalloc_coherent(hwdev,
+ nic_io->ci_vaddr_base = dma_zalloc_coherent(hwdev,
CI_TABLE_SIZE(num_qp, HINIC_PAGE_SIZE),
- &nic_io->ci_dma_base, GFP_KERNEL);
+ &nic_io->ci_dma_base,
+ pdev->device.numa_node);
if (!nic_io->ci_vaddr_base) {
PMD_DRV_LOG(ERR, "Failed to allocate ci area");
err = -ENOMEM;
* @return
* 0 on success,
* negative error value otherwise.
- **/
+ */
int hinic_convert_rx_buf_size(u32 rx_buf_sz, u32 *match_sz)
{
u32 i, num_hw_types, best_match_sz;