mirror of
https://github.com/corundum/corundum.git
synced 2025-01-16 08:12:53 +08:00
Improve sanity checking and error reporting in event queue processing
This commit is contained in:
parent
a432a8f472
commit
c4d17b6a3c
@ -182,24 +182,41 @@ void mqnic_process_eq(struct net_device *ndev, struct mqnic_eq_ring *eq_ring)
|
|||||||
if (event->type == MQNIC_EVENT_TYPE_TX_CPL)
|
if (event->type == MQNIC_EVENT_TYPE_TX_CPL)
|
||||||
{
|
{
|
||||||
// transmit completion event
|
// transmit completion event
|
||||||
struct mqnic_cq_ring *cq_ring = priv->tx_cpl_ring[event->source];
|
if (unlikely(event->source > priv->tx_cpl_queue_count))
|
||||||
if (likely(cq_ring && cq_ring->handler))
|
|
||||||
{
|
{
|
||||||
cq_ring->handler(cq_ring);
|
dev_err(&priv->mdev->pdev->dev, "mqnic_process_eq on port %d: unknown event source %d (index %d, type %d)", priv->port, event->source, eq_index, event->type);
|
||||||
|
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 1, event, MQNIC_EVENT_SIZE, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct mqnic_cq_ring *cq_ring = priv->tx_cpl_ring[event->source];
|
||||||
|
if (likely(cq_ring && cq_ring->handler))
|
||||||
|
{
|
||||||
|
cq_ring->handler(cq_ring);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (event->type == MQNIC_EVENT_TYPE_RX_CPL)
|
else if (event->type == MQNIC_EVENT_TYPE_RX_CPL)
|
||||||
{
|
{
|
||||||
// receive completion event
|
// receive completion event
|
||||||
struct mqnic_cq_ring *cq_ring = priv->rx_cpl_ring[event->source];
|
if (unlikely(event->source > priv->rx_cpl_queue_count))
|
||||||
if (likely(cq_ring && cq_ring->handler))
|
|
||||||
{
|
{
|
||||||
cq_ring->handler(cq_ring);
|
dev_err(&priv->mdev->pdev->dev, "mqnic_process_eq on port %d: unknown event source %d (index %d, type %d)", priv->port, event->source, eq_index, event->type);
|
||||||
|
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 1, event, MQNIC_EVENT_SIZE, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
struct mqnic_cq_ring *cq_ring = priv->rx_cpl_ring[event->source];
|
||||||
|
if (likely(cq_ring && cq_ring->handler))
|
||||||
|
{
|
||||||
|
cq_ring->handler(cq_ring);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dev_warn(&priv->mdev->pdev->dev, "mqnic_process_eq on port %d: unknown event type %d (source %d)", priv->port, event->type, event->source);
|
dev_err(&priv->mdev->pdev->dev, "mqnic_process_eq on port %d: unknown event type %d (index %d, source %d)", priv->port, event->type, eq_index, event->source);
|
||||||
|
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 1, event, MQNIC_EVENT_SIZE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
done++;
|
done++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user