From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0040.outbound.protection.outlook.com [104.47.34.40]) by dpdk.org (Postfix) with ESMTP id 4BA541B238 for ; Fri, 5 Jan 2018 10:53:15 +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=r7rJbZyAkMnmzPwwvg1RRm5XQ+V7iFdCf4ojKyPqVvE=; b=1rCR+Kma97sZQJYc3Yd7IVNghDuCH8KsRj1M9xzBuTl0p5832Kj014GFmiOe4Gbxtp2BWBTRl4y4vlw0mUXT1HdN0DN65OiMgokV8C1Dzlxc3vyWCsnlzkdlBY9qmrCmB3c/vCmt/huJocLHUxC9Gi5jDTgDqjT3I7tZU8fdCYs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Fri, 5 Jan 2018 09:53:12 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 5 Jan 2018 04:52:16 -0500 Message-Id: <1515145938-97474-14-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> References: <1512047472-118050-1-git-send-email-Ravi1.kumar@amd.com> <1515145938-97474-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: BM1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (10.174.221.17) To BN6PR12MB1506.namprd12.prod.outlook.com (10.172.24.147) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: efb5f489-ae55-43e4-2023-08d554222309 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BN6PR12MB1506; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 3:HpZIZCPeWYfHesIz/U/x6JqY38U5oMWvsCyv5xSZMVa04QYA86YQckETYkPVCsKkWzEiOi9ojzLUBSTUGpIqwkJW0llXliZ8rA2oUrbQphLrZdk9ZuvpOz9lSYH/vcOwEn/4OiDfhkkKzg+U91CnBvGR9tetW+SfLT++WRBlpP2t0rEMWslxb9aoOA4Zufkau+iwinJDeFDyX0dj3ZaCfypVmUSlKLFvQG8rKJxm3GW8L5GLM4cCpht7U8LdzFnh; 25:cNoXVmC8hKM+GVDVZ8y6/t1kEFxwnVKhuwTKJl78L+h2gdYdqWdDFQEz0gFPyidwSSAKWV6of9weoGSV3UVutjvvXSzScj9r+xr+TJX6yydTD8gkdVC1yKxNBXET19aYjnLJsHwLPsPcJJEkbLP/jGtm6aL9o1VPd8tiz4pj6CzLZUL0urasUT3x6ZA39pA6E3QNDhT/b8He3V3eazQyXBa5gL9L8qCjK9n8o8gUyMopbPYebYXOJHvtfxpZuw/6Yuo7AG6Z21WGg3E7XrFNH45Z/on8MBOyQaujhWlIz87mSpDpg61aFlejeUEw5ch3PldDIY/xkL4TUPdHL4gO9g==; 31:I7hPqI+q/AHbjIYJQirarMjZk34FrtdAT8N8WBWJxYGOKL6fyI30klGZelKDfLRuwZEwXx+OTpEqDhAur8S3cKAJSrETru6Tm4lBluXawvC+qmewW8nIBPm/SvYmufOCcUhMKb4UYtfg+3wwtuBcU8rxMoTKWWbKeVSrOgCdbPNl0m+GwZzCy28OXuqOLsMLUaBI5vADo8G1r9ea0IXQnMKOwwVKtjvllvJ+gHClckA= X-MS-TrafficTypeDiagnostic: BN6PR12MB1506: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 20:jUhsajQT7Op1zFdQyovqHadMBmvBh8+R/8BR+4Vx/8N+kxhPCjobEqxdGhPCKmP52WQEbD3KOK4WtfHd2hdh2NhPsRkVY++je1I9ntCAXrLqIxWiudplELpYnNaZrJSdiqXm5K4expeUFgaELX8GaPFUVx5ygt1teAvlDFlNUNnk/aJPx2jGT15uIJTAk91rzhatGsPJ18i8WHp68KMeKPB2SzRoviQakxkiQnxYDgyDEv92T+Op8zjnw92avudAquOneJQNvbP0SjcagGnupOdzlgG615IAFJMIMGa9fSGrFkj4wmLPjgw4Jn10qApcpiE1q5ZUaM5m8+AOQQF6thk6Jd9i1F9Ad7EefTREimGHSfidM5G8Zg3upg7GV7H29R3sTF2DzOpxdELv7Ya+gz8LqnD1n4VGbvIqa6czSRtqUZITb6vduRAMcCr4id+ldIF9lOlol7rnWceFTBm31eqLDHVX9X7iKQJrL4EWjujVeqRGQ8lsXKu5Zu0Qq4aQ; 4:LOj/CK+/To6cqY/aBt6+RrszOU+qI3z/a5fo/r1CUHSvP9L7ZcarInAUNhBP/6nN5l8VMIapn2OERX+zMOAYFAX+ZcvfoD7SoseRTfMSP7EjQKedOorXmL9evNtY4F3migwpoiGP1l+KV7CldrYq4+hxIepszgbITESWgH+KM/0e5Au3PLEwwxEY4b6vktSDRVDXCDgeq+FVyL3kGL6dYv9Sjon5+/yYaAKxonKqUB+kT5+64MARXFxe5cw/3xY753EtMK3Opeh0eAheod7Zd1DilGbVuR+6iH2DYynriJbwcXAoikRmUkr5jfQBLLPM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944501075)(6055026)(6041268)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:BN6PR12MB1506; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR12MB1506; X-Forefront-PRVS: 05437568AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(366004)(396003)(39860400002)(376002)(199004)(189003)(105586002)(4326008)(53936002)(36756003)(68736007)(50226002)(7696005)(8676002)(51416003)(52116002)(25786009)(3846002)(106356001)(8936002)(2906002)(53416004)(6116002)(81156014)(2361001)(6486002)(81166006)(47776003)(97736004)(16586007)(316002)(66066001)(305945005)(48376002)(2351001)(478600001)(7736002)(16526018)(6916009)(2950100002)(86362001)(59450400001)(76176011)(50466002)(386003)(5660300001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1506; 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; BN6PR12MB1506; 23:oHwm0eOXdHDG8nOUv8cgYeuDEsQZstWnFsvIhRrs2?= =?us-ascii?Q?RdyQg4ZKpKEhXo8MAwehKmPilzDgGr1sY45RcMX6KcCUXB+RzUI2KAwe2KLK?= =?us-ascii?Q?fMUfVh7jZQnwAYHFLkEbIg8dN+S//qfX1EiSxdA+G0t3JU3NBXSVFevIrfCa?= =?us-ascii?Q?/ZriBkCO4dDnrIR7ij6KScYVjs9HPNN0LOc6kpCKpzde1vzYjoDzAGNJn5s+?= =?us-ascii?Q?Z/MvKNX741MSlFdsph1pK13HIrTe/BlXTtzCM+JfIN5nl+SMw0qI2rdJbsT3?= =?us-ascii?Q?AUAcyLsTaRYISd2rytSyH7uV/aO2njp550otnGETbKTkREg77XOit3MwKro9?= =?us-ascii?Q?ySE4VRZ2woVHbmt6TBUiVTiP6Ea2Ka5aDCpPiHAP7/ZhFQ8y+s4JWoPl4rk1?= =?us-ascii?Q?+xiDZjVin8jvDLpSLFCt5YVFQrIU6XDFjThdk9TVk6Ato/+qjy5+3UeIYsUj?= =?us-ascii?Q?A2vl4dlT0OC2GqTars9lKZXCbWk8EJdNmT3slK+G34OYQ+WJqMy39GK2OzyR?= =?us-ascii?Q?+QepIVeHyqpeC8y0R4TXoLb5GaTPaitISsEAZ95NwcJ6sRlIdtInvNvfkIX6?= =?us-ascii?Q?GYB1rCnQ4F6VV2l7YoBDS4JIDnl8ctaU6Liwb2iQDb5Yeix1hkakhAs+YuO+?= =?us-ascii?Q?JSdc6HrCNX42bE4R++05NqoMW1ljsTA9nrYzGUqZEvS1z1+9BWvMaZ+dR+mc?= =?us-ascii?Q?00ue+UsPdXxF9jg/2jU6noFwEKoyEYC8/EWzdhcExy46D5JKfjpkFpfpVb9y?= =?us-ascii?Q?NllI5X1Pw3NkpM2IboKKHimwISOKGXV4jrqus9lB+my/y2hSSf3scXsrRvWH?= =?us-ascii?Q?Q+Uq2yu4iXNYsO0U1GoItX9EWzs42XaswzG7QA2q0AjNLy/i1Yb1gsJqT88j?= =?us-ascii?Q?Z1MBUUNbBL2gDMLzEm+nFtnMmLQxoFB1nAcEe339e5P8j+YGTxkhG7CQzDAa?= =?us-ascii?Q?NEA36hLFrLIv0MvRbRc6WioSB8Vg4X+1GKZxw91yElZvZQYsZqMBomN4VtBG?= =?us-ascii?Q?mak0+/pmjx50FqmyJtb3IEeXgntZjK5CeBEEjj42VvdKP61c5h0jVCaPthS7?= =?us-ascii?Q?QpUcf5Ev31qp9/S7rXHG9BNuUSTU7hhJsLgENlzIkAz/0BPBdkQkmKNp02K4?= =?us-ascii?Q?hxKiBA/Lc+HtFdxrgWa8ijtNTWgj1io?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1506; 6:RImWkFG72rV/JqHtHlqbHXYWgQq5dR3oluBgVtOtucijn1wo4CjxLYficFepB733IFRXLwWqfaVMGVXnEppcbgk5icxADNbT1MNXIXiiffE2OAU0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Z9oFvy9PpNR2PXvKaaFNHhB+DXM8zZIBukH71hGWmFeBQUe7TvwYVj X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2018 09:53:12.4964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: efb5f489-ae55-43e4-2023-08d554222309 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1506 Subject: [dpdk-dev] [PATCH v2 14/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: Fri, 05 Jan 2018 09:53:16 -0000 Signed-off-by: Ravi Kumar --- doc/guides/nics/axgbe.rst | 2 ++ doc/guides/nics/features/axgbe.ini | 2 ++ drivers/net/axgbe/axgbe_ethdev.c | 48 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/doc/guides/nics/axgbe.rst b/doc/guides/nics/axgbe.rst index e9bebb8..8fe75bf 100644 --- a/doc/guides/nics/axgbe.rst +++ b/doc/guides/nics/axgbe.rst @@ -135,6 +135,8 @@ AXGBE PMD has support for: - Base L2 features - TSS (Transmit Side Scaling) +- Promiscuous mode +- Multicast mode - RSS (Receive Side Scaling) - Checksum offload - Jumbo Frame upto 9K diff --git a/doc/guides/nics/features/axgbe.ini b/doc/guides/nics/features/axgbe.ini index 2dbff18..9f4d38f 100644 --- a/doc/guides/nics/features/axgbe.ini +++ b/doc/guides/nics/features/axgbe.ini @@ -7,6 +7,8 @@ Speed capabilities = Y Link status = Y Jumbo frame = Y +Promiscuous mode = Y +Allmulticast mode = Y RSS hash = Y CRC offload = Y L3 checksum offload = Y diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index ebae6cc..0b67cf6 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -137,6 +137,10 @@ static int axgbe_dev_start(struct rte_eth_dev *dev); static void axgbe_dev_stop(struct rte_eth_dev *dev); static void axgbe_dev_interrupt_handler(void *param); 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, @@ -195,6 +199,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, @@ -341,6 +349,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