From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F15CA0564; Thu, 11 Mar 2021 20:55:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA0B74014D; Thu, 11 Mar 2021 20:55:13 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) by mails.dpdk.org (Postfix) with ESMTP id 57F1E40141; Thu, 11 Mar 2021 20:55:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AGV4W74hc4fXlQjkaHFucI3KwosgMIthY8oI17qYMCZnie6c3f6tW+np9us5k+FMQOE0AbK8IC5JIavnD7+8zaCYQ1Sv022nz9hNOiaE9CzQtOlsngWdWKBasE+oJyFZhmO4PeHrQXs99OK4pka3ghVMsXhutH+Ui5Rg2rY4FrhyG/qXmAHwAN8jnTM5lUq9CfS4eqa2E/GCS54OB444FI8f6VcoeV8IwmnsnkuXxgllhDeioDBnc9LScUyTNlPANoPBOFoO1WG6ouSFcyEGbmwgoE59cZrp0KJkdX/KG4UE89r9E+ZXBq0OUmKotIkZgFIcFB1pFQ4KazDoZaboAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jMt7fdioTSaKJZGRMlsFVHaM5fTplceVqANtDwXDHgA=; b=T9SnGMiGPzx/QLB/Crh/JtbwmO0bowmSJvw+9M7msOI0kgX8/+icy2nHg9HkG1Sml5FcYL/hhs5y/ttccruwaAHLg4CwYeX2FrrSjft9EMqlolmBOouA2RgsvXWbTQEZbKgyZkIv/roW5OTafiytjFApEQTnksU4aupQgq5aToIiHGcNyVJhbSauvOQlEWw2t96/TrNBW5CrUIOMiS6XL6S6LtbfhnIIXURUuq7XbAggArfk5ZJNp4BQ1hE7B9A+2Bioq3RpdAunzca2SzS8BKoWCjEndiseKQ6ov00Y4vocOxNuDhkrPqhK4lqFnZ/URDVld1VAUZH148Ru+3xS4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jMt7fdioTSaKJZGRMlsFVHaM5fTplceVqANtDwXDHgA=; b=Msyb5gytvPmdQleFIwBol1oYuZwr4wLsuiOjOZT38lv8qVgZiJEXgJRstbaxzEfYsd3R34//koWXen3iDVUIdSaDdaU3O8m8MGzMF3XXEzmj+hGJvWEH9hm4ANujzeXyM38tRtdO1DZpVAgVfJTU6/aY3gXEe2TW/QzumIb+/7QNX3/T9KCJM9OOfzZ8Ph0bJNMPsAoUOKtjAoDDGEEon4Nnu2KACggBzh6b+sr8sTPH3F3OB510Ph0tw/NHcTkSSsJGJfeyk0MR5xwFHDqcelJWS4fx4EbeKqQGBB9tOVT1jwZm1fEvGz+06R1p3Le4GYUPkregjPNMe5492Rfd5g== Received: from MW2PR12MB2492.namprd12.prod.outlook.com (2603:10b6:907:8::19) by MWHPR12MB1536.namprd12.prod.outlook.com (2603:10b6:301:6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Thu, 11 Mar 2021 19:55:10 +0000 Received: from MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::99f2:8567:2f9e:c351]) by MW2PR12MB2492.namprd12.prod.outlook.com ([fe80::99f2:8567:2f9e:c351%4]) with mapi id 15.20.3890.038; Thu, 11 Mar 2021 19:55:10 +0000 From: Matan Azrad To: Slava Ovsiienko , "dev@dpdk.org" CC: Raslan Darawsheh , Ori Kam , NBU-Contact-Thomas Monjalon , "stable@dpdk.org" Thread-Topic: [PATCH 3/5] vdpa/mlx5: add timestamp format support Thread-Index: AQHXEzkSUec4Me/HaEyhm7GWxMG4cqp/ObSQ Date: Thu, 11 Mar 2021 19:55:10 +0000 Message-ID: References: <20210307100251.22538-1-viacheslavo@nvidia.com> <20210307100251.22538-4-viacheslavo@nvidia.com> In-Reply-To: <20210307100251.22538-4-viacheslavo@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [216.228.117.190] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc3e9f57-84a7-468b-9e29-08d8e4c79414 x-ms-traffictypediagnostic: MWHPR12MB1536: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ELxypmWcpmKXJ5AbkFy5Q6YrMcOl3ZeI4IN35ZQN1yNx4jFUjMQYy3S29fTzA0/4nFb83tq0gh8sav1Bf+zQRHuuKYiNocmXw9p6fgx7Bh3sowfOD14Q030btfQ19yjeaeY93S2eH64bEOe6Z6cwcxGa/lAFHE/6y3CJxvBimxm/8kL3a3dEh4C6vsrBfVzzgnHsLoR1x+qzPLxZHSLSk5RbijDPKb/jEoWxwjErWebdN25DQOXrAgcFumQQ7jiZbyl5nVRd5+sEp2+Wb2BIEhoHxWrorNBjZFTDqjDbcunKXfl3dcdbNYjClsLMB7VcT8weCC9+GigqjF+p9pjfV9Y+BrgYfeUETzzmVkFxwkxvBQR6azpa0yRc3IRJx584Ae8fkyxulO0ZC6Y9g4HVQqwp1SJywyyDgZSFlm5zt9C2BOxWcztxYXR3DCRdSry6Z8RhE9kl76gGnfrgSXXT4uScJVxlaB7vboADdk0kbzy2VL3l44DO4P3rS9Joz8LbhWNBr1iOBAAD2IO2TG6GrQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB2492.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(136003)(366004)(346002)(478600001)(54906003)(316002)(7696005)(86362001)(52536014)(26005)(110136005)(6506007)(66476007)(66556008)(66946007)(55016002)(64756008)(76116006)(5660300002)(71200400001)(66446008)(2906002)(4326008)(9686003)(8676002)(8936002)(33656002)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?YQJpYuxqw/dzbORVsaK5Ptcd12JxhObvXb9YCnE+s4iG/vx66rAaAq3f8UxR?= =?us-ascii?Q?aI/fPYxpcolI1qjGT+m7Oi5/bJFXc2GoRlJSI45yurLS3NReMFET01XAZusO?= =?us-ascii?Q?B2yUsSJh/JuQHQiBCwSD/KHLOhy3Zipn8kUgCP7Li+lv0h0g4z/MKP4wnjVZ?= =?us-ascii?Q?UnHUzJlz2rWqdqhuWBIdgoYtywLSXiEQdR09BOeNJVtQsx89F9xaWiQrjJfq?= =?us-ascii?Q?7WtOzMtggoC7qluoPToeT0/eVd5lRo3h/AtJLmQQDLykYaKNeKudZSAlsR2i?= =?us-ascii?Q?ybCizor00LBsAqviepYjh8TtYdWZ0TXxqRrXQ1T9epHOwu8YKIG1YS+AB6sG?= =?us-ascii?Q?g1FOkFenWAn6NrGjTd2cSJ7kpfO9RN8iB7tK7mNkQrKlgD9IL8nJfnezA7Fa?= =?us-ascii?Q?E+ycarw8UwtPrip8WA4Caw7p6im1LGt2TupdvNVd0Lal+t7jqdrtcf6yc+T6?= =?us-ascii?Q?Q3Kwo/dFLVo3CBaqRVEaijszKfWbGd4aMC0Sh3UrhOs+vLncUKCLgj2Vw3za?= =?us-ascii?Q?kuJKJBH2RVm1Uc82oWRfL5F+1KaBmt8Mz79N1MYLWzXHsQ97xK2rZkzKQOov?= =?us-ascii?Q?kA1B3/tfDyI+3RJ65HLocLHvXAeLwm0+YtltjyO9AFIScUtL3V47R2o5/++p?= =?us-ascii?Q?Sdlxxbq8hEQH07WNPu/grnumwQdChaV3Zp5v87bz43L4Pkr+OxgjROcOSiZJ?= =?us-ascii?Q?e4Had1LHCUSE/OLmGC46veuYqmNSp46qbzIUMXussfQQVPWds6MwaC13MAsn?= =?us-ascii?Q?JS2G5FnfVPJd0XHdBvIlxAMphrMwQnzVTWKlVYqBjYctQpExAw05dOHtCVNk?= =?us-ascii?Q?McAIhJMPe95ayHMO0vsNSnftvowAEMtMIZB4zbjfdE1nG7KBG40RZd4ImdKu?= =?us-ascii?Q?b8Ch9raOAGAq9Y8H4um69nx1xMz6IxgEqNJ8zEo1NWbLau/umMvdjqEaWmAf?= =?us-ascii?Q?h6fjlhhBii478YSjWyFeicPdwzPLoQ6yLMV/DYEfdVPjAJPYYUnpFLfp7jtd?= =?us-ascii?Q?ZAddsWODWyMFo3YrUQYY7BVr2lXJBxV5BrDV/rphrQrfagQ3ZSzZ1HONQxqo?= =?us-ascii?Q?b1WSJyTQpYgqVf1sIVPrudrWbtKflpzCZEhj0iayoQs3m7l22KUPP1lHcgPT?= =?us-ascii?Q?0NfXCoVS7QI/SkA+BXRD/6Xkz4VtJcV7yHOWH52YIO/rHp5dCTVrhdyjX1Hg?= =?us-ascii?Q?1jhIL8vFKwJvxRmtIG0C+OwzrufrbulvikV8Bu8HNYobpSxVy58QPCDxDHLF?= =?us-ascii?Q?ULljI+NR9lS8bzqV3hFd7j4LCSCZLT47QkY2bZH7b9z9OKwN42W17kG6aTjq?= =?us-ascii?Q?3PiSZTsw3rIfszIH0gF+Nsve?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB2492.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc3e9f57-84a7-468b-9e29-08d8e4c79414 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Mar 2021 19:55:10.5749 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FE1nYbSrwJSaeiYxFbyGN0tNfjtjRlQfvEygeoc22Zg8wzH1pdSQv9rIbyFxJoXcxlerpLP2gqXQ3TgsD207bA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1536 Subject: Re: [dpdk-dev] [PATCH 3/5] vdpa/mlx5: add timestamp format support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Viacheslav Ovsiienko > This patch adds support for the timestamp format settings for the queues = pairs. > If the firmware version x.30.256 or above is installed and the NIC timest= amps > are configured with the real-time format, the default zero values for new > added values cause the queue creation reject. The patch queries the times= tamp > formats supported by the hardware and sets the configuration values in qu= eue > context accordingly. >=20 > Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver") > Cc: stable@dpdk.org >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/vdpa/mlx5/mlx5_vdpa.c | 1 + > drivers/vdpa/mlx5/mlx5_vdpa.h | 1 + > drivers/vdpa/mlx5/mlx5_vdpa_event.c | 8 ++++++++ > 3 files changed, 10 insertions(+) >=20 > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.= c > index 4c2d886bd7..af15977800 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c > @@ -745,6 +745,7 @@ mlx5_vdpa_pci_probe(struct rte_pci_driver *pci_drv > __rte_unused, > priv->caps =3D attr.vdpa; > priv->log_max_rqt_size =3D attr.log_max_rqt_size; > priv->num_lag_ports =3D attr.num_lag_ports; > + priv->qp_ts_format =3D attr.qp_ts_format; > if (attr.num_lag_ports =3D=3D 0) > priv->num_lag_ports =3D 1; > priv->ctx =3D ctx; > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.= h > index 98c71aad4c..d93b430c97 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa.h > +++ b/drivers/vdpa/mlx5/mlx5_vdpa.h > @@ -152,6 +152,7 @@ struct mlx5_vdpa_priv { > struct mlx5_devx_obj *tiss[16]; /* TIS list for each LAG port. */ > uint16_t nr_virtqs; > uint8_t num_lag_ports; > + uint8_t qp_ts_format; > uint64_t features; /* Negotiated features. */ > uint16_t log_max_rqt_size; > struct mlx5_vdpa_steer steer; > diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c > b/drivers/vdpa/mlx5/mlx5_vdpa_event.c > index 86adc864f5..fcc6b30a05 100644 > --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c > +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c > @@ -662,6 +662,10 @@ mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv > *priv, uint16_t desc_n, > if (mlx5_vdpa_cq_create(priv, log_desc_n, callfd, &eqp->cq)) > return -1; > attr.pd =3D priv->pdn; > + attr.ts_format =3D > + priv->qp_ts_format =3D=3D > MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR ? > + MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING : > + MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; Later on, we can think how we save this configuration in common for all the= device drivers, with probably more other global managements... > eqp->fw_qp =3D mlx5_devx_cmd_create_qp(priv->ctx, &attr); > if (!eqp->fw_qp) { > DRV_LOG(ERR, "Failed to create FW QP(%u).", rte_errno); @@ > -692,6 +696,10 @@ mlx5_vdpa_event_qp_create(struct mlx5_vdpa_priv *priv, > uint16_t desc_n, > attr.wq_umem_offset =3D 0; > attr.dbr_umem_id =3D eqp->umem_obj->umem_id; > attr.dbr_address =3D (1 << log_desc_n) * MLX5_WSEG_SIZE; > + attr.ts_format =3D > + priv->qp_ts_format =3D=3D > MLX5_HCA_CAP_TIMESTAMP_FORMAT_FR ? > + MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING : > + MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; > eqp->sw_qp =3D mlx5_devx_cmd_create_qp(priv->ctx, &attr); > if (!eqp->sw_qp) { > DRV_LOG(ERR, "Failed to create SW QP(%u).", rte_errno); > -- > 2.28.0 Acked-by: Matan Azrad