IB: Add CQ comp_vector support
Add a num_comp_vectors member to struct ib_device and extend ib_create_cq() to pass in a comp_vector parameter -- this parallels the userspace libibverbs API. Update all hardware drivers to set num_comp_vectors to 1 and have all ULPs pass 0 for the comp_vector value. Pass the value of num_comp_vectors to userspace rather than hard-coding a value of 1. We want multiple CQ event vector support (via MSI-X or similar for adapters that can generate multiple interrupts), but it's not clear how many vectors we want, or how we want to deal with policy issues such as how to decide which vector to use or how to set up interrupt affinity. This patch is useful for experimenting, since no core changes will be necessary when updating a driver to support multiple vectors, and we know that we want to make at least these changes anyway. Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
committed by
Roland Dreier
parent
154257f362
commit
f4fd0b224d
@@ -793,7 +793,7 @@ static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
|
||||
}
|
||||
|
||||
p->cq = ib_create_cq(priv->ca, ipoib_cm_tx_completion, NULL, p,
|
||||
ipoib_sendq_size + 1);
|
||||
ipoib_sendq_size + 1, 0);
|
||||
if (IS_ERR(p->cq)) {
|
||||
ret = PTR_ERR(p->cq);
|
||||
ipoib_warn(priv, "failed to allocate tx cq: %d\n", ret);
|
||||
|
@@ -187,7 +187,7 @@ int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca)
|
||||
if (!ret)
|
||||
size += ipoib_recvq_size;
|
||||
|
||||
priv->cq = ib_create_cq(priv->ca, ipoib_ib_completion, NULL, dev, size);
|
||||
priv->cq = ib_create_cq(priv->ca, ipoib_ib_completion, NULL, dev, size, 0);
|
||||
if (IS_ERR(priv->cq)) {
|
||||
printk(KERN_WARNING "%s: failed to create CQ\n", ca->name);
|
||||
goto out_free_mr;
|
||||
|
@@ -76,7 +76,7 @@ static int iser_create_device_ib_res(struct iser_device *device)
|
||||
iser_cq_callback,
|
||||
iser_cq_event_callback,
|
||||
(void *)device,
|
||||
ISER_MAX_CQ_LEN);
|
||||
ISER_MAX_CQ_LEN, 0);
|
||||
if (IS_ERR(device->cq))
|
||||
goto cq_err;
|
||||
|
||||
|
@@ -197,7 +197,7 @@ static int srp_create_target_ib(struct srp_target_port *target)
|
||||
return -ENOMEM;
|
||||
|
||||
target->cq = ib_create_cq(target->srp_host->dev->dev, srp_completion,
|
||||
NULL, target, SRP_CQ_SIZE);
|
||||
NULL, target, SRP_CQ_SIZE, 0);
|
||||
if (IS_ERR(target->cq)) {
|
||||
ret = PTR_ERR(target->cq);
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user