Re: [ovs-dev] [PATCH] util: Use lookup table to optimize hexit_value().
Thanks for the patch, Ben. Looks good to me. Acked-by: Daniel Alvarez On Sat, Feb 3, 2018 at 12:16 AM, Ben Pfaff wrote: > Daniel Alvarez Sanchez reported a significant overall speedup in ovn-northd > due to a similar patch. > > Reported-by: Daniel Alvarez Sanchez > Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018- > February/046120.html > Signed-off-by: Ben Pfaff > --- > lib/util.c | 39 +-- > 1 file changed, 13 insertions(+), 26 deletions(-) > > diff --git a/lib/util.c b/lib/util.c > index a4d22df0c359..2e7765e41f03 100644 > --- a/lib/util.c > +++ b/lib/util.c > @@ -843,32 +843,19 @@ str_to_double(const char *s, double *d) > int > hexit_value(int c) > { > -switch (c) { > -case '0': case '1': case '2': case '3': case '4': > -case '5': case '6': case '7': case '8': case '9': > -return c - '0'; > - > -case 'a': case 'A': > -return 0xa; > - > -case 'b': case 'B': > -return 0xb; > - > -case 'c': case 'C': > -return 0xc; > - > -case 'd': case 'D': > -return 0xd; > - > -case 'e': case 'E': > -return 0xe; > - > -case 'f': case 'F': > -return 0xf; > - > -default: > -return -1; > -} > +static const signed char tbl[UCHAR_MAX + 1] = { > +#define TBL(x) \ > +( x >= '0' && x <= '9' ? x - '0' \ > + : x >= 'a' && x <= 'f' ? x - 'a' + 0xa \ > + : x >= 'A' && x <= 'F' ? x - 'A' + 0xa \ > + : -1) > +#define TBL0(x) TBL(x), TBL((x) + 1), TBL((x) + 2), TBL((x) + 3) > +#define TBL1(x) TBL0(x), TBL0((x) + 4), TBL0((x) + 8), TBL0((x) + 12) > +#define TBL2(x) TBL1(x), TBL1((x) + 16), TBL1((x) + 32), TBL1((x) + 48) > +TBL2(0), TBL2(64), TBL2(128), TBL2(192) > +}; > + > +return tbl[c]; > } > > /* Returns the integer value of the 'n' hexadecimal digits starting at > 's', or > -- > 2.15.1 > > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Re: [ovs-dev] [PATCH V2] ovn-controller: Reduce the number of flows by use conjunction action
On Sat, Feb 3, 2018 at 4:37 AM, Ben Pfaff wrote: > On Wed, Oct 18, 2017 at 10:39:12AM +0800, wei wrote: > > This patch convert ovn-sb lflow match expr "(1 or 2) and (3 or 4)" to > > match 1 aciton connjunction(1, 1/2) > > match 2 aciton connjunction(1, 1/2) > > match 3 aciton connjunction(1, 2/2) > > match 4 aciton connjunction(1, 2/2) > > match conj_id=1, action=XXX > > > > NOT support nested conjunction, only use conjunction action in situation > "or in level 0" > > Like (1 or 2) and (3 or ((4 or 5) and (6 or 7))), (4 or 5) and (6 or 7) > will not be converted conjunction action, > > We could call this situation as "or in level 1", in this situation (4 or > 5) and (6 or 7) will be crossproduct, > > so (1 or 2) and (3 or ((4 or 5) and (6 or 7))) -> (1 or 2) and (3 or (4 > and 6) or (4 and 7) or (5 and 6) or (5 and 7)) > > > > In openstack, security group rule will match remote security group and > tcp port, like > > match=(ip4.src == $as_ip4_6a8f4283_ba60_4d1c_9dec_28d027eadef2 && > tcp.dst >= 1 && tcp.dst <= 2)) > > > > Use this patch, the number of flows will be significantly reduced > > > > Signed-off-by: wei > > I'm awfully sorry that I took far too long to review this. Somehow I > missed it, even though it is a really important topic. > > This patch causes numerous test failures: > > 2316: ovn -- 4-term mixed expression normalizationFAILED (ovn.at:483) > 2321: ovn -- 4-term string expressions to flows FAILED (ovn.at:515) > 2320: ovn -- 4-term numeric expressions to flows FAILED (ovn.at:508) > 2314: ovn -- 4-term numeric expression normalization FAILED (ovn.at:471) > 2322: ovn -- 4-term mixed expressions to flowsFAILED (ovn.at:522) > 2315: ovn -- 4-term string expression normalization FAILED (ovn.at:477) > 2318: ovn -- 5-term string expression normalization FAILED (ovn.at:495) > 2319: ovn -- 5-term mixed expression normalizationFAILED (ovn.at:501) > 2324: ovn -- converting expressions to flows -- string fields FAILED ( > ovn.at:560) > 2317: ovn -- 5-term numeric expression normalization FAILED (ovn.at:489) > 2358: ovn -- ACL logging FAILED (ovn.at:5955) > > which all take the following form: > > # -*- compilation -*- > 2314. ovn.at:470: testing ovn -- 4-term numeric expression > normalization ... > ../../tests/ovn.at:471: ovstest test-ovn exhaustive > --operation=normalize --nvars=3 --svars=0 --bits=1 4 > --- /dev/null 2017-07-26 15:46:07.674034656 -0700 > +++ /home/blp/nicira/ovs/_build/tests/testsuite.dir/at-groups/2314/stderr > 2018-02-02 15:05:06.998858676 -0800 > @@ -0,0 +1,2 @@ > +test-ovn: ../tests/test-ovn.c:874: assertion > expr_is_normalized(modified) failed in test_tree_shape_exhaustively() > > +/home/blp/nicira/ovs/_build/tests/testsuite.dir/at-groups/2314/test-source: > line 27: 18216 Aborted (core dumped) ovstest test-ovn > exhaustive --operation=normalize --nvars=3 --svars=0 --bits=1 4 > --- - 2018-02-02 15:05:07.018262584 -0800 > +++ /home/blp/nicira/ovs/_build/tests/testsuite.dir/at-groups/2314/stdout > 2018-02-02 15:05:07.002858553 -0800 > @@ -1,2 +1 @@ > -Tested normalizing 1874026 expressions of 4 terminals with 3 numeric > vars (each 1 bits) in terms of operators == != < <= > >=. > > ../../tests/ovn.at:471: exit code was 134, expected 0 > 2314. ovn.at:470: 2314. ovn -- 4-term numeric expression > normalization (ovn.at:470): FAILED (ovn.at:471) > > There is another patch that purports to improve the same thing: > https://patchwork.ozlabs.org/patch/868639/ > I'm going to look at that one soon, too. > Oops. I missed this patch completely. Else I would have tried this first before working myself on this feature. Thanks Numan > ___ > dev mailing list > d...@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev
[ovs-dev] Reminder: CFP closes Feb 5th 2018- DPDK Summit : Bangalore March 9th
Subject: [dpdk-dev] [dpdk-announce] Reminder: CFP closes Feb 5th 2018 DPDK Summit - Bangalore March 9th Submit a proposal to speak at DPDK Summit Bangalore 2018 [1] March 9th | Leela Palace, Bangalore, India The agenda will cover the latest developments to the DPDK framework and other related projects such as FD.io, including plans for future releases, and will provide an opportunity to hear from DPDK users who have used the framework in their applications. Let's discuss the present and future, including DPDK roadmap suggestions, container networking, P4, hardware accelerators and any other networking innovation. Submissions must be received by 11:59pm on IST 5th February 2018 CFP Close: Feb 5th, 2018 CFP Notifications: Feb 13th, 2018 Schedule Announced: Week of Feb 13th , 2018 Slide Due Date: Feb 27th , 2018 Event Dates: Mar 9th , 2018 2018 Suggested Presentation Topics: Suggested DPDK Topics: * Enhancements to the DPDK Framework, including performance improvements, new APIs/libraries etc. * Usability improvements to make DPDK easier to use. * Packaging of DPDK to make it easier to consume * Expansion of DPDK to support new use cases for example storage. * Virtualization and container networking. * DPDK-accelerated open source projects such as Open vSwitch, FD.io etc. * New networking technologies such as P4, and their applicability to DPDK. *Application to Wireless technologies such as but not limited to 4G/5G base station, Packet core, MEC. * Use of DPDK in Network Slicing, Deep Packet Inspection, Traffic Engineering, Service Assurance etc Reminder: This is a community conference - so let's try to avoid blatant product and/or vendor sales pitches. Question on submitting a proposal? Contact us at eve...@dpdk.org [1] https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.google.com%2Fforms%2Fd%2Fe%2F1FAIpQLSfPuJBk4Pj59yRNwlsra56DVaxkriqM0MD_Ownbdf05I_Zd9A%2Fviewform&data=02%7C01%7Chemant.agrawal%40nxp.com%7Ca32f943da3c1407c8aed08d56aefb5c0%7Cbd8a2a2207224ec7b35f1c4f0497e341%7C0%7C0%7C636532500165376304&sdata=k2mmO5ypc4YhMKtGCWiN1R%2BhueMvOp6%2FitH4HN%2FDoJk%3D&reserved=0 Sujata Tibrewala @sujatatibre Community Development Manager Intel Developer Zone https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsoftware.intel.com%2Fnetworking&data=02%7C01%7Chemant.agrawal%40nxp.com%7Ca32f943da3c1407c8aed08d56aefb5c0%7Cbd8a2a2207224ec7b35f1c4f0497e341%7C0%7C0%7C636532500165376304&sdata=zLFhbTPwqn9Qca8yUO2ipwXv4VX3D99Al5KAg5mB6e4%3D&reserved=0 NPG Marketing Training PM (DOT) ___ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev