From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0070.outbound.protection.outlook.com [104.47.32.70]) by dpdk.org (Postfix) with ESMTP id DE75DFACC for ; Tue, 21 Feb 2017 10:30: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=f8FAlCLmLP25VYJdxmRcFpHvR2Ubf/pfqCPs1JJyMNA=; b=myZxr28Q5n/6RPifDQBP2wDAZVw0gPgHOwFAuK2Rog2WJUuinaFcgTOFuQrbuZpn1o0C/oNLGhGtS+QNdFm0hBwuEi+zykqLq600ke6qTpVZQc6QahbYptT0rEMMItjqdIhgeGH9wJ+B8tAEfY4pL9tPKf3kshyGK3cAk5/a4mY= 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:11 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:56 +0530 Message-Id: <1487669225-30091-42-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: 9daced1a-4448-43f8-7de2-08d45a3c3d09 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:q4M6BhuugCnYof8nYztAVVcvj6Opk9aiOqxlHxe0W5G4xOtbmu5D38gzB8mILjYvENxFn5bBdzuPata/FhfTTdvvmeSCo81ueBcT97vhWyxEnfAp/TlW3e4peup0faUOWTYXYtV4ZNyrYHcAxou+YabXLSbnfGf/OOBfF2sh/Beqsxyv9DeKT5oeDklzky8JjxWitpUeIzRmNLjURuT2BVHDhArorwXO9v4jd1Sge3T/sFsbO6kdisi8jh6kP7Z4nfSCb8PdoywKLhOrsEr5vQ==; 25:Mj0kuih4URCde/GYQ1XTRGgUBqfEkc0VKbxYCaDvwVHqoSxGtjsmLy4JhTNfBXpktgoIQ1mc9r4GBIKx84aZuggvdNHlXdLf86cf8wH7jR0Vq5CUV4iNPtRB8JTp7hyRibVHXBsh4+/TDvVArKvZLMBQoY2sCi9zGMfYVPbYUu2SZuMx0Er6h7UR9l6V8cvibTIIp/hu6tKoVUyqvXSzOz4TwuQVUX8DVam1VMKlQDJkBij5Yoa6MpuTcUt2aJ/68FcNtijqRh4nUfWsQR4rwYG+U9GMGGFESEqWiRkh5qE9bhjripESbFjFZtiOSDNoj30n8B641yyf42ZKqxH7fjemydphDgvaEAPNA89hhiWp3hlZoRHJzZTTN6+epAslt2JHSnH51my+GdPOqcCkYZTpX+hp4FGAfF6oLvkd7Bdi1FLXLVBb1LjU5kGV9GRn3rZmImd/5KdDWVntbyfigQ== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:QkJuC4w0LJh1SB9XyiAYyANEKJul+qe7btWWDd+kaXzk37yMGzoFKAQeQZOpjn08wiB1MkYHu5C7feuzMF4CoG2TcWQb9kEi6VbHvIomgSEBOsI7mWQAi8jR+DAaoVaixMWTu3Ru0dVD2aUdlZiW8rpOniMwXEkwrbnIzSPZiCe7CVShc1J8i3wRo2IUKnGQY5cQKpQYgh9Y2xCBBVipYgp0pUc02DQ+ZZq2tOs/iqc=; 20:WpA+iTA9HhBIEt64NCJk0Hb5hFD+2qzymnOd5iYiHO1iUMFQwsqhhek3A6lYiYFLDc8M4NDkh2eJikhhRi3ENqEF54JsQNBdvRqJOihfClatBO6IPQJZvq7FAGAN0cXjY7Ly86h0t5RZN3pJYWuG0FCOkPc8K9H0a/4lYkxVxjsJWJxC5v8TvveJV6/r2j8sJF7pUzaPXbfLWaAx4Z8y7FoHAhy/mTaTzzOrBDGqbUOp/A5M2WVCpFHqG+fSdbX49EbSwk6c3jxZx7Z1+1VQkuSeudztNarhZjtxloQKE+P3I2qg7WrB3UTf4UJnc9Ylo7xOOiiVaj/jH6353snn1SLDMtlrWPWYwXqNMNrDzzOzpdqv4kC8vpEEWkkbrZi3bCBd+9Yr/HfCoGPhUAQERo6CnZyC4Z8CLQ0DeXSPIWwTB5Eo/LcRxcbV9vYbhMoecVKci1tySVBnAxg3CSlHwcVNjzimN0TDcRnqunrqeOp+H53j4wKUQyICG65cOcBAqaRzPx8/7s3HQ6WiT3Kl0nsMmiVhM3gcoaatEC9xB7AqcS4IvRE6en2mumlQVvpLq2TO64tgbfVTu7rkFnzZFV93xItJRUfhiPH8+BpANyw= 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:XQmnglNxdZwOFN0uLXD1a34QUik/61Weuo8hO0vyu3Oj+Az+Fj9KCPlULLNPnpvior3i+0D0lP7EgyVo21m/wcIR4eEwQCVsL4lZFzSDcSmPaIsiZMMwOfSCfRiRY7l5F8LjQjIAX8MZGFE2Sc8PlRA6yZspEvEA3GUehyTMlKD/lhQvUJSjnN4/JVIdPRjJ9hXVCIjvqxO+dm5GaIsfQFxq+xva3cH9BxTSBVr9qHUwvunonbLln9OpkQjaNcY1cwPZO4wpFCVNGmtyrF3Y1JGYRU15tF2fcepkxZQv2LnvFW6mA2hNcN+D5r8ZD/H6CW71iZ+7eXS7d+TrvKj33//eNmnmYM4/q9VLmR5sM9Q5E0TYvCQSuFuZ/luxtcvjFCP22++COwYfQARbONdmCStxGi/HXj4prvR+JBAZrMabrxmcq3RKrF7B8646bLaqVgEh/DzUbIf2U6bl2Y4nhWmSeJ3+N4n9gjQqgZKzdpeR/i8hn/U6zw3EmrpDR1UmlbOv82fxZQAScl3oajCWONbv0SjeMGjPTMfWUpDyAnF35GpV9X31TLT2Cw14IKGAekyl5QIiFnUA2iKC2PMbK4KNn7d7KSjSIAGgJTan9Io= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(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; SN1PR07MB2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kv3fI2eg4Xb+l7AqfswQgVT5Gj26rjPKBJ+nhe2gVKIQPaBGPCkcn4uJiu6awZtUGnlmhMQ==; 24:y7mI/IsfHnD5G2gFozcj8OlrJKZH88WGP73ltfYSxXIysF6HsJ1KJwSXFdnhV6miD6yTVW4J4+i1iy9QCKxNIYFNvQ0OXpGwbG6RqjcyhkM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:MlROE2VN+mHVj9NPtEPwXNGqbpw0t3JCrtn5p7aLnY6/4OOh1H8YwCA8+m/atgCOYc7YTHe6MNldWe05AQ3Vzteivi6034EEkQ22lUNzMQEZcC/riMWUMRddKUIWAh+lOaEoSeKxf/JUsMg4drW0mt1FJKpoAbJN+xgMHaT0QtW+eKiAKMqKdwMDtT20pi8J9tnzfIDgGFY7JFmhVQKfNGnaTXff3Y5nR1hn5Omjw+zEbKufiFpuojFQ1amFV/SlPZ9hrNtGY2YTRjoKV5U3pz/Fz7NeF2xFwqvNAvX7cH75n1qATdmJt8t2e/hcbVvaHf2p2LiR6gwuS0388oMtzA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:30:11.5433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 41/50] net/liquidio: add API 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: Tue, 21 Feb 2017 09:30:15 -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 | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/drivers/net/liquidio/base/lio_hw_defs.h b/drivers/net/liquidio/base/lio_hw_defs.h index d4be699..54d554a 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 d82a46b..c534f48 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) { @@ -1079,6 +1145,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, .mtu_set = lio_dev_change_vf_mtu, -- 1.8.3.1