1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-30 08:32:52 +08:00

Rename ring_index to index

This commit is contained in:
Alex Forencich 2021-12-12 13:46:09 -08:00
parent 413238f81c
commit 0418fe33a6
6 changed files with 16 additions and 16 deletions

View File

@ -205,7 +205,7 @@ struct mqnic_ring {
struct device *dev;
struct net_device *ndev;
struct mqnic_priv *priv;
int ring_index;
int index;
int active;
u32 hw_ptr_mask;
@ -231,7 +231,7 @@ struct mqnic_cq_ring {
struct net_device *ndev;
struct mqnic_priv *priv;
struct napi_struct napi;
int ring_index;
int index;
int eq_index;
int active;
@ -259,7 +259,7 @@ struct mqnic_eq_ring {
struct device *dev;
struct net_device *ndev;
struct mqnic_priv *priv;
int ring_index;
int index;
struct mqnic_irq *irq;
int irq_index;
int active;

View File

@ -48,7 +48,7 @@ int mqnic_create_cq_ring(struct mqnic_priv *priv, struct mqnic_cq_ring **ring_pt
ring->ndev = priv->ndev;
ring->priv = priv;
ring->ring_index = index;
ring->index = index;
ring->active = 0;
ring->hw_addr = hw_addr;

View File

@ -58,7 +58,7 @@ int mqnic_create_eq_ring(struct mqnic_priv *priv, struct mqnic_eq_ring **ring_pt
ring->ndev = priv->ndev;
ring->priv = priv;
ring->ring_index = index;
ring->index = index;
ring->active = 0;
ring->irq_nb.notifier_call = mqnic_eq_int;

View File

@ -52,7 +52,7 @@ static int mqnic_start_port(struct net_device *ndev)
// set up RX completion queues
for (k = 0; k < priv->rx_cpl_queue_count; k++) {
mqnic_activate_cq_ring(priv->rx_cpl_ring[k],
priv->event_ring[k % priv->event_queue_count]->ring_index);
priv->event_ring[k % priv->event_queue_count]->index);
priv->rx_cpl_ring[k]->handler = mqnic_rx_irq;
netif_napi_add(ndev, &priv->rx_cpl_ring[k]->napi,
@ -70,13 +70,13 @@ static int mqnic_start_port(struct net_device *ndev)
else
priv->rx_ring[k]->page_order = ilog2((ndev->mtu + ETH_HLEN + PAGE_SIZE - 1) / PAGE_SIZE - 1) + 1;
mqnic_activate_rx_ring(priv->rx_ring[k],
priv->rx_cpl_ring[k % priv->rx_cpl_queue_count]->ring_index);
priv->rx_cpl_ring[k % priv->rx_cpl_queue_count]->index);
}
// set up TX completion queues
for (k = 0; k < priv->tx_cpl_queue_count; k++) {
mqnic_activate_cq_ring(priv->tx_cpl_ring[k],
priv->event_ring[k % priv->event_queue_count]->ring_index);
priv->event_ring[k % priv->event_queue_count]->index);
priv->tx_cpl_ring[k]->handler = mqnic_tx_irq;
netif_tx_napi_add(ndev, &priv->tx_cpl_ring[k]->napi,
@ -89,7 +89,7 @@ static int mqnic_start_port(struct net_device *ndev)
// set up TX queues
for (k = 0; k < priv->tx_queue_count; k++) {
mqnic_activate_tx_ring(priv->tx_ring[k],
priv->tx_cpl_ring[k % priv->tx_cpl_queue_count]->ring_index);
priv->tx_cpl_ring[k % priv->tx_cpl_queue_count]->index);
priv->tx_ring[k]->tx_queue = netdev_get_tx_queue(ndev, k);
}

View File

@ -48,7 +48,7 @@ int mqnic_create_rx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
ring->ndev = priv->ndev;
ring->priv = priv;
ring->ring_index = index;
ring->index = index;
ring->active = 0;
ring->hw_addr = hw_addr;
@ -302,7 +302,7 @@ int mqnic_process_rx_cq(struct mqnic_cq_ring *cq_ring, int napi_budget)
{
struct mqnic_priv *priv = cq_ring->priv;
struct net_device *ndev = priv->ndev;
struct mqnic_ring *rx_ring = priv->rx_ring[cq_ring->ring_index];
struct mqnic_ring *rx_ring = priv->rx_ring[cq_ring->index];
struct mqnic_rx_info *rx_info;
struct mqnic_cpl *cpl;
struct sk_buff *skb;
@ -335,7 +335,7 @@ int mqnic_process_rx_cq(struct mqnic_cq_ring *cq_ring, int napi_budget)
if (unlikely(!page)) {
dev_err(priv->dev, "%s: ring %d null page at index %d",
__func__, cq_ring->ring_index, ring_index);
__func__, cq_ring->index, ring_index);
print_hex_dump(KERN_ERR, "", DUMP_PREFIX_NONE, 16, 1,
cpl, MQNIC_CPL_SIZE, true);
break;
@ -344,7 +344,7 @@ int mqnic_process_rx_cq(struct mqnic_cq_ring *cq_ring, int napi_budget)
skb = napi_get_frags(&cq_ring->napi);
if (unlikely(!skb)) {
dev_err(priv->dev, "%s: ring %d failed to allocate skb",
__func__, cq_ring->ring_index);
__func__, cq_ring->index);
break;
}
@ -352,7 +352,7 @@ int mqnic_process_rx_cq(struct mqnic_cq_ring *cq_ring, int napi_budget)
if (priv->if_features & MQNIC_IF_FEATURE_PTP_TS)
skb_hwtstamps(skb)->hwtstamp = mqnic_read_cpl_ts(priv->mdev, rx_ring, cpl);
skb_record_rx_queue(skb, rx_ring->ring_index);
skb_record_rx_queue(skb, rx_ring->index);
// RX hardware checksum
if (ndev->features & NETIF_F_RXCSUM) {

View File

@ -49,7 +49,7 @@ int mqnic_create_tx_ring(struct mqnic_priv *priv, struct mqnic_ring **ring_ptr,
ring->ndev = priv->ndev;
ring->priv = priv;
ring->ring_index = index;
ring->index = index;
ring->active = 0;
ring->hw_addr = hw_addr;
@ -246,7 +246,7 @@ int mqnic_free_tx_buf(struct mqnic_ring *ring)
int mqnic_process_tx_cq(struct mqnic_cq_ring *cq_ring, int napi_budget)
{
struct mqnic_priv *priv = cq_ring->priv;
struct mqnic_ring *tx_ring = priv->tx_ring[cq_ring->ring_index];
struct mqnic_ring *tx_ring = priv->tx_ring[cq_ring->index];
struct mqnic_tx_info *tx_info;
struct mqnic_cpl *cpl;
struct skb_shared_hwtstamps hwts;