From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0041.outbound.protection.outlook.com [104.47.42.41]) by dpdk.org (Postfix) with ESMTP id BA80FFABA for ; Thu, 2 Mar 2017 12:39:53 +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=P8aWZZqGKxBXmXfkVynVdtKGJEv7qHhwyxelzpDrvys=; b=NI6ZVWW4VzMXfhwItl4ldEuyp5RrC53O+QwdYbYO1pNGVS9vXPiS2ZpHOqI2R2+b1Yc0fRCS2SLS3QT1PlLgJryYx3n2hqWVl2zA6QrVjOyqxVrFIVYsNcymPOy3wU4t3vvpqv21GvtP66rNA7JZwmZJZeOO0+vNcblb+7W5v54= 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:39:49 +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:42 +0530 Message-Id: <1488454371-3342-38-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: 6c187075-6cbd-48b5-5935-08d46160d743 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:LRcuMjNMEKDL3NMAwuQFfBoAt+E00etFnoLzmlte37PmbCqThgWSKxSt9YOSoGdeGmDVYHOqv6kMhctDjUrwROURqQXLojunNcu6rWAH3L3oSlBfYj84/zKHXAMHhPmWtDK/G5/Gm3K7fTMg9H8kVUhTxhHEIXnEPyv1WLC6PMHv9NZ77Ms03Et/WDV/uS3klHLJ9QoRDKJ119P67U1aMfjvr5gCiLYzSnsVT022GpcG0Z40/QBu3rtxte0Mf8quOylb2mExGCXSr4iX8cWmNw==; 25:0n6clXqjmxJuf6754vyiIEutrba5Zi9Z8yIVrenE6PJVN7TCMzO1av7PILTZKthhC+qept0XDG2n+BkkVx8H1YaT2paUjZDbMTxurOoc4RwWRCqvp/Z7F/qmubaMnIP6OuSD0vHUuLZi2S6P4lyz8yZJ6J5G0skbA9xh86JvfPWPjpjyRtGq/9CBv/dWwJSY3QXfDwoYEm9eImZTDUu8Qg09HRYOtod3kKCJ/tmMJP/fcKTD/6JQtae5GLUnLc5A+YPkg6z34N3EBNuR3b9ndRbgEqPlA6rY72hasPbuGrXk3TujWyNvohqH+X9NGw2ZNe2h/TGHM1mMUe0jCOvbPW+2by3FSUhrs8kfEepzc+DexBK+GPWgWOgl3VgOZ8s1OjDw+2kDEuUQf5PCUwZcMVW6iwUxg2/SZ/ddNEzDtqtFjJsG+ssMDpsCNPHsKGIpd9JiEGawnrpftZXfkgp/Tw== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:nrbhdgZLIo3Y9usDdbyCyvqH0hIf5HU8yrt/HIVjzfgmPxwRl6/A2xMu7HbpAosnyT8ymhUO0kn9s/jOM7ww2R1ajs+qSw78aLtZtClIdFV56LkplO0kLdMtiDKkYeCCKzcWEMOD28HJkyzcvcwg6cWPTX0ER0xWZVXGWXeeOnL2rotgvcY8y2o0hcWqqMsy8W4F2iD9rinoxN6AEp5+XMttOknV+kFt5+FcUS2GmrjzOdghp1P3L18fMorQ2egl; 20:b7zzJhwz1NPg+21e9/sNJmAhX22ZnwrM6AGyahTnFbvmkkjKiYOi8M3BEgJqD25HrppaRFcsoekYp3Ejrm2IPHgtMpU9pBYMwqUzIBSPJItpoczAweSrquxbP8I9KLXnTG4oXeSE+ML3vUU3vP3sEIwmBUmvs4brXhSDdWtY5wBbqBF4kk/e/sGRTIwu9a0nvm0otNCvPCNZe2TEzjKfVeKVvDcABOSsPaZYBuRrVuwTudAZHsjDoDOwjRDOq7A5i9q0ngL20kfZm8H32nbMOnp4k4i6TNbzf8i3X0KAu049bd/MyHUTbFDMTAT1NrYpdJTz9MP3Hlsb5GbeG9P3KBeIG32Fio6Yx6HL7heaJFbBO/W9NJBTrYxa/ozTeilT8DBEPIBumHBW/T7DeCf+7LyVme6BuTe0XqI/4v3mcVu7ZGLa58ZTMl24+grYqOIqg2lrjeoGEH5ElY7zVVGLqPMEQ0hzLMvdZ+UhW8rySZEbnwSgbvzrugrhQWQUCRX7F/e0dCVwNpOuoG+fC8GTPM+9aL9d8jzX1faIfo8HxM5GAwSa1lSHtacf7lCknmOC4fkadtu7WrUe3LOUIZHxXU8YunqAAxyvBRoFOEmycTc= 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:n6tXiuz4wmkRqj7oaE4YpIw7KPFOCvohgXFmavaSc8ThAaz9tIAZ1vZSfaOWhGNR9feUPIXOIqEPG6xSOGuqED4Dsf+0malOncaWK2/dIHe/qEZwa6XOKN6+YWRNBDSrngSHcP8745HG3K8AF0THiJOWIa5xfBWPNEawVXzgw4Apc22TEuIe4ayALPcrtiwBg3qabZxIujX/i3/Ef0LVOC4JfmQLrJT8H7UyM/ExPZv0EP1ZY1HPv767uuxTEKjx5saqirTaFlTpsoa6Gs9gSUkKXtIWWRHMGNGkZUbC+TbOPDSvIZi+YHrNct+uCAAJFDUDST6tBh3dNNLeFeABOcWCeumgT4+10pwdYNyywPgJYvIqZnPIHmves65myfQ78Bto9Mk+jSVjD9GkeUPbeyqhivHfCpVaow8uySDHrg+9lDXnlXskpDMwvxP0Tzw9lhmlKBZNwy7cjGXnIcOEzzeHnByMIraVdLFDg0Lrd9VOIIlwtt/SXvEHquKGMJe5EVqftvRWylynecpWgpcp4hCcLqOgRBSqLJu9J9GVSbn1XbyK/HbQjqyLtUKMuXIkq2Av7xWLjWGMKFD2kqPAM24O7rQ4datxck+OxpqitRs= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(575784001)(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:1GcW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ascii?Q?bhoxKHua7pRM4HxtY7dEnvcu08ierqHeyS3+b82Gkq4l6Icu3ai1fxK11wA0?= =?us-ascii?Q?jddl2Rw1Knb9vquaNBPQL/GG9EZJi0G778sQgLXO68dGULUOuf0k417gy5Zx?= =?us-ascii?Q?gxoLEHHft9c9YXoxt4m6e00HhzNvVMxON5h9Wh+Vat5bfo/1d4Jw0eVFbqqJ?= =?us-ascii?Q?YUSitGunAiSImK6nApYv7hqo7omLimsuS4b6jF00hK8OTjKkvmEYyANALEs1?= =?us-ascii?Q?RxVPJBj8aE=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:nuvQfo2yzucn2I63WfVpB7P68qsCOnWJ056kLrijrmW1sLQuhnpPFIzl1dhwkvRjYMag53sNRKdv1GNTeMkc6LSydPJZOwoJNKn2ZwzTusp5CSwwvS5KEXGVqhEDkoybOO48aC4/ppDgCt4croMlP+XvyLi6PdGOXIKidV/4utQzPJ41m6qrHl/qgzP4M8VqIq/6Mlp+p9rC1XZ8haTsw+82omElyqQH2bg9t0LyLnvht7yNV1AIaNhVjLolwW5d1/fg/27qLkLZUDkrCHzgwsQAxqRCYtM7pajgYBytE3gnTVzrKcIKgEVsnSRLkGt1mOS3emz01Hb2fAFSISS19iRpdB2t1r+PoRJmRebU/TRNPhNERRWVh8pOIbJhVXWt9IALYv14zMx1ucA3beOPjg==; 5:PgbTG5vNTMddE541QS4I4ciuerMfnvfrn3xIByCoURYJ4tBzQa4omrYVQ0w46BM9ZChX9S3xfS6B6HIrEdb08DU53rVdW5VtZEKNuFDI/TmM18hpV4mg0kuk6py1/xN7dVMiBluJlmmrMpI2CCHS3A==; 24:TRCe8IUQNwljZC4AwFzyEOp1WZ3f916KJLsM/v9quNLcN1rPJtsMwpC7x+LmaIS4vJMub5qdKOAyTkpeVJhyUd/KFO5lYlR38AukyQYN1cM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:er/S83KA6/6ceYwTOEQQ2dRM7F2S2X925XmygCoqrLHYB/2ekjkPYzqBxRuTmYeAiHjQeFPQKq7p7cB2zr5KXNO1J8FMquVY4vGVacMUfqKO79NSHISnzHa6ouoPqNYWHDnH9+ImCHxXOAoajyfhGhZUeTu3q8cCYLBDcBEHpY4OHTKwtLjSVl83xurxhR7Swowo/gUJReLfQ/nAXGXeahRQDFPHqh9lIHU4/Prezz8RyJUSJ5cX6ORTi0V3kicGuTttqPzXMC5qrhHusttIuis6aDs0KMDYihr1BJ5rbpf/DJp0ggqN9EE2TbWmnCocA+InX63DVB3iiFJWZerhXw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:39:49.6101 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 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: Thu, 02 Mar 2017 11:39:54 -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 | 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 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 167d41e..194d219 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, .mtu_set = lio_dev_change_vf_mtu, -- 1.8.3.1