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 59D76A0573; Wed, 4 Mar 2020 17:09:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9AD862C02; Wed, 4 Mar 2020 17:09:17 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by dpdk.org (Postfix) with ESMTP id 0F08B2BB8 for ; Wed, 4 Mar 2020 17:09:16 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id g6so1210583plt.2 for ; Wed, 04 Mar 2020 08:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KlPQVVUpg+DKzqiz2STO+mOd/mnY4h4H1Nwi0RQQ6z8=; b=Jtz4VyYmdVGPSrsS6Y2d55wL1uiQEeDWo4kJzw8XJCsffJE5D/JajzEVKhyKDSV3OH ZXrVhdTPUfYLCw97XZ8MYwdumDAG6Y+ZI6U7w9XJ4xqBqlPM0c1eGdwwRf2bGw3z93Vf lVY6XqZnUIJwtXiQI0fQnyAn3uOEuswObqbvdTcb5yaslAwCuQJrledlOaHzOoEetbUc VtlR/X4AFY8K9X1Q+Gq82O39OOXOs9mQyiOFpLvsM75eZeXrMUZ1sXTXy/p8HQDPNejB F4AGkLnja+CMyIgcxaUKDZkW3q14e9ZCWvVxOvf27rx4OWXPHc9bbT0mnAsMOKidr+uV MhKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KlPQVVUpg+DKzqiz2STO+mOd/mnY4h4H1Nwi0RQQ6z8=; b=KOUIt4ZM0QFHuqwZBu3pPnGnXkX82gLGjWV8B23O4OADMd8g8nNX28UuNeUVc61y3q yWnZrJvmJoU7/K1+nVlmHMNAxnTiLOMPUKNzz3bcRvijMpWkt8OEpDCZcAgJflWhOgCv kfUTGV+OhM4FFXeOI0+/mYsZU/3L2r3ZECbdSESrCzv44f8XgrRQbFULmJsotjpJ8v/2 jWXEzW+Ojm6lvMXzyfTup/KsQk15gfFWG/KKmnmhbASt5f1SE25kwfJmOHEkvVadra7N AFryy99SYYJIgpCNsETlYc/YV0r6EIEl93WCFH/nIj8fuWO+KGwjWNsdyPB1lsstLD8J zhxw== X-Gm-Message-State: ANhLgQ3qnADvJGK28b4Jgy/M0KrgxtIu6epgeCDt0Mb5bCqQz3mOuhvl HnCOy0uT4Wfi7uAIu2U3/gpq750rEEI= X-Google-Smtp-Source: ADFU+vvOsE53XpXny7Wejs8o+m9prlyh3lXKdmZS5Do7WA3oOfaofRMz3TNaoa36MpL+xKVAVBw6Sw== X-Received: by 2002:a17:902:ea8b:: with SMTP id x11mr3684904plb.312.1583338155007; Wed, 04 Mar 2020 08:09:15 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id z6sm3292851pjd.34.2020.03.04.08.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 08:09:14 -0800 (PST) Date: Wed, 4 Mar 2020 08:09:06 -0800 From: Stephen Hemminger To: Muhammad Ahmad Cc: dev@dpdk.org Message-ID: <20200304080906.57f36c5a@hermes.lan> In-Reply-To: References: MIME-Version: 1.0 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" 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 streamlined. > The idea is to create a separate application, which provides REST interfa= ce to: > - Query the current status of devices and drivers > - Bind and unbind devices to different drivers >=20 > 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|compres= s] > Sample call: curl http://127.0.0.1:5000/devices?type=3Dcrypto&typ= e=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" > } >=20 >=20 > -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" > } >=20 > OR > Code: 400 BAD REQUEST > Content: > { > "code": 2, > "message": "invalid driver" > } >=20 > OR > Code: 405 METHOD NOT ALLOWED > Content: > { > "code": 3, > "message": "PCI Device active run with force=3DTRUE" > } >=20 > =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 >=20 > Signed-off-by: Muhammad Ahmad There already is a better generic tool driverctl https://gitlab.com/driverc= tl/driverctl It is already in many distributions I would recommend using that instead of extending the limited DPDK tool.