From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0050.outbound.protection.outlook.com [104.47.42.50]) by dpdk.org (Postfix) with ESMTP id 60B187CBA for ; Thu, 30 Nov 2017 14:11:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UTZZMOVBq8AYPeTmDIKagHP+mop6QSkZsH8vVNwNjtM=; b=A1/2GOFBwwKcxsEE3E58SE8p0LLEN4n5WGUUUuzeAlJ68NErOMYZ6QgWUMebGMSD+I/2ZMsC7Un8XXoO8QIEckhvR16FA4NFZyXf1X7kQ69oNmWqXSuAqHCgnIywg+uFfHcWAz8Lri7hUNItYQCSIhFKIf8s9Z0l9M879+kr4pw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 30 Nov 2017 13:11:55 +0000 From: Ravi Kumar To: dev@dpdk.org Date: Thu, 30 Nov 2017 08:11:08 -0500 Message-Id: <1512047472-118050-12-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: MA1PR01CA0077.INDPRD01.PROD.OUTLOOK.COM (10.174.56.17) To DM5PR12MB1514.namprd12.prod.outlook.com (10.172.39.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e75d0fbf-569c-4841-4c10-08d537f3eeb0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603286); SRVR:DM5PR12MB1514; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 3:ryeXvcqXNTpjI9tAWRTDwSGl8AHWINjkrT7gSVcLGfExfdhdTtucvZ/DDhAL7kM7vJC75eOcMvRaCURz2pTvpXJ4JW2BD5oMj/GqNW54I8z1iOIluwjmrbk2cx/eoWttVFWXzmOfQOPk3MzFAm5vGmsxn2aLs7EjIb+zhonPstMpVdWkOtap5jJf84qyIYr3Ipz0EdIzAoztA5kro1gtNuZO/elM08Q1GW93r1T3ZQZZoGkJzRFxhlQHlYGdsIL0; 25:L5mpD66eowBp4yHjsPJjU1ystC1f87GHQhN7uiLASvnpoaKWkVL/SJjSRgoBpfTU9eJmqYzhWVOG+fZDBGs+ZRtDrodiKSvikVcY7PveUsntfhPFrFDLsFRQ2hloe7dfS1vxMoTnnC7XgpfDKdxDGtPloCuSiH5UX9Wq365rg9qteoQGPKEySrClkyYYnOCYqpI11Ppz/CfyMdWujZyOKxXfTpK4cUFScMl/SEvFkMxBG136McqsJ0tnlWJjXBPRephQPKh8izdTjZbAo2ODtafzTsA5VlSm33cHNS+5LLBSrTMGyvNHfddJk5Nft7yqgUxYA2VLe3wLweHA1q2Pog==; 31:4Sb7RnIIux3n96xr77XkY12r3mdqDJTHBKAx0U3s5PNlXzcnGbX//yiH4ZNiLatDBqxy6qJZCF38DtpZ113vVvX+8tfkpFMUw9OGucQWZRQmbd4WvciKClEV3wVUpeLY6geLrDDq+icI0POwaqnZMDXGT3afBO5odus8Rifkfsj8DwrXiifphjqO7aynWTcmXCVhCKgPNzz7n+SZkiVpJ4F5Me21NOj452TG60Uoq3U= X-MS-TrafficTypeDiagnostic: DM5PR12MB1514: X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1514; 20:eAce/o8fS7nhp8sYKsD5xWBFfeF088bYXYP7pfHkMmtsiDwSilQti9FK6OM7hXHULpCVOpnsBrYrUvpr7kp/REBQqyBMRr/nFz7Lp/Guma7FH3bIdOK503ptb2NyesNn758MA6YVLG14qxcD1kLJMzAyBEelu+e0PIdjUzFiIjwA14j/X0BDEbnqBePUV1DYUdiFJ/vfaD4BTxto6+wBubx/mYdk6KDeD97TJI6oz/3IK5fG4umamLJ1aNbkwn85UTumozOo95hzHJxurkywwZzizFaHac/f/U62cD0Pu+LZnDXIAtm9lLTTtj5gY0Evfoo3Z/LdQbPRmdtiUDxIGqOlWaRvfFko8wbPcIvNYWtSuyvMaGRcXY/CMV8a00vjH9oKEFg/xWbpMs0/FF4FvIZjcbXsvqW6RZExs+UBCVYjOFGIGIGg3KjDLvOGOvmD7st+Ykysr3Y3Yhnx9Md9M2n+VK24w/L4aublK4DBnOaKaCnSB37j6qjZJYFHPkmc; 4:+LXW3CS9Mbpl74MEvcO8svm1d09vqnsnf+y8LWG3+o0YkBGm5y629LFG5xRbVGjlh7/KgbARizTnUwOWw8AoYwvD3fWGarWIlh2k0D2jzbaK1S4QzxOjMVeX61vndKfxpv9kxtuLCBoem9enCvBfEc1AfNQlWABi6abPM3uB5m3LMdHBsM/X2YuJqKASK16uKL57d3AKV+1azzfqRZcs9bkclNtv/vJncIfBV1No7rvlUKz3l2wRpi5wv8EX/g3vgOGtB77gjk+islJPfP7/TVBnMj9332u4kIDY6vaUpRypdCj0ZFCcJSHwe0gu8Oxy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231022)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:DM5PR12MB1514; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR12MB1514; X-Forefront-PRVS: 05079D8470 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(39860400002)(376002)(199003)(189002)(48376002)(16586007)(6666003)(68736007)(86362001)(316002)(101416001)(2906002)(50466002)(8676002)(51416003)(6486002)(72206003)(50226002)(16526018)(50986010)(76176010)(53416004)(189998001)(7696005)(52116002)(97736004)(53936002)(6916009)(2351001)(2950100002)(105586002)(66066001)(106356001)(3846002)(25786009)(2361001)(81156014)(5660300001)(36756003)(6116002)(47776003)(305945005)(478600001)(8936002)(7736002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1514; H:wallaby-smavila.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1514; 23:pYp14Q+KNWeMdkUqLPiV3ZCbpUh2kgUCXngSPveGx?= =?us-ascii?Q?UrwUl6OtNHWwzAxin2MHrVbexQ47leA4Hl1ZAve5uC3t7VLsU7UC0IgfRTZj?= =?us-ascii?Q?V2NK00ieuiOQC/aJ94J3fbkSDgQjTM9MDK3L7+Zqt+6FzOR+rDdbBIKlDsBe?= =?us-ascii?Q?WHdRzTvCAu5ePauLLHsL5ipj8XMVs9QpxSXzcDiVxpLl9ceI3dKPvlKNXg0/?= =?us-ascii?Q?2XIAdRX8NoDYrcPWL7s4h9C97Zl6JAacn3d3xBBbNPg8MjyJciMhFdxchAmw?= =?us-ascii?Q?9L4g8zQVS7w6PqtIoShVNIl85GwyV/K30rJT8ugCw34Hbpfl2iy6KRT+Yj8L?= =?us-ascii?Q?op2W6d/87IkJsws2kKNhKcffnrY0uLhwOJZZduA5wwFI2VEUpcgtStKskcVo?= =?us-ascii?Q?+QkB5bOkcOHUpDyUH51XOeLs0ItCXwzNuOwLMAb+5YaV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AxfWJuIlc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2017 13:11:55.5936 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e75d0fbf-569c-4841-4c10-08d537f3eeb0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1514 Subject: [dpdk-dev] [PATCH 12/16] net/axgbe: add promiscuous mode support 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, 30 Nov 2017 13:11:57 -0000 Signed-off-by: Ravi Kumar --- drivers/net/axgbe/axgbe_ethdev.c | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index dc012a0..d476632 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -136,6 +136,10 @@ static int axgbe_dev_configure(struct rte_eth_dev *dev); static int axgbe_dev_start(struct rte_eth_dev *dev); static void axgbe_dev_stop(struct rte_eth_dev *dev); static void axgbe_dev_close(struct rte_eth_dev *dev); +static void axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev); +static void axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev); +static void axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev); +static void axgbe_dev_allmulticast_disable(struct rte_eth_dev *dev); static int axgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete); static void axgbe_dev_info_get(struct rte_eth_dev *dev, @@ -192,6 +196,10 @@ static const struct eth_dev_ops axgbe_eth_dev_ops = { .dev_start = axgbe_dev_start, .dev_stop = axgbe_dev_stop, .dev_close = axgbe_dev_close, + .promiscuous_enable = axgbe_dev_promiscuous_enable, + .promiscuous_disable = axgbe_dev_promiscuous_disable, + .allmulticast_enable = axgbe_dev_allmulticast_enable, + .allmulticast_disable = axgbe_dev_allmulticast_disable, .link_update = axgbe_dev_link_update, .dev_infos_get = axgbe_dev_info_get, .rx_queue_setup = axgbe_dev_rx_queue_setup, @@ -336,6 +344,46 @@ axgbe_dev_close(struct rte_eth_dev *dev) axgbe_dev_clear_queues(dev); } +static void +axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 1); +} + +static void +axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 0); +} + +static void +axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + if (AXGMAC_IOREAD_BITS(pdata, MAC_PFR, PM)) + return; + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PM, 1); +} + +static void +axgbe_dev_allmulticast_disable(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + struct axgbe_port *pdata = dev->data->dev_private; + + if (!AXGMAC_IOREAD_BITS(pdata, MAC_PFR, PM)) + return; + AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PM, 0); +} + /* return 0 means link status changed, -1 means not changed */ static int axgbe_dev_link_update(struct rte_eth_dev *dev, -- 2.7.4