]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/dpdk/drivers/net/enic/base/vnic_intr.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2008-2017 Cisco Systems, Inc. All rights reserved.
3 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
9 void vnic_intr_free(struct vnic_intr
*intr
)
14 int vnic_intr_alloc(struct vnic_dev
*vdev
, struct vnic_intr
*intr
,
20 intr
->ctrl
= vnic_dev_get_res(vdev
, RES_TYPE_INTR_CTRL
, index
);
22 pr_err("Failed to hook INTR[%d].ctrl resource\n", index
);
29 void vnic_intr_init(struct vnic_intr
*intr
, uint32_t coalescing_timer
,
30 unsigned int coalescing_type
, unsigned int mask_on_assertion
)
32 vnic_intr_coalescing_timer_set(intr
, coalescing_timer
);
33 iowrite32(coalescing_type
, &intr
->ctrl
->coalescing_type
);
34 iowrite32(mask_on_assertion
, &intr
->ctrl
->mask_on_assertion
);
35 iowrite32(0, &intr
->ctrl
->int_credits
);
38 void vnic_intr_coalescing_timer_set(struct vnic_intr
*intr
,
39 uint32_t coalescing_timer
)
41 iowrite32(vnic_dev_intr_coal_timer_usec_to_hw(intr
->vdev
,
42 coalescing_timer
), &intr
->ctrl
->coalescing_timer
);
45 void vnic_intr_clean(struct vnic_intr
*intr
)
47 iowrite32(0, &intr
->ctrl
->int_credits
);