* [dpdk-dev] vring_init bug
@ 2015-09-09 3:00 Xie, Huawei
2015-09-09 3:18 ` Ouyang, Changchun
0 siblings, 1 reply; 3+ messages in thread
From: Xie, Huawei @ 2015-09-09 3:00 UTC (permalink / raw)
To: dev
static inline void
vring_init(struct vring *vr, unsigned int num, uint8_t *p,
unsigned long align)
{
vr->num = num;
vr->desc = (struct vring_desc *) p;
vr->avail = (struct vring_avail *) (p +
num * sizeof(struct vring_desc));
vr->used = (void *)
RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align);
}
There is a bug in vr->used calculation. 2 bytes of used_event_idx isn't
considered. Would submit a fix.
__u16 available[num];
__u16 used_event_idx;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] vring_init bug
2015-09-09 3:00 [dpdk-dev] vring_init bug Xie, Huawei
@ 2015-09-09 3:18 ` Ouyang, Changchun
2015-09-09 3:20 ` Xie, Huawei
0 siblings, 1 reply; 3+ messages in thread
From: Ouyang, Changchun @ 2015-09-09 3:18 UTC (permalink / raw)
To: Xie, Huawei, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xie, Huawei
> Sent: Wednesday, September 9, 2015 11:00 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] vring_init bug
>
> static inline void
> vring_init(struct vring *vr, unsigned int num, uint8_t *p,
> unsigned long align)
> {
> vr->num = num;
> vr->desc = (struct vring_desc *) p;
> vr->avail = (struct vring_avail *) (p +
> num * sizeof(struct vring_desc));
> vr->used = (void *)
> RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align); }
>
> There is a bug in vr->used calculation. 2 bytes of used_event_idx isn't
> considered. Would submit a fix.
> __u16 available[num];
> __u16 used_event_idx;
For vring_used ring, it also misses avail_event.
struct vring_used {
u16 flags ;
u16 idx ;
struct vring_used_elem r ing [qsz] ;
u16 avail_event ; // this one missed in dpdk
} ;
It doesn't affect the offset calculation, but it will be great if you can add it together.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] vring_init bug
2015-09-09 3:18 ` Ouyang, Changchun
@ 2015-09-09 3:20 ` Xie, Huawei
0 siblings, 0 replies; 3+ messages in thread
From: Xie, Huawei @ 2015-09-09 3:20 UTC (permalink / raw)
To: Ouyang, Changchun, dev
> -----Original Message-----
> From: Ouyang, Changchun
> Sent: Wednesday, September 09, 2015 11:18 AM
> To: Xie, Huawei; dev@dpdk.org
> Cc: Ouyang, Changchun
> Subject: RE: vring_init bug
>
>
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xie, Huawei
> > Sent: Wednesday, September 9, 2015 11:00 AM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] vring_init bug
> >
> > static inline void
> > vring_init(struct vring *vr, unsigned int num, uint8_t *p,
> > unsigned long align)
> > {
> > vr->num = num;
> > vr->desc = (struct vring_desc *) p;
> > vr->avail = (struct vring_avail *) (p +
> > num * sizeof(struct vring_desc));
> > vr->used = (void *)
> > RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align); }
> >
> > There is a bug in vr->used calculation. 2 bytes of used_event_idx isn't
> > considered. Would submit a fix.
> > __u16 available[num];
> > __u16 used_event_idx;
>
> For vring_used ring, it also misses avail_event.
>
> struct vring_used {
> u16 flags ;
> u16 idx ;
> struct vring_used_elem r ing [qsz] ;
> u16 avail_event ; // this one missed in dpdk
> } ;
>
> It doesn't affect the offset calculation, but it will be great if you can add it
> together.
No need to add this field for use vring and you couldn't because previous array is variable length.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-09 3:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-09 3:00 [dpdk-dev] vring_init bug Xie, Huawei
2015-09-09 3:18 ` Ouyang, Changchun
2015-09-09 3:20 ` Xie, Huawei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).