From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Emelianov Subject: Re: [PATCH] Virtual ethernet device (v2.1) Date: Wed, 11 Jul 2007 17:00:35 +0400 Message-ID: <4694D473.3080707@openvz.org> References: <4694A363.2070406@openvz.org> <4694CBD9.90503@trash.net> <4694D0C5.6020700@openvz.org> <4694D2CC.10409@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: David Miller , Linux Netdev List , Daniel Lezcano , Ben Greear , devel@openvz.org, Kirill Korotaev To: Patrick McHardy Return-path: Received: from mailhub.sw.ru ([195.214.233.200]:14750 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760331AbXGKNAw (ORCPT ); Wed, 11 Jul 2007 09:00:52 -0400 In-Reply-To: <4694D2CC.10409@trash.net> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Patrick McHardy wrote: > Pavel Emelianov wrote: >> Patrick McHardy wrote: >> >>> Pavel Emelianov wrote: >>> >>>> +static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = { >>>> + [VETH_INFO_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN }, >>>> + [VETH_INFO_PEER] = { .type = NLA_STRING }, >>>> + [VETH_INFO_PEER_MAC] = { .type = NLA_BINARY, .len = ETH_ALEN }, >>>> +}; >>> >>> Looks good, just one question. What happended to the IFLA_PARTNER >>> attribute idea? I have a patch to allow specifying the initial >>> MAC address for a device, IFLA_PARTNER would make the whole thing >>> symetrical. >> >> Well, the notion of a partner is not applicable to any generic link >> unlike the device name, physical (MAC) address or MTU value. So i >> think that it's better to keep this as a specific driver information >> not to confuse the generic code. I think it's worth making this as >> some more generic code than it is now, but since this driver is the >> only user of "partner" maybe it's better not to make it right now. >> Later, when we do know what do we want "partner" to be. > > > Mhh doing it later means dealing with compatibility issues, which > is why I'm asking now. We currently support IFLA_NAME, IFLA_MTU, Oh, I see. > IFLA_TXQLEN, IFLA_WEIGTH, IFLA_OPERSTATE and IFLA_LINKMODE, and > with my patch additionally IFLA_ADDRESS and IFLA_BROADCAST. > AFAICT they are all applicable for the partner link as well. Agree. Maybe it is better to make some generic routine to create the device with the parameters specified in the netlink packet. Then the generic code creates one end of a tunnel and calls ->new_link callback. This callback extracts the PARTNER packet part and calls this generic routine to create the second pair. Thanks, Pavel