From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0070.outbound.protection.outlook.com [104.47.36.70]) by dpdk.org (Postfix) with ESMTP id 1DF44D496 for ; Sat, 25 Mar 2017 07:29:14 +0100 (CET) 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=jCu1xQZZ0qJT26NypaTDNtgwx6uXaEJK2j917RnZCjc=; b=HPmC1VrCUL7P5ICKE6aButSZC6UVfr6r7xTTX0y0raeLBLVO9gdvvkUPn0j83F/JOebt4JHfQdvntyVQmI3dwPMyb213/fwBx6B6Av1gsRmhcls95FigXOu1btrF/bSgWb6UMTGyK7nVlXCMSErnyJ/2fYC1MnC5+Us6QDvKg8M= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:29:10 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:56 +0530 Message-Id: <1490423097-6797-46-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: 05ffde66-ebf2-4d8b-584e-08d47348408e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:mw/TStpygt/bHOqtOMF6txm1Pqb6H6oz/GXPX2ifFG5dP3ymcFKwkpsTBDZKq8IMy1XPra7bvP1y/CfDdj1PryRk7jPsreFG9ju9Sok8fT+ROlMylDRHEn9evOHEG/f1rlht42PmHeypnpeJkbFBuj2tz3PcBAqVNEhmXGSveB4/Z6dX6yJ/hXwvs65RWsxstXiOwi5LxSQgs6WwAz0W7IGCPJeaXF2Cq59TrpbPEuw07Mw24OjBRqeRumKRodlmbG3FFMXcji4wmY5CXB4jWA==; 25:WNYyxtjjXR1g/BZ5v53C70YPXYhbZ+ZYSIyss5uJZ/DE89ljgY2M8iBgMNCUqYAeElGc5dQTsnMUMts7V0YWMyn5e0yVjbgkltyfzdp600NjQw1/DAd7UiaSLttwJJeCiYop1s4FbRYRFOaPLiFxB2pA36F3sD8eiBbEPzxGT0EtbnGJlMqSOokJkwlMMwQZJZFvOHcyfwktgLYt82iD14FCiKqworrob4miWUDAj8K3E9DteQNJ2j25fNNqtXhtMxUzyN94pcCKPq8XSSzN526Auk4TLKEWGMie23ggpYwkDsxsowD37H+7H3n82Yf2duNnXR3E/10myVkqtBtQrEhYQqj2hG62O1VRll0tMl7XccuLM0CG9VldXuK3CMVFyIP9F8ev7EpOtm/UrG47DUTSacbDMM2MQoT8p8H2KSKD4v7iOPxVKbMkTAMSw8/Nzk55ZVbuBgv1nju/C2hNcw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:4KHQanb46iekihxghq/e1TnoEFWixwKTOH9B+Wotx1yK1KIeafxxcj6rHfEZD0MK6yh7SRl6B/4PxKpPruPQrDIw7bkz0VWrpchG1NbUqAKGXSD15yNthOXdBIGrGbTrNcmepKsuIkYAN5XGYrVBogETmscmP3qEKKxVIwnnp8WVgxweWsn5Kv7o6OcPA5Hi/A2hU7Z33r4JKriv892TLvJE1Ll5t8gNcyE1MD1CvTlpGJjYNHXfhkpLu2CPcYJO; 20:Q4Sr+qIFqr2//xmH9L4rak/FgWB/yj1YXHvWq6bMHYFzTSatGPEtloDj332pp5LiXysyQIaHIvypYl8ZsUSePelofL4ilRbzPGJUmtCtXbl4svW8nQcH991UPiIhhGPi1kYtnG3WHcLXRk36eRafwyTu2zB/spwIPUZSrHjpSn+RNS/fdFdGZN35YsKccv56xQHv8wH0HeRE1JEEcHg3sgOUn/IwDYVaQkAxOGFwXf+Kcboy4YVbVfY8NX9HoO943wFAdrabSvGoNlor2v4O+kq4H3ekMWnSnSaLv54KAe1rpYHaEEcXJ/fz7HLTlx3kfCDy0p0/5vjaV1ZL+1boi72HNY9GZo1AATjNB5z1kHbUJpr43swng1dofs+bbe7njkj4YFBMzKJRvUvMr0kpaNHzYGyKtyM7NovEoq8LH1W7kEx+I8plgzBqtnEvNL9EuJp2jvDJcfZXcOqTlt3VwRrh6Ihdu21qhaFwZTvSTtjs0fbNWrK+CH0dDKOP6FpxRxmQd/Nndc4T4o9iJ0CRX3LTerI3E9KKPd4NkqXTNnALhsOxmS7Jlm/NG3lI2mJcgeodRgEnDvih1JUR30Rw+t7LgTsz+s2pg/DHTVHafks= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:jU45A9568KlgPgVWqYkCXJFh/RkbtFRDz0KQRGme0gcyAyEpLN1hwMKKE89EyU6sJBKzAmy+WGSo1zc53Vx0A2xn+nNBghtkRNRIC+kMQYWylWWCZYnFdKbzNyVS0mgkcua+Xpf4FXX6f8TpbxBOKQfMRWPPWoR4j8LABQLvWZMrnP5jjriZsIeWJRpWpkmqaAx5USZ7zi2tUScLCfju2nclhVPAFOFKfMZOtJy5yCfik/Nj4HgTU4hoUZSDsbw4VSGWjEuyMo5zsS+V+e0rvpV1Jj4We2XEfo0pKpHHpDLl4Dt9JtmREHLyk5bMhNJZZcsmZhQrO/qQxsFNTKM5xi+tyQlnsaQ0WkBH4kNWIyfWQYysIMNg7ZURK1E7s06Xa2agjtewEoAndMvEgYHmGVrwvn988X9C8MHIAbmmbwHfjxiPz56ejC6PkN1UxNezSANMN4KWeje6+o335JTd0nMffqFxfO2yKPg5PQLt6PleMMij4fTTQDC5uAac/JxjPOGQcrYrwxkBOQKBH8dMECE+GqDQ1nXNj5pcLLHA74dYa0so8E/EQr0yVz3jvIog8GO007FQ2r5kwTPDpjo45izZU46AfUH+s2h3bOTRnx8= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:10IOz2RiHpGA4GrzvvII+YhLI6C8De8rnhcy61FrC?= =?us-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mFTvfRWa6wX4L1gS/cdodVCaTbCvegyx9TShVwv?= =?us-ascii?Q?9saoceCXKJk544nG/QndwcT6YveDy0Uh7vc4/CLScHUMAuUJH9/3xdtRjRol?= =?us-ascii?Q?L7b/mUeZ3901S1MDnqcJ0bjtr2B20zAWIbumP2uRMXRnKIgW7PXoY/X+ihaR?= =?us-ascii?Q?G2Gw6V0g4l9yzIVn/mB7sPr7Tfd?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:8ckgu8a85iDUkXEwd0VcL4suxKChDLQWUXFITjUwsRmH/1NrYkBd/VIBmO1vagb4GF07QwBwYTQuaqBwnvItDNq25puiXXURDvaZX6geOXZtkWSw/IpeQpizIO4F7hUcOjlKdDikkl9T8reNooMFJ2NhA0K47smq9Om9dVWNq7cQHb8eOOdzE51Hj+7wdY7whBMB7zqq+KWZJ3eHuJGI3PHCvK4DC4KHfKE6itMAGB/EKNwiNlEm+/LfdSFpdAuk0twEIHWSQI/zvKqyvjoziKU6yo9R18vrnFXw7WLL+LjJeqMfLxPBJZ6nJgEuaBA5BYmft1iMGVOZzN1uTFF/hVe0Zii0iklw/Chdxr6btcDhkD2xcOIWvauEeUJEXSOXjEjGQDhcJtjyTtmYCffVMw==; 5:zuWanigrCegxxBdx9Favwp81+adrv6PxtFXbJmroZ5Xd0ObQo6fWj0UOL2DuXsKsAWJFWXQACvTH0vueEmiDpDr5K3XlmYFfpogxOmj8reBeBhFRnLWxRvFIdwHWwa6aBWcFvOkrGdOfIgBZ/Fk6Bw==; 24:CdzwydbCKqTl3rvqaEloWjVZS0MJ9zuRas6XVcvTmu2PhtQm9UFdcIjYV4v8ImQdSPScsGXt3E1hOILZ1WY9hqUNqz2M1RNtsvXaHWK3dmM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:PiwI45JMJKYVfJkd/bsI/S2HK7fSYcVcWJnAH627aD4Gj8YDiK47gkTgUbhL2vdvWvHM1NKVcn3ePm6th2dw0Lh9O3sevqUe8OJqkFqlKiuTNRSqCdzbxHRnuitxSLxnCZCyf77L40MHWPLMrxIIHZfrHOCfA/vM9ZtpYoCLBHsP4UA31rZlQFQaSiUDNWik4lCZ/uBN9ttUAjhrAKbe9Lx5FKYAyQ1rIRYs41Y65ogK5omUGEbkwmVRv9zaC/b6Z05GGWrO7+i9g5STRH+d/fWE6l1n6N4TOIyM/HBH11pgtXnCkNW2GVFZRhVH7bLQj2IOmlKLUuw4SBDOK4vBtQ== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:29:10.0273 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 45/46] net/liquidio: add API to add and remove VLAN port 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: , X-List-Received-Date: Sat, 25 Mar 2017 06:29:14 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- doc/guides/nics/features/liquidio.ini | 2 ++ drivers/net/liquidio/base/lio_hw_defs.h | 2 ++ drivers/net/liquidio/lio_ethdev.c | 45 ++++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/liquidio.ini b/doc/guides/nics/features/liquidio.ini index d6d9e92..6230033 100644 --- a/doc/guides/nics/features/liquidio.ini +++ b/doc/guides/nics/features/liquidio.ini @@ -12,7 +12,9 @@ Allmulticast mode = Y RSS hash = Y RSS key update = Y RSS reta update = Y +VLAN filter = Y CRC offload = Y +VLAN offload = P L3 checksum offload = Y L4 checksum offload = Y Inner L3 checksum = Y diff --git a/drivers/net/liquidio/base/lio_hw_defs.h b/drivers/net/liquidio/base/lio_hw_defs.h index 8a22d10..67eaa45 100644 --- a/drivers/net/liquidio/base/lio_hw_defs.h +++ b/drivers/net/liquidio/base/lio_hw_defs.h @@ -137,6 +137,8 @@ enum octeon_tag_type { #define LIO_CMD_SET_RSS 0xD #define LIO_CMD_TNL_RX_CSUM_CTL 0x10 #define LIO_CMD_TNL_TX_CSUM_CTL 0x11 +#define LIO_CMD_ADD_VLAN_FILTER 0x17 +#define LIO_CMD_DEL_VLAN_FILTER 0x18 #define LIO_CMD_VXLAN_PORT_CONFIG 0x19 #define LIO_CMD_VXLAN_PORT_ADD 0x0 diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 60dfa61..df91659 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -404,7 +404,8 @@ struct rte_lio_xstats_name_off { devinfo->rx_offload_capa = (DEV_RX_OFFLOAD_IPV4_CKSUM | DEV_RX_OFFLOAD_UDP_CKSUM | - DEV_RX_OFFLOAD_TCP_CKSUM); + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_VLAN_STRIP); devinfo->tx_offload_capa = (DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | @@ -825,6 +826,47 @@ struct rte_lio_xstats_name_off { return 0; } +static int +lio_dev_vlan_filter_set(struct rte_eth_dev *eth_dev, uint16_t vlan_id, int on) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + struct lio_dev_ctrl_cmd ctrl_cmd; + struct lio_ctrl_pkt ctrl_pkt; + + if (lio_dev->linfo.vlan_is_admin_assigned) + return -EPERM; + + /* flush added to prevent cmd failure + * incase the queue is full + */ + lio_flush_iq(lio_dev, lio_dev->instr_queue[0]); + + memset(&ctrl_pkt, 0, sizeof(struct lio_ctrl_pkt)); + memset(&ctrl_cmd, 0, sizeof(struct lio_dev_ctrl_cmd)); + + ctrl_cmd.eth_dev = eth_dev; + ctrl_cmd.cond = 0; + + ctrl_pkt.ncmd.s.cmd = on ? + LIO_CMD_ADD_VLAN_FILTER : LIO_CMD_DEL_VLAN_FILTER; + ctrl_pkt.ncmd.s.param1 = vlan_id; + ctrl_pkt.ctrl_cmd = &ctrl_cmd; + + if (lio_send_ctrl_pkt(lio_dev, &ctrl_pkt)) { + lio_dev_err(lio_dev, "Failed to %s VLAN port\n", + on ? "add" : "remove"); + return -1; + } + + if (lio_wait_for_ctrl_cmd(lio_dev, &ctrl_cmd)) { + lio_dev_err(lio_dev, "Command to %s VLAN port timed out\n", + on ? "add" : "remove"); + return -1; + } + + return 0; +} + /** * Atomically writes the link status information into global * structure rte_eth_dev. @@ -1750,6 +1792,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) .stats_reset = lio_dev_stats_reset, .xstats_reset = lio_dev_xstats_reset, .dev_infos_get = lio_dev_info_get, + .vlan_filter_set = lio_dev_vlan_filter_set, .rx_queue_setup = lio_dev_rx_queue_setup, .rx_queue_release = lio_dev_rx_queue_release, .tx_queue_setup = lio_dev_tx_queue_setup, -- 1.8.3.1