From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 03D55A04B5;
	Wed, 13 Jan 2021 14:44:56 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id DA650140D20;
	Wed, 13 Jan 2021 14:44:55 +0100 (CET)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by mails.dpdk.org (Postfix) with ESMTP id D5283140D1E
 for <dev@dpdk.org>; Wed, 13 Jan 2021 14:44:54 +0100 (CET)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 xuemingl@nvidia.com) with SMTP; 13 Jan 2021 15:44:52 +0200
Received: from nvidia.com ([172.27.8.145])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 10DDinB6024044;
 Wed, 13 Jan 2021 15:44:50 +0200
From: Xueming Li <xuemingl@nvidia.com>
To: Thomas Monjalon <thomas@monjalon.net>,
 Ferruh Yigit <ferruh.yigit@intel.com>,
 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
 Olivier Matz <olivier.matz@6wind.com>
Cc: dev@dpdk.org, Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
 xuemingl@nvidia.com, Asaf Penso <asafp@nvidia.com>
Date: Wed, 13 Jan 2021 21:44:13 +0800
Message-Id: <20210113134422.15723-1-xuemingl@nvidia.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <1608303356-13089-2-git-send-email-xuemingl@nvidia.com>
References: <1608303356-13089-2-git-send-email-xuemingl@nvidia.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v3 0/9] ethdev: support SubFunction representor
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

SubFunction [1] is a portion of the PCI device, a SF netdev has its own
dedicated queues(txq, rxq). A SF netdev supports eswitch representation
offload similar to existing PF and VF representors. A SF shares PCI
level resources with other SFs and/or with its parent PCI function.

>From SmartNIC perspective, when PCI device is shared for multi-host,
representors for host controller and host PF is required.

This patch set introduces new representor types in addtion to existing
VF representor. Syntax:

[[c#]pf#]vf#: VF port representor/s from controller/pf
[[c#]pf#]sf#: SF port representor/s from controller/pf
#: VF representor - for backwards compatibility

"#" is number instance, list or range, valid examples:
  1, [1,3,5], [0-3], [0,2-4,6]

For backward compatibility, this patch also introduces new netdev
capability to indicate the capability of supportting SF representor.

Version history:
 RFC:
 	initial version [2]
 V2:
    - separate patch for represnetor infrastructure, controller, pf and
      sf.
    - replace representor ID macro with functions:
      rte_eth_representor_id_encode()
      rte_eth_representor_id_parse()
    - new patch to allow devargs with same PCI BDF but different
      representors.
    - other minor code updates according to comments, thanks Andrew!
    - update document
 V3:
    - improve probing of allowed devargs with same name.
    - parse single word of kvargs as key. 
    - update kvargs test cases.


[1] SubFunction in kernel:
https://lore.kernel.org/netdev/20201112192424.2742-1-parav@nvidia.com/

[2] RFC:
http://patchwork.dpdk.org/project/dpdk/list/?series=14376

[3] V2:
http://patchwork.dpdk.org/project/dpdk/list/?series=14559


Xueming Li (9):
  ethdev: refactor representor infrastructure
  ethdev: support new VF representor syntax
  ethdev: support sub function representor
  ethdev: support PF index in representor
  ethdev: support multi-host representor
  devarg: change reprsentor ID to bitmap
  ethdev: capability of new representor syntax
  kvargs: update parser for new representor syntax
  eal: probe devices of same PCI but different devargs

 app/test/test_kvargs.c                   |  51 +++++++--
 config/rte_config.h                      |   1 +
 doc/guides/prog_guide/poll_mode_drv.rst  |   8 +-
 drivers/net/bnxt/bnxt_ethdev.c           |   7 ++
 drivers/net/bnxt/bnxt_reps.c             |   3 +-
 drivers/net/enic/enic_ethdev.c           |   7 ++
 drivers/net/enic/enic_vf_representor.c   |   3 +-
 drivers/net/i40e/i40e_ethdev.c           |   8 ++
 drivers/net/i40e/i40e_vf_representor.c   |   3 +-
 drivers/net/ixgbe/ixgbe_ethdev.c         |   8 ++
 drivers/net/ixgbe/ixgbe_vf_representor.c |   3 +-
 drivers/net/mlx5/linux/mlx5_os.c         |  15 ++-
 lib/librte_eal/common/eal_common_bus.c   |  23 ++++
 lib/librte_ethdev/ethdev_private.c       | 128 ++++++++++++++---------
 lib/librte_ethdev/ethdev_private.h       |   3 -
 lib/librte_ethdev/rte_class_eth.c        |  40 +++++--
 lib/librte_ethdev/rte_ethdev.c           |  31 +++++-
 lib/librte_ethdev/rte_ethdev.h           |   2 +
 lib/librte_ethdev/rte_ethdev_driver.h    |  64 ++++++++++++
 lib/librte_ethdev/version.map            |   2 +
 lib/librte_kvargs/rte_kvargs.c           | 101 +++++++++++++-----
 21 files changed, 401 insertions(+), 110 deletions(-)

-- 
2.25.1