Hi Kai Ma, the file utilities/ovs-ofctl.c contains the code to manage add-flow and all other similar ovs-ofctl commands.
struct ovs_cmdl_command all_commands[] lists the implemented commands { "show", "switch", ... { "dump-flows", "switch", ... ... with some info on the syntax + the function that executes the command itself. For add-flow { "add-flow", "switch flow", 2, 2, ofctl_add_flow }, So ofctl_add_flow() is a starting point to have a look at. Basically the arguments are parsed by parse_ofp_flow_mod_str() and the request is formatted into a list. transact_multiple_noreply() calls functions into lib/vconn.c up to vconn_send_block(). Hope that helps, Antonio > -----Original Message----- > From: discuss [mailto:discuss-boun...@openvswitch.org] On Behalf Of > Kai Ma (kaima) > Sent: Friday, June 3, 2016 9:25 AM > To: discuss@openvswitch.org > Subject: [ovs-discuss] which API handle add-flow finally to configure > ASIC > > Dear all, > > I want to porting OVS to ASIC basd switch, > When configure flow to OVS, I found ovs-ofctl and controller will > configure ovs in different channel. > > I am wondering which c file and which API handle add-flow finally to > configure ASIC? > Please advise, thanks > > Regards > Kai Ma > > On 6/3/16, 4:16 PM, "discuss on behalf of discuss- > requ...@openvswitch.org" > <discuss-boun...@openvswitch.org on behalf of > discuss-requ...@openvswitch.org> wrote: > > >Send discuss mailing list submissions to > > discuss@openvswitch.org > > > >To subscribe or unsubscribe via the World Wide Web, visit > > http://openvswitch.org/mailman/listinfo/discuss > >or, via email, send a message with subject or body 'help' to > > discuss-requ...@openvswitch.org > > > >You can reach the person managing the list at > > discuss-ow...@openvswitch.org > > > >When replying, please edit your Subject line so it is more specific > >than "Re: Contents of discuss digest..." > > > > > >Today's Topics: > > > > 1. Re: Packet-in event (Fischetti, Antonio) > > > > > >-------------------------------------------------------------------- > -- > > > >Message: 1 > >Date: Fri, 3 Jun 2016 08:16:05 +0000 > >From: "Fischetti, Antonio" <antonio.fische...@intel.com> > >To: Adonis Congaro <5667gar...@gmail.com>, "discuss@openvswitch.org" > > <discuss@openvswitch.org> > >Subject: Re: [ovs-discuss] Packet-in event > >Message-ID: > > > <bcfd2bb875535045a5368d9adbf2969909d22...@irsmsx101.ger.corp.in > tel.com> > > > >Content-Type: text/plain; charset="utf-8" > > > >Referring to OVS in userspace, the function > dp_netdev_process_rxq_port() > >calls > >netdev_rxq_recv() > >which, depending on the type of interface, will call the specific > >function, > >eg > >for a dpdk IF it will call dp_netdev_process_rxq_port() > >for an internal interface it calls netdev_linux_rxq_recv(). > >Then > >dp_netdev_input() > >will process the received packet: decode, match against emc,Š > > > >Antonio > > > >From: discuss [mailto:discuss-boun...@openvswitch.org] On Behalf Of > >Adonis Congaro > >Sent: Tuesday, May 31, 2016 11:13 AM > >To: discuss@openvswitch.org > >Subject: [ovs-discuss] Packet-in event > > > >Hi > > > >I'm trying to understand the caching system in ovs, and I'm > wondering > >where is the function that handle first packet-in event in the > source > >code? > > > >Many thanks > >Ado > >-------------- next part -------------- > >An HTML attachment was scrubbed... > >URL: > ><http://openvswitch.org/pipermail/discuss/attachments/20160603/fcb95 > c9e/at > >tachment.html> > > > >------------------------------ > > > >Subject: Digest Footer > > > >_______________________________________________ > >discuss mailing list > >discuss@openvswitch.org > >http://openvswitch.org/mailman/listinfo/discuss > > > > > >------------------------------ > > > >End of discuss Digest, Vol 84, Issue 11 > >*************************************** > > _______________________________________________ > discuss mailing list > discuss@openvswitch.org > http://openvswitch.org/mailman/listinfo/discuss _______________________________________________ discuss mailing list discuss@openvswitch.org http://openvswitch.org/mailman/listinfo/discuss