On Fri, Feb 07, 2025 at 04:53:40PM +0100, Dumitru Ceara wrote:
> On 2/6/25 3:19 PM, Felix Huettner via dev wrote:
> > From: Frode Nordahl <[email protected]>
> > 
> > Introduce route-exchange-netlink module which implements interface
> > for maintaining VRFs [0] and routes through Netlink.
> > 
> > There is a desire to do this without having to (re-)implement
> > routing protocol state machines in OVN, and to accomplish this we
> > make use of Netlink.
> > 
> > Netlink was chosen because:
> > * Its ubiquitous nature with availability on any Linux system as
> >   as well other platforms.
> > * Presence of a very good Netlink library implementation in our
> >   sibling project and library, Open vSwitch.
> > * Popular routing protocol software conveniently already have
> >   support for redistributing routes to/from Netlink.
> > * Support for interacting with Virtual Routing and Forwarding
> >   domains [0], allowing full isolation between virtual network
> >   resources defined within OVN and the hosting system while
> >   retaining access to all system network interfaces.
> > 
> > It is important to note that the purpose of this integration is
> > generic exchange of control plane information, while allowing to
> > keep the datapath in OVS/OVN, enabling users to leverage its full
> > range of user-, kernel- and mixed- space datapath implementations.
> > 
> > 0: https://docs.kernel.org/networking/vrf.html
> > 
> > Acked-by: Dumitru Ceara <[email protected]>
> > Acked-by: Frode Nordahl <[email protected]>
> 
> Nit: Frode can't be both author and reviewer of the patch. :)
> 
> > Co-Authored-by: Felix Huettner <[email protected]>
> > Signed-off-by: Felix Huettner <[email protected]>
> > Signed-off-by: Frode Nordahl <[email protected]>
> > ---
> 
> [...]
> 
> > +int
> > +re_nl_create_vrf(const char *ifname, uint32_t table_id)
> > +{
> > +    if (!TABLE_ID_VALID(table_id)) {
> > +        static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
> > +        VLOG_WARN_RL(&rl,
> > +                     "attempt to create VRF using invalid table id 
> > %"PRIu32,
> > +                     table_id);
> > +        return EINVAL;
> > +    }
> > +
> > +    size_t linkinfo_off, infodata_off;
> > +    struct ifinfomsg *ifinfo;
> > +    struct ofpbuf request;
> > +    int err;
> > +
> > +    ofpbuf_init(&request, 0);
> > +    nl_msg_put_nlmsghdr(&request, 0, RTM_NEWLINK,
> > +                        NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | 
> > NLM_F_EXCL);
> > +    ifinfo = ofpbuf_put_zeros(&request, sizeof *ifinfo);
> > +    nl_msg_put_string(&request, IFLA_IFNAME, ifname);
> > +
> > +    ifinfo->ifi_change = ifinfo->ifi_flags = IFF_UP;
> > +    linkinfo_off = nl_msg_start_nested(&request, IFLA_LINKINFO);
> > +    nl_msg_put_string(&request, IFLA_INFO_KIND, "vrf");
> > +    infodata_off = nl_msg_start_nested(&request, IFLA_INFO_DATA);
> > +    nl_msg_put_u32(&request, IFLA_VRF_TABLE, table_id);
> > +    nl_msg_end_nested(&request, infodata_off);
> > +    nl_msg_end_nested(&request, linkinfo_off);
> > +
> > +    err = nl_transact(NETLINK_ROUTE, &request, NULL);
> > +
> > +    ofpbuf_uninit(&request);
> > +    return err;
> > +
> 
> Nit: no need for a newline here.
> 
> With this addressed my ack still stands:
> Acked-by: Dumitru Ceara <[email protected]>

Thanks a lot,
Felix

> 
> > +}
> > +
> 
> Thanks,
> Dumitru
> 
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to