Commit 5c74064f authored by Haiyang Zhang's avatar Haiyang Zhang Committed by Jakub Kicinski

net: mana: Rename mana_refill_rxoob and remove some empty lines

Rename mana_refill_rxoob for naming consistency.
And remove some empty lines between function call and error
checking.
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 8e8e47d9
...@@ -563,7 +563,6 @@ static int mana_pre_alloc_rxbufs(struct mana_port_context *mpc, int new_mtu) ...@@ -563,7 +563,6 @@ static int mana_pre_alloc_rxbufs(struct mana_port_context *mpc, int new_mtu)
da = dma_map_single(dev, va + mpc->rxbpre_headroom, da = dma_map_single(dev, va + mpc->rxbpre_headroom,
mpc->rxbpre_datasize, DMA_FROM_DEVICE); mpc->rxbpre_datasize, DMA_FROM_DEVICE);
if (dma_mapping_error(dev, da)) { if (dma_mapping_error(dev, da)) {
put_page(virt_to_head_page(va)); put_page(virt_to_head_page(va));
goto error; goto error;
...@@ -1515,7 +1514,6 @@ static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev, ...@@ -1515,7 +1514,6 @@ static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev,
*da = dma_map_single(dev, va + rxq->headroom, rxq->datasize, *da = dma_map_single(dev, va + rxq->headroom, rxq->datasize,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
if (dma_mapping_error(dev, *da)) { if (dma_mapping_error(dev, *da)) {
put_page(virt_to_head_page(va)); put_page(virt_to_head_page(va));
return NULL; return NULL;
...@@ -1525,14 +1523,13 @@ static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev, ...@@ -1525,14 +1523,13 @@ static void *mana_get_rxfrag(struct mana_rxq *rxq, struct device *dev,
} }
/* Allocate frag for rx buffer, and save the old buf */ /* Allocate frag for rx buffer, and save the old buf */
static void mana_refill_rxoob(struct device *dev, struct mana_rxq *rxq, static void mana_refill_rx_oob(struct device *dev, struct mana_rxq *rxq,
struct mana_recv_buf_oob *rxoob, void **old_buf) struct mana_recv_buf_oob *rxoob, void **old_buf)
{ {
dma_addr_t da; dma_addr_t da;
void *va; void *va;
va = mana_get_rxfrag(rxq, dev, &da, true); va = mana_get_rxfrag(rxq, dev, &da, true);
if (!va) if (!va)
return; return;
...@@ -1597,7 +1594,7 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq, ...@@ -1597,7 +1594,7 @@ static void mana_process_rx_cqe(struct mana_rxq *rxq, struct mana_cq *cq,
rxbuf_oob = &rxq->rx_oobs[curr]; rxbuf_oob = &rxq->rx_oobs[curr];
WARN_ON_ONCE(rxbuf_oob->wqe_inf.wqe_size_in_bu != 1); WARN_ON_ONCE(rxbuf_oob->wqe_inf.wqe_size_in_bu != 1);
mana_refill_rxoob(dev, rxq, rxbuf_oob, &old_buf); mana_refill_rx_oob(dev, rxq, rxbuf_oob, &old_buf);
/* Unsuccessful refill will have old_buf == NULL. /* Unsuccessful refill will have old_buf == NULL.
* In this case, mana_rx_skb() will drop the packet. * In this case, mana_rx_skb() will drop the packet.
......
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