From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0070.outbound.protection.outlook.com [104.47.42.70]) by dpdk.org (Postfix) with ESMTP id B789CFAE9 for ; Thu, 2 Mar 2017 12:40:19 +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=gTK0yuGUIODlKpkFcl3yOmeu4E9RvXNKL+Q6AH2RWuw=; b=hMioBvDWtYCeR3FPXzg/dBdmSgRd4rqILQOO9fnJQ3NTNhE/ysi+OC4ZzFFcQTGBtDfaQNFYJ1WkTyghd9CIJ7RhxlKF5CsILNn7GC6UXko90OoEImC9vY8flibEv3K2aWk+fVC+sQmCWohvfonhzP0uUgGeNtu8jVo3/34qXZI= 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 CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 11:40:15 +0000 From: Shijith Thotton To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Thu, 2 Mar 2017 17:02:50 +0530 Message-Id: <1488454371-3342-46-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> <1488454371-3342-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: BM1PR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.163.198.156) To CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) X-MS-Office365-Filtering-Correlation-Id: 18e7cd7c-b422-4e91-d339-08d46160e6d5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:qv+hpxcW+nM4QXYjUf1fVmmuerc0Pz1Q7ncmEenk18znsHhovOnIXNmVS239C9NuV6XmTj27/Ne5LamFu4qd+pO+PwreRS7iY7ChKuRkeSMe5zj5pSdWMLHeoAToCuIkGtyQ5efNMiPsBfNvAaVdW5GE6zjRz/lQ+pJY8pcFvNDi7G2hay/mdvjxW2NV0FqMDOAqUOejNQSEGx4qYWEJRkE0T6LDoON8hm7DQIBcJLcMo+oYpDOCuKN8BoqjyjPBKbgonBRV69+DI9aszG+7Wg==; 25:NGWNJnitTpBftK6rjnnWxJJHAdxj+FwpWDcv8JCNtrKA65j90Y9hlYTeYYb3yrhzYWywxbnOtr1MsQzw68/0o/9Pm05CqUVSjUXR/8WS7X66If4xEUXOwywj82JgLEob9aVS8ml5pl4JsrvpzaYP0QC28nBM7IxiyZdKKs6a1m99qSMte1iIY6yTjzhbfuU7nANkEXvCEZuENXMAOW69Oi21kuDCMwCnhmdiIV8qCtmnNewypMF32kmClppQQyii+Mzuc03SYNO+p92ndWNaBjHZNdL0IeQr1uuekSyJsLnPA7OlreBVQj3+6YDH1XlvTUJhJNMCDYz4EkTDJLP6SizjKv0wrRRM4XZEf9bqKLuIlsxri8HzlBcugL9+9aXTKZIggPUMTISZhSBnaBkUvbXZ1bOVNXNX4cibVg3Px2Rg5uBdBqdOQ8bI5IuQlYp9XysXX74JLrTn+g6Me7k1TQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:d1Tn9bmjvlOYhWmSR72+AlHcQDUAGWpgwgU9RIYyrCPOYD+OTAJ6Y1T/BKFMOjTQckq+0XOqtrz7L0Y+ac2or0JUPTbfMri7lkSc6pGdp6kL2eukXpVGnDEttKnc2Z3AZeA6cJbbACQKRwrIWx+/uoRI5pitzDUx1ljTZQOQIDjP41uQroTU/GswL+YNR9osdUdC8ePAFeQEIdFIYhAag1S6trexP5U/rQxr2sXc0rQ=; 20:7acLl7X26M8Ko0m7iuCrfSb1CCqNwzM2Qii4dfKglMCNVn3Aus6grp6iBd+pmSBHyANZ4VJGBtwDmC/FqNMrqKRTaXPU1U3nEDiZIfnOvGT1ZGAkirGNyHAW+qj4Pfd61/XijBkWhzjDt4fLty0YhaOaSkJQbGAvncdM0OYxfnluokhJFPx76KlDF+RLOi0PGkxHffsmois7GQDpX5cRpPsGg1Z0P7ojSjTE7YamhwDV2ZdXM6J4u2XovoY4xnn3FNhvhYchDe0zLHMC6jYC1QQbYy0tUa7+rTOcgt9M+HUhBpQvSKAqgqIXw7MANrOmWSnJf3GTMw3ePwffgjkb/ZKfntggwM1TwV6zDyqYHIsNgFYKg85cfqX4KpLlSyTVmRkGEI8SkaC/k1zCO8ddImrvPvg9Q+MLgfW45hHhQirXlTes1OanMKQTOtjeniol9lGgM+UuzauRfXuj/bhCGGwuvdOMUBL2f2ukXNQcfXPNZ/Z42+RC5GMPba3GLK+3dxlmstN3QAqHNcQiFvbKQs3W0Jp+kuq05E/70TMwyfcPm2KOzEUE/iHHgIeJVqjvNGq8hJWClwowL39OEMMAPApPnKefOcXP4KGMkmhz0Gg= 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)(10201501046)(3002001)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR07MB2277; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 4:WeRnyFDu43/cfwlotUznIsVzeahzgu+kI9KMxysKBFDDkDYNEXsdr32XgzGMcSWzI+ChhDOmOo8rvg3TJ1kEv+09nkToEE4t84tN1qkdJ/JnBjqRjLQWQyC9C4VNwcAYqFQiqeolq+z6wPS4pEDUGN3K3XXFksxxTkvzrQWY6vxs9DZrzj99wRF41XsstxuKrZl97ET/G5CKndf1k66ekHRkyx8raaQW4ntGkJ+e+dMacAE+ZGNB5i9PRTqM5JgNBbIG7C940gvyxLZQ9XnepGlBdV5NiGi76oSZjioPg88AAPNU4sl+CxC2wTpKVpxfz91y6dHxir6yQjujnID/B2dXeJhJRlwE/e0X11OfbDLs114leo8kn14gTJ0MPjZcsPUaCbQngFbej9X+PQqsFJHx51+HpM859ND0/dO7HZb5fqi2wDLf5B8moRX3sxo5VkadmCaykUkmX1KC7/pFkeIqbiGVPSCXw6AUzaUAGOHLsgQ77zS00V3s2dPYEzURIu1dqz/Rw/jNszn669i0Bh9oVfSsRJi0qr8inYkIRlOM7KaUU24w/Vs03eAZ2oSINl14G1d9ThH11ENKXDh9Q+VESjGwAoWoA9SIkjsLOxI= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(5660300001)(92566002)(4720700003)(33646002)(48376002)(50226002)(6666003)(2906002)(5003940100001)(36756003)(8676002)(50466002)(81166006)(110136004)(38730400002)(4326008)(305945005)(2361001)(53936002)(2351001)(25786008)(6512007)(189998001)(54906002)(47776003)(6506006)(6486002)(66066001)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(7736002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2277; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2277; 23:I+5fhbY5nx9rTaVXCUQqZuxmYCK1hrpzsM3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gnfZB8AyJuLfQ8orijtCUdRage7c5ZpDBJK+MLKNNBcWtoifTrN?= =?us-ascii?Q?ExpyWjlqDHQKSO7uucCs3WSiygUEwOWRk50in4lFQf+Lbmd3wO9GzOQ3ITVE?= =?us-ascii?Q?WV1/qdo04AZwUAKBZMuoJJuNIwuM5vPUESHFyJGGEUmCnUy42iF+Xls6SV90?= =?us-ascii?Q?WisqwVHs+M6T96inE+3AInhpOpC6yKPSLNmfO4RwRbS//KLIw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:b3UtUm38VBrmyfXhNEfKdwA8ZZQDRp/Nf7NQa/zwhzTfXfURSOySdGC5bBljBBr7zk5fB3r9DYSR+1NFrdGENjCT4fGK7RtVt55UffLbOGD1HJzd9Ri68wisaQyCrt5zZomvjjjwzxv6cu7W+IbrfvhLZUhD+qKnzN+rF0bUl4K0WX9ctY3uOkS9H2E+WfjIc0Tibozn8Zj/Bfqur+Cw5UGXoFN6Nq7Vl0OJeNWqtay03H/3wYfNw1WOlOirRE53JcfgZEjHTgR/B2AfBIyh5IDXqmDrB72HTuJgWYQCVmK9TL/zVqNHps10dNsOgpUOP/OVMkHL0LAwGPZGXHY5ItHg1IgOsR95kOrHcBZI5EMympyI8gBSfTBtZCxLEUAMZX9bw5uXQZIBEUjLgY6eWw==; 5:FJzyb/niZ6eqwgRPvKybX+vQl7lv4pyn3vIqk1KT0uU1u8oxWZyqhYyZWJ8pjXtQFoduWUFbTHwM7amZF6B7mAuRfHCOlHo5oR3kv8goUHPwwFjlLUeDo11zE0Z/HGqzCTWSam3f+jQGpquVFCt3Jw==; 24:BSPB33H7i9r/c11G/vIwGqIeOj4RtFoMPx32jKewZQR+dUPG6ECiHr0N6m+MaS2yOnB/L1HiPLVu1RvIeSOcU6RBRGMy+F4GHIhcekxBDRo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:E4PiskNup3kuNAw64KkagjwWuVC0Dk7nx3dFZSfXRFDsuLwOLJhHA+lhu+F8CWw9GlMOxOOntaGjbc5B0riAi8kmKIEWV1A08tBG9aA6x6Hapi4lYtePOfDOgIKWToQPTXV1/P1zOL78hpK/mMKgQvuoix4KHRgaQAn9HWyT4OIZ9SkxJvRJsjhCgNIPdqpCil8CMLHIsjOoMqxT9igXRhUP4v01aA4N0r7tY9xpqQy6IsZT6K2vopw5Gw+iV7O++nIQW2Ay7Q8DMmGZgrxMYuuxXuIpHWkR69y923Ygg94zCY0670/qQ62q/VhXcbgZDRuzuCqx4+rgpy/lDmvDhw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:40:15.9703 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 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: Thu, 02 Mar 2017 11:40:20 -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 --- drivers/net/liquidio/base/lio_hw_defs.h | 2 ++ drivers/net/liquidio/lio_ethdev.c | 45 ++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) 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 9a936bf..920a7f8 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. @@ -1751,6 +1793,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