From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id F364D2B9D for ; Fri, 5 Aug 2016 16:41:55 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 05 Aug 2016 07:41:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,474,1464678000"; d="scan'208";a="1030376596" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga002.jf.intel.com with ESMTP; 05 Aug 2016 07:41:46 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX151.ger.corp.intel.com (163.33.192.59) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 5 Aug 2016 15:41:45 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.102]) by irsmsx111.ger.corp.intel.com ([169.254.2.113]) with mapi id 14.03.0248.002; Fri, 5 Aug 2016 15:41:45 +0100 From: "Kavanagh, Mark B" To: "dev@dpdk.org" CC: 'Ilya Maximets' , 'Daniele Di Proietto' Thread-Topic: [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports. Thread-Index: AQHR7yYOYN2JU3pKikWF5r+cQOmWvaA6bsbA Date: Fri, 5 Aug 2016 14:41:44 +0000 Message-ID: References: <1470407413-157932-1-git-send-email-mark.b.kavanagh@intel.com> In-Reply-To: <1470407413-157932-1-git-send-email-mark.b.kavanagh@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGU4YTc5OTUtZjc5OS00NjIzLTgyY2UtNWNkOWQ2OGI2ZmYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjNoWlBackJWaEszVTlRVXFuZkpsV1dhNDAyaWJ3XC9IZGlVelN2UTExWjJzPSJ9 x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 14:41:56 -0000 Please disregard this patchset - it was sent erroneously to the incorrect m= ailing list. I've already removed the related patches from Patchwork. Cheers, Mark=20 >-----Original Message----- >From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mark Kavanagh >Sent: Friday, August 5, 2016 3:30 PM >To: dev@dpdk.org; diproiettod@vmware.com >Cc: i.maximets@samsung.com >Subject: [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looki= ng for internal >ports. > >From: Daniele Di Proietto > >Interfaces with type "internal" end up having a netdev with type "tap" >in the dpif-netdev datapath, so a strcmp will fail to match internal >interfaces. > >We can translate the types with ofproto_port_open_type() before calling >strcmp to fix this. > >This fixes a minor issue where internal interfaces are considered >non-internal in the userspace datapath for the purpose of adjusting the >MTU. > >Signed-off-by: Daniele Di Proietto >--- > ofproto/ofproto.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c >index 8e59c69..088f91a 100644 >--- a/ofproto/ofproto.c >+++ b/ofproto/ofproto.c >@@ -220,7 +220,8 @@ static void learned_cookies_flush(struct ofproto *, st= ruct ovs_list >*dead_cookie > /* ofport. */ > static void ofport_destroy__(struct ofport *) OVS_EXCLUDED(ofproto_mutex)= ; > static void ofport_destroy(struct ofport *, bool del); >-static inline bool ofport_is_internal(const struct ofport *); >+static inline bool ofport_is_internal(const struct ofproto *, >+ const struct ofport *); > > static int update_port(struct ofproto *, const char *devname); > static int init_ports(struct ofproto *); >@@ -2465,7 +2466,7 @@ static void > ofport_remove(struct ofport *ofport) > { > struct ofproto *p =3D ofport->ofproto; >- bool is_internal =3D ofport_is_internal(ofport); >+ bool is_internal =3D ofport_is_internal(p, ofport); > > connmgr_send_port_status(ofport->ofproto->connmgr, NULL, &ofport->pp, > OFPPR_DELETE); >@@ -2751,9 +2752,10 @@ init_ports(struct ofproto *p) > } > > static inline bool >-ofport_is_internal(const struct ofport *port) >+ofport_is_internal(const struct ofproto *p, const struct ofport *port) > { >- return !strcmp(netdev_get_type(port->netdev), "internal"); >+ return !strcmp(netdev_get_type(port->netdev), >+ ofproto_port_open_type(p->type, "internal")); > } > > /* Find the minimum MTU of all non-datapath devices attached to 'p'. >@@ -2770,7 +2772,7 @@ find_min_mtu(struct ofproto *p) > > /* Skip any internal ports, since that's what we're trying to > * set. */ >- if (ofport_is_internal(ofport)) { >+ if (ofport_is_internal(p, ofport)) { > continue; > } > >@@ -2797,7 +2799,7 @@ update_mtu(struct ofproto *p, struct ofport *port) > port->mtu =3D 0; > return; > } >- if (ofport_is_internal(port)) { >+ if (ofport_is_internal(p, port)) { > if (dev_mtu > p->min_mtu) { > if (!netdev_set_mtu(port->netdev, p->min_mtu)) { > dev_mtu =3D p->min_mtu; >@@ -2827,7 +2829,7 @@ update_mtu_ofproto(struct ofproto *p) > HMAP_FOR_EACH (ofport, hmap_node, &p->ports) { > struct netdev *netdev =3D ofport->netdev; > >- if (ofport_is_internal(ofport)) { >+ if (ofport_is_internal(p, ofport)) { > if (!netdev_set_mtu(netdev, p->min_mtu)) { > ofport->mtu =3D p->min_mtu; > } >-- >1.9.3