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 4A60DA04EF; Mon, 2 Dec 2019 20:14:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EF238F96; Mon, 2 Dec 2019 20:14:37 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 63DBB5681 for ; Mon, 2 Dec 2019 20:14:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Dec 2019 11:14:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,270,1571727600"; d="scan'208";a="213132435" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga006.jf.intel.com with ESMTP; 02 Dec 2019 11:14:34 -0800 Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Dec 2019 11:14:33 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX114.amr.corp.intel.com (10.22.240.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Dec 2019 11:14:33 -0800 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (104.47.41.59) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 2 Dec 2019 11:14:33 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ep2oNcjB60+PX/PvDagyxvxzevz8iC0+H5fsQFTNyTQ6l8rTJFu8st4RCMzuBMt55jueSkd/bTzlgaQySRrzczSVCfhvDGrYtsFsMtUPYy+izF4+A/gf6D3BQfM4wdAeqf3WxQEhXH4dOjYTdUREOKeucyDwGtzrbGSDhYCUuLa8FGZg0rzFWMA8a1lMoOL1W5aPJ+Z3KKjh91cXddJr274PNNUgAy9rygVfjkFUnoI3w1+PBNU72xnCgaUlKp+o4Ai7Q2ovoeGwerI0vMX2WxsOOtK8rjc6av5wxbpIh4NzsW8qjCwmHYjtRHW91Hq7lrgN3Tv4XIkLVwMZw+2hhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U8FXWzrx1ZWfT4TzrxdPcrfORYntbVKIe8Fj7pie9gc=; b=GzxW9habKC+SmtWAr0nzMnyskUeZ2sYCTGWIZaBeyPEwINnd7BCWb7j1emDH5J9aDW91ktEO2VAYZ7RoD3BjkqItd+TXwqH3uo/LgMCh5qNudEWCCIdou1qrlIbyXSGbU0tC44Pg+A8nfaYRUHDAzYPekp5iLBTRU07mb0tDDO9rg3EGE0v01AlfnuAMhVLJpRrxMeAqdxav1vlmWsK3dJHsH3TcbdFxPlWSz/NnYbkrX6MQEO064xVAvodMQmpkNJJqEvvQn/Cz5PvGBYjVmGtpE5WSt6ms64PHaY3ur34o+NOW6WGZYiVl/e6dUogq5Ssmzl+gQ60NHF9ieXqemQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U8FXWzrx1ZWfT4TzrxdPcrfORYntbVKIe8Fj7pie9gc=; b=KO7IXaxeMNWXWM81EsJwS+WoR0xj8DlS3GgRDCrkccxghOOfdJX73VtsbEX2tMWr77wEOIQP8g4Y0XxjBEepKw2CnA+ovIsXXFdS2Y8hSlNFaRQ11MH3DM7FTLWo2SYl3FG+DdtJ0O+2IDPt+skqKwhVW8yfvHrfKmggBRVZIzE= Received: from BN8PR11MB3828.namprd11.prod.outlook.com (20.178.220.87) by BN8PR11MB3666.namprd11.prod.outlook.com (20.178.221.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18; Mon, 2 Dec 2019 19:14:31 +0000 Received: from BN8PR11MB3828.namprd11.prod.outlook.com ([fe80::703d:649c:b713:8011]) by BN8PR11MB3828.namprd11.prod.outlook.com ([fe80::703d:649c:b713:8011%7]) with mapi id 15.20.2495.014; Mon, 2 Dec 2019 19:14:31 +0000 From: "Stillwell Jr, Paul M" To: "Ye, Xiaolong" , "Xing, Beilei" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Ye, Xiaolong" , "Burra, Phani R" Thread-Topic: [dpdk-dev] [PATCH 57/69] net/i40e/base: update virtchnl header with advanced features Thread-Index: AQHVqOeVrcmx9Z/XLkGv/pgxe7ElOKenN3DQ Date: Mon, 2 Dec 2019 19:14:31 +0000 Message-ID: References: <20191202074935.97629-1-xiaolong.ye@intel.com> <20191202074935.97629-58-xiaolong.ye@intel.com> In-Reply-To: <20191202074935.97629-58-xiaolong.ye@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGJiODE2MDgtNzIwYy00YTAwLTg4NzYtZmIzNmY3OTAwYmMyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY1N1ZU80Kzd6UFQzNVlacjRzTWRPekVLbklsUWVqdCtzNTlqU21UN0ZcL3pob282WERNOFVrdWlCWGo1T0ZaTkcifQ== dlp-version: 11.2.0.6 dlp-reaction: no-action dlp-product: dlpe-windows x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=paul.m.stillwell.jr@intel.com; x-originating-ip: [134.134.136.208] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 58325b2b-ae29-4f03-d994-08d7775bdc60 x-ms-traffictypediagnostic: BN8PR11MB3666: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4125; x-forefront-prvs: 0239D46DB6 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(376002)(366004)(346002)(136003)(396003)(51234002)(189003)(199004)(13464003)(446003)(3846002)(316002)(86362001)(14454004)(6116002)(55016002)(99286004)(107886003)(6246003)(2906002)(9686003)(25786009)(15650500001)(478600001)(6636002)(33656002)(305945005)(74316002)(7736002)(81156014)(8936002)(81166006)(66066001)(4326008)(229853002)(5660300002)(54906003)(30864003)(6436002)(110136005)(71200400001)(256004)(14444005)(66446008)(64756008)(66556008)(66476007)(71190400001)(66946007)(76116006)(26005)(102836004)(52536014)(53546011)(6506007)(186003)(11346002)(76176011)(7696005)(579004); DIR:OUT; SFP:1102; SCL:1; SRVR:BN8PR11MB3666; H:BN8PR11MB3828.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VM41B+jpzW4dKhTQNa7CVvnsArkXOPH0O74FgplHxsDiWvklFIVHzQeKgZT9VvWy+KbksErKdbav/Vb7y+tCwuPBWnsl4t2iWrXveQgIy184PXWsEx0/sju5SQDblKq0QM6FFop2MIAhDJAzqp10ZAYTC7KGfuy03Co5tUiKNeZj7dKS6Tp/nCcuXOerw8+hHhkqETBVVkGOHWiG14oLNcpOeKau60+AcUvqfv/VtH7cQU/clayxx+oDcRlzcE+62nHTdUbFyq7LC9BuoP537kCkFyG+aeJkObu49UZJkdYWU5WX0MHDsnADasWWl+2GkZszSO4Ofzg5fiOIMz07FgLVJL2iurQ5A7AnKVmetnt8tepNSDpDE7zeShfNKmNQbJSR4HNchOxpogMgAril6Ek857PHUF9fvv939A52j0ULpscBFbIDLBOqR9z4iQ1b9HhPetikoMls2mTOI2mugA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 58325b2b-ae29-4f03-d994-08d7775bdc60 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Dec 2019 19:14:31.8598 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7kZ+/WFQOcbxWDiMfb6ZkVdmfLRkqSOeId4vF2i3N8N1cdLzNpUytBF4DhfVrF5KopLL5iL6+ySq9xwMPBrj2dPbWGQntAq/2nLkTL44dcc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3666 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 57/69] net/i40e/base: update virtchnl header with advanced features 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" NACK, this code is not properly stripped and should not be released externa= lly. Additionally, APF is NOT released and is only for Mt Evans and should = not be in the code. Paul > -----Original Message----- > From: dev On Behalf Of Xiaolong Ye > Sent: Sunday, December 1, 2019 11:49 PM > To: Xing, Beilei ; Zhang, Qi Z > Cc: dev@dpdk.org; Ye, Xiaolong ; Burra, Phani R > > Subject: [dpdk-dev] [PATCH 57/69] net/i40e/base: update virtchnl header > with advanced features >=20 > Updating the virtchnl header file with new interfaces. The new interfaces= will > support the split queue and advanced features. These new features are > initially targeted for APF and CPF driver model. AVF also will enable the= new > features in future and use the advanced interfaces. >=20 > Signed-off-by: Phani R Burra > Reviewed-by: Aleksandr Loktionov > Reviewed-by: Kirsher Jeffrey T > Signed-off-by: Xiaolong Ye > --- > drivers/net/i40e/base/virtchnl.h | 511 > ++++++++++++++++++++++++++++++- > 1 file changed, 509 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/i40e/base/virtchnl.h > b/drivers/net/i40e/base/virtchnl.h > index 0ea03d06b..c3495ab39 100644 > --- a/drivers/net/i40e/base/virtchnl.h > +++ b/drivers/net/i40e/base/virtchnl.h > @@ -134,7 +134,34 @@ enum virtchnl_ops { > VIRTCHNL_OP_DISABLE_CHANNELS =3D 31, > VIRTCHNL_OP_ADD_CLOUD_FILTER =3D 32, > VIRTCHNL_OP_DEL_CLOUD_FILTER =3D 33, > - > +#ifdef VIRTCHNL_EXT_FEATURES > + /* New major set of opcodes introduced and so leaving room for > + * old misc opcodes to be added in future. Also these opcodes may > only > + * be used if both the PF and VF have successfully negotiated the > + * VIRTCHNL_VF_CAP_EXT_FEATURES capability during initial > capabilities > + * exchange. > + */ > + VIRTCHNL_OP_GET_CAPS =3D 100, > + VIRTCHNL_OP_CREATE_VPORT =3D 101, > + VIRTCHNL_OP_DESTROY_VPORT =3D 102, > + VIRTCHNL_OP_ENABLE_VPORT =3D 103, > + VIRTCHNL_OP_DISABLE_VPORT =3D 104, > + VIRTCHNL_OP_CONFIG_TX_QUEUES =3D 105, > + VIRTCHNL_OP_CONFIG_RX_QUEUES =3D 106, > + VIRTCHNL_OP_ENABLE_QUEUES_V2 =3D 107, > + VIRTCHNL_OP_DISABLE_QUEUES_V2 =3D 108, > + VIRTCHNL_OP_ADD_QUEUES =3D 109, > + VIRTCHNL_OP_DEL_QUEUES =3D 110, > + VIRTCHNL_OP_MAP_VECTOR_QUEUE =3D 111, > + VIRTCHNL_OP_UNMAP_VECTOR_QUEUE =3D 112, > + VIRTCHNL_OP_MAP_VECTOR_ITR =3D 113, > + VIRTCHNL_OP_GET_RSS_KEY =3D 114, > + VIRTCHNL_OP_GET_RSS_LUT =3D 115, > + VIRTCHNL_OP_GET_RSS_HASH =3D 116, > + VIRTCHNL_OP_SET_RSS_HASH =3D 117, > + VIRTCHNL_OP_CREATE_VFS =3D 118, > + VIRTCHNL_OP_DESTROY_VFS =3D 119, > +#endif /* VIRTCHNL_EXT_FEATURES */ > }; >=20 > /* These macros are used to generate compilation errors if a structure/u= nion > @@ -248,8 +275,10 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, > virtchnl_vsi_resource); > #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM 0X00400000 > #define VIRTCHNL_VF_OFFLOAD_ADQ 0X00800000 > /* Define below the capability flags that are not offloads */ > +#ifdef VIRTCHNL_EXT_FEATURES > +#define VIRTCHNL_VF_CAP_EXT_FEATURES 0x01000000 > +#endif /* VIRTCHNL_EXT_FEATURES */ > #define VIRTCHNL_VF_CAP_ADV_LINK_SPEED 0x00000080 > - > #define VF_BASE_MODE_OFFLOADS (VIRTCHNL_VF_OFFLOAD_L2 | \ > VIRTCHNL_VF_OFFLOAD_VLAN | \ > VIRTCHNL_VF_OFFLOAD_RSS_PF) > @@ -707,6 +736,362 @@ enum virtchnl_vfr_states { > VIRTCHNL_VFR_VFACTIVE, > }; >=20 > +#ifdef VIRTCHNL_EXT_FEATURES > +/* PF capability flags > + * VIRTCHNL_CAP_STATELESS_OFFLOADS flag indicates stateless offloads > + * such as TX/RX Checksum offloading and TSO for non-tunneled packets. > +Please > + * note that old and new capabilities are exclusive and not supposed to > +be > + * mixed > + */ > +#define VIRTCHNL_CAP_STATELESS_OFFLOADS BIT(1) > +#define VIRTCHNL_CAP_UDP_SEG_OFFLOAD BIT(2) > +#define VIRTCHNL_CAP_RSS BIT(3) > +#define VIRTCHNL_CAP_TCP_RSC BIT(4) > +#define VIRTCHNL_CAP_HEADER_SPLIT BIT(5) > +#define VIRTCHNL_CAP_RDMA BIT(6) > +#define VIRTCHNL_CAP_SRIOV BIT(7) > +/* Earliest Departure Time capability used for Timing Wheel */ > +#define VIRTCHNL_CAP_EDT BIT(8) > + > +/* Type of virtual port */ > +enum virtchnl_vport_type { > + VIRTCHNL_VPORT_TYPE_DEFAULT =3D 0, > +}; > + > +/* Type of queue model */ > +enum virtchnl_queue_model { > + VIRTCHNL_QUEUE_MODEL_SINGLE =3D 0, > + VIRTCHNL_QUEUE_MODEL_SPLIT =3D 1, > +}; > + > +/* TX and RX queue types are valid in legacy as well as split queue mode= ls. > + * With Split Queue model, 2 additional types are introduced - > +TX_COMPLETION > + * and RX_BUFFER. In split queue model, RX corresponds to the queue > +where HW > + * posts completions. > + */ > +enum virtchnl_queue_type { > + VIRTCHNL_QUEUE_TYPE_TX =3D 0, > + VIRTCHNL_QUEUE_TYPE_RX =3D 1, > + VIRTCHNL_QUEUE_TYPE_TX_COMPLETION =3D 2, > + VIRTCHNL_QUEUE_TYPE_RX_BUFFER =3D 3, > +}; > + > +/* RX Queue Feature bits */ > +#define VIRTCHNL_RXQ_RSC BIT(1) > +#define VIRTCHNL_RXQ_HDR_SPLIT BIT(2) > +#define VIRTCHNL_RXQ_IMMEDIATE_WRITE_BACK BIT(4) > + > +/* RX Queue Descriptor Types */ > +enum virtchnl_rxq_desc_size { > + VIRTCHNL_RXQ_DESC_SIZE_16BYTE =3D 0, > + VIRTCHNL_RXQ_DESC_SIZE_32BYTE =3D 1, > +}; > + > +/* TX Queue Scheduling Modes Queue mode is the legacy type i.e. > +inorder > + * and Flow mode is out of order packet processing */ enum > +virtchnl_txq_sched_mode { > + VIRTCHNL_TXQ_SCHED_MODE_QUEUE =3D 0, > + VIRTCHNL_TXQ_SCHED_MODE_FLOW =3D 1, > +}; > + > +/* Queue Descriptor Profiles Base mode is the legacy and Native is the > + * flex descriptors > + */ > +enum virtchnl_desc_profile { > + VIRTCHNL_TXQ_DESC_PROFILE_BASE =3D 0, > + VIRTCHNL_TXQ_DESC_PROFILE_NATIVE =3D 1, > +}; > + > +/* Type of RSS algorithm */ > +enum virtchnl_rss_algorithm { > + VIRTCHNL_RSS_ALG_TOEPLITZ_ASYMMETRIC =3D 0, > + VIRTCHNL_RSS_ALG_R_ASYMMETRIC =3D 1, > + VIRTCHNL_RSS_ALG_TOEPLITZ_SYMMETRIC =3D 2, > + VIRTCHNL_RSS_ALG_XOR_SYMMETRIC =3D 3, > +}; > + > +/* VIRTCHNL_OP_GET_CAPS > + * PF sends this message to CP to negotiate capabilities by filling > + * in the u64 bitmap of its desired capabilities. > + * CP responds with an updated virtchnl_get_capabilities structure > + * with allowed capabilities and possible max number of vfs it can creat= e. > + */ > +struct virtchnl_get_capabilities { > + u64 cap_flags; > + u16 max_num_vfs; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_get_capabilities); > + > +/* structure to specify a chunk of contiguous queues */ struct > +virtchnl_queue_chunk { > + enum virtchnl_queue_type type; > + u16 start_queue_id; > + u16 num_queues; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_queue_chunk); > + > +/* structure to specify several chunks of contiguous queues */ struct > +virtchnl_queue_chunks { > + u16 num_chunks; > + struct virtchnl_queue_chunk chunks[]; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(4, virtchnl_queue_chunks); > + > +/* VIRTCHNL_OP_CREATE_VPORT > + * PF sends this message to CP to create a vport by filling in the > +first 8 > + * fields of virtchnl_create_vport structure (vport type, tx, rx queue > +models > + * and desired number of queues and vectors). CP responds with the > +updated > + * virtchnl_create_vport structure containing the number of assigned > +queues, > + * vectors, vport id, max mtu, default mac addr followed by chunks > +which in turn > + * will have an array of num_chunks entries of virtchnl_queue_chunk > structures. > + */ > +struct virtchnl_create_vport { > + enum virtchnl_vport_type vport_type; > + /* single or split */ > + enum virtchnl_queue_model txq_model; > + /* single or split */ > + enum virtchnl_queue_model rxq_model; > + u16 num_tx_q; > + /* valid only if txq_model is split Q */ > + u16 num_tx_complq; > + u16 num_rx_q; > + /* valid only if rxq_model is split Q */ > + u16 num_rx_bufq; > + u16 num_vectors; > + u16 vport_id; > + u16 max_mtu; > + u8 default_mac_addr[ETH_ALEN]; > + enum virtchnl_rss_algorithm rss_algorithm; > + u16 rss_key_size; > + u16 rss_lut_size; > + u16 qset_handle; > + struct virtchnl_queue_chunks chunks; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(48, virtchnl_create_vport); > + > +/* VIRTCHNL_OP_DESTROY_VPORT > + * VIRTCHNL_OP_ENABLE_VPORT > + * VIRTCHNL_OP_DISABLE_VPORT > + * PF sends this message to CP to destroy, enable or disable a vport by > +filling > + * in the vport_id in virtchnl_vport structure. > + * CP responds with the status of the requested operation. > + */ > +struct virtchnl_vport { > + u16 vport_id; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(2, virtchnl_vport); > + > +/* Tx queue config info */ > +struct virtchnl_txq_info_v2 { > + u16 queue_id; > + /* single or split */ > + enum virtchnl_queue_model model; > + /* tx or tx_completion */ > + enum virtchnl_queue_type type; > + /* queue or flow based */ > + enum virtchnl_txq_sched_mode sched_mode; > + /* base or native */ > + enum virtchnl_desc_profile desc_profile; > + u16 ring_len; > + u64 dma_ring_addr; > + /* valid only if queue model is split and type is tx */ > + u16 tx_compl_queue_id; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(40, virtchnl_txq_info_v2); > + > +/* VIRTCHNL_OP_CONFIG_TX_QUEUES > + * PF sends this message to set up parameters for one or more TX queues. > + * This message contains an array of num_qinfo instances of > +virtchnl_txq_info_v2 > + * structures. CP configures requested queues and returns a status > +code. If > + * num_qinfo specified is greater than the number of queues associated > +with the > + * vport, an error is returned and no queues are configured. > + */ > +struct virtchnl_config_tx_queues { > + u16 vport_id; > + u16 num_qinfo; > + struct virtchnl_txq_info_v2 txq_info[]; }; > + > +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_config_tx_queues); > + > +/* Rx queue config info */ > +struct virtchnl_rxq_info_v2 { > + u16 queue_id; > + /* single or split */ > + enum virtchnl_queue_model model; > + /* rx or rx buffer */ > + enum virtchnl_queue_type type; > + /* base or native */ > + enum virtchnl_desc_profile desc_profile; > + /* rsc, header-split, immediate write back */ > + u16 queue_flags; > + /* 16 or 32 byte */ > + enum virtchnl_rxq_desc_size desc_size; > + u16 ring_len; > + u16 hdr_buffer_size; > + u32 data_buffer_size; > + u32 max_pkt_size; > + u64 dma_ring_addr; > + u64 dma_head_wb_addr; > + u16 rsc_low_watermark; > + u8 buffer_notif_stride; > + enum virtchnl_rx_hsplit rx_split_pos; > + /* valid only if queue model is split and type is rx buffer*/ > + u16 rx_bufq1_id; > + /* valid only if queue model is split and type is rx buffer*/ > + u16 rx_bufq2_id; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(72, virtchnl_rxq_info_v2); > + > +/* VIRTCHNL_OP_CONFIG_RX_QUEUES > + * PF sends this message to set up parameters for one or more RX queues. > + * This message contains an array of num_qinfo instances of > +virtchnl_rxq_info_v2 > + * structures. CP configures requested queues and returns a status code. > + * If the number of queues specified is greater than the number of > +queues > + * associated with the vport, an error is returned and no queues are > configured. > + */ > +struct virtchnl_config_rx_queues { > + u16 vport_id; > + u16 num_qinfo; > + struct virtchnl_rxq_info_v2 rxq_info[]; }; > + > +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_config_rx_queues); > + > +/* VIRTCHNL_OP_ADD_QUEUES > + * PF sends this message to request additional TX/RX queues beyond the > +ones > + * that were assigned via CREATE_VPORT request. virtchnl_add_queues > +structure is > + * used to specify the number of each type of queues. > + * CP responds with the same structure with the actual number of queues > +assigned > + * followed by num_chunks of virtchnl_queue_chunk structures. > + */ > +struct virtchnl_add_queues { > + u16 vport_id; > + u16 num_tx_q; > + u16 num_tx_complq; > + u16 num_rx_q; > + u16 num_rx_bufq; > + struct virtchnl_queue_chunks chunks; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_add_queues); > + > +/* VIRTCHNL_OP_ENABLE_QUEUES > + * VIRTCHNL_OP_DISABLE_QUEUES > + * VIRTCHNL_OP_DEL_QUEUES > + * PF sends these messages to enable, disable or delete queues > +specified in > + * chunks. PF sends virtchnl_del_ena_dis_queues struct to specify the > +queues > + * to be enabled/disabled/deleted. Also applicable to single queue RX > +or > + * TX. CP performs requested action and returns status. > + */ > +struct virtchnl_del_ena_dis_queues { > + u16 vport_id; > + struct virtchnl_queue_chunks chunks; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_del_ena_dis_queues); > + > +/* Vector to Queue mapping */ > +struct virtchnl_vector_queue { > + u16 vector_id; > + u16 queue_id; > + enum virtchnl_queue_type queue_type; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(8, virtchnl_vector_queue); > + > +/* VIRTCHNL_OP_MAP_VECTOR_QUEUE > + * VIRTCHNL_OP_UNMAP_VECTOR_QUEUE > + * PF sends this message to map or unmap vectors to queues. > + * This message contains an array of num_vector_queue_pairs instances > +of > + * virtchnl_vector_queue structures. CP configures interrupt mapping > +and returns > + * a status code. If the number of vectors specified is greater than > +the number > + * of vectors associated with the vport, an error is returned and no > +vectors are > + * mapped. > + */ > +struct virtchnl_vector_queue_pairs { > + u16 vport_id; > + u16 num_vector_queue_pairs; > + struct virtchnl_vector_queue vq[]; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(4, virtchnl_vector_queue_pairs); > + > +/* Vector to ITR index registers mapping */ struct virtchnl_vector_itr > +{ > + u16 vector_id; > + u16 rxitr_idx; > + u16 txitr_idx; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_vector_itr); > + > +/* VIRTCHNL_OP_MAP_VECTOR_ITR > + * PF sends this message to map vectors to RX and TX ITR index registers= . > + * This message contains an array of num_vector_itr_pairs instances of > + * virtchnl_vector_itr structures. CP configures requested queues and > +returns a > + * status code. If the number of vectors specified is greater than the > +number of > + * vectors associated with the VSI, an error is returned and no vectors > +are > + * mapped. > + */ > +struct virtchnl_vector_itr_pairs { > + u16 vport_id; > + u16 num_vector_itr_pairs; > + struct virtchnl_vector_itr vitr[]; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(4, virtchnl_vector_itr_pairs); > + > +/* VIRTCHNL_OP_GET_RSS_LUT > + * PF sends this message to get RSS lookup table. Only supported if > + * both PF and CP drivers set the VIRTCHNL_CAP_RSS bit during > +configuration > + * negotiation. Uses the virtchnl_rss_lut structure */ > + > +/* VIRTCHNL_OP_GET_RSS_KEY > + * PF sends this message to get RSS key. Only supported if > + * both PF and CP drivers set the VIRTCHNL_CAP_RSS bit during > +configuration > + * negotiation. Used the virtchnl_rss_key structure */ > + > +/* VIRTCHNL_OP_GET_RSS_HASH > + * VIRTCHNL_OP_SET_RSS_HASH > + * PF sends these messages to get and set the hash filter enable bits fo= r > RSS. > + * By default, the CP sets these to all possible traffic types that the > + * hardware supports. The PF can query this value if it wants to change > +the > + * traffic types that are hashed by the hardware. > + * Only supported if both PF and CP drivers set the VIRTCHNL_CAP_RSS > +bit > + * during configuration negotiation. > + */ > +struct virtchnl_rss_hash { > + u16 vport_id; > + u64 hash; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_rss_hash); > + > +/* VIRTCHNL_OP_CREATE_SRIOV_VFS > + * VIRTCHNL_OP_DESTROY_SRIOV_VFS > + * This message is used to let the CP know how many SRIOV VFs need to > +be > + * created. The actual allocation of resources for the VFs in terms of > +VSI, > + * Queues and Interrupts is done by CP. When this call completes, the > +APF driver > + * calls pci_enable_sriov to let the OS instantiate the SRIOV PCIE devic= es. > + */ > +struct virtchnl_sriov_vfs_info { > + u16 num_vfs; > +}; > + > +VIRTCHNL_CHECK_STRUCT_LEN(2, virtchnl_sriov_vfs_info); > + > +#endif /* VIRTCHNL_EXT_FEATURES */ > /** > * virtchnl_vc_validate_vf_msg > * @ver: Virtchnl version info > @@ -871,6 +1256,128 @@ virtchnl_vc_validate_vf_msg(struct > virtchnl_version_info *ver, u32 v_opcode, > case VIRTCHNL_OP_GET_ADDNL_SOL_CONFIG: > break; > #endif > +#ifdef VIRTCHNL_EXT_FEATURES > + case VIRTCHNL_OP_GET_CAPS: > + valid_len =3D sizeof(struct virtchnl_get_capabilities); > + break; > + case VIRTCHNL_OP_CREATE_VPORT: > + valid_len =3D sizeof(struct virtchnl_create_vport); > + if (msglen >=3D valid_len) { > + struct virtchnl_create_vport *cvport =3D > + (struct virtchnl_create_vport *)msg; > + > + valid_len +=3D cvport->chunks.num_chunks * > + sizeof(struct virtchnl_queue_chunk); > + } > + break; > + case VIRTCHNL_OP_DESTROY_VPORT: > + case VIRTCHNL_OP_ENABLE_VPORT: > + case VIRTCHNL_OP_DISABLE_VPORT: > + valid_len =3D sizeof(struct virtchnl_vport); > + break; > + case VIRTCHNL_OP_CONFIG_TX_QUEUES: > + valid_len =3D sizeof(struct virtchnl_config_tx_queues); > + if (msglen >=3D valid_len) { > + struct virtchnl_config_tx_queues *ctq =3D > + (struct virtchnl_config_tx_queues *)msg; > + if (ctq->num_qinfo =3D=3D 0) { > + err_msg_format =3D true; > + break; > + } > + valid_len +=3D ctq->num_qinfo * > + sizeof(struct virtchnl_txq_info_v2); > + } > + break; > + case VIRTCHNL_OP_CONFIG_RX_QUEUES: > + valid_len =3D sizeof(struct virtchnl_config_rx_queues); > + if (msglen >=3D valid_len) { > + struct virtchnl_config_rx_queues *crq =3D > + (struct virtchnl_config_rx_queues *)msg; > + if (crq->num_qinfo =3D=3D 0) { > + err_msg_format =3D true; > + break; > + } > + valid_len +=3D crq->num_qinfo * > + sizeof(struct virtchnl_rxq_info_v2); > + } > + break; > + case VIRTCHNL_OP_ADD_QUEUES: > + valid_len =3D sizeof(struct virtchnl_add_queues); > + if (msglen >=3D valid_len) { > + struct virtchnl_add_queues *add_q =3D > + (struct virtchnl_add_queues *)msg; > + > + valid_len +=3D add_q->chunks.num_chunks * > + sizeof(struct virtchnl_queue_chunk); > + } > + break; > + case VIRTCHNL_OP_ENABLE_QUEUES_V2: > + case VIRTCHNL_OP_DISABLE_QUEUES_V2: > + case VIRTCHNL_OP_DEL_QUEUES: > + valid_len =3D sizeof(struct virtchnl_del_ena_dis_queues); > + if (msglen >=3D valid_len) { > + struct virtchnl_del_ena_dis_queues *qs =3D > + (struct virtchnl_del_ena_dis_queues *)msg; > + if (qs->chunks.num_chunks =3D=3D 0) { > + err_msg_format =3D true; > + break; > + } > + valid_len +=3D qs->chunks.num_chunks * > + sizeof(struct virtchnl_queue_chunk); > + } > + break; > + case VIRTCHNL_OP_MAP_VECTOR_QUEUE: > + case VIRTCHNL_OP_UNMAP_VECTOR_QUEUE: > + valid_len =3D sizeof(struct virtchnl_vector_queue_pairs); > + if (msglen >=3D valid_len) { > + struct virtchnl_vector_queue_pairs *v_qp =3D > + (struct virtchnl_vector_queue_pairs *)msg; > + if (v_qp->num_vector_queue_pairs =3D=3D 0) { > + err_msg_format =3D true; > + break; > + } > + valid_len +=3D v_qp->num_vector_queue_pairs * > + sizeof(struct virtchnl_vector_queue); > + } > + break; > + case VIRTCHNL_OP_MAP_VECTOR_ITR: > + valid_len =3D sizeof(struct virtchnl_vector_itr_pairs); > + if (msglen >=3D valid_len) { > + struct virtchnl_vector_itr_pairs *v_itrp =3D > + (struct virtchnl_vector_itr_pairs *)msg; > + if (v_itrp->num_vector_itr_pairs =3D=3D 0) { > + err_msg_format =3D true; > + break; > + } > + valid_len +=3D v_itrp->num_vector_itr_pairs * > + sizeof(struct virtchnl_vector_itr); > + } > + break; > + case VIRTCHNL_OP_GET_RSS_KEY: > + valid_len =3D sizeof(struct virtchnl_rss_key); > + if (msglen >=3D valid_len) { > + struct virtchnl_rss_key *vrk =3D > + (struct virtchnl_rss_key *)msg; > + valid_len +=3D vrk->key_len - 1; > + } > + break; > + case VIRTCHNL_OP_GET_RSS_LUT: > + valid_len =3D sizeof(struct virtchnl_rss_lut); > + if (msglen >=3D valid_len) { > + struct virtchnl_rss_lut *vrl =3D > + (struct virtchnl_rss_lut *)msg; > + valid_len +=3D vrl->lut_entries - 1; > + } > + break; > + case VIRTCHNL_OP_GET_RSS_HASH: > + case VIRTCHNL_OP_SET_RSS_HASH: > + valid_len =3D sizeof(struct virtchnl_rss_hash); > + break; > + case VIRTCHNL_OP_CREATE_VFS: > + case VIRTCHNL_OP_DESTROY_VFS: > + valid_len =3D sizeof(struct virtchnl_sriov_vfs_info); > + break; > +#endif /* VIRTCHNL_EXT_FEATURES */ > /* These are always errors coming from the VF. */ > case VIRTCHNL_OP_EVENT: > case VIRTCHNL_OP_UNKNOWN: > -- > 2.17.1