From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0052.outbound.protection.outlook.com [104.47.0.52]) by dpdk.org (Postfix) with ESMTP id C23352BD3 for ; Thu, 29 Mar 2018 08:13:59 +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=Zb6DANsjZbv4/0aAbPTSz31S8BNB/gE7Bx5zOaYVk7o=; b=cUM2L3yK7+Ij5/4ORlfbOp6/8lwVC4dBdcWgvYSXwBgwvcNOMWGmoDaa4K6z1q4D1+K2I+ARQrUcTjiJUVglnXITXOSniy7RailxtqHlk3x8Oo1uiSn7HGMrcjpVzaR7qpLs0vmbUltfA+io0YNKO8YlamttAg7RVONuKwqVYEo= 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:56 +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:56 +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 4/8] ethdev: Add port representor device flag Thread-Index: AQHTxp1/K93+f4GS30COmQnZGbWbRKPmuILg Date: Thu, 29 Mar 2018 06:13:56 +0000 Message-ID: References: <20180328135433.20203-1-declan.doherty@intel.com> <20180328135433.20203-5-declan.doherty@intel.com> In-Reply-To: <20180328135433.20203-5-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:vcAbLnsUSyxvfQEEy749PLjlVcqqoF/xSgLVMeS0xUwSo3dFwAN5jXnByOqTyM0/U3no/i/KKJjE8Ade/vIUZUkpvP4kbU5+wk1vdiDoH5AUBDMpf3KiNAg/P4aMAdPj1B8KSt37Ln1TNbD78CzQfxNRQSrtbg3bNs/AFVBSkzDnCSA+PqWgoNSzsGLSVr9ighGQUu/E94Y3Y/S3syt+UmFj4fGjHDusQjt+a+uIm/+hprlNiXswyni2EPnm2Us4 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: fdfd886b-6d6e-4055-88dc-08d5953c4144 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:(278428928389397)(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)(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)(59450400001)(53936002)(305945005)(6246003)(55016002)(486005)(476003)(86362001)(446003)(486005)(9686003)(2906002)(11346002)(6436002)(97736004)(25786009)(478600001)(66066001)(68736007)(4326008)(3660700001)(99286004)(39060400002)(74316002)(14454004)(575784001)(3280700002)(87944003); 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: nAjnc5w/1fqrobkkR0or2Ts0sViIQ4juwFDcZGCpJeQJPeVbXMeEibwT+j/PSf+8f5Ig/jdHJM8arpA8WUPf7dkPqkrBsIoxlymOAruv1d4oNcI/Unm/AAX1SArJ48FH8OopMfi6OneGu/ahKsipLS0gZKyJzHXnXx7rLA0l7K+JXfgtP17xomujfeN0F1iOGNRZsoqzbawKXNd2GpKZ/hjFJf+AmmKbVz1/ajzmpcKdw78WcGqj7YcHJ8abmE5nb6Aap6hHg4oFwDNGBV/o4cXxWSnWjK1aa7QmcWDjtQTjL4TSHLM4aS+yXkHQkYwDMLIFmgkPofCaxgIQBFWGMg== 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: fdfd886b-6d6e-4055-88dc-08d5953c4144 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2018 06:13:56.6661 (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 4/8] ethdev: Add port representor device flag 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:14:00 -0000 Wednesday, March 28, 2018 4:54 PM, Declan Doherty: > Subject: [dpdk-dev][PATCH v6 4/8] ethdev: Add port representor device fla= g >=20 > Add new device flag to specify that ethdev port is a port representor. > Extend rte_eth_dev_info structure to expose device flags to user which > enable applications to discover if a port is a representor port. >=20 > Signed-off-by: Declan Doherty > --- > lib/librte_ether/rte_ethdev.c | 1 + > lib/librte_ether/rte_ethdev.h | 9 ++++++--- > lib/librte_ether/rte_ethdev_representor.h | 3 +++ > 3 files changed, 10 insertions(+), 3 deletions(-) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index c719f84a3..163246433 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2399,6 +2399,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct > rte_eth_dev_info *dev_info) > 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; > + dev_info->dev_flags =3D dev->data->dev_flags; > } >=20 > int > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h > index dced4fc41..226acc8b1 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -996,6 +996,7 @@ struct rte_eth_dev_info { > const char *driver_name; /**< Device Driver name. */ > unsigned int if_index; /**< Index to bound host interface, or 0 if > none. > Use if_indextoname() to translate into an interface name. */ > + uint32_t dev_flags; /**< Device flags */ > uint32_t min_rx_bufsize; /**< Minimum size of RX buffer. */ > uint32_t max_rx_pktlen; /**< Maximum configurable length of RX > pkt. */ > uint16_t max_rx_queues; /**< Maximum number of RX queues. */ > @@ -1229,11 +1230,13 @@ struct rte_eth_dev_owner { }; >=20 > /** Device supports link state interrupt */ > -#define RTE_ETH_DEV_INTR_LSC 0x0002 > +#define RTE_ETH_DEV_INTR_LSC 0x0002 > /** Device is a bonded slave */ > -#define RTE_ETH_DEV_BONDED_SLAVE 0x0004 > +#define RTE_ETH_DEV_BONDED_SLAVE 0x0004 > /** Device supports device removal interrupt */ > -#define RTE_ETH_DEV_INTR_RMV 0x0008 > +#define RTE_ETH_DEV_INTR_RMV 0x0008 > +/** Device is port representor */ > +#define RTE_ETH_DEV_REPRESENTOR 0x0010 Maybe it is a good time to make some order here.=20 I understand the decision to use flags instead of bit-field. It is better.= =20 However there is a mix here of device capabilities like : RTE_ETH_DEV_INTR_= LSC and RTE_ETH_DEV_INTR_RMV =20 And device attributes like : RTE_ETH_DEV_BONDED_SLAVE and RTE_ETH_DEV_REPRE= SENTOR. I don't think they belong together under the genetic name of dev_flags.=20 Moreover, I am not sure the fact device is bonded slave should be exposed t= o the application. It should be internal to ethdev and its port iterators.= =20 Finally I think representor port may need more info now (and in the future)= , for example the associated vf id. For that, I think it is better it to be exposed as a dedicated struct on de= vice info. >=20 > /** > * @warning > diff --git a/lib/librte_ether/rte_ethdev_representor.h > b/lib/librte_ether/rte_ethdev_representor.h > index cbc1f2855..f3726d0ba 100644 > --- a/lib/librte_ether/rte_ethdev_representor.h > +++ b/lib/librte_ether/rte_ethdev_representor.h > @@ -22,6 +22,9 @@ eth_dev_representor_port_init(struct rte_eth_dev > *ethdev, void *init_params) > /** representor inherits the switch id of it's base device */ > ethdev->data->switch_id =3D base_ethdev->data->switch_id; >=20 > + /** Set device flags to specify that device is a representor port */ > + ethdev->data->dev_flags |=3D RTE_ETH_DEV_REPRESENTOR; Should be set in the PMD, not in ethdev layer.=20 > + > return 0; > } >=20 > -- > 2.14.3