提交 d30721d4 编写于 作者: Q Qianqian Xie 提交者: David S. Miller

net: hns: modify buffer format of cpu data to le64

Hardware ring buffer data is stored in Little-endian. Thus cpu data
should be modified to Little-endian.
Signed-off-by: NQianqian Xie <xieqianqian@huawei.com>
Reviewed-by: NYisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 20b3385a
......@@ -590,7 +590,7 @@ static inline int hnae_alloc_buffer_attach(struct hnae_ring *ring, int i)
if (ret)
return ret;
ring->desc[i].addr = (__le64)ring->desc_cb[i].dma;
ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma);
return 0;
}
......@@ -621,14 +621,14 @@ static inline void hnae_replace_buffer(struct hnae_ring *ring, int i,
bops->unmap_buffer(ring, &ring->desc_cb[i]);
ring->desc_cb[i] = *res_cb;
ring->desc[i].addr = (__le64)ring->desc_cb[i].dma;
ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma);
ring->desc[i].rx.ipoff_bnum_pid_flag = 0;
}
static inline void hnae_reuse_buffer(struct hnae_ring *ring, int i)
{
ring->desc_cb[i].reuse_flag = 0;
ring->desc[i].addr = (__le64)(ring->desc_cb[i].dma
ring->desc[i].addr = cpu_to_le64(ring->desc_cb[i].dma
+ ring->desc_cb[i].page_offset);
ring->desc[i].rx.ipoff_bnum_pid_flag = 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册