[dts] [PATCH] br.py: change some BR nic config so that vlan could run correctly on this nic

Liu, Yong yong.liu at intel.com
Fri Apr 15 08:52:25 CEST 2016


Hi Heng,
There's no need to change those settings. Even BR pep sequence is the 
same as pci port sequence, we can just adjust to it by our port 
configurations.
Let's assume that the previous pci device is the second port for BR 
device, and actually it is the second pep.

On 04/13/2016 05:43 PM, Ding Heng wrote:
> Signed-off-by: Ding Heng <hengx.ding at intel.com>
>
> diff --git a/nics/br.py b/nics/br.py
> index ae9f9a2..2e4aadd 100644
> --- a/nics/br.py
> +++ b/nics/br.py
> @@ -46,13 +46,13 @@ FUNC_RULES = [
>               #redirect PEP0 to EPL0
>               'create acl 0',
>               'create acl-rule 0 0',
> -            'add acl-rule condition 0 0 src-port 0',
> +            'add acl-rule condition 0 0 src-port 11',
>               'add acl-rule action 0 0 redirect 1',
>               'add acl-rule action 0 0 count',
>               #redirect PEP1 to EPL1
>               'create acl 1',
>               'create acl-rule 1 0',
> -            'add acl-rule condition 1 0 src-port 11',
> +            'add acl-rule condition 1 0 src-port 0',
>               'add acl-rule action 1 0 redirect 5',
>               'add acl-rule action 1 0 count',
>               'apply acl',
> @@ -214,31 +214,31 @@ class BoulderRapid(NetDevice):
>       def add_vlan(self, vlan_id=0):
>           self.ctrl_crb.send_expect("create vlan %d" % vlan_id, "<0>%")
>           if self.sec_port:
> -            self.ctrl_crb.send_expect("add vlan port %d 1,0" % vlan_id, "<0>%")
> +            self.ctrl_crb.send_expect("add vlan port %d 5,0" % vlan_id, "<0>%")
>           else:
> -            self.ctrl_crb.send_expect("add vlan port %d 5,11" % vlan_id, "<0>%")
> +            self.ctrl_crb.send_expect("add vlan port %d 1,11" % vlan_id, "<0>%")
>       
>       def delete_vlan(self, vlan_id=0):
>           if self.sec_port:
> -            self.ctrl_crb.send_expect("del vlan port %d 1,0" % vlan_id, "<0>%")
> +            self.ctrl_crb.send_expect("del vlan port %d 5,0" % vlan_id, "<0>%")
>           else:
> -            self.ctrl_crb.send_expect("del vlan port %d 5,11" % vlan_id, "<0>%")
> +            self.ctrl_crb.send_expect("del vlan port %d 1,11" % vlan_id, "<0>%")
>           self.ctrl_crb.send_expect("del vlan %d" % vlan_id, "<0>%")
>   
>       def add_txvlan(self, vlan_id=0):
>           if self.sec_port:
> -            self.ctrl_crb.send_expect("set vlan tagging %d 1 tag" % vlan_id, "<0>%")
> -        else:
>               self.ctrl_crb.send_expect("set vlan tagging %d 5 tag" % vlan_id, "<0>%")
> +        else:
> +            self.ctrl_crb.send_expect("set vlan tagging %d 1 tag" % vlan_id, "<0>%")
>   
>       def delete_txvlan(self, vlan_id=0):
>           if self.sec_port:
> -            self.ctrl_crb.send_expect("set vlan tagging %d 1 untag" % vlan_id, "<0>%")
> -        else:
>               self.ctrl_crb.send_expect("set vlan tagging %d 5 untag" % vlan_id, "<0>%")
> +        else:
> +            self.ctrl_crb.send_expect("set vlan tagging %d 1 untag" % vlan_id, "<0>%")
>   
>       def enable_jumbo(self, framesize=0):
>           if self.sec_port:
> -            self.ctrl_crb.send_expect("set port config 1 max_frame_size %d" % framesize, "<0>%")
> -        else:
>               self.ctrl_crb.send_expect("set port config 5 max_frame_size %d" % framesize, "<0>%")
> +        else:
> +            self.ctrl_crb.send_expect("set port config 1 max_frame_size %d" % framesize, "<0>%")



More information about the dts mailing list