From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0084.outbound.protection.outlook.com [104.47.32.84]) by dpdk.org (Postfix) with ESMTP id C1E83FA74 for ; Tue, 21 Feb 2017 10:30:38 +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=CgesULm04uDMqAU30Z1F/anbgUs+HtdCzRHRhwUoYEY=; b=K1uSNkJadvl0EP1Y032flQJOONp7+GUPZycDWSrMOuSWleoIRYw+1JqH9R0to4GRpqHEJN6ejFdOVoLy27ukK7v1ok1SjECPrcvDmx0ciX4w5v5aMmI7yUXPfYv+8Q+sRD2CJ7lNUWx8jyXfdt9qp8gtrkZ/+R7QCvxczSkFHgU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:30:35 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:57:04 +0530 Message-Id: <1487669225-30091-50-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-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: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: ac3332bf-cedf-4dcc-a210-08d45a3c4b25 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:isaG0j8PxkK+sEsXyvjRwZOYhaM0kVcJKydL5xGHsV7CWHuhWjpN67rLJXjGIOyMBgzJZfn4vMuvyero/FjCaopKEfhsa4eXZzyLA7xcJ1/4ZrAQb/+Pa9d2xOJZbwWVyd8wwu7+cNIvqdOflLvm0EhDX5U89SrGovrT5zN8JYVzBcLMF1D5y6TL8IAHxHFmQ4J/CdEfAuW3aml+FUX1uqjfg8b6h7e7/SVmdOp4+HbfEcNpdqlZFZGyBC4I7XDaT4xC7bEKjqXO00lZAtNNPA==; 25:xrKcI9alS+NguY/ffPQNAZpT01N8ESpfHgrT1xhW+63odZ/Av9PXaLdXEnmcSL1FjBa+8+eVq+ktVxT1XC8kYHBMRMZ3nebWyt1Sh+BUqMjJpsg9FvpgVCefHFxWxCNZgS2IO0o9W4+JDQUbTkwpWMi3rl2n44Bn0g3cr5UJm9HnP4w2H+BK1APXFbURsy9Mdj3k1egaIFc7EdrB8e6WV/xhB6VFPVlpUNDYFVI3vhzIP8nlOZw4oOe3nJSZZaRpE06q/BiBc7tB7CAHxfvajMkewUk0EGgiXfUNqlEIBR663fTg1e/Wk31DgolJpsqillroiglCPcGBNBEI5dJeGvZJ1iCYjCl6KO0LeR1vBscK2sD2inbT7++6kwEzN2uQ30KBfeZIuJozJJtOa9N+/QqAe1+Vr8h1HYXhc/rXYKG1CrgmpiyMUbdgYGN7I/K/g5wNu8kMgJ+PS85vTPocxQ== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:kPO/rov3RCmQaM+jI5ZuWA/+s6P1YaZRjBpaUAc1fabHi15PwLEFI6P/lMMp5HOicq6/ZG0KAc6hi1W3l4DbK6uIWbiJIA58Je6k3tvniEcJifQ/tgzq08aCSKXQJlDKLved00WoDde/bi7C/whR/4dmI4PNFi+OmgQXMZEGRwVDzW59ix6kduHYGhGHA6R8ibtYB0R1nkjj6qGKPst9fljzP4NiYgUj8C1ieuhbqBGsyHVhu1nopXwLE6Wqn5sh; 20:niaPSUvR58BOsu6ib1pBdKW5Z9494kkcEIG57nvP9gKzH+2oQUiA5EEvJO4sFtktNtouyxa0UZyArZUZP/QQHS7vz31pbDWYwAPZRZNH5ayPSCzNRcwNv6ITXAr6/sjlpQoTHKNPEtnNZ+zLiFbhNcvRnJyUyCGIxLecsOEBI5LCyheQ64hWyRA4WZ07MqzzkJjVoQeDCPwvJ44rUPd9z8oMQE2rLDlVkr99kFzuaVLn0kdD0QfDOSo+3fnSn6JEl4nnizgvXkByAyjufGUAO/crYnhzlCOyL172nYMNH6ZDhFKuCrZkRoXLeIJqfbI0mrBSuma1gAGCnsA1rWlRK/y5uP7x6lBbiMOf5aRqeul0VWy3dP5bix7wdeFSLmYGbQ9c5Nde4D34VXZW9uJiV/oe5iAD5rdHwOOeqoXWNsK7KYVWnwjrWiCK9fS6UZKroiKDrO0mottdUIaEFjABIIlfmgVbnlsq9hiGEHGyFaNMJzBKCAzXSwcJ48JKyQr1Ris8r7NtTQZ8vv0+SsErmCQawI/0Oe4Ub0Sspsi3x9zWK9tdlJHaKFYN//g/F0fSCRYoUdqC4wSsdT0qGL46wPhtRzPtLxFuDLBjKQpiC64= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:ZlEernus66Lckv446/koFkfm5W+ieAx1zRu68WgOXeWTEM4/CeT12BB9MJaPgNRigObnZCUfYMkd+pZbii5C8zH+pmCPkJqhczZSqLQEeStFNQA3Pt5IQ4fPFcOZ6QcYeTXnmjhqpFQ14KJQKKHRG2bGFVgoNnxZjF0ft3WtAdWa6P9reRdmiXu+VEu3CL+AvVg1225vk/2LLDsHHsNvYj177Vs84SYrTMlTe0Xx44roYPTcZYlXj6YocLUKiQid5HXIYWy/xjLY9/iSRSeKgtd2CUcYDbDG8hPQMlHZiNPOlHmiUBnzSdV10fKgReVy6uVC+xqroj0BTGcf/YaftJ6S/g+EQh2mOKf3H2qyNse+BFfQpHqvl2WSuEeZBOLiuoIgEcjdHAX/6cHHVnWnlXbXUKInlaEThRSUVpyBr5wbZyRUE1fQiAnTGI6InlkYQOuvG2umJ24s3/ju6tTvH4AdnuUXU9V7m4mkxasdPJF7wy3daUWMSz7Mi4+TS8Tz1T5KYtreObrDomHWi7W7vocAvKL+CW7rJsy/w/e89ESvkUtwx+5+bVKOIg+oDPS9kfoNW3ps4RRZOcn36IDngzBwsINkAovsMjc5ktX21OU= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(575784001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6666003)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; 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; SN1PR07MB2285; 23:Fn27qRL3nwaU0159jb2UJdR6jtqiYmjY6RevB5HLv?= =?us-ascii?Q?0p3xbW+QwnBXNdHqD4Eufcky6brUDUcu9EYe/QHGK5pGc8BgRnMKe4zdB1eh?= =?us-ascii?Q?dKYsEUsL7ZL9ae0akYEDKF1+R3nKtkrnhtWk6uVvZb06tZSmGVMoH1BPME+T?= =?us-ascii?Q?JZk6b4UapAWYJp5hIHKKMYjwKTB8DX1vgow7GGtKamE5+UyPymfKPKot8oSm?= =?us-ascii?Q?veC6a2P9YFlaNVlS8/IQTn5Sc2++7rjuxMzX15LNaxFMv2pMNq09SDdfwngU?= =?us-ascii?Q?JNvxzVf2H4luxpmi6wU7t8dNGBMtiYjec/bUsY8TvM5qu4cjQQ5RHBrPU0Ep?= =?us-ascii?Q?u+/z42AN7RdQ12vomqx4doMG/St5ANAWvb7Zg3i3Ur8BrtDrSqh9yxFg44uE?= =?us-ascii?Q?lg9+5LIlsYhxG71YVMM93GxJRhXwCzPTADwXGzQej5uYnwySNWndwj2PIJgk?= =?us-ascii?Q?dRk/6Cj0rquR/UfRyV9aMDSs7h5+CUM59JDeL3f3ZSA5jUehHUJ9guFxV3Sb?= =?us-ascii?Q?Fvh6UvmGsV3/CdViM6s16X4eM1TleyBi7/1zcRDYpd0Zg71cTbgLINdxfKby?= =?us-ascii?Q?PxWdrWiduU4iexYVhKUXU43kDuvrLC45IV2fyXC3LL01v4YJF5gLO9jpOh16?= =?us-ascii?Q?Uwp06YJ5cucenVnYFosCg0GTrBLqKlbKwjAYpAo7LrJXm6isaFbyELy1xKx8?= =?us-ascii?Q?0PTUCkCo1ZspyqduHYfW+4iOAuzSOKX9AKoeDu6+e4XlBTmE5DbFj53PMzoJ?= =?us-ascii?Q?tIKyFt+4NKJiWK6qjWVULg5KrVJ4QCxgM9LZNyp77/LagjvZenXgvdgNUT5N?= =?us-ascii?Q?bJC5VPT/OByM8no7/m3bBQsBwb85LglRoJx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B2KOI8Ms7jmHmoqUCUiPXPiHd6YPesBqQoiG0DVJVz4Y2WOosV7gRKAbd21VW8Nz+xg1f2sWwST7odgBAFd0nWoDVoiURjca+23U3YgNF9cJg==; 24:ZIzua66kuR1geH3Wrn4eZHHmHxGuSi/R6wISdffb/5OvrGvDvktiUoabPTqJitD6Ry0ui66531NFktd8jJpoX/Ehe2XpI0R4BQk1jvS8vGM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:XKU7iAcVlKmQVaJ6HgctDHzFoV7jK/UH52VZ5z0O5ACCFCWrjvFSazreSmfMaj3kTG0GDkS3W/Ac6ads23k+nHgceIWVc0dTOmPxgncNLQ3NUb4OjaNA60pfZInvoSg5XokvOI/Ms/Rneg1cr55dVAvrxOAe8TpXfuQofEDGz82Xdjsn587oChDHVnMG23P3Fyn8WHpjWLeVO8dvSH4Oo6v7U06uyTjR4yplu4AM/HmbIutKOmCdPPnZnE1Hh0JnY44A7B87AOVwJfNrz6rcfQT1oRbaflu1TXLrV7I/MvFuvViIEfZ6FWDNkI5IIggxKgb5J/pU76X8Xg225A28IA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:30:35.2314 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 49/50] 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: Tue, 21 Feb 2017 09:30:39 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/base/lio_hw_defs.h | 2 ++ drivers/net/liquidio/lio_ethdev.c | 46 ++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/drivers/net/liquidio/base/lio_hw_defs.h b/drivers/net/liquidio/base/lio_hw_defs.h index d0a8936..dec12f8 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 cb2d048..a003de4 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,48 @@ 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. @@ -1752,6 +1795,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) .xstats_reset = lio_dev_xstats_reset, .dev_infos_get = lio_dev_info_get, .mtu_set = lio_dev_change_vf_mtu, + .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