Re: [dpdk-dev] [PATCH] vhost: try to shrink pfdset when fdset_add fails

2017-02-22 Thread Yuanhan Liu
On Wed, Feb 22, 2017 at 11:01:43AM +0100, Matthias Gatto wrote: > On Wed, Feb 22, 2017 at 2:59 AM, Yuanhan Liu > wrote: > > > > On Tue, Feb 21, 2017 at 03:25:30PM +0100, Matthias Gatto wrote: > > > fdset_add increment pfdset->num, but fdset_del doesn't decrement > > > pfdset->num, > > > so if we

Re: [dpdk-dev] [PATCH] vhost: try to shrink pfdset when fdset_add fails

2017-02-22 Thread Matthias Gatto
On Wed, Feb 22, 2017 at 2:59 AM, Yuanhan Liu wrote: > > On Tue, Feb 21, 2017 at 03:25:30PM +0100, Matthias Gatto wrote: > > fdset_add increment pfdset->num, but fdset_del doesn't decrement > > pfdset->num, > > so if we call fdset_add then fdset_del in a loop witout calling > > fdset_shrink, we ca

Re: [dpdk-dev] [PATCH] vhost: try to shrink pfdset when fdset_add fails

2017-02-21 Thread Yuanhan Liu
On Tue, Feb 21, 2017 at 03:25:30PM +0100, Matthias Gatto wrote: > fdset_add increment pfdset->num, but fdset_del doesn't decrement pfdset->num, > so if we call fdset_add then fdset_del in a loop witout calling > fdset_shrink, we can easily exceed MAX_FDS with only a few number of fds > used. I'm a

[dpdk-dev] [PATCH] vhost: try to shrink pfdset when fdset_add fails

2017-02-21 Thread Matthias Gatto
fdset_add increment pfdset->num, but fdset_del doesn't decrement pfdset->num, so if we call fdset_add then fdset_del in a loop witout calling fdset_shrink, we can easily exceed MAX_FDS with only a few number of fds used. So my solution is simply to call fdset_shrink in fdset_add when it exceed MAX