From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FD12C43381 for ; Tue, 19 Feb 2019 23:57:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E87D721736 for ; Tue, 19 Feb 2019 23:57:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730040AbfBSX5D (ORCPT ); Tue, 19 Feb 2019 18:57:03 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:56000 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728164AbfBSX5D (ORCPT ); Tue, 19 Feb 2019 18:57:03 -0500 X-IronPort-AV: E=Sophos;i="5.58,388,1544511600"; d="scan'208";a="24922060" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Feb 2019 16:57:03 -0700 Received: from localhost.localdomain (10.10.76.4) by chn-sv-exch03.mchp-main.com (10.10.76.49) with Microsoft SMTP Server id 14.3.352.0; Tue, 19 Feb 2019 16:57:02 -0700 From: To: Sergio Paracuellos , Andrew Lunn , Florian Fainelli , Pavel Machek CC: Tristram Ha , , Subject: [PATCH v2 net-next 0/4] net: dsa: microchip: add MIB counters support Date: Tue, 19 Feb 2019 15:56:59 -0800 Message-ID: <1550620623-13036-1-git-send-email-Tristram.Ha@microchip.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tristram Ha This series of patches is to modify the KSZ9477 DSA driver to read MIB counters periodically to avoid overflow. The MIB counters should be read only when there is link. Otherwise it is a waste of time as hardware never increases the counters. Functions are added to check the port link status so that MIB counters read call is used efficiently. v2 - Create macro similar to readx_poll_timeout to use with switch - Create ksz_port_cleanup function so that variables like on_ports and live_ports can be updated inside it. v1 - Use readx_poll_timeout - Do not clear MIB counters when port is enabled - Do not advertise 1000 half-duplex mode when port is enabled - Do not use freeze function as MIB counters may miss counts Tristram Ha (4): net: dsa: microchip: prepare PHY for proper advertisement net: dsa: microchip: add MIB counter reading support net: dsa: microchip: get port link status net: dsa: microchip: remove unnecessary include headers drivers/net/dsa/microchip/ksz9477.c | 137 +++++++++++++++++---------- drivers/net/dsa/microchip/ksz_common.c | 163 ++++++++++++++++++++++++++++++++- drivers/net/dsa/microchip/ksz_common.h | 27 +++++- drivers/net/dsa/microchip/ksz_priv.h | 14 +-- 4 files changed, 284 insertions(+), 57 deletions(-) -- 1.9.1