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 8A2E2A056B; Wed, 4 Mar 2020 08:11:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D76392C4F; Wed, 4 Mar 2020 08:11:43 +0100 (CET) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by dpdk.org (Postfix) with ESMTP id 72B3D2C16 for ; Wed, 4 Mar 2020 08:11:42 +0100 (CET) Received: by mail-ot1-f66.google.com with SMTP id x19so1028116otp.7 for ; Tue, 03 Mar 2020 23:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=VEqu9AFYa/VBsrBFj2VfjrKriZTxWoFKBZ3WuMK9wGc=; b=uoc3W6dQlaEylVvgZ7FOrZ75QKLZ5mMgkOC872sDxOMmMg4N+H2QK6m7B3wUEDJK3t 4hnO7/0W/R7xSoemT9MNpom9+hurdy/jiJwfgTceAgFCe20opT9qkEM5eR7nLvr6oOQ2 YoNi7VGiEV5Xox//au4BdP+8Yx1hHyOXkqGMkMNH0pDMlyy2SX2Unf8e3TPw67jJQ6tg X6swAkz2YUXQ+yWUAT+V94apAic/cpzbFVDfoSf1/CzgEicihfcfDd3pSIo3XmrAvZo2 GeT/ekW5w5wf1U5KEgWxXRxHIkA/NFtC0aQuRcLbvkFJWj/+gQz4THgWBaQd0xl43C80 gDzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=VEqu9AFYa/VBsrBFj2VfjrKriZTxWoFKBZ3WuMK9wGc=; b=JpUS75VqlAab2C0qONylB8pQ0UHV04gWe3kNu308FB6fObU7PrqutdqWVlPMAm1Ach ndLDMyfrGwJKTyGILD80ofNEDB1RlIlx92VpHM8XtFpHuWYaiVp7Q4rUcbsVHHjDh6dm g+kyq6FD9uI7YbX7a4zyfQQ7Ex/tZyF8zL4sjxXtLr7XT406T7ow2X8zujMMobV3VHtO 9BuuYuHqA3QSttiVJN2MH9lnNwAeeEQo9Y8S50rorEtiW3RGvmcXLSAR6uEds0btYj6j vkXGQjteNAHFrJYKksiDT5oyvzsNQ3iZPCPKfCvuIiXLl4XXjvuaIIBFeG6hvxulTg/p Ub+A== X-Gm-Message-State: ANhLgQ2B4uiMv9Ynr0hqsmbho8WNlDgMpy5BQEsShyhUqlTZERDnPrtJ FsC9vslVgLQlihLudnE8bC0/1LbPwNjzdKXz+2/E/O9+UtA= X-Google-Smtp-Source: ADFU+vv6jmWEuBlMyGlvIO4WigRGzUXj6gKRqW3AySa8jYgaDcs7QtxrD/pDVIWBkftoTcuAc2eNebM+CP4s0wG0Cvk= X-Received: by 2002:a9d:5e8b:: with SMTP id f11mr1341863otl.110.1583305901484; Tue, 03 Mar 2020 23:11:41 -0800 (PST) MIME-Version: 1.0 From: Muhammad Ahmad Date: Wed, 4 Mar 2020 12:11:05 +0500 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: [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" 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 streamlined. The idea is to create a separate application, which provides REST interface= 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|compress] Sample call: curl http://127.0.0.1:5000/devices?type=3Dcrypto&type= =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 u= nbind 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