Commit 0f4e7f4e authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: count dma errors

Increment our dma-error counter in a couple of spots
that were missed before.
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 578c97b0
...@@ -609,6 +609,7 @@ static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb, ...@@ -609,6 +609,7 @@ static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb,
struct ionic_desc_info *desc_info) struct ionic_desc_info *desc_info)
{ {
struct ionic_buf_info *buf_info = desc_info->bufs; struct ionic_buf_info *buf_info = desc_info->bufs;
struct ionic_tx_stats *stats = q_to_tx_stats(q);
struct device *dev = q->dev; struct device *dev = q->dev;
dma_addr_t dma_addr; dma_addr_t dma_addr;
unsigned int nfrags; unsigned int nfrags;
...@@ -616,8 +617,10 @@ static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb, ...@@ -616,8 +617,10 @@ static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb,
int frag_idx; int frag_idx;
dma_addr = ionic_tx_map_single(q, skb->data, skb_headlen(skb)); dma_addr = ionic_tx_map_single(q, skb->data, skb_headlen(skb));
if (dma_mapping_error(dev, dma_addr)) if (dma_mapping_error(dev, dma_addr)) {
stats->dma_map_err++;
return -EIO; return -EIO;
}
buf_info->dma_addr = dma_addr; buf_info->dma_addr = dma_addr;
buf_info->len = skb_headlen(skb); buf_info->len = skb_headlen(skb);
buf_info++; buf_info++;
...@@ -626,8 +629,10 @@ static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb, ...@@ -626,8 +629,10 @@ static int ionic_tx_map_skb(struct ionic_queue *q, struct sk_buff *skb,
nfrags = skb_shinfo(skb)->nr_frags; nfrags = skb_shinfo(skb)->nr_frags;
for (frag_idx = 0; frag_idx < nfrags; frag_idx++, frag++) { for (frag_idx = 0; frag_idx < nfrags; frag_idx++, frag++) {
dma_addr = ionic_tx_map_frag(q, frag, 0, skb_frag_size(frag)); dma_addr = ionic_tx_map_frag(q, frag, 0, skb_frag_size(frag));
if (dma_mapping_error(dev, dma_addr)) if (dma_mapping_error(dev, dma_addr)) {
stats->dma_map_err++;
goto dma_fail; goto dma_fail;
}
buf_info->dma_addr = dma_addr; buf_info->dma_addr = dma_addr;
buf_info->len = skb_frag_size(frag); buf_info->len = skb_frag_size(frag);
buf_info++; buf_info++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment