lkml.org 
[lkml]   [2007]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH -mm 4/9] netconsole: Introduce netconsole_netdev_notifier
    Hi,

    On Sun, 8 Jul 2007, KII Keiichi wrote:
    > [...]
    > Should we avoid the automatic update of netconsole_target until we can notice all
    > necessary members of netconsole_target updated automatically?
    >
    > I had thought about automatic updating of the netconsole_target(i.e. local IP address
    > and network device).
    > But I thought that the netconsole(netpoll) can only be related to a network device
    > because the user of netconsole is free to be able to set local IP address and
    > MAC address of netconsole and it is difficult to monitor change of local IP address.
    [...]
    > But, in the case, we must think of the case of changing IP address
    > because we can change IP address without disabling the network device and
    > can't hook the event of changing IP address.

    Well, updating the local _IP_ address (for a particular interface) as
    and when it changes would also be good ... it is another piece of info
    exposed (read-write) to userspace through configfs, so makes sense to
    keep it uptodate. But note that the two event notifications that we
    care about currently are simply to keep up with changes in local _MAC_
    address and interface name.

    Regarding local_ip, the present behaviour is:

    (1) If the user did not specify any local IP address (that is left that
    field empty or zero), netpoll_setup() automatically fills it up with the
    IP of the local network interface device that it is attached to: from
    net_device->ip_ptr->ifa_list->ifa_local

    (2) If user specified some local IP address, netpoll_setup() blindly
    copies that into np->local_ip and that would later get used when
    constructing the eth/ip/udp packet to be sent (containing the logging
    data), as can be seen in netpoll_send_udp(). If the local IP changes
    at some point after netpoll_setup(), nothing updates np->local_ip
    accordingly.

    So this patch just continues preserving the current behaviour, but yes,
    it could make sense to trap protocol address changes and update the
    local_ip field too when that happens (as long as it doesn't break
    anything, as Matt warned earlier). I'm not aware of any existing
    netdevice notifier that'll do this, so I'll look around (or trace
    an ifconfig(8) / ip(8) to see what actually happens).

    > Or I propose updating netconsole_taget informations when the network device up/down.
    > The MAC address and network interface name can be changed when
    > the network device is disabled.

    Actually, what happens is that if you: (1) disable / down the interface,
    (2) change name / MAC address while it was down, and then (3) bring it
    back up, then on coming back up, *both* the NETDEV_CHANGE{NAME,ADDR} and
    the NETDEV_UP notifier chains are called out. If you just brought it
    down and back up without setting any params, the other chains would not
    be called out, but NETDEV_UP would. In this case, it's unnecessary to
    update the params, because nothing got changed. And if something did
    get changed, the corresponding chain would get called anyway, so it's
    clearly best to update only the appropriate params, only when the
    corresponding event notification comes along.

    Satyam
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-07-07 22:09    [W:4.409 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site