[ovs-dev] datapath: Print friendly error message when conntrack fails to init
diff mbox series

Message ID 1563500600-4853-1-git-send-email-pkusunyifeng@gmail.com
State New
Headers show
Series
  • [ovs-dev] datapath: Print friendly error message when conntrack fails to init
Related show

Commit Message

Yifeng Sun July 19, 2019, 1:43 a.m. UTC
On 4.14 kernels, if kernel isn't configured with CONFIG_NF_CONNTRACK_IPV4
and CONFIG_NF_CONNTRACK_IPV6, openvswitch module will fail to load. The
error message is "openvswitch: failed to init nf_conncount -91".

This patch prints helpful error message for this case.

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
---
 datapath/conntrack.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Gregory Rose July 19, 2019, 4:10 p.m. UTC | #1
On 7/18/2019 6:43 PM, Yifeng Sun wrote:
> On 4.14 kernels, if kernel isn't configured with CONFIG_NF_CONNTRACK_IPV4
> and CONFIG_NF_CONNTRACK_IPV6, openvswitch module will fail to load. The
> error message is "openvswitch: failed to init nf_conncount -91".
>
> This patch prints helpful error message for this case.
>
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> ---
>   datapath/conntrack.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/datapath/conntrack.c b/datapath/conntrack.c
> index 292febb3c83e..ca56428cd78b 100644
> --- a/datapath/conntrack.c
> +++ b/datapath/conntrack.c
> @@ -1864,6 +1864,10 @@ static int ovs_ct_limit_init(struct net *net, struct ovs_net *ovs_net)
>   		kfree(ovs_net->ct_limit_info->limits);
>   		kfree(ovs_net->ct_limit_info);
>   		pr_err("openvswitch: failed to init nf_conncount %d\n", err);
> +		if (err == -EPROTOTYPE) {
> +			pr_err("openvswitch: probably your kernel isn't configured with "
> +				   "CONFIG_NF_CONNTRACK_IPV4 and CONFIG_NF_CONNTRACK_IPV6.\n");
> +		}
>   		return err;
>   	}
>   	return 0;

Hi Yifeng,

I think this patch is fine but I would prefer you post it to netdev 
first and then after accepted there we can backport to our Out of Tree 
drivers here.

Thanks,

- Greg
Yifeng Sun July 19, 2019, 5:55 p.m. UTC | #2
Ok, I will do that. Thanks for reviewing.
Yifeng

On Fri, Jul 19, 2019 at 9:10 AM Gregory Rose <gvrose8192@gmail.com> wrote:
>
> On 7/18/2019 6:43 PM, Yifeng Sun wrote:
> > On 4.14 kernels, if kernel isn't configured with CONFIG_NF_CONNTRACK_IPV4
> > and CONFIG_NF_CONNTRACK_IPV6, openvswitch module will fail to load. The
> > error message is "openvswitch: failed to init nf_conncount -91".
> >
> > This patch prints helpful error message for this case.
> >
> > Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
> > ---
> >   datapath/conntrack.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> >
> > diff --git a/datapath/conntrack.c b/datapath/conntrack.c
> > index 292febb3c83e..ca56428cd78b 100644
> > --- a/datapath/conntrack.c
> > +++ b/datapath/conntrack.c
> > @@ -1864,6 +1864,10 @@ static int ovs_ct_limit_init(struct net *net, struct ovs_net *ovs_net)
> >               kfree(ovs_net->ct_limit_info->limits);
> >               kfree(ovs_net->ct_limit_info);
> >               pr_err("openvswitch: failed to init nf_conncount %d\n", err);
> > +             if (err == -EPROTOTYPE) {
> > +                     pr_err("openvswitch: probably your kernel isn't configured with "
> > +                                "CONFIG_NF_CONNTRACK_IPV4 and CONFIG_NF_CONNTRACK_IPV6.\n");
> > +             }
> >               return err;
> >       }
> >       return 0;
>
> Hi Yifeng,
>
> I think this patch is fine but I would prefer you post it to netdev
> first and then after accepted there we can backport to our Out of Tree
> drivers here.
>
> Thanks,
>
> - Greg

Patch
diff mbox series

diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 292febb3c83e..ca56428cd78b 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -1864,6 +1864,10 @@  static int ovs_ct_limit_init(struct net *net, struct ovs_net *ovs_net)
 		kfree(ovs_net->ct_limit_info->limits);
 		kfree(ovs_net->ct_limit_info);
 		pr_err("openvswitch: failed to init nf_conncount %d\n", err);
+		if (err == -EPROTOTYPE) {
+			pr_err("openvswitch: probably your kernel isn't configured with "
+				   "CONFIG_NF_CONNTRACK_IPV4 and CONFIG_NF_CONNTRACK_IPV6.\n");
+		}
 		return err;
 	}
 	return 0;