From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0040.outbound.protection.outlook.com [104.47.36.40]) by dpdk.org (Postfix) with ESMTP id AAFCD1C94C for ; Thu, 5 Apr 2018 08:40:32 +0200 (CEST) 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=KUdhFL0nFz6gMIyYiVMVUn2ic9As9jf0naD1ljxlNQs=; b=t15uFgnCpY4PXPFIuaFrBL32xCiPs8hJ5zrKwSM86jUgb4ooll8TLF8FoCBg44UEls0PcNYLBolgClgloCSraxqIVBGQ5ZxUmGrQC5SmRRv1PVS8cE3EXRFwJAxv1cDka8/ZKQQmRPhq1V3/0uRf5X8m8Tie9pBZ+w/xw+kAijQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ravi1.Kumar@amd.com; Received: from wallaby-smavila.amd.com (202.56.249.162) by BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Thu, 5 Apr 2018 06:40:30 +0000 From: Ravi Kumar To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 5 Apr 2018 02:39:46 -0400 Message-Id: <1522910389-35530-14-git-send-email-Ravi1.kumar@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522910389-35530-1-git-send-email-Ravi1.kumar@amd.com> References: <1520584954-130575-1-git-send-email-Ravi1.kumar@amd.com> <1522910389-35530-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: BMXPR01CA0040.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:c::26) To BN6PR12MB1505.namprd12.prod.outlook.com (2603:10b6:405:11::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c40d854d-c0e2-437f-9621-08d59ac020ab X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BN6PR12MB1505; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 3:FoydSa+gREczMpTrbEZhXnBijBOQWFrR+c9cOg/Ir3ZM+KfGJbmhWMdpwbJ2xvLTQNzp32dKIgZunQMFddeeQGJbid3nREAUS4a1SFnjs55+deP6MoNKQmatuyXIZD3PqvrQgPJCbXhbETsZ0h+BU2H8RCxn885oIjtxOh8oL8es8F8X/CWPCxq+zSczbINHjn9MQDb6AqR1oSJ+QyLFrCGis+WsiZrqRsaM5W5gtFOYW3iKXdL9ebYndfYNCirg; 25:3dnibsP6onm6O95pDq5vvQBD9YCpl6kZPCkB6zGrbJ4owyxd0BQCidvPMj+WYcYRGvYAA+nHfni7nszV58LbAzufOUGATFPL52edDnZqK/Op8QkUJCIryVTSLzRmonLen1ZDGcIJm9EiYPidvwkphoSQs6ctqKDyMXdoAIi6STOMLaZRFpJK2UGGbKtx9xKEj2Seg1z1rJwud6mcbL9FYUHETfXDx3Z2x7iDX+YuRB+ZfvkYeaORzS3t63YXp00l/8MYX7MzAiScTlOlH+wEWpQUMpT6NKFcHGfyoh7Flq1sUwUFNTE92edQm8u8HbHTssDmAJ5uF0os9AGUW0K0AA==; 31:GTPcPkLqMWkvmNmADl/cWo1FrzUdNv7c4/bPh1xGNmjv0O7RRcRIMTp7/GnM1M5m19DySdcFH4I2rcrFk6lAxfuufltaVf1+KmPL39v9dInmB4uyC/FupYLwdAMMQqBWcNEKmoitYNfiiipmaRPqCrxbZyk4VUhH0nb6dhCAhGUfYfOiXaQygAYNIgeYq9yXiR+YMFjHemLU5L8eYJEmIc6Nv5ryDUkTL+EmoIxJ+SA= X-MS-TrafficTypeDiagnostic: BN6PR12MB1505: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 20:souftE5Q4BBJ3TgJGobZOrfH5DbHcV0tH4Sv6W1wwB52aGKbd0/8R0auqLBik6x6XG9YDsVTapb3m6HH2Wm37fC3m6Lgg6dH3Af6Z42Em/YD8VXO/eaeDamNrjmQiddZbqoHABhf91EXN/78hcQ3d1eXT1GJGCcVcuaz7fd7jYPIhIdecHhXLsCsaKGJpU+6JA5RWip/zzpLU5juOFXPJ+W2GBpnT0DP9gQ4lpMwvM2yjcuUtiifyNwTOSy05BEJmsMi7BRcRJheZx1UTemvHKciTZqAOjcu2bdIcVXQ4SiTpKL2bz5ZZkwqj6tvIAVT6rfB/KWVrc3TmfFXi+FcT/xLVYD7Gowll4So4LMMd8OCzE75ebOxlj4DIiH6HfiP+y2rMcvP9rB+5aVzEI9grI11gcVZAxiohevVnyHnbcr4MSIKazFLi8+A+r717sY6gvuVITtRG6ubGT5+/gk/AGIgSCdJ8EEbfFapudg+OEAeasaST1dX/YiTRVgonrLt; 4:rwQ6T/G6rJk0oHolHkrnErflI5S054olMKOpqRnOA6YTDaMrguySKoYQHv5LvF6lfC/YO/QRA5MGqZW5dyHf1g4dlXq8xNJzlhPFlSLjoA3eObzIB6iIH7LdYtXBRRxMAXzhKPK4KlVb3VJhifPVHiUHVI+pRAQbRn+1P6lnIby3KrnZuzJhN0jo7xhshdfa0ArwmnIKbng0ljEwSkhuB7ATC9KaTfAnXlG7dhUSO/OCh/Y773qVJ7kYXekg4JYRZYmDnKt9qBdK7SZW19Gvv2ufBaSKK2KnZW2QEXbnVLaLsZsf3gByZT44tTfNG9nF 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)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:BN6PR12MB1505; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1505; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(396003)(39860400002)(39380400002)(199004)(189003)(3846002)(476003)(2616005)(316002)(446003)(956004)(305945005)(7736002)(478600001)(16586007)(16526019)(6486002)(186003)(76176011)(5660300001)(59450400001)(97736004)(2906002)(6116002)(486006)(386003)(26005)(50466002)(11346002)(25786009)(575784001)(8936002)(86362001)(50226002)(66066001)(47776003)(48376002)(2351001)(6666003)(2361001)(6916009)(4326008)(81166006)(36756003)(53416004)(51416003)(68736007)(7696005)(8676002)(106356001)(105586002)(52116002)(81156014)(53936002)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1505; H:wallaby-smavila.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1505; 23:UaSdxHg5wvX5E7+u5tmk3iBp76DOr0mQ4/jMUztyi?= =?us-ascii?Q?9pH4WSjW5xmPL20IMncVXeqCOZ6PgW2m+Pd9hLzDda/MtMCpzq0UEx2qNEZQ?= =?us-ascii?Q?+z0OznkaNu/BhnSMqF2BK5Kf/XVsfep08FYrCsFVZ21+P1UoUYEue/vE9QvE?= =?us-ascii?Q?7ztibGr/n6xEsjs7VdJL9EweU48rO4qJ9dx1pXhstThBz9c0HUBFoX6F4AIE?= =?us-ascii?Q?HIykPnasIuJQ2shQO6undRyv4ipyvAPpqA28lfeLFfpCRPZRr5F5Q3zfIQSk?= =?us-ascii?Q?ajn3zdbFKwJbb1noyI0IdMutuwPXxsu/W6zzMRQk7r2u5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RtQv8L/epnKl8Y1wdejyrB7kORidGWHrI52Cw886b/SCaPgxp/TpZqMRB?= =?us-ascii?Q?P0af8sYXI50L9OhGCYGA49uSb7tb+u8eOxeXzUU8jJX6Qz34/HlvwMh7PaD5?= =?us-ascii?B?dz09?= X-Microsoft-Antispam-Message-Info: Z3U5DNdv8surTB5W144xCDkDOWe8COWntuWeByjJai00FSNM4GNfzsUTNFut9OayiE7GNR5aAaXQE3mUSZoQQIkaeSGEgEnTrVHaRQYTiZm8WvYxSQ8nEq289jbEFHlXPs0sOiR9PJXLFfs6e3L/Z4Z4KYdSQKxDx9usAJh26ZuRyGjbZDVlZ+DK91cHvVUR X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 6:Nu3nry+vO9ldyy5gz0DlaCmbC88uXtnxtHdjJb4bIEUK1MVV63Q/sk16YqgA7veJdcCKJeZfKgu5v00abNv9CY9SEjDsOwcz9QH7LWS5NWIDqP3zYkf8JQ56X8ocwP7Lq8Ml8nCFUNoaerm3xR190IY4rTFOtCt+5Y9QT5cQTp76jlcMVZJSf82GponqJo6sCJHHHJjFxVf7/GSwI92PdrX98GMXqY6azhpGxPSnPWg9ZYH8NAGtyGnIichwJuXLGQheKH8emiweu+t1sPyWjkrWl3PDsyd/j9QGegrm9OejpbN1HsMS+VTSh+YUg+yeJcszTdKLpEmFTInRHuTWI1F8S8T54Moytii6FeKkH3p3sUX3GVR4gRTNko5ipWeOjgf5VbfX0lHqUykkFnsfqAfbOpO34LvGRFLTD0vUJYchLVYAOc0S7i4l0HpvTKX9m1px84zLgLa9B2H+3Mthug==; 5:wsUESONhSFZWp/Zy2qMrxFwV6V6YkN4TMwKjCX4YnQaN1Y0csSVplbnUHM2ObnjT23KkgP4/EJcaIgqvaRUGsCP0yfzTNtvAZjRYpOyFiWH48YXJBnrD+CV7H0bVov2w/zfjRhY6w7SI1BhityiUFg6oN6aBEdplmhr2VAUWRJk=; 24:vILECzihvBlETXqeK8Do2mjkbuyDIue3EYhLK0xFCTcAlA/xWEiMt2klWE8H2YTjnNfS7AQeBajQy1h7DU07fCxGPsD78ZZ9YydecVFlA8g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1505; 7:Mv88fYI+96EgQls1CCYwobbqe5K7Gpyw5Jk5xQtnbko007R2ExA5p4AfrzphqzvnR9uHJL57xPlpExkWoC/J3gkbBfXHHqXSzh7qFeNvzVAmLXlbtm+hBXMR3nZDwE+mCm5jg/I6kRV1JGw+4+wbLTAj4KetKru+ZnguKIPsKUp9SHmjBC4g0dNRWzsDeIvhVypgn9lKelPdboX+NRUShoZ82TZSKwkc5f2ICQz1Se5/RGBR4dQ9w15sdxPhZ2R3; 20:geZrv7c5Of4F9YFKE6DuTraAYOG+8ZrZHjIg61SfIumw7Rg0LAp/2CxszydD0oqlDDJM08n8Xefi2FbgaDbvWRw94kAlaj0rrljWg2MjkDfvbX/92UsPs/Z6ZfrUxhZRgbtrdwZEVZrpbO02Yss3ctkXifWx0O6yBtVeDuZ0yezovqCtMmSLi9im4e7vi3VP3cXlzzUvIrs6Fv6fX/jFIRRzbi+uFyx/nAxppED4L365g5/DKNQd1EOeU4A8Zcxc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 06:40:30.6139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c40d854d-c0e2-437f-9621-08d59ac020ab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1505 Subject: [dpdk-dev] [PATCH v4 14/17] 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, 05 Apr 2018 06:40:33 -0000 This patch enables promiscous and multicast support for AXGBE PMD 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 f0b0ff6..b2581f9 100644 --- a/doc/guides/nics/axgbe.rst +++ b/doc/guides/nics/axgbe.rst @@ -19,6 +19,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 3123572..e5495bd 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -15,6 +15,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, @@ -73,6 +77,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, @@ -219,6 +227,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