From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch iproute2 1/6] iproute2: ipa: show switch id Date: Thu, 4 Dec 2014 17:30:24 +0100 Message-ID: <20141204163024.GG1861@nanopsycho.orion> References: <1417683438-10935-1-git-send-email-jiri@resnulli.us> <1417683438-10935-2-git-send-email-jiri@resnulli.us> <87y4qne6if.fsf@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, nhorman@tuxdriver.com, andy@greyhouse.net, tgraf@suug.ch, dborkman@redhat.com, ogerlitz@mellanox.com, jesse@nicira.com, pshelar@nicira.com, azhou@nicira.com, ben@decadent.org.uk, stephen@networkplumber.org, jeffrey.t.kirsher@intel.com, vyasevic@redhat.com, xiyou.wangcong@gmail.com, john.r.fastabend@intel.com, edumazet@google.com, jhs@mojatatu.com, sfeldma@gmail.com, f.fainelli@gmail.com, roopa@cumulusnetworks.com, linville@tuxdriver.com, jasowang@redhat.com, nicolas.dichtel@6wind.com, ryazanov.s.a@gmail.com, buytenh@wantstofly.org, aviadr@mellanox.com, nbd@openwrt.org, alexei.starovoitov@gmail.com, Neil.Jerram@metaswitch.com, ronye@mellanox.com, simon.horman@netronome.com, alexander.h.duyck@redhat.com, john.ronciak@intel.com, mleitner@redhat.com, shrijeet@gmail.com, gospo@cumulusnetworks.com, bcrl@kvack.org, hemal@broadcom.c To: "Eric W. Biederman" Return-path: Received: from mail-wg0-f48.google.com ([74.125.82.48]:53982 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116AbaLDQa0 (ORCPT ); Thu, 4 Dec 2014 11:30:26 -0500 Received: by mail-wg0-f48.google.com with SMTP id y19so23121446wgg.7 for ; Thu, 04 Dec 2014 08:30:25 -0800 (PST) Content-Disposition: inline In-Reply-To: <87y4qne6if.fsf@x220.int.ebiederm.org> Sender: netdev-owner@vger.kernel.org List-ID: Thu, Dec 04, 2014 at 05:15:04PM CET, ebiederm@xmission.com wrote: >Jiri Pirko writes: > >Would someone please explain to me what a switch id is? > >I looked in the kernel source, and I looked here and while I know >switches I don't have a clue what a switch id is. > >My primary concern at this point is that you have introduced a global >identifier that is isn't a hardware property (it certainly does not look >like a mac address) and that is unique across network namespaces and >thus breaks checkpoint/restart (aka CRIU). IFLA_PHYS_SWITCH_ID is very similar to IFLA_PHYS_PORT_ID. It is generated by the driver and ensures that there is the same switch id for all ports belonging to the same switch chip/asic. It is up to the driver how to implement the id. I would like to point you to driver implementing ndo_get_phys_port_id > >Also what in the world does PHYS mean in IFLA_PHYS_SWITCH_ID? Does that >mean we can't have a purely software implementation of this interface? >Given that we will want a software implementation at some point >including PHYS in the name seems completely wrong. We can remove the "PHYS", no problem. I do not understand what you say about "software implementation". The point is to allow hw switch/ish chips to be supported. > >> Signed-off-by: Jiri Pirko >> --- >> include/linux/if_link.h | 1 + >> ip/ipaddress.c | 8 ++++++++ >> 2 files changed, 9 insertions(+) >> >> diff --git a/include/linux/if_link.h b/include/linux/if_link.h >> index 4732063..a6e2594 100644 >> --- a/include/linux/if_link.h >> +++ b/include/linux/if_link.h >> @@ -145,6 +145,7 @@ enum { >> IFLA_CARRIER, >> IFLA_PHYS_PORT_ID, >> IFLA_CARRIER_CHANGES, >> + IFLA_PHYS_SWITCH_ID, >> __IFLA_MAX >> }; >> >> diff --git a/ip/ipaddress.c b/ip/ipaddress.c >> index 4d99324..bd36a07 100644 >> --- a/ip/ipaddress.c >> +++ b/ip/ipaddress.c >> @@ -589,6 +589,14 @@ int print_linkinfo(const struct sockaddr_nl *who, >> b1, sizeof(b1))); >> } >> >> + if (tb[IFLA_PHYS_SWITCH_ID]) { >> + SPRINT_BUF(b1); >> + fprintf(fp, "switchid %s ", >> + hexstring_n2a(RTA_DATA(tb[IFLA_PHYS_SWITCH_ID]), >> + RTA_PAYLOAD(tb[IFLA_PHYS_SWITCH_ID]), >> + b1, sizeof(b1))); >> + } >> + >> if (tb[IFLA_OPERSTATE]) >> print_operstate(fp, rta_getattr_u8(tb[IFLA_OPERSTATE]));