From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0082.outbound.protection.outlook.com [104.47.34.82]) by dpdk.org (Postfix) with ESMTP id 36F621AFEE for ; Fri, 9 Mar 2018 09:43:24 +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=SLVh7hnis1KWxvKZWODYYgqNYwMeFxOnEMFa2PKifMHWomU2vt1evVPjIQ+wGVvaLSz4yqzIvFerVyrebPqSLLaC2jIE5JQsHCVWpBVtJZS0jxiZEhd3PBXoHh5ynJ/80oOW74VbTSGPHDXdM33fioXAsHlUS64Pq0ic6dkqV90= Received: from wallaby-smavila.amd.com (202.56.249.162) by MWHPR12MB1517.namprd12.prod.outlook.com (2603:10b6:301:b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.12; Fri, 9 Mar 2018 08:43:21 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 9 Mar 2018 03:42:30 -0500 Message-Id: <1520584954-130575-14-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> References: <1515145938-97474-1-git-send-email-Ravi1.kumar@amd.com> <1520584954-130575-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: BM1PR0101CA0057.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::19) To MWHPR12MB1517.namprd12.prod.outlook.com (2603:10b6:301:b::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a36197d7-f7ad-4506-82be-08d58599d12d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:MWHPR12MB1517; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 3:0zUohtiZXP29akJK9ii7mLp4spd+RoEhU/bCcYCZAdOMel/qI6WUMrjWwzxKrgaNRcItBVfHd0F2vgaR/aV+hFgaNVGILSmVgUDxscVxExhnVX+F4wB+9kIJZATvDZZCAmsEhFmpOoMJVaBQt2ersRy3HXhDSWxpRTJIZ12Y6NHYme1EsVf9Mz8OcnUwbmHwFRkOOlLOaNBEL9sBS0OqZp4/oefbJDYK6u/mffyJYK3YEkBqmL2jSeJEia5tsFZq; 25:upTc/BRwqGw3jZVWlJGy/8GCrd2K1b1GCtBmh35qYJXxNRokO09imnITlw3eKtoK9T7hwXYJCqX1uOVKWNW2PYq9qaq70YuHPM6ytl+aLI2Q4EwSrixAq8s6ykSUBqyUSbLow1SypSScR7K+aVs0/Xk6cV6mUvW7gtlNwyNMdRpdmMxIZ0od+AYjR5NkhVkoCQEcR9bmGuXPzj8cfGvsFTNMfuRevwG7JKpS+IcNK4wVZdmK4UHFDtftYMW92rmaLXq7km3li+q9uQKwr/v0mqvyMzeOXJxjYef/WKe/HKvZSsyrlZ7oGNqfCBEK8WDM2bKHuVIg9SlGw9tqCmwm9A==; 31:dnewMW52fFNcPSRdIuAxqcDBL+5SQmPTkrm+ZPBac/rwhOtXhGzj6cNwbxYM6rQNFkp1jAcF+sgHf3coNmN4VE9TyuswPQljty+XnpqZXcZ1WNS9AEp4D4613m/zU4zwibNTqLhrqUemdA6bvPruIu+w3em4a2A8rLVYWd6vnDwlTxq+sD4OQd1WlId924hMT8CNO+EfUfJKTLo3dal7mP3MBJOKW5i1fBt8WPj58cs= X-MS-TrafficTypeDiagnostic: MWHPR12MB1517: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 20:BZUhP9mbt9nbSDWWl8/8Onea53A/oMLRKenOxAxsJ2hDkelDFN8/kM4DSPQabvhb1TogrCd6Ah/x1cJkMuT13HYtObaJt5NSwzyxNp0exZWdvG1sgbHaNEHrhsjcug6bKv12w4WTgAiMOBI8gDAve0oI6+dzHzZ9kIGilPL9EI3WT/BbGuLafhD3iyPf71yKLWat/x54XpH6mxsGikgIu00ifR5CA5vLgYaZxLBVrTBXvV+eGn4AnMOyF04ZGo68J0SjM+CtzyTc9r8XyTtK6bZhhVLBKDhgcOxEglyBsAvk8U7usLZXB0HfRJ4IoyZRQggOPwZ4L3i5CLPdMwx5iwnJpxV1YKWMkO0Lfrb9Vo1acgl2GNVOuVEzzn5Djc7z5i/XL9Ct5UKcED5uEr4taluk6czcwnvg3JQkxstWJF08oTmkq8Z5r/mXdBm/zZbGGSKLAVU9RFmaPz74H9UsC3CzvQwhi6u3V+71z5bgpywP6mySvfdZRbJpgM5WCd0l; 4:yDuu/SdlJyBNGz4d7aDSq2BfXnP0ouVsbDBPWK8yrQrYWi3ELILXFqUN5XMnNFyjzrnHFtjOUd3M6h98i4Ictz4/UUi71QVl9ggwUh12we8xBGJnbX64dggldKeVbAKOnx8P2Gd0blW6+0cQ8c3BDGyPY0doPcdn6v+wrvleAjEWMJW+4Zf5eHpVxN3CH6WQ3Ds2lU7Kahhy1VnKZRpLvkepg0D3GPafcd1O7h+zlxIn6q4TpFXz8FjtMM7IWcxmSqrgErSFT4qDaxZUVF5/wSYI5xegPUINFo2XPjzDU395P0ZAswnnJM/CjojkFdO1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231220)(944501244)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:MWHPR12MB1517; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1517; X-Forefront-PRVS: 0606BBEB39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(396003)(39860400002)(366004)(376002)(199004)(189003)(305945005)(50226002)(386003)(6346003)(26005)(36756003)(97736004)(25786009)(7736002)(50466002)(8936002)(4326008)(16586007)(86362001)(81156014)(81166006)(6666003)(2950100002)(6916009)(16526019)(186003)(5660300001)(59450400001)(316002)(8676002)(76176011)(52116002)(51416003)(7696005)(53416004)(48376002)(478600001)(106356001)(6116002)(3846002)(68736007)(2351001)(2906002)(6486002)(66066001)(47776003)(105586002)(72206003)(53936002)(2361001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1517; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1517; 23:jEv24qAaJa918qQ53GkRBF27jNgfAnlXyu8RvPHW7?= =?us-ascii?Q?nSUhRUVK5MGB4OfjIK9lYHFVAN7c41eME+xmyzf8Z2+EJMiWkylThCGkhYnu?= =?us-ascii?Q?zoQO6nvw9pbKDVIEIYbWEjcd+gUNldQLYzx0BP5TNqaOwSmrBwEKz4K9W87H?= =?us-ascii?Q?RO6ocMotocVMm60xwiJ+0FduACVkGqI/LxTlIbnO4fWuimbNktMPC6GPXOy5?= =?us-ascii?Q?Z7x6KlO+Ory/2bJWl/OTcOb2QtlsbvQBfR/YQ7yOPFdabVUNsrJXaFEVmE2B?= =?us-ascii?Q?wSqTBgA3z6RiHzVJklLfVP7dGM8+VoQvqoXOXeQrF6i40avrgseEqjdtO68m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fiSL0XdUI63sE28BOLFUuhHL4ajkW1fnatGCxe3V4sL1aWzk6BpuPmevhT+ZRHh0YqFcFoyRe+gw/M8KV6rQBUdHKZyTAizpcoDNl7GgwXM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1517; 20:E59jRVKFh2C3qxbydcNEJ5lKtvjfSuT2DRSpjy1gFxVBgqS5lKH57XywzCohDaL2OGNvqiWJCIX9gV/TX8BGf5Hb1mhLg4QcvLMh2to5e3gIavajJUCVoYJ6BiP8MVe0ZmjNMVjnZN1f+ScQKE3n2S0c+MciLFX1KTRatBCJz+O1QO8cguADDCiML70qCAWfnZtdfybCO9YC12Eyu1YOlFVqVOTXLqUNiwvdIE3tEfeGD4Eh1qERSO/y/t3oMyOj X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2018 08:43:21.8860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a36197d7-f7ad-4506-82be-08d58599d12d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1517 Subject: [dpdk-dev] [PATCH v3 14/18] 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, 09 Mar 2018 08:43:24 -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