From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <konstantin.ananyev@intel.com>
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id 3B3287CFA
 for <dev@dpdk.org>; Fri, 20 Apr 2018 15:29:09 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga008.fm.intel.com ([10.253.24.58])
 by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 20 Apr 2018 06:29:09 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.49,301,1520924400"; d="scan'208";a="34047022"
Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99])
 by fmsmga008.fm.intel.com with ESMTP; 20 Apr 2018 06:29:07 -0700
Received: from irsmsx102.ger.corp.intel.com ([169.254.2.164]) by
 IRSMSX107.ger.corp.intel.com ([169.254.10.157]) with mapi id 14.03.0319.002;
 Fri, 20 Apr 2018 14:29:07 +0100
From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: "Doherty, Declan" <declan.doherty@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
CC: Adrien Mazarguil <adrien.mazarguil@6wind.com>, "Yigit, Ferruh"
 <ferruh.yigit@intel.com>, Thomas Monjalon <thomas@monjalon.net>, "Shahaf
 Shuler" <shahafs@mellanox.com>, "Doherty, Declan" <declan.doherty@intel.com>, 
 "Awal, Mohammad Abdul" <mohammad.abdul.awal@intel.com>, "Horton, Remy"
 <remy.horton@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v7 9/9] net/ixgbe: add support for
 representor	ports
Thread-Index: AQHT1YVXuZspB7wii0CHrAnjEdysBaQJqpSQ
Date: Fri, 20 Apr 2018 13:29:06 +0000
Message-ID: <2601191342CEEE43887BDE71AB977258AE918C6C@IRSMSX102.ger.corp.intel.com>
References: <20180328135433.20203-1-declan.doherty@intel.com>
 <20180416130605.6509-1-declan.doherty@intel.com>
 <20180416130605.6509-10-declan.doherty@intel.com>
In-Reply-To: <20180416130605.6509-10-declan.doherty@intel.com>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGExYzEyOWYtMmM4Yi00NDllLWI2N2EtMzc5NjhiMDAyMWNiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IitHMEc5cHdiZDUzVGNJMjhHZXArbmFSakl3Yk9PWDlUV0VGdW5ZZ2JLSVk9In0=
x-ctpclassification: CTP_NT
dlp-product: dlpe-windows
dlp-version: 11.0.200.100
dlp-reaction: no-action
x-originating-ip: [163.33.239.181]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH v7 9/9] net/ixgbe: add support for
 representor	ports
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Apr 2018 13:29:10 -0000


> --- /dev/null
> +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c
> @@ -0,0 +1,217 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2018 Intel Corporation.
> + */
> +
> +#include <rte_ethdev.h>
> +#include <rte_pci.h>
> +#include <rte_malloc.h>
> +
> +#include "base/ixgbe_type.h"
> +#include "base/ixgbe_vf.h"
> +#include "ixgbe_ethdev.h"
> +#include "ixgbe_rxtx.h"
> +#include "rte_pmd_ixgbe.h"
> +
> +
> +static int
> +ixgbe_vf_representor_link_update(struct rte_eth_dev *ethdev,
> +	int wait_to_complete)
> +{
> +	struct ixgbe_vf_representor *representor =3D ethdev->data->dev_private;
> +
> +	return ixgbe_dev_link_update_share(representor->pf_ethdev,
> +		wait_to_complete, 1);
> +}
> +
> +static int
> +ixgbe_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev,
> +	struct ether_addr *mac_addr)
> +{
> +	struct ixgbe_vf_representor *representor =3D ethdev->data->dev_private;
> +
> +	return rte_pmd_ixgbe_set_vf_mac_addr(
> +		representor->pf_ethdev->data->port_id,
> +		representor->vf_id, mac_addr);
> +}
> +
> +static void
> +ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev,
> +	struct rte_eth_dev_info *dev_info)
> +{
> +	struct ixgbe_vf_representor *representor =3D ethdev->data->dev_private;
> +
> +	struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(
> +		representor->pf_ethdev->data->dev_private);
> +
> +	dev_info->device =3D representor->pf_ethdev->device;
> +
> +	dev_info->min_rx_bufsize =3D 1024;
> +	/**< Minimum size of RX buffer. */
> +	dev_info->max_rx_pktlen =3D 9728;
> +	/**< Maximum configurable length of RX pkt. */
> +	dev_info->max_rx_queues =3D IXGBE_VF_MAX_RX_QUEUES;
> +	/**< Maximum number of RX queues. */
> +	dev_info->max_tx_queues =3D IXGBE_VF_MAX_TX_QUEUES;
> +	/**< Maximum number of TX queues. */

Sort of generic question - for representor ports that do only control path =
-
shouldn't we have max_rx_queues=3Dmax_tx_queues=3D0, zero and make
queue_setup/rx_burst/tx_burst, etc. to return an error?=20

> +
> +	dev_info->max_mac_addrs =3D hw->mac.num_rar_entries;
> +	/**< Maximum number of MAC addresses. */
> +
> +	dev_info->rx_offload_capa =3D DEV_RX_OFFLOAD_VLAN_STRIP |
> +		DEV_RX_OFFLOAD_IPV4_CKSUM |	DEV_RX_OFFLOAD_UDP_CKSUM  |
> +		DEV_RX_OFFLOAD_TCP_CKSUM;
> +	/**< Device RX offload capabilities. */
> +
> +	dev_info->tx_offload_capa =3D DEV_TX_OFFLOAD_VLAN_INSERT |
> +		DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM |
> +		DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM |
> +		DEV_TX_OFFLOAD_TCP_TSO;
> +	/**< Device TX offload capabilities. */
> +
> +	dev_info->speed_capa =3D
> +		representor->pf_ethdev->data->dev_link.link_speed;
> +	/**< Supported speeds bitmap (ETH_LINK_SPEED_). */
> +
> +	dev_info->switch_info.name =3D
> +		representor->pf_ethdev->device->name;
> +	dev_info->switch_info.domain_id =3D representor->switch_domain_id;
> +	dev_info->switch_info.port_id =3D representor->vf_id;
> +}
> +
> +static int ixgbe_vf_representor_dev_configure(
> +		__rte_unused struct rte_eth_dev *dev)
> +{
> +	return 0;
> +}
> +
> +static int ixgbe_vf_representor_rx_queue_setup(
> +	__rte_unused struct rte_eth_dev *dev,
> +	__rte_unused uint16_t rx_queue_id,
> +	__rte_unused uint16_t nb_rx_desc,
> +	__rte_unused unsigned int socket_id,
> +	__rte_unused const struct rte_eth_rxconf *rx_conf,
> +	__rte_unused struct rte_mempool *mb_pool)
> +{
> +	return 0;
> +}
> +
> +static int ixgbe_vf_representor_tx_queue_setup(
> +	__rte_unused struct rte_eth_dev *dev,
> +	__rte_unused uint16_t rx_queue_id,
> +	__rte_unused uint16_t nb_rx_desc,
> +	__rte_unused unsigned int socket_id,
> +	__rte_unused const struct rte_eth_txconf *tx_conf)
> +{
> +	return 0;
> +}
> +