Hi Rahul,

You need to specify the "mask" value whose bits are corresponding to the
"config" value you need to change.
For example, if you need to change ports into "up" state, the mask value should
be the logical sum of all ofp_port_config flags
e.g.)
        mask_all = (ofproto.OFPPC_PORT_DOWN
                    | ofproto.OFPPC_NO_RECV
                    | ofproto.OFPPC_NO_FWD
                    | ofproto.OFPPC_NO_PACKET_IN)

        ...(snip)...

        mod = parser.OFPPortMod(
            datapath, port_no=port_no, hw_addr=hw_addr,
            config=0, mask=mask_all)  # 0 means "up" state = no flag configured

The most easiest way to instantiate OFPPortMod is always use mask_all value
(like the above) as mask value, but please note, with mask_all, OFPPortMod
behave "exactly" setting for the given config value.
If you prefer to setting only the specific flag(s), specify the same value as
both config/mask field and change mask to mask_all only when setting up state.

Thanks,
Iwase


On 2017年12月17日 18:56, rahul b wrote:
Hi,

I am using OF 1.5, OVS 2.7.4. I have couple of questions regarding OFPPortMod

I want to bring down/shut port added to a ovs bridge, to do that,i am currently using, OFPPortMod with config=0,mask=ofp.OFPPC_PORT_DOWN. This operation successfully brings the port down in OVS, and i receive port mod notification on Ryu.

However changing the mask to ofp.OFPPC_NO_FWD ,ofp.OFPPC_NO_RECV has no effect,the configuration in OVS does not get changed, and hence i do not receive port status change message.

Both these messages below does not work.

version=None,msg_type=None,msg_len=None,xid=None,OFPPortMod(config=0,hw_addr='08:00:45:56:67:78',mask=1,port_no=300,properties=[])

version=None,msg_type=None,msg_len=None,xid=None,OFPPortMod(config=0,hw_addr='08:00:45:56:67:78',mask=32,port_no=300,properties=[])

Q) So am i doing something wrong here?

Q)Once i set the port-config to ofppc_port_down no matter what values of conifg/mask i use i am not able to bring up the port , is this expected?Or is there a way to emulate "ovs-ofctl mod-port br0 eth1 up" through OFPPortMod message.



----------------------------------------------------------------------------------------------------------------
I am new to OVSDB, and i have tried this code to bring up the port.



self.ovs = ovs_bridge.OVSBridge(CONF=self.CONF,
datapath_id=datapath.id <http://datapath.id>, ovsdb_addr=ovsdb_addr)
....
....
self.ovs.set_db_attribute("Interface", "eth1", "admin_state", "up")

Q)The above code does not work, does it make sense to perform an operation like this?




Thanks,
Rahul






------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to