From patchwork Wed Jan 27 19:30:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rami Rosen X-Patchwork-Id: 574141 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8990C1402EC for ; Thu, 28 Jan 2016 06:30:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934522AbcA0Ta3 (ORCPT ); Wed, 27 Jan 2016 14:30:29 -0500 Received: from mga02.intel.com ([134.134.136.20]:64695 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934408AbcA0TaX convert rfc822-to-8bit (ORCPT ); Wed, 27 Jan 2016 14:30:23 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 27 Jan 2016 11:30:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,356,1449561600"; d="scan'208";a="37247904" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 27 Jan 2016 11:30:23 -0800 Received: from HASMSX109.ger.corp.intel.com (10.184.198.21) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 27 Jan 2016 11:30:21 -0800 Received: from HASMSX110.ger.corp.intel.com ([169.254.11.58]) by hasmsx109.ger.corp.intel.com ([169.254.3.144]) with mapi id 14.03.0248.002; Wed, 27 Jan 2016 21:30:19 +0200 From: "Rosen, Rami" To: Roopa Prabhu , "stephen@networkplumber.org" CC: "netdev@vger.kernel.org" , "wkok@cumulusnetworks.com" , "scotte@cumulusnetworks.com" , "nikolay@cumulusnetworks.com" , "makita.toshiaki@lab.ntt.co.jp" , "Rosen, Rami" Subject: RE: [PATCH iproute2] bridge: support for static fdb entries Thread-Topic: [PATCH iproute2] bridge: support for static fdb entries Thread-Index: AQHRWSWYYjj/9sbQbkKxfNun+zRlIJ8PvysA Date: Wed, 27 Jan 2016 19:30:18 +0000 Message-ID: <9B0331B6EBBD0E4684FBFAEDA55776F92CB5E597@HASMSX110.ger.corp.intel.com> References: <1453914577-43389-1-git-send-email-roopa@cumulusnetworks.com> In-Reply-To: <1453914577-43389-1-git-send-email-roopa@cumulusnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWYzNmZlMGUtOTAyMi00NmYyLTlhNmMtYzZiZWIzMDQ5YTZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS40LjEwLjE5IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik5uc1wvZXF4NW9jSlZseVRZM1FPS0dcL08wdW8xTlJDZmJ2TWFYdlJCVTRcL1k9In0= x-ctpclassification: CTP_PUBLIC x-originating-ip: [10.184.70.10] MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org +1 'temp' seems indeed not to be intuitive enough as 'static' in this context. Regards, Rami Rosen Intel Corporation -----Original Message----- From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Roopa Prabhu Sent: Wednesday, January 27, 2016 7:10 PM To: stephen@networkplumber.org Cc: netdev@vger.kernel.org; wkok@cumulusnetworks.com; scotte@cumulusnetworks.com; nikolay@cumulusnetworks.com; makita.toshiaki@lab.ntt.co.jp Subject: [PATCH iproute2] bridge: support for static fdb entries From: Roopa Prabhu There is no intuitive option to add static fdb entries today. 'temp' seems to have a side effect of adding 'static' fdb entries. But the name and intent of 'temp' does not say anything about it being static. example: bridge fdb add operates as follows: $bridge fdb add 00:01:02:03:04:05 dev eth0 master $bridge fdb add 00:01:02:03:04:06 dev eth0 master temp $bridge fdb add 00:01:02:03:04:07 dev eth0 master local $bridge fdb show 00:01:02:03:04:05 dev eth0 permanent 00:01:02:03:04:06 dev eth0 static 00:01:02:03:04:07 dev eth0 permanent 00:01:02:03:04:08 dev eth0 <<== dynamic, ageable learned mac This patch adds a new bridge fdb type 'static' which makes sure NUD_NOARP and NUD_REACHABLE is set for static entries. This effectively is nothing but what 'temp' does today. But the name 'temp' is misleading. After the patch: $bridge fdb add 00:01:02:03:04:06 dev eth0 master static $bridge fdb show 00:01:02:03:04:06 dev eth0 static 'temp' could ideally be a dynamic mac that can age (ie just NUD_REACHABLE). But, 'temp' sets 'NUD_NOARP' and 'NUD_REACHABLE'. Too late to change 'temp' now. But, we are thinking of introduing a 'dynamic' keyword after this patch that only sets NUD_REACHABLE. Signed-off-by: Wilson Kok Signed-off-by: Roopa Prabhu --- Will submit another patch to document bridge fdb options once we agree on the behaviour and this patch is accepted. bridge/fdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bridge/fdb.c b/bridge/fdb.c index 4d10925..9bc6b94 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -33,7 +33,7 @@ static void usage(void) { fprintf(stderr, "Usage: bridge fdb { add | append | del | replace } ADDR dev DEV\n" " [ self ] [ master ] [ use ] [ router ]\n" - " [ local | temp ] [ dst IPADDR ] [ vlan VID ]\n" + " [ local | temp | static ] [ dst IPADDR ] [ vlan VID ]\n" " [ port PORT] [ vni VNI ] [ via DEV ]\n"); fprintf(stderr, " bridge fdb [ show [ br BRDEV ] [ brport DEV ] ]\n"); exit(-1); @@ -301,7 +301,8 @@ static int fdb_modify(int cmd, int flags, int argc, char **argv) } else if (matches(*argv, "local") == 0|| matches(*argv, "permanent") == 0) { req.ndm.ndm_state |= NUD_PERMANENT; - } else if (matches(*argv, "temp") == 0) { + } else if (matches(*argv, "temp") == 0 || + matches(*argv, "static") == 0) { req.ndm.ndm_state |= NUD_REACHABLE; } else if (matches(*argv, "vlan") == 0) { if (vid >= 0)