DPDK patches and discussions
 help / color / mirror / Atom feed
From: Muhammad Ahmad <muhammad.ahmad@emumba.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC] A REST API based daemon of dpdk-devbind.py
Date: Wed, 4 Mar 2020 12:11:05 +0500
Message-ID: <CAC9Mqu99NgK38gYDQejXhdBvNJWDtihWxELS8whKvYFzSBGC1A@mail.gmail.com> (raw)

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 “dpdk-usertools-server” 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.
=================Details of API====================
-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=[all|net|baseband|crypto|event|mempool|compress]
        Sample call: curl http://127.0.0.1:5000/devices?type=crypto&type=net
        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 “none” to unbind
        URL:/devices/<pci>
        Method: PUT
        URL Prams: PCI=[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=TRUE"
          }

=================++++++++====================

Signed-off-by: Muhammad Ahmad <muhammad.ahmad@emumba.com>

             reply	other threads:[~2020-03-04  7:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  7:11 Muhammad Ahmad [this message]
2020-03-04 13:59 ` Bruce Richardson
2020-03-04 16:09 ` Stephen Hemminger
2020-03-12  9:03   ` Muhammad Ahmad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC9Mqu99NgK38gYDQejXhdBvNJWDtihWxELS8whKvYFzSBGC1A@mail.gmail.com \
    --to=muhammad.ahmad@emumba.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git