[dpdk-dev] net/virtio: fix coding style
Checks
Commit Message
Make the code more readable. No functional change.
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
drivers/net/virtio/virtio_rxtx.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On 7/17/2017 7:35 AM, Tiwei Bie wrote:
> Make the code more readable. No functional change.
>
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Applied to dpdk-next-net/master, thanks.
On 7/18/2017 12:04 PM, Ferruh Yigit wrote:
> On 7/17/2017 7:35 AM, Tiwei Bie wrote:
>> Make the code more readable. No functional change.
>>
>> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>
> Applied to dpdk-next-net/master, thanks.
And indeed this should go in via next-virtio, I confused it.
Yuanhan,
Please let me know if you want me drop this from next-net.
Thanks,
ferruh
On Tue, Jul 18, 2017 at 01:29:48PM +0100, Ferruh Yigit wrote:
> On 7/18/2017 12:04 PM, Ferruh Yigit wrote:
> > On 7/17/2017 7:35 AM, Tiwei Bie wrote:
> >> Make the code more readable. No functional change.
> >>
> >> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> >
> > Applied to dpdk-next-net/master, thanks.
>
> And indeed this should go in via next-virtio, I confused it.
>
> Yuanhan,
>
> Please let me know if you want me drop this from next-net.
Nope, it's okay.
--yliu
@@ -744,8 +744,9 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
virtio_rmb();
- num = (uint16_t)(likely(nb_used <= nb_pkts) ? nb_used : nb_pkts);
- num = (uint16_t)(likely(num <= VIRTIO_MBUF_BURST_SZ) ? num : VIRTIO_MBUF_BURST_SZ);
+ num = likely(nb_used <= nb_pkts) ? nb_used : nb_pkts;
+ if (unlikely(num > VIRTIO_MBUF_BURST_SZ))
+ num = VIRTIO_MBUF_BURST_SZ;
if (likely(num > DESC_PER_CACHELINE))
num = num - ((vq->vq_used_cons_idx + num) % DESC_PER_CACHELINE);