Message ID | 1453930264-111017-3-git-send-email-azhou@ovn.org |
---|---|
State | Accepted |
Headers | show |
For the series: Acked-by: Daniele Di Proietto <diproiettod@vmware.com> I didn't observe any performance regressions. Thanks! On 27/01/2016 13:31, "Andy Zhou" <azhou@ovn.org> wrote: >Code clean up to reduce code duplication. > >Signed-off-by: Andy Zhou <azhou@ovn.org> >--- > lib/dpif-netdev.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c >index a7e15aa..8d72e27 100644 >--- a/lib/dpif-netdev.c >+++ b/lib/dpif-netdev.c >@@ -3178,13 +3178,11 @@ dp_netdev_queue_batches(struct dp_packet *pkt, > { > struct packet_batch *batch = flow->batch; > >- if (OVS_LIKELY(batch)) { >- packet_batch_update(batch, pkt, mf); >- return; >+ if (OVS_UNLIKELY(!batch)) { >+ batch = &batches[(*n_batches)++]; >+ packet_batch_init(batch, flow); > } > >- batch = &batches[(*n_batches)++]; >- packet_batch_init(batch, flow); > packet_batch_update(batch, pkt, mf); > } > >-- >1.9.1 > >_______________________________________________ >dev mailing list >dev@openvswitch.org >http://openvswitch.org/mailman/listinfo/dev
On Wed, Jan 27, 2016 at 5:01 PM, Daniele Di Proietto <diproiettod@vmware.com > wrote: > For the series: > > Acked-by: Daniele Di Proietto <diproiettod@vmware.com> > > I didn't observe any performance regressions. > > Thanks! > Thanks for the review and testing. Pushed to master.
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a7e15aa..8d72e27 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -3178,13 +3178,11 @@ dp_netdev_queue_batches(struct dp_packet *pkt, { struct packet_batch *batch = flow->batch; - if (OVS_LIKELY(batch)) { - packet_batch_update(batch, pkt, mf); - return; + if (OVS_UNLIKELY(!batch)) { + batch = &batches[(*n_batches)++]; + packet_batch_init(batch, flow); } - batch = &batches[(*n_batches)++]; - packet_batch_init(batch, flow); packet_batch_update(batch, pkt, mf); }
Code clean up to reduce code duplication. Signed-off-by: Andy Zhou <azhou@ovn.org> --- lib/dpif-netdev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)