From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0062.outbound.protection.outlook.com [104.47.36.62]) by dpdk.org (Postfix) with ESMTP id A3F73D466 for ; Sat, 25 Mar 2017 07:28:50 +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=zJy/59sGOt/3IfhbTyAzu7gc3xmZIH86nO6P5CziXe4=; b=hKMuWy7x+TnCZfed94s67SpRhyhmTARwPp2VtS4mhEFgQ/4h0da+S48iaRO8w1fO+YQ3Gv9Bbmj5svRYmAIyQS/DI5VNarjVbqCvIqH3rVnV8K2yo03ec+Ci7vOLlPnY363c7gwgEcQza4wBy9wa68TzPZNRBsNEMk2y4xHvpZk= 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:28:45 +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:48 +0530 Message-Id: <1490423097-6797-38-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: dfa1d2c9-fd27-451a-915d-08d4734831fa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:F9LL7Ue8BeJdJQr8NISzP59acYAp+Cf89ZsuDbXHeZLKDpgkv/gsbNlYwdIKWjMPl7wpGS/JoX+fh3t39qb25uqgW5yys45e2WnGWnuwKqvqF+dcGkZw5ohf98bQjCvtsW1DEW6/4BQNLcy6oMU01nyhilBzB/lELk22lTOYs3uTy4/yRH9u4/lL7Tiv/9obzJRgaQKAwyUduO8ta+cTVM0Yhjy9f8imDUybUOPqbihKn4uI7jemJABfG3BvLp0TytuZ6sGCIbka1+TFN41JYA==; 25:2iVwhchV/CGnerfiqkq1wSUJhnI7fC9D03LlL/3BOKFxNFglt9gll0f5DDqgh+rmFrg+tCnJLgkc0zngyrhgiKlDMVDBW5U+plEWUePngBru89fqvR0lfmzxsUXAS2EVhb8/h/Q0eE0hb831I5Lh2XUocJ5nubrm1SvK8ZJROOYolb2EMWnDkYvE9r3OdtJDsPaKVtDYGkZ8JnM6Boe0s9ZaL9Tp3tjNxrZEDFnEw2I/vEgn4OWVgx/MZ/ANybmeTEFUFjjgblaDtQsJXm0AjPiXK3AwYOzTn5e6/0E14hybA40vjMEoixdo/J4ed+9KOtnMD3RSYTPTJZ+B4QymkVUBDn2HC17gPaNt6PlElUhBd/mbEtZ0lCUY0BAZs41uOe54G6OywMtctJRIzLpmmtQmHLS0BWCXevPxP80ltuxRotx+euQoCyU9TSbaAXgCp8t9kHsZOvIYt1ctK7FrdA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:ayGvbF8WpeqqP1P0Mmo4goVQpBFLbROJAA/Sa5PvAHfiXTX1xQZoLIYpFCYNkoImo9FnSunLcAzhPZebcC23Oybm4MJ3TSvupL2sPHPAs/Ob7y2RxB7EOZGJjpD1g5dW9oYl9136+EYr56FRX4pBGqxFKMCS1nxZVWG1b87R7ptGp5GAiqtSWjnzXIMoNtEBspJfrehcHEvvkhMjUOOP/BUaCAtx5DdzGP6Fau4F+DET6Oj4CZx3n43P1uF5UejZ; 20:DpBsCGJc+QW+cnsQgZDBghs6rUGrlYZbfZGroTngNRR6GSQ/Lg1Fy7DYQIZwzesxShelSxHn9gYz79w00pnJU7+j61TzKZPqwdK6CMFZhZxf3Avxr0QUXPFJtMHm1dytgSltVze50MTzMI1iTo5ZP0TstHXyV0znQMCwdkFKx72FMDvM2PwVh9E0MKRScN4cZFbcfh4ICn5wWyoWdIFfIpJoH9SNCU0EHHXYDdLvWWcyIpCY0yGNnDRjf5iLnPKGniVLFqcdgeZ4naSCXzaRiqxhO050NZp84CvknS3puULjg/9NVkUNldCU/G8eo9r7rU7jcvCX3XjMfFlsf5/630TQbuXA4l77Fj1GLx2RY/TbAmfTX8syCbh54RklnvsO5yEHzG77mmBx0jK5Uz2t/8cEuIUo4UqM9wri8BT+/6+Whr1fHgNr3MdYEXhv+AIo1nErniUt4xVz3T912Tps6qM7kDTmh6irm6YkGgklG+xo8nxllo6jAPpigAQn2Dq/PArG0ykjpF7edap0w78uXwv0ACVWAIFKG6M+c/MRDbDfFSkfJPmFfUQsr2nh+1LLBLq6i0hA+4c3sgGJEmqTfhf4Ks8UeMSHu8EuqtUWgkI= 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:CdGRENeGc08aW5V21ygYauC+dq/cNR0XuSh4+RmvUFawjMKay1YFsRjye1+FT5WYHp6cPzkrIvdiHfPK2FQaouM+4b+p/K1eecdsWx2mmJU/xkBLHXlMa+RhSYS6zlG+is1sR/gvEt47ojQGS/VL4k62rgQOqQBTifLmRwdvKAJ3L5sSLpM7VthiUW4zICKzrV2xGYoaOLSu0ZaLaa+2j3Bj+OeCgSgEabyJlb5gVKGTSFkeFAwVqf8pSxIq8fgaAh9k4BYc4LL4BeYCe3FDpliw+rKT7Oy6CnYBdOdephMTKnYE5qYZmOvl/hRa2HMAtAa4d68KOeWjdZ+MVfKeId/cLKlgooqZeR00VAXUZgETDoUC5pkk5/mCP7CwAbjO33pgaZtZxjTwEkf9uGaatIYBnd57pGUTjknJeEV+kE7v/krsyDW6a4sAg5FuHRwWlNl8VWo8SIrXmqDfQcEiyuK1FGsyNxpo8UY0CRQSv5Rl2ZWc9rXKbRyo+gS1k7rspf777ba8Sge50CdsP3aTT2Bcn0R/TqfRUrtFpEOglc5Kqk78lJoCQXm61RuYIMq0CL88D92r4XiCGRC7995/dsif47EZSzOnfYqjx/9w8hQ= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(575784001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(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:45VvUJJuhzJmONye63oDNqJm4L06awEoS1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rbyYOj46SP8rXjS7XNPth8+niTZ4UDZw5mwNiQnEb8Xubb6Pa/sPhDhWamVmupxdhC+ARb/n1mz27J0uM1S52U2YUYajWpYIk4774oRMdGK/VlwPdproLE/11qvP+bAkH7QTQfeBXWxvGGtBjS3vYLkJorJhhDsfIIrAuk3TKuTTq6W9Ti4vT8T5lftr0jFFX9Mz38piRbV/8B1Wiq4hIUQ2wIwOEczRC4lbs0KMZ5Hjbbi60mDYnzlgfuIeM2LBzAJpd6FkHaOoEpk56uB2XFLjCZ1f/v8tuuHCXI76bbliw92hfoBg== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:28:45.5337 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 37/46] net/liquidio: add APIs to enable and disable multicast 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:28:51 -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 | 1 + drivers/net/liquidio/base/lio_hw_defs.h | 2 + drivers/net/liquidio/lio_ethdev.c | 68 +++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) diff --git a/doc/guides/nics/features/liquidio.ini b/doc/guides/nics/features/liquidio.ini index 8760849..11e5df3 100644 --- a/doc/guides/nics/features/liquidio.ini +++ b/doc/guides/nics/features/liquidio.ini @@ -8,6 +8,7 @@ Link status = Y Link status event = Y Jumbo frame = Y Scattered Rx = Y +Allmulticast mode = Y RSS hash = Y RSS key update = Y RSS reta update = Y diff --git a/drivers/net/liquidio/base/lio_hw_defs.h b/drivers/net/liquidio/base/lio_hw_defs.h index 3ea2e0f..781e929 100644 --- a/drivers/net/liquidio/base/lio_hw_defs.h +++ b/drivers/net/liquidio/base/lio_hw_defs.h @@ -130,6 +130,7 @@ enum octeon_tag_type { #define LIO_MAX_RX_PKTLEN (64 * 1024) /* NIC Command types */ +#define LIO_CMD_CHANGE_DEVFLAGS 0x3 #define LIO_CMD_RX_CTL 0x4 #define LIO_CMD_SET_RSS 0xD @@ -165,6 +166,7 @@ enum octeon_tag_type { /* Interface flags communicated between host driver and core app. */ enum lio_ifflags { + LIO_IFFLAG_ALLMULTI = 0x02, LIO_IFFLAG_UNICAST = 0x10 }; diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 560f195..ab97977 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -522,6 +522,72 @@ return 0; } +/** + * \brief Net device enable, disable allmulticast + * @param eth_dev Pointer to the structure rte_eth_dev + */ +static void +lio_change_dev_flag(struct rte_eth_dev *eth_dev) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + struct lio_dev_ctrl_cmd ctrl_cmd; + struct lio_ctrl_pkt ctrl_pkt; + + /* 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; + + /* Create a ctrl pkt command to be sent to core app. */ + ctrl_pkt.ncmd.s.cmd = LIO_CMD_CHANGE_DEVFLAGS; + ctrl_pkt.ncmd.s.param1 = lio_dev->ifflags; + ctrl_pkt.ctrl_cmd = &ctrl_cmd; + + if (lio_send_ctrl_pkt(lio_dev, &ctrl_pkt)) { + lio_dev_err(lio_dev, "Failed to send change flag message\n"); + return; + } + + if (lio_wait_for_ctrl_cmd(lio_dev, &ctrl_cmd)) + lio_dev_err(lio_dev, "Change dev flag command timed out\n"); +} + +static void +lio_dev_allmulticast_enable(struct rte_eth_dev *eth_dev) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + + if (!lio_dev->intf_open) { + lio_dev_err(lio_dev, "Port %d down, can't enable multicast\n", + lio_dev->port_id); + return; + } + + lio_dev->ifflags |= LIO_IFFLAG_ALLMULTI; + lio_change_dev_flag(eth_dev); +} + +static void +lio_dev_allmulticast_disable(struct rte_eth_dev *eth_dev) +{ + struct lio_device *lio_dev = LIO_DEV(eth_dev); + + if (!lio_dev->intf_open) { + lio_dev_err(lio_dev, "Port %d down, can't disable multicast\n", + lio_dev->port_id); + return; + } + + lio_dev->ifflags &= ~LIO_IFFLAG_ALLMULTI; + lio_change_dev_flag(eth_dev); +} + static void lio_dev_rss_configure(struct rte_eth_dev *eth_dev) { @@ -1078,6 +1144,8 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) static const struct eth_dev_ops liovf_eth_dev_ops = { .dev_configure = lio_dev_configure, .dev_start = lio_dev_start, + .allmulticast_enable = lio_dev_allmulticast_enable, + .allmulticast_disable = lio_dev_allmulticast_disable, .link_update = lio_dev_link_update, .dev_infos_get = lio_dev_info_get, .rx_queue_setup = lio_dev_rx_queue_setup, -- 1.8.3.1