From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BCC4EA0569; Thu, 12 Mar 2020 10:04:04 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E81D1C021; Thu, 12 Mar 2020 10:04:04 +0100 (CET) Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by dpdk.org (Postfix) with ESMTP id 57CCF1C01E for ; Thu, 12 Mar 2020 10:04:03 +0100 (CET) Received: by mail-oi1-f194.google.com with SMTP id k21so4751648oij.5 for ; Thu, 12 Mar 2020 02:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=e3XvKhgTU57akm7gS6dG/T+GemEjGfwEyz/+il6ddQE=; b=fHTF15Iuct5rVMaXnz1QwVDmdO+JcEaFdnPzI5wjQ8MhH7V9MuoP4tc3lBjF63eOaw XFP21kLeek4jhrgkTyTjOr2GPFUYyxz34htXBL8oVAn+F381DSDGy8X/FLl0NTa8Z3gq goSzJ1QIivGm+orTR07j2oZ2oTvqtjv5nL3mI6KgV1xeMWTMDDGiBBcEJLCrP2XgTshm u4VYR1w4XDmwV3PrJcdKl1RXYD62a/4Z8db92umhZGEeE0qIoTOzsCnE5ElkddrOVEbp m/k9LTITS6JHoFpRkHpK+71GftFFoS7C50W7DtnmegfiKxH4kDtPMFVLsKg4yF6m/PdS O9IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=e3XvKhgTU57akm7gS6dG/T+GemEjGfwEyz/+il6ddQE=; b=tLvDzFAPvbrBp3oVTmM+g/7wHtBBRMGWk7oggvvlM4MKnMUjejH0MOtggyDtwi8Mx0 9BvRvoBiwg5nY4tMmFyYW+WEpL2vAMaKu34tABUepwzMvoVqBvJ9tJYaeKS/TbOdj7Wn YpjJ9gCheXy3BdVY5mv/OkOeRVmAq1UU+u1RuW8HlQ8IVSWptmD0zibjXLR83xLzQl7p VNYiiGlgv25QhZdUqiBQmp+UJi6qss2YuBNF/Ks8KDC89NhiQvC99gyO0iuocj5OVC00 BWPH7e58JqEhHc00eyqqsOTNajmn3dVxpC8sHmHT/o3KKeUfkqCS+xrmnSRIBXhNE6JI eD6Q== X-Gm-Message-State: ANhLgQ1KgqL1TqdJGdIBN/oN9cLk46RqvxwWX5ul1U5IM8sH8AJLYVUW Nzq9YzUeEsWyhoSikLwykfEvMdeQKmxuXSoTM69xs0DdUNQ= X-Google-Smtp-Source: ADFU+vtfZs1A2V5/3PnIKT0ewbYx9tZswQxDDZzCFWw+W/lDfOMeMZeHfVKmCB/H8N9hZMR/MKAR5niYw5zWK2ZhRGw= X-Received: by 2002:aca:cf48:: with SMTP id f69mr1667781oig.122.1584003842355; Thu, 12 Mar 2020 02:04:02 -0700 (PDT) MIME-Version: 1.0 References: <20200304080906.57f36c5a@hermes.lan> In-Reply-To: <20200304080906.57f36c5a@hermes.lan> From: Muhammad Ahmad Date: Thu, 12 Mar 2020 14:03:26 +0500 Message-ID: To: dev@dpdk.org Cc: Stephen Hemminger , bruce.richardson@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [RFC] A REST API based daemon of dpdk-devbind.py 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thanks for your comments. "Better" may be subjective as the tool we are working on and using within out infrastructure provides a RESTful API interface whereas "driverctl" as you said seems more generic. "driverctl" is an external tool and isn't part of DPDK toolset, what we are providing here is more suitable for DPDK specific automated testing, this is more of an argument of suitability of CLI interface tools vs REST API tools which is what the industry preferred interface "is/maybe". We believed this is more suitable for "Automated Testing and Integration" use-cases, and integrating various scripts in one main as modules made more sense to us. I understand the tools functionality does not directly affect DPDK as they aren't a part of core codebase, but they certainly impact how DPDK is used. Please let me know if this isn't something to be accepted in DPDK upstream, we can then perhaps push it to upstream pip repo as a python module or a CLI tool as a third-party DPDK tool. Thanks -Ahmad On Wed, Mar 4, 2020 at 9:09 PM Stephen Hemminger wrote: > > On Wed, 4 Mar 2020 12:11:05 +0500 > Muhammad Ahmad wrote: > > > Hi, > > I have observed that the dpdk-devbind.py is an interactive tool and > > not quite useful for automated testing in CI/CD. We are planning to > > create =E2=80=9Cdpdk-usertools-server=E2=80=9D for making it streamline= d. > > The idea is to create a separate application, which provides REST inter= face to: > > - Query the current status of devices and drivers > > - Bind and unbind devices to different drivers > > > > Future extensions will be to make dpdk-pmdinfo.py, cpu_layout.py and > > dpdk-setup.sh more automation friendly. > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DDetails of API=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > -Query Status of devices: > > Fetch the status of all devices or of a given group, supported > > groups are: network, crypto, event and mempool devices. > > URL: /devices > > Method:GET > > URL Params: type=3D[all|net|baseband|crypto|event|mempool|compr= ess] > > Sample call: curl http://127.0.0.1:5000/devices?type=3Dcrypto&t= ype=3Dnet > > Success Response: > > HTTP response code: 200 > > Content: > > [ > > { > > "pci":"0000:b7:00.3", > > "type":"net", > > "infoString":"Ethernet Connection X722 for 10GbE SFP+ 37d0= ", > > "interface":"eno8", > > "driver":"i40e", > > "unusedDriver":"igb_uio", > > "active":false > > } > > ] > > Error response: > > HTTP Code: 400 BAD REQUEST > > Content: > > { > > "code": 1, > > "message": "invalid type" > > } > > > > > > -Bind/Unbind device with a driver: > > Bind the PCI devices to the given driver or =E2=80=9Cnone=E2=80=9D = to unbind > > URL:/devices/ > > Method: PUT > > URL Prams: PCI=3D[PCI address] > > Sample call: curl http://127.0.0.1:5000/devices/0000:b7:00.3 > > --header "Content-Type: application/json" --request PUT --data > > '{driver:"igb_uio", force: false}' > > Success Response: > > HTTP response code: 200 > > Content: > > { > > "pci":"0000:b7:00.3", > > "type":"net", > > "infoString":"Ethernet Connection X722 for 10GbE SFP+ 37d0= ", > > "interface":"", > > "driver":"igb_uio", > > "unusedDriver":"i40e", > > "active":false > > } > > Error response: > > Code: 400 BAD REQUEST > > Content: > > { > > "code": 1, > > "message": "invalid id" > > } > > > > OR > > Code: 400 BAD REQUEST > > Content: > > { > > "code": 2, > > "message": "invalid driver" > > } > > > > OR > > Code: 405 METHOD NOT ALLOWED > > Content: > > { > > "code": 3, > > "message": "PCI Device active run with force=3DTRUE" > > } > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D++++++++=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > > Signed-off-by: Muhammad Ahmad > > There already is a better generic tool driverctl https://gitlab.com/drive= rctl/driverctl > It is already in many distributions > > I would recommend using that instead of extending the limited DPDK tool.