[ovs-dev] 答复: 答复: 答复: [ovs-discuss] How can I delete flows which match a given cookie value?

Yi Yang (杨燚)-云服务集团 yangyi01 at inspur.com
Thu Jul 18 07:03:29 UTC 2019


Cookie is enough, I just think two field matches can avoid false del-flows.

-----邮件原件-----
发件人: Ben Pfaff [mailto:blp at ovn.org] 
发送时间: 2019年7月18日 11:34
收件人: Yi Yang (杨燚)-云服务集团 <yangyi01 at inspur.com>
抄送: ovs-discuss at openvswitch.org; ovs-dev at openvswitch.org
主题: Re: 答复: 答复: [ovs-discuss] How can I delete flows which match a given cookie value?

Hmm.  I can see how that would be inconvenient.

If you have control over the cookies, and enough space in them, then you could encode the (16-bit) priority as part of the (64-bit) cookie.

On Thu, Jul 18, 2019 at 12:18:55AM +0000, Yi Yang (杨燚)-云服务集团 wrote:
> Got it, thanks Ben, I want to use cookie and priority to del-flows, but only --strict option can handle priority. So I only can use cookie to del-flows in batch, --strict only can delete one flow.
> 
> sudo ovs-ofctl -Oopenflow13 del-flows br-int "cookie=0x01/-1,priority=1"
> ovs-ofctl: unknown keyword priority
> 
> -----邮件原件-----
> 发件人: Ben Pfaff [mailto:blp at ovn.org]
> 发送时间: 2019年7月18日 2:02
> 收件人: Yi Yang (杨燚)-云服务集团 <yangyi01 at inspur.com>
> 抄送: ovs-discuss at openvswitch.org; ovs-dev at openvswitch.org
> 主题: Re: 答复: [ovs-discuss] How can I delete flows which match a given cookie value?
> 
> --strict means that only exact matches are deleted, so add 'icmp' to your del-flows command to delete the flow.
> 
> On Wed, Jul 17, 2019 at 03:35:09AM +0000, Yi Yang (杨燚)-云服务集团 wrote:
> > Ben, I found del-flows ran successfully but the flows aren't deleted, what's wrong?
> > 
> > [yangyi at localhost ~]$ sudo ovs-ofctl -Oopenflow10 add-flow br-int "table=0,cookie=0x1234,priority=10000,icmp,actions=drop"
> > [yangyi at localhost ~]$ sudo ovs-ofctl -Oopenflow10 dump-flows br-int                 
> > NXST_FLOW reply (xid=0x4):
> >  cookie=0x1234, duration=3.994s, table=0, n_packets=0, n_bytes=0, 
> > idle_age=3, priority=10000,icmp actions=drop [yangyi at localhost ~]$ sudo ovs-ofctl -Oopenflow10 --strict del-flows br-int "table=0,cookie=0x1234/-1,priority=10000"
> > [yangyi at localhost ~]$ sudo ovs-ofctl -Oopenflow10 dump-flows br-int                 
> > NXST_FLOW reply (xid=0x4):
> >  cookie=0x1234, duration=49.866s, table=0, n_packets=0, n_bytes=0, 
> > idle_age=49, priority=10000,icmp actions=drop [yangyi at localhost ~]$
> > 
> > -----邮件原件-----
> > 发件人: Ben Pfaff [mailto:blp at ovn.org]
> > 发送时间: 2019年7月17日 1:04
> > 收件人: Yi Yang (杨燚)-云服务集团 <yangyi01 at inspur.com>
> > 抄送: ovs-discuss at openvswitch.org; ovs-dev at openvswitch.org
> > 主题: Re: [ovs-discuss] How can I delete flows which match a given cookie value?
> > 
> > On Tue, Jul 16, 2019 at 09:35:06AM +0000, Yi Yang (杨燚)-云服务集团 wrote:
> > > I need to add and delete flows according to user operations, I 
> > > know openflowplugin in Opendaylight can do this, but it seems 
> > > “ovs-ofctl del-flows” can’t do this way, why can’t cookie value be 
> > > used to do this for “ovs-ofctl del-flows”?
> > > 
> > >  
> > > 
> > > sudo ovs-ofctl -Oopenflow13 --strict del-flows br-int "table=2,cookie=12345"
> > 
> > To match on a cookie, specify a mask, e.g. cookie=12345/-1.
> 
> 




More information about the dev mailing list