On 19.03.2019 18:51, Ilya Maximets wrote:
> On 19.03.2019 12:23, Eelco Chaudron wrote:
>> When debugging an issue we noticed that by accident someone has changes the
>> bridge datapath_type to netdev, where it's clearly a kernel (system bridge)
>> with physical and tap devices. Unfortunately, this is not something you
>> will easily spot, as the bridge datapath type value is not shown by default.
>>
>> In addition, OVS is not warning you about this potential mismatch in
>> interface and bridge datapath.
>>
>> I'm sending out this patch as an RFC as I could not find a clear
>> demarcation between bridge datapath types and interface datapath types.
>> The patch below will at least warn for netdev bridges with system
>> interfaces. But no warning will be given for some unsupported virtual
>> interfaces. For system bridges, the dpdk types will no be recognized as
>> system/virtual interfaces (unless the name exists) which will result in
>> an error.
>>
>> Signed-off-by: Eelco Chaudron <[email protected]>
>> ---
> 
> Hi.
> 
> Hmm. What do you mean under misconfiguration?
> In practice, userspace datapath is able to open "system" type netdevs.
> It's supported by netdev-linux to open system network devices via socket.
> And these devices has "system" type.
> On 'datapath_type' changes, bridge/ofproto will be destroyed and re-created.
> All the ports from kernel datapath will be destroyed and new ones created
> in userspace. All the ports should still work as usual.
> 
> The only possible issue will be that this bridge will no longer communicate
> with other bridges, because they're in different datapaths now.

For this issue, probably, following warning will give a clue to a user:

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 21dd54bab..df51aaa3a 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -3557,6 +3557,10 @@ ofport_update_peer(struct ofport_dpif *ofport)
 
         break;
     }
+    if (!ofport->peer) {
+        VLOG_WARN_RL(&rl, "No usable peer '%s' exist for patch port '%s'.",
+                     peer_name, netdev_get_name(ofport->up.netdev));
+    }
     free(peer_name);
 }
 
---

I could send this as a proper patch.


Best regards, Ilya Maximets.

> 
> So, below warning will be printed on any attempt to add legitimate
> system network interface to the userspace bridge.
> "system" devices supported by both datapaths, but "dpdk" devices supported
> only by userspace, that is why you see the error in case of changing to
> 'datapath_type=system'.
> 
> Maybe I'm missing something? What is the issue you're trying to address?
> 
> Best regards, Ilya Maximets.
> 
>>  vswitchd/bridge.c |    6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
>> index a427b0122..42c33d1d9 100644
>> --- a/vswitchd/bridge.c
>> +++ b/vswitchd/bridge.c
>> @@ -1808,6 +1808,12 @@ iface_do_create(const struct bridge *br,
>>          goto error;
>>      }
>>  
>> +    if (!iface_is_internal(iface_cfg, br->cfg)
>> +        && !strcmp(br->type, "netdev")
>> +        && !strcmp(netdev_get_type(netdev), "system")) {
>> +        VLOG_WARN("bridge %s: interface %s is a system type where the 
>> bridge "
>> +                  "is a netdev one", br->name, iface_cfg->name);
>> +    }
>>      VLOG_INFO("bridge %s: added interface %s on port %d",
>>                br->name, iface_cfg->name, *ofp_portp);
>>  
>>
> 
> 
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to