All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] netdevsim port add, delete support
@ 2021-02-06 12:55 Parav Pandit
  2021-02-06 12:55 ` [PATCH net-next 1/7] netdevsim: Add support for add and delete of a PCI PF port Parav Pandit
                   ` (7 more replies)
  0 siblings, 8 replies; 38+ messages in thread
From: Parav Pandit @ 2021-02-06 12:55 UTC (permalink / raw)
  To: netdev, davem, kuba; +Cc: Parav Pandit

This series simulates one or more PCI PF and SF port addition and function
configuration functionality.

Example sequence:
Create a device with ID=10 and one physical port.
$ echo "10 1" > /sys/bus/netdevsim/new_device

Add PCI PF port:
$ devlink port add netdevsim/netdevsim10 flavour pcipf pfnum 2
netdevsim/netdevsim10/1: type eth netdev eth1 flavour pcipf controller 0 pfnum 2 external false splittable false
  function:
    hw_addr 00:00:00:00:00:00

$ devlink port add netdevsim/netdevsim10 flavour pcisf pfnum 2
netdevsim/netdevsim10/2: type eth netdev eth2 flavour pcisf controller 0 pfnum 2 sfnum 0 splittable false
  function:
    hw_addr 00:00:00:00:00:00

Show devlink port:
$ devlink port show netdevsim/netdevsim10/2
netdevsim/netdevsim10/2: type eth netdev eth2 flavour pcisf controller 0 pfnum 2 sfnum 0 splittable false
  function:
    hw_addr 00:00:00:00:00:00 state inactive opstate detached

Set the MAC address and activate the function:
$ devlink port function set netdevsim/netdevsim10/2 hw_addr 00:11:22:33:44:55 state active

Show the port and function attributes in JSON format:
$ devlink port show netdevsim/netdevsim10/2 -jp
{
    "port": {
        "netdevsim/netdevsim10/2": {
            "type": "eth",
            "netdev": "eth2",
            "flavour": "pcisf",
            "controller": 0,
            "pfnum": 2,
            "sfnum": 0,
            "splittable": false,
            "function": {
                "hw_addr": "00:11:22:33:44:55",
                "state": "active",
                "opstate": "attached"
            }
        }
    }
}

Delete PCI SF and PF ports:
$ devlink port del netdevsim/netdevsim10/2

Patch summary:
patch-1 adds support for adding/remove PCI PF port
patch-2 adds support for adding/remove PCI SF port
patch-3 simulates MAC address query
patch-4 simulates setting MAC address
patch-5 simulates state query
patch-6 simulates setting state
patch-7 adds tests

Parav Pandit (7):
  netdevsim: Add support for add and delete of a PCI PF port
  netdevsim: Add support for add and delete PCI SF port
  netdevsim: Simulate get hardware address of a PCI port
  netdevsim: Simulate set hardware address of a PCI port
  netdevsim: Simulate port function state for a PCI port
  netdevsim: Simulate port function set state for a PCI port
  netdevsim: Add netdevsim port add test cases

 drivers/net/netdevsim/Makefile                |   2 +-
 drivers/net/netdevsim/dev.c                   |  14 +
 drivers/net/netdevsim/netdevsim.h             |  38 ++
 drivers/net/netdevsim/port_function.c         | 521 ++++++++++++++++++
 .../drivers/net/netdevsim/devlink.sh          |  72 ++-
 5 files changed, 645 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/netdevsim/port_function.c

-- 
2.26.2


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2021-02-09  4:06 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-06 12:55 [PATCH net-next 0/7] netdevsim port add, delete support Parav Pandit
2021-02-06 12:55 ` [PATCH net-next 1/7] netdevsim: Add support for add and delete of a PCI PF port Parav Pandit
2021-02-06 14:34   ` kernel test robot
2021-02-06 14:34     ` kernel test robot
2021-02-07  7:59     ` Parav Pandit
2021-02-07  7:59       ` Parav Pandit
2021-02-07  8:04       ` [kbuild-all] " Rong Chen
2021-02-07  8:04         ` Rong Chen
2021-02-06 16:24   ` kernel test robot
2021-02-06 16:24     ` kernel test robot
2021-02-06 18:28   ` kernel test robot
2021-02-06 18:28     ` kernel test robot
2021-02-06 12:55 ` [PATCH net-next 2/7] netdevsim: Add support for add and delete PCI SF port Parav Pandit
2021-02-06 17:42   ` kernel test robot
2021-02-06 17:42     ` kernel test robot
2021-02-06 12:55 ` [PATCH net-next 3/7] netdevsim: Simulate get hardware address of a PCI port Parav Pandit
2021-02-06 12:55 ` [PATCH net-next 4/7] netdevsim: Simulate set " Parav Pandit
2021-02-06 12:55 ` [PATCH net-next 5/7] netdevsim: Simulate port function state for " Parav Pandit
2021-02-06 18:30   ` kernel test robot
2021-02-06 18:30     ` kernel test robot
2021-02-06 12:55 ` [PATCH net-next 6/7] netdevsim: Simulate port function set " Parav Pandit
2021-02-06 12:55 ` [PATCH net-next 7/7] netdevsim: Add netdevsim port add test cases Parav Pandit
2021-02-07  8:44 ` [PATCH net-next v2 0/7] netdevsim port add, delete support Parav Pandit
2021-02-07  8:44   ` [PATCH net-next v2 1/7] netdevsim: Add support for add and delete of a PCI PF port Parav Pandit
2021-02-07 12:00     ` kernel test robot
2021-02-07 12:00       ` kernel test robot
2021-02-07  8:44   ` [PATCH net-next v2 2/7] netdevsim: Add support for add and delete PCI SF port Parav Pandit
2021-02-07 12:28     ` kernel test robot
2021-02-07 12:28       ` kernel test robot
2021-02-07  8:44   ` [PATCH net-next v2 3/7] netdevsim: Simulate get hardware address of a PCI port Parav Pandit
2021-02-07  8:44   ` [PATCH net-next v2 4/7] netdevsim: Simulate set " Parav Pandit
2021-02-07  8:44   ` [PATCH net-next v2 5/7] netdevsim: Simulate port function state for " Parav Pandit
2021-02-07 13:09     ` kernel test robot
2021-02-07 13:09       ` kernel test robot
2021-02-07  8:44   ` [PATCH net-next v2 6/7] netdevsim: Simulate port function set " Parav Pandit
2021-02-07  8:44   ` [PATCH net-next v2 7/7] netdevsim: Add netdevsim port add test cases Parav Pandit
2021-02-08 21:21     ` Jakub Kicinski
2021-02-09  3:59       ` Parav Pandit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.