[ovs-discuss] tc ingress qdisc of tapB disappeared when del-port tapA from bridge

ychen ychen103103 at 163.com
Thu Aug 20 06:59:22 UTC 2015



ok, I think now I understand what's your meaning about flag VALID_POLICING.
as your explanation, this flag will always set whether or not netdev->kbits_rate is 0,
so there will be no flag to describe whether ingress policing is enabled or not.


hence it lead to the problem, when the first time port add to ovs bridge, 
VALID_POLICING is not set in netdev->cache_valid, so we don't check the netdev->kbits_rate == kbits_rate,
and so tc_add_del_ingress_qdisc(netdev_, false) is called, then lead to tc ingress rule which configured by linux tc removed by ovs function.


my solution is just give VALID_POLICING another meaning,
when ingress policing is enabled(ingress_policing_rate not equal to 0), then VALID_POLICING set
when ingress policing is disabled(ingress_policing_rate  equal to 0), then VALID_POLICING is unset


when ingress policing is disabled, in order to do nothing with tc ingress, so I check the 
parameter kbits_rate with stored value netdev->kbits_rate(maybe check VALID_POLICING with kbits_rate will be better)
if the current status is ingress policing disabling, and the parameter is still to disable ingress policing(kbits_rate=0), so we do nothing.


of course, the solution is not perfect, but is did resolved my problem, and I think it is the lowest cost method.
 I have run ovs unit tests, and the following tests passed:
1. ovs service restart
2. change port tag
3. add or del port from  ovs
4. ovs ingress policing
5. use linux command to up/down interface, change mac, mtu after interface has added to ovs birdge


If this is not a good answer, maybe I can try another more complicated method.









At 2015-08-20 12:59:57, "Ben Pfaff" <blp at nicira.com> wrote:
>
>
>On Thu, Aug 20, 2015 at 10:59:36AM +0800, ychen wrote:
>> 1. maybe I am not clearly describe this question.
>>    what I am want to find out is why VALID_POLICING is still set when kbits_rate equals to 0?
>>   in openvsiwthc document, it says:
>> 
>>  ingress_policing_rate: integer, at least 0
>>      Maximum rate for data received on this interface, in kbps. Data received faster than this rate is
>>      dropped. Set to 0 (the default) to disable policing.
>
>If VALID_POLICING is set, and netdev->kbits_rate is 0, then OVS has
>removed policing from the netdev and any further requests to remove
>policing can turn into no-ops.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20150820/3db980db/attachment-0002.html>


More information about the discuss mailing list