Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Ensure to call if_register after interface initializatio...



details:   https://anonhg.NetBSD.org/src/rev/94038e8c0e99
branches:  trunk
changeset: 322948:94038e8c0e99
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri May 25 04:40:26 2018 +0000

description:
Ensure to call if_register after interface initializations finish

diffstat:

 sys/dev/pci/if_wm.c       |  6 +++---
 sys/dev/pci/ixgbe/ixgbe.c |  5 +++--
 sys/dev/pci/ixgbe/ixv.c   |  5 +++--
 sys/net/if_bridge.c       |  7 +++----
 sys/net/if_gif.c          |  6 +++---
 sys/net/if_pppoe.c        |  6 +++---
 6 files changed, 18 insertions(+), 17 deletions(-)

diffs (171 lines):

diff -r c74af704d3ab -r 94038e8c0e99 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri May 25 00:31:07 2018 +0000
+++ b/sys/dev/pci/if_wm.c       Fri May 25 04:40:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.579 2018/05/10 03:43:42 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.580 2018/05/25 04:40:26 ozaki-r Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.579 2018/05/10 03:43:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.580 2018/05/25 04:40:26 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2829,8 +2829,8 @@
        }
        sc->sc_ipq = if_percpuq_create(&sc->sc_ethercom.ec_if);
        ether_ifattach(ifp, enaddr);
+       ether_set_ifflags_cb(&sc->sc_ethercom, wm_ifflags_cb);
        if_register(ifp);
-       ether_set_ifflags_cb(&sc->sc_ethercom, wm_ifflags_cb);
        rnd_attach_source(&sc->rnd_source, xname, RND_TYPE_NET,
                          RND_FLAG_DEFAULT);
 
diff -r c74af704d3ab -r 94038e8c0e99 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Fri May 25 00:31:07 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Fri May 25 04:40:26 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.155 2018/05/23 10:11:07 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.156 2018/05/25 04:40:27 ozaki-r Exp $ */
 
 /******************************************************************************
 
@@ -1316,7 +1316,6 @@
         * We use per TX queue softint, so if_deferred_start_init() isn't
         * used.
         */
-       if_register(ifp);
        ether_set_ifflags_cb(ec, ixgbe_ifflags_cb);
 
        adapter->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
@@ -1365,6 +1364,8 @@
        /* Set autoselect media by default */
        ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO);
 
+       if_register(ifp);
+
        return (0);
 } /* ixgbe_setup_interface */
 
diff -r c74af704d3ab -r 94038e8c0e99 sys/dev/pci/ixgbe/ixv.c
--- a/sys/dev/pci/ixgbe/ixv.c   Fri May 25 00:31:07 2018 +0000
+++ b/sys/dev/pci/ixgbe/ixv.c   Fri May 25 04:40:26 2018 +0000
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.100 2018/05/23 10:11:07 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.101 2018/05/25 04:40:27 ozaki-r Exp $*/
 
 /******************************************************************************
 
@@ -1519,7 +1519,6 @@
         * We use per TX queue softint, so if_deferred_start_init() isn't
         * used.
         */
-       if_register(ifp);
        ether_set_ifflags_cb(ec, ixv_ifflags_cb);
 
        adapter->max_frame_size = ifp->if_mtu + IXGBE_MTU_HDR;
@@ -1558,6 +1557,8 @@
        ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL);
        ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO);
 
+       if_register(ifp);
+
        return 0;
 } /* ixv_setup_interface */
 
diff -r c74af704d3ab -r 94038e8c0e99 sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Fri May 25 00:31:07 2018 +0000
+++ b/sys/net/if_bridge.c       Fri May 25 04:40:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.155 2018/05/14 02:55:03 ozaki-r Exp $  */
+/*     $NetBSD: if_bridge.c,v 1.156 2018/05/25 04:40:27 ozaki-r Exp $  */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.155 2018/05/14 02:55:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.156 2018/05/25 04:40:27 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -470,10 +470,9 @@
 
                return error;
        }
+       if_alloc_sadl(ifp);
        if_register(ifp);
 
-       if_alloc_sadl(ifp);
-
        return 0;
 }
 
diff -r c74af704d3ab -r 94038e8c0e99 sys/net/if_gif.c
--- a/sys/net/if_gif.c  Fri May 25 00:31:07 2018 +0000
+++ b/sys/net/if_gif.c  Fri May 25 04:40:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.141 2018/05/01 07:21:39 maxv Exp $        */
+/*     $NetBSD: if_gif.c,v 1.142 2018/05/25 04:40:27 ozaki-r Exp $     */
 /*     $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $    */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.141 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.142 2018/05/25 04:40:27 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -306,9 +306,9 @@
        if (rv != 0)
                return rv;
 
-       if_register(&sc->gif_if);
        if_alloc_sadl(&sc->gif_if);
        bpf_attach(&sc->gif_if, DLT_NULL, sizeof(u_int));
+       if_register(&sc->gif_if);
        return 0;
 }
 
diff -r c74af704d3ab -r 94038e8c0e99 sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c        Fri May 25 00:31:07 2018 +0000
+++ b/sys/net/if_pppoe.c        Fri May 25 04:40:26 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.137 2018/05/03 16:52:42 maxv Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.138 2018/05/25 04:40:27 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.137 2018/05/03 16:52:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.138 2018/05/25 04:40:27 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pppoe.h"
@@ -336,12 +336,12 @@
        }
        sc->sc_sppp.pp_if.if_percpuq = if_percpuq_create(&sc->sc_sppp.pp_if);
        sppp_attach(&sc->sc_sppp.pp_if);
-       if_register(&sc->sc_sppp.pp_if);
 
        bpf_attach(&sc->sc_sppp.pp_if, DLT_PPP_ETHER, 0);
        if (LIST_EMPTY(&pppoe_softc_list)) {
                pfil_add_ihook(pppoe_ifattach_hook, NULL, PFIL_IFNET, if_pfil);
        }
+       if_register(&sc->sc_sppp.pp_if);
 
        rw_init(&sc->sc_lock);
 



Home | Main Index | Thread Index | Old Index