From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0076.outbound.protection.outlook.com [104.47.36.76]) by dpdk.org (Postfix) with ESMTP id 7E266902 for ; Fri, 9 Sep 2016 16:23:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4qW3CkLIRf3/aco8cWVoSi/HDPu0NP5XGBah01e+y3U=; b=AdgXafeJv6y/AA1WYjAMtTJ2Dov3qedsl6+OvaBCgLD4uSwUCTPafBhEbRC/lsvBnT6TKsYIwUiuyXDGrp/R8KUDuJpYBz9Xy2Ijaz/gUr16WMQypcUfbgvWBWW2hUTeYYZu43vX8Y6DDFPbfA5pzEs7Yzsmw42f904xKvIKCYY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (171.61.104.44) by CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9; Fri, 9 Sep 2016 14:23:15 +0000 Date: Fri, 9 Sep 2016 19:52:52 +0530 From: Jerin Jacob To: Bernard Iremonger CC: , , , azelezniak Message-ID: <20160909142251.GB4100@localhost.localdomain> References: <1471528125-26357-1-git-send-email-bernard.iremonger@intel.com> <1472202620-20487-1-git-send-email-bernard.iremonger@intel.com> <1472202620-20487-4-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1472202620-20487-4-git-send-email-bernard.iremonger@intel.com> User-Agent: Mutt/1.6.2 (2016-07-01) X-Originating-IP: [171.61.104.44] X-ClientProxiedBy: MA1PR01CA0038.INDPRD01.PROD.OUTLOOK.COM (10.164.116.138) To CY1PR0701MB1726.namprd07.prod.outlook.com (10.163.21.140) X-MS-Office365-Filtering-Correlation-Id: d36bf699-fee1-484b-8348-08d3d8bcd78a X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 2:FzoRAcOoIXg5zqrXVm+Tn/8qBY/7OiX4vszUmHes/5lwpVjvKM9w0rVIOcHlEb+ghnscTxtGwupyL58hvjMrbC0g+WxTdvbIuCChWQ6zJm7yNGjefZy8rFceFfPhWQ3DhIS7wys3IHT6SvVDQ+f0Xq3FCVy75jkAmyfq6CkRfqdJdrNMZ/N9iRGfwwuGsuFi; 3:KYqoQSY7WFapvX7L24lxSan87eCgtq3gg7gPDVi8QELpqJyWpQsWANjwuXNa4nGUt/jOgtaFa+DUveyLW7/BN+EYW42ftnQ0rBwk/2OPlT7yMcG9aQu1pxF0Wam9r45j X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 25:Hw6h4kDIAYzyLhg0UsGRFyTT2xX2LH/K4OzenvsXT/J7VSaplUlmbTbeuNKcy7fN+B3xtSfRyT83zgnkhiOqhNlm5JvZeUoXotXVyUGoq21CwF9UFpNN8QzqAmBw+inUnwVySzqcw0M16BUu6EluKin3kiiPnxK0wC3Z9I2xpCWViqdDGNVBKh3VWf72/TV5rPGVIJ31UBbVvU8Oka5yvbOuqh/80GXxL9Hs669cXV+O/HtTIgNuzRc+xcivl3Efy7rnOMoQ+G0f1S02E4SofssvitfWFPimVgunl01rM9B7jyrdlktKYXhwTvtelYAdel8nDc7e23KQoe/172tbEScL69wFpRLblCbiMFTUEPPr0t21Jaup1+f73yPWoFdPxzWVEY5maJ3uFmliXy1anzkazBaK8zwacS1RAnpnEYb+JOLN3KJnCn84WBVlc157W0ntzxzmaQUza0KhUYp4neIMjCHsoGgPMFI5dJqbwaEKeZeTUhn8bBA3hBxgTDiIeB1Zc6DQLmPhcG9EKbgB3rNl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DHFpKB7SEQnkirayqPnvB0LkoDD7+XarN3FBw+HLAcYMilImMZb3doFnk95HuhkQSAUO0KXdOniF2KKQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(97927398514766)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY1PR0701MB1726; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1726; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1726; 4:y+9u/sZ+z1dfAR0QOI+p5lPaRGmg6Q/Kj8hFhYDoimC4cYkVy/wiXVV+qNB6SCjWdHZ4LR30Z/Dmh0lPr9NCv/AvOHqVrOuIIBmMyLcLQvbIdmPakn3oAzzROPkL8n5ltK9RtbHZZzW/tbaTFQVpWwTPywzHTQQ1DIU5+PmpwvPLmjvMRi3WwDeqwncaSNhnyIQ/3gvHovz8fkrEmaBiVYb7IocuSGMORhmmJiiF9+RymyMxIyQbHBaBaqMOrLYZBZPcmqPHRCvDWN5JCiKvuyOE+GFsWrvb30fMTGBLLrgySnBV1rqJV29l7d1kvQmFg3qsvgOdXnY1SkQdVO6Du0O4BcpZ2kR9MMxugylLCvYiZypzV8ApiINJJHqyenzANSRFiSOkLll3ciwMrWTph0Tbeh7K8Xi77vd5V/EFnPCXs5UYBu3fff1lpAuEjFIVKlOZSlek3jL53Ph0G7cILQ== X-Forefront-PRVS: 00603B7EEF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(24454002)(305945005)(23726003)(105586002)(61506002)(33656002)(81166006)(189998001)(8676002)(81156014)(50466002)(77096005)(106356001)(42186005)(54356999)(76176999)(50986999)(101416001)(46406003)(9686002)(97756001)(586003)(2950100001)(92566002)(1076002)(19580405001)(4001350100001)(19580395003)(7736002)(83506001)(7846002)(3846002)(110136002)(47776003)(97736004)(4326007)(6116002)(2906002)(68736007)(66066001)(5660300001)(18370500001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1726; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1726; 23:5OVCuuHz+0PR9eS7FOUu7II9VTlXmoU9/b6PxKY?= =?us-ascii?Q?GWc+oqjDHJ1as4Lw+F9Y2Pjwdo3//n+M+PWJnuVfrsjVGQw3v5R9beuSV8xf?= =?us-ascii?Q?39O8thPnhUIwPj9HF7oHRPYatmbRAjT8VrtLsWlNEGsL0L7A4MzND5ynRgUP?= =?us-ascii?Q?ml0GCnigmybJxGRHyyf2Q+YJ7nagmVH67dRP+VpOiux7Kd9cFVICuVgD/Bgc?= =?us-ascii?Q?sy1mboMAFTUu2cqQGzi/cijkL8Nfy+1e1EZTeztas/eUta5hZUR5/RrYGI7t?= =?us-ascii?Q?iSWDB9Eye5UE+7ESjbgRJfNCrrimILNAU1Y6cq1BYFOTO8vYrvXq20R3zyFE?= =?us-ascii?Q?3egPaHHCo4eKtLPxZc1PYTVeQ64PG1SSzkCeNPZ6JC3Ftpwa4gXKxstsBa1G?= =?us-ascii?Q?xaAYPXGDBG043ciq19EmKUiSzhMGbtP8zENiR/6mky769Cwr2Peeh38s9Mzv?= =?us-ascii?Q?0F3ah2BL9BDm4amQ3UhDKg6/o55Mgjk2M3Pxm9vxPMNdDpoZ7oDTU5CCF/gi?= =?us-ascii?Q?8YZb7fc5trxgDo3oJliZoxH+VjPcEwfOmW2Dl9cV6/zE0WdKqbjF+KoUF24E?= =?us-ascii?Q?3IvlmDt4qpapJX3x7jBmKBKL1ZiKxR84p0qnzqgQrnumU1ndWNlD5TgFqGuE?= =?us-ascii?Q?zutFXbyNl1H/r+VJK4tc9Iusol+m3SJDdSyKeu9eeDN4Y1OgzvcwWAm7LjbH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PnWlwKwMWmCorhGX4jJ9bvzTpTaUydI+vbrjWSga//WXuRYqBm6WJDYu8/9vy0qFovhwJDsuUG/nN26JlcUEo6FxCYBRRf5xS5ld8zkIQ==; 24:HDEbgkIbdr18rZGmzCb2R/7HeQGkgfUgX7slazw/Xf5YwEZ4ygSqEVhmrbUSSpVYWzGUwrYDhs7qGuAxZGtMp7gEIN8C64anvhmQ3Q7WT9s=; 7:C+TUzFjGghZbf6HjXJ0h1OoRf1Ez0joeoPr1PPWBTSXAUenD8i86pVQStTl5KmtENOw0lnheeJSNl5u+/Rkvo+gfcV4DWirM9mXtJ1RdMb0/IlVUrNqY5aHNERNSWTwgisY5oADzSsFiOSuOvypm1ynIo4zpZSyfCMrBYhRaMNYV/fnsEHtEyfJou37vt2lYyY7M7IisKPf+gQeFNGzzqnQ1xfNtnIj2T52pm7RpmnUCODzBmiRX5cJVk3sRGC+L SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2016 14:23:15.1628 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1726 Subject: Re: [dpdk-dev] [RFC PATCH v2 3/5] librte_ether: add API's for VF management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 14:23:19 -0000 On Fri, Aug 26, 2016 at 10:10:18AM +0100, Bernard Iremonger wrote: > Add new API functions to configure and manage VF's on a NIC. > > add rte_eth_dev_vf_ping function. > add rte_eth_dev_set_vf_vlan_anti_spoof function. > add rte_eth_dev_set_vf_mac_anti_spoof function. > > Signed-off-by: azelezniak > > add rte_eth_dev_set_vf_vlan_strip function. > add rte_eth_dev_set_vf_vlan_insert function. > add rte_eth_dev_set_loopback function. > add rte_eth_dev_set_all_queues_drop function. > add rte_eth_dev_set_vf_split_drop_en function > add rte_eth_dev_set_vf_mac_addr function. Do we really need to expose VF specific functions here? It can be generic(PF/VF) function indexed only through port_id. (example: as rte_eth_dev_set_vlan_anti_spoof(uint8_t port_id, uint8_t on)) For instance, In Thunderx PMD, We are not exposing a separate port_id for PF. We only enumerate 0..N VFs as 0..N ethdev port_id > increment LIBABIVER to 5. > > Signed-off-by: Bernard Iremonger > --- > lib/librte_ether/rte_ethdev.c | 159 +++++++++++++++++++++++ > lib/librte_ether/rte_ethdev.h | 223 +++++++++++++++++++++++++++++++++ > lib/librte_ether/rte_ether_version.map | 9 ++ > 3 files changed, 391 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 1388ea3..2a3d2ae 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -2306,6 +2306,22 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr) > } > > int > +rte_eth_dev_set_vf_mac_addr(uint8_t port_id, uint16_t vf, struct ether_addr *addr) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + if (!is_valid_assigned_ether_addr(addr)) > + return -EINVAL; > + > + dev = &rte_eth_devices[port_id]; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_mac_addr, -ENOTSUP); > + > + return (*dev->dev_ops->set_vf_mac_addr)(dev, vf, addr); > +} > + > +int > rte_eth_dev_set_vf_rxmode(uint8_t port_id, uint16_t vf, > uint16_t rx_mode, uint8_t on) > { > @@ -2490,6 +2506,149 @@ rte_eth_dev_set_vf_vlan_filter(uint8_t port_id, uint16_t vlan_id, > vf_mask, vlan_on); > } > > +int > +rte_eth_dev_set_vf_vlan_anti_spoof(uint8_t port_id, > + uint16_t vf, uint8_t on) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev = &rte_eth_devices[port_id]; > + if (vf > 63) { PMD may have more than 64 VFs. > + RTE_PMD_DEBUG_TRACE("VF VLAN anti spoof:VF %d > 63\n", vf); > + return -EINVAL; > + } > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_vlan_anti_spoof, -ENOTSUP); > + (*dev->dev_ops->set_vf_vlan_anti_spoof)(dev, vf, on); > + return 0; > +} > +