[dev] FRR support for FPM

Mayank Tiwari mike.tiwari at gmail.com
Wed Aug 15 13:24:32 EDT 2018


Hi Donald,

 Thanks for your response. I am giving you background on the issue:
 We were initially using quagga 0.99.23 in our solution. Quagga 0.99.23 was
not having FPM support so the FPM related changes were ported to Quagga
0.99.23.
 Later there was a requirement for reverse FPM support in Quagga so there
was additional patch added to quagga for reverse FPM support.
  Now there is a latest requirement where we wanted to have bfd support in
quagga. The patch for bfd support was available in the older version of
quagga. When I tried patching those change it was referring to some
deprecated functions which were removed due to some memory leak.  I tried
porting the changes to the new functions instead of those deprecated
function but quagga was not working as expected so we did not pursue
further on that path.

  The next option we had was to use FRR which already supports BFD. So as
part of the latest approach  I compared the fpm and reverse fpm patch with
the code present in FRR and could see most of the FPM logic was already
present. I have added the reverse FPM patch and also some patch which was
part of fpm but missing in the latest code as I was not sure on the
significance of those changes. It is one of those FPM changes which is
causing this compilation issue.

  If I do not have that change which is causing issue and if I have
following line in zebra configuration then the configuration was not
getting recognized. So I was concentrating on making this change work:

!
hostname cord-zebra
password cord
!
fpm connection ip <IP> port 2620
!
!
log file /var/log/zebra.log
!
end

The line fpm connection was reported as command not supported error
message. Hence I was concentrating on fixing this issue.
 Please find attached the patch which we are trying and please let me know
what all issue you see in the patch.
The patch also has some code to dockerize frr which can be ignored for this
issue. However if you see any issue in the Dockerfile script which has
compilation instructions for frr then also please let us know on that.
We want zebra, bgpd, bfdd, fpm, and reverse fpm(added by us) for our
solutions to work.

Thanks and Regards,
Mayank



On Wed, Aug 15, 2018 at 10:04 AM, Donald Sharp <sharpd at cumulusnetworks.com>
wrote:

> Mayank -
>
> The FPM code is already in FRR, why are you trying to forward port the
> same code?
>
> donald
>
> On Tue, Aug 7, 2018 at 3:08 PM, Mayank Tiwari <mike.tiwari at gmail.com>
> wrote:
> > Hi,
> >
> >
> >
> >   We are using quagga in our solution for FPM connection and Reverse FPM
> > connection with ONOS. In order to support BFD feature I need to upgrade
> from
> > quagga to FRR. For that I was patching the changes present in quagga to
> FRR.
> > During that patching process the following patch is causing compilation
> > issue:
> >
> >
> >
> > diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
> >
> > index 43d76a6..03c4a6b 100644
> >
> > --- a/zebra/zebra_vty.c
> >
> > +++ b/zebra/zebra_vty.c
> >
> > @@ -20,6 +20,7 @@
> >
> >
> >
> > #include <zebra.h>
> >
> >
> >
> > +#include "zebra_fpm.h"
> >
> > #include "memory.h"
> >
> > #include "zebra_memory.h"
> >
> > #include "if.h"
> >
> >
> >
> > +
> >
> > +/* function to write the fpm config info */
> >
> > +static int config_write_fpm (struct vty *vty)
> >
> > +{
> >
> > +  return fpm_remote_srv_write (vty);
> >
> > +}
> >
> > +
> >
> > +/* Zebra node  */
> >
> > +static struct cmd_node zebra_node =
> >
> > +{
> >
> > +  ZEBRA_NODE,
> >
> > +  "",
> >
> > +  1
> >
> > +};
> >
> >
> >
> > /* Route VTY.  */
> >
> > void zebra_vty_init(void)
> >
> > {
> >
> >         /* Install configuration write function. */
> >
> >         install_node(&table_node, config_write_table);
> >
> >         install_node(&forwarding_node, config_write_forwarding);
> >
> > +    install_node (&zebra_node, config_write_fpm);
> >
> >
> >
> >
> >
> >         install_element(VIEW_NODE, &show_ip_forwarding_cmd);
> >
> >         install_element(CONFIG_NODE, &ip_forwarding_cmd);
> >
> >
> >
> >
> >
> > diff --git a/zebra/zebra_fpm.h b/zebra/zebra_fpm.h
> >
> > new file mode 100644
> >
> > index 0000000..9291ffa
> >
> > --- /dev/null
> >
> > +++ b/zebra/zebra_fpm.h
> >
> > @@ -0,0 +1,35 @@
> >
> > +/*
> >
> > + * Router ID for zebra daemon.
> >
> > + *
> >
> > + * Copyright (C) 2004 James R. Leu
> >
> > + *
> >
> > + * This file is part of Quagga routing suite.
> >
> > + *
> >
> > + * Quagga is free software; you can redistribute it and/or modify it
> >
> > + * under the terms of the GNU General Public License as published by the
> >
> > + * Free Software Foundation; either version 2, or (at your option) any
> >
> > + * later version.
> >
> > + *
> >
> > + * Quagga is distributed in the hope that it will be useful, but
> >
> > + * WITHOUT ANY WARRANTY; without even the implied warranty of
> >
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> >
> > + * General Public License for more details.
> >
> > + *
> >
> > + * You should have received a copy of the GNU General Public License
> along
> >
> > + * with this program; see the file COPYING; if not, write to the Free
> > Software
> >
> > + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
> USA
> >
> > + */
> >
> > +
> >
> > +#ifndef _ZEBRA_VTY_H_
> >
> > +#define _ZEBRA_VTY_H_
> >
> > +
> >
> > +#include <zebra.h>
> >
> > +#include "memory.h"
> >
> > +#include "prefix.h"
> >
> > +#include "zclient.h"
> >
> > +#include "if.h"
> >
> > +
> >
> > +
> >
> > +static int fpm_remote_srv_write (struct vty *vty );
> >
> > +
> >
> > +#endif
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > The function 'fpm_remote_srv_write'  is already defined in zebra_fpm.c
> file
> > which I need to use zebra_vty.c file. I have created a header with name
> > zebra_fpm.h and declared that function there and later included this
> header
> > in zebra_vty.c. The compilation of zebra_vty.c fails as it is not able to
> > find  'fpm_remote_srv_write' function
> >
> >
> >
> > This is the compilation error:
> >
> >
> >
> >   CCLD     zebra/zebra_irdp.la
> >
> >   CC       zebra/zebra_fpm.lo
> >
> >   CC       zebra/zebra_fpm_netlink.lo
> >
> > …..
> >
> > …..
> >
> >
> >
> >   CC       zebra/zebra_vty.o
> >
> > In file included from zebra/zebra_vty.c:23:0:
> >
> > zebra/zebra_fpm.h:33:12: warning: 'fpm_remote_srv_write' used but never
> > defined
> >
> > static int fpm_remote_srv_write (struct vty *vty );
> >
> >             ^
> >
> >   CC       zebra/zebra_vxlan.o
> >
> >   CC       zebra/zserv.o
> >
> >   CC       zebra/zebra_netns_id.o
> >
> >   CC       zebra/zebra_netns_notify.o
> >
> >   CC       zebra/table_manager.o
> >
> >   CC       zebra/zapi_msg.o
> >
> >   CCLD     zebra/zebra
> >
> > zebra/zebra_vty.o: In function `config_write_fpm':
> >
> > /frr/zebra/zebra_vty.c:3697: undefined reference to
> `fpm_remote_srv_write'
> >
> > collect2: error: ld returned 1 exit status
> >
> > make[2]: *** [zebra/zebra] Error 1
> >
> > Makefile:3246: recipe for target 'zebra/zebra' failed
> >
> > make[2]: Leaving directory '/frr'
> >
> > Makefile:4421: recipe for target 'all-recursive' failed
> >
> > make[1]: Leaving directory '/frr'
> >
> > make[1]: *** [all-recursive] Error 1
> >
> > make: *** [all] Error 2
> >
> >
> >
> >   I have observed that zebra_fpm.c is compiled as zebra_fpm.lo instead of
> > zebra_fpm.o. I am not sure if that can cause this issue. Please suggest
> what
> > I am missing here and what approach I need to take to fix this issue.
> >
> >
> >
> > Thanks and Regards,
> >
> > Mayank
> >
> >
> > _______________________________________________
> > dev mailing list
> > dev at lists.frrouting.org
> > https://lists.frrouting.org/listinfo/dev
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.frrouting.org/pipermail/dev/attachments/20180815/46ecd890/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fpm.patch
Type: application/octet-stream
Size: 12898 bytes
Desc: not available
URL: <http://lists.frrouting.org/pipermail/dev/attachments/20180815/46ecd890/attachment-0001.obj>


More information about the dev mailing list