From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0069.outbound.protection.outlook.com [104.47.0.69]) by dpdk.org (Postfix) with ESMTP id A633F2BBD for ; Thu, 29 Mar 2018 08:13:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qnSsWKvRtDNjYcSYLT8UB/ikb49VtYt+Dj8dlpvAib0=; b=Vd9CORdwishrKZSzrgXkEgrQQW29Wc1Dwh+UznQx2Rgr9ZujX5yoje+7AA5GFfxvOZiPWGtksU4F2UGNogGy6cLiNzpswBfJKSjpURq/6d/G67jruPNfsB5Vp/Lc726tdEeHEnCe/SjqduuqAvxfRQOWMQp4MpoWUzfpeqfkE6k= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4137.eurprd05.prod.outlook.com (52.134.107.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Thu, 29 Mar 2018 06:13:53 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::808d:386e:26f3:859f]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::808d:386e:26f3:859f%13]) with mapi id 15.20.0609.012; Thu, 29 Mar 2018 06:13:53 +0000 From: Shahaf Shuler To: Declan Doherty , "dev@dpdk.org" CC: Alex Rosenbaum , Ferruh Yigit , Thomas Monjalon , Qi Zhang , Alejandro Lucero , Andrew Rybchenko , Mohammad Abdul Awal , Remy Horton , "John McNamara" , Rony Efraim , Wu , Jingjing , Lu , Wenzhuo , Vincent JArdin , Yuanhan Liu , Richardson , Bruce , Ananyev , Konstantin , Wang , Zhihong Thread-Topic: [dpdk-dev][PATCH v6 2/8] ethdev: add switch identifier parameter to port Thread-Index: AQHTxp15ZS6FT5zsT0SS1BMjKiaGcqPmtiaw Date: Thu, 29 Mar 2018 06:13:52 +0000 Message-ID: References: <20180328135433.20203-1-declan.doherty@intel.com> <20180328135433.20203-3-declan.doherty@intel.com> In-Reply-To: <20180328135433.20203-3-declan.doherty@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.107] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4137; 7:UdIlx/q6GsO+uYQDNWAPeF4mg3pLyFNgbvSStptuzP7yrgtQunkfHaepXuh/V1VTlO3oNs4N1gsjPsnrktFZJuo+iVaBH832V+9vkftlvaHUQHMQQWrcAklOjxqpB1iMRAVqInQVI85kLjj5sA6NUhAPCkmQuBF0kXa7rm09tnfza0y8awo2tmd+lnGBh6Y4pWlrxjZ85+ju6rvDQV3ePOu4v1ptZF+BZsJk19Q0s6UsYgh7M/IUbOWHTKn54U3i x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 65b2ab05-5729-4ae2-c9db-08d5953c3efe x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4137; x-ms-traffictypediagnostic: DB7PR05MB4137: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231221)(944501327)(52105095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB7PR05MB4137; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4137; x-forefront-prvs: 0626C21B10 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(39860400002)(396003)(39380400002)(376002)(346002)(51234002)(51914003)(199004)(189003)(2900100001)(6506007)(3846002)(7696005)(7416002)(229853002)(2501003)(6116002)(26005)(33656002)(102836004)(81166006)(5660300001)(81156014)(186003)(106356001)(105586002)(316002)(76176011)(7736002)(54906003)(8936002)(8676002)(110136005)(5250100002)(53936002)(305945005)(6246003)(55016002)(486005)(476003)(86362001)(446003)(486005)(9686003)(2906002)(11346002)(6436002)(97736004)(25786009)(478600001)(66066001)(68736007)(4326008)(3660700001)(99286004)(39060400002)(74316002)(14454004)(3280700002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4137; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: MQwqtruKcEJw7yI8dPp8o2Fq5a5FbWzaC3iZatrMoEOjLap1EtjQnFs+VWPAQFNyhqIc9MpPo0SCShQ3oRBTqq1VOLfWs04C9uyuFJzvfiCD4E1dcVa/zVmkZxihQsWG2w/86CVgIohyetinRFlhx+v6bKgp8Xz0pOCxFp6FRuMkhWOgCwefXIPvpgkw388HDdNBFeByJCUiGC+b1twBIOybrKxi/F6se5tUVFQPEoJTfcGCgscIU5A8pEC6MfjF+CSS6n9AwSV2HW/FhAQgZ5LRgfRdrhOUXgZR5EqCvrTvubHDi8VeoOM1D3SfFIkFrLKJ1fUB4YdtKgJN14bLHA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65b2ab05-5729-4ae2-c9db-08d5953c3efe X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2018 06:13:52.8536 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4137 Subject: Re: [dpdk-dev] [PATCH v6 2/8] ethdev: add switch identifier parameter to port X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 06:13:57 -0000 Hi Declan, Thanks for the series! See some comments below Wednesday, March 28, 2018 4:54 PM, Declan Doherty: > Subject: [dpdk-dev][PATCH v6 2/8] ethdev: add switch identifier parameter > to port >=20 > Introduces a new port attribute to ethdev port's which denotes the switch > domain a port belongs to. By default all port's switch identifiers are th= e their > port_id. Ports which share a common switch domain are configured with the > same switch id. >=20 > Signed-off-by: Declan Doherty > --- > app/test-pmd/config.c | 1 + > lib/librte_ether/rte_ethdev.c | 3 +++ > lib/librte_ether/rte_ethdev.h | 1 + > lib/librte_ether/rte_ethdev_core.h | 1 + > 4 files changed, 6 insertions(+) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > 4bb255c62..e12f8c515 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -517,6 +517,7 @@ port_infos_display(portid_t port_id) > printf("Min possible number of TXDs per queue: %hu\n", > dev_info.tx_desc_lim.nb_min); > printf("TXDs number alignment: %hu\n", > dev_info.tx_desc_lim.nb_align); > + printf("Switch Id: %u\n", dev_info.switch_id); > } >=20 > void > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index 23857c91f..f32d18cad 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -290,6 +290,8 @@ rte_eth_dev_allocate(const char *name) > eth_dev =3D eth_dev_get(port_id); > snprintf(eth_dev->data->name, sizeof(eth_dev->data->name), > "%s", name); > eth_dev->data->port_id =3D port_id; > + eth_dev->data->switch_id =3D port_id; > + /**< Default switch_id is the port_id of the device */ Why such default is needed? Why not let the PMD to set it always? > eth_dev->data->mtu =3D ETHER_MTU; >=20 > unlock: > @@ -2395,6 +2397,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct > rte_eth_dev_info *dev_info) > dev_info->driver_name =3D dev->device->driver->name; > dev_info->nb_rx_queues =3D dev->data->nb_rx_queues; > dev_info->nb_tx_queues =3D dev->data->nb_tx_queues; > + dev_info->switch_id =3D dev->data->switch_id; Why there is a need to keep the switch_id on device data?=20 I think PMD to store it on its private structure and report it in dev_info = is enough.=20 > } >=20 > int > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h > index 036153306..dced4fc41 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1029,6 +1029,7 @@ struct rte_eth_dev_info { > /** Configured number of rx/tx queues */ > uint16_t nb_rx_queues; /**< Number of RX queues. */ > uint16_t nb_tx_queues; /**< Number of TX queues. */ > + uint16_t switch_id; /**< Switch Domain Id */ > }; >=20 > /** > diff --git a/lib/librte_ether/rte_ethdev_core.h > b/lib/librte_ether/rte_ethdev_core.h > index e5681e466..caed7a4e6 100644 > --- a/lib/librte_ether/rte_ethdev_core.h > +++ b/lib/librte_ether/rte_ethdev_core.h > @@ -585,6 +585,7 @@ struct rte_eth_dev_data { > struct ether_addr* hash_mac_addrs; > /** Device Ethernet MAC addresses of hash filtering. */ > uint16_t port_id; /**< Device [external] port identifier. */ > + uint16_t switch_id; /**< Switch which port is associated with > */ > __extension__ > uint8_t promiscuous : 1, /**< RX promiscuous mode ON(1) / OFF(0). > */ > scattered_rx : 1, /**< RX of scattered packets is ON(1) / > OFF(0) */ > -- > 2.14.3