From patchwork Fri Mar 19 00:48:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149509 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 E0B34C433E0 for ; Fri, 19 Mar 2021 00:49:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6D4364F10 for ; Fri, 19 Mar 2021 00:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233363AbhCSAtU (ORCPT ); Thu, 18 Mar 2021 20:49:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232547AbhCSAsu (ORCPT ); Thu, 18 Mar 2021 20:48:50 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C18C06174A for ; Thu, 18 Mar 2021 17:48:50 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id r17so2555154pgi.0 for ; Thu, 18 Mar 2021 17:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1+8DMDzmPGV9CsSy99MQgiTN28n2Q7iZRaPhh3XiXWo=; b=mE7QeCg28kkJH/3NpOddBAERrR8P7Y7tif7q55qttNJdcR8M/yqLjTHtPfNP8ERw6Y s7h0L5t1//BBiLjnUgEGimfFA5gI0lfhMcqk2UPscIlGBUuH10LiL+H/O6dR6ulAfLfh CVVKcVs3g5nM8UEza/qG1gksIkA4lIolmeHwzrlLCLA7E1kS13qSWJVNMPJkl27kE3fC LKcF/Wy7hQIl0lbjvrFlscU1TOfJOtoCk0Wfshz8iF/h6o9agRjdHowIVdqOKQvywzUv Hzq172W1VeuKT63ednqFLgz5qrITKuuO7glhi8mLoacDfm0LehGmjcKvD44rv9lioHF6 sq9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1+8DMDzmPGV9CsSy99MQgiTN28n2Q7iZRaPhh3XiXWo=; b=CbP9ntYdo6PnpQx9Rmu/Poi1Z4Pd3nK3KD6nbh3HCCE7wvHY53Wt+HlHjBFlgIb4gU T67lF/+TwLlJw/5W2aezPvrcUKiTorjmD3c6fm+6gTkgIeQGwdOiseDqQl5q1M37LI0L R8dVtufovEplQD1UZr2KJN2tQLrNQ7dzcKwOH2+scYv3VDd69EzVvT8de/FIW3eV4mNA +CFEvntsrr3SX7FfU7Oja3p1iHiPU3kI4LEpYIS/JG0gh/NLRbK8FUhAd5DRAE6GH7pR 5eSyq64EjWmRadUpsy7svfm7nBscAxiNqvbKUA9Ihd36T2M//kI6Lay/66oYww4YI6Le aQ0A== X-Gm-Message-State: AOAM5322F05ZxGv7SbDR+rAnA+OHvj8k59YK4o+3u/4MyJEqHBbpldJO 4PPo+eCXOlMyIpZNBKCuNyfnqjNe26+XCQ== X-Google-Smtp-Source: ABdhPJz2+w4AkYk9tKCMtNmNQ2Ldt3R1Acw1md2NO0maRUQFXVzvYzTlP1pamnHksVt4Kci8DScBTQ== X-Received: by 2002:a63:a547:: with SMTP id r7mr9564385pgu.186.1616114929195; Thu, 18 Mar 2021 17:48:49 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:48 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 1/7] ionic: code cleanup details Date: Thu, 18 Mar 2021 17:48:04 -0700 Message-Id: <20210319004810.4825-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Catch a couple of missing macro name uses, fix a couple of misspellings, etc. Signed-off-by: Shannon Nelson --- .../ethernet/pensando/ionic/ionic_ethtool.c | 8 ++---- .../net/ethernet/pensando/ionic/ionic_if.h | 26 +++++++++---------- .../net/ethernet/pensando/ionic/ionic_lif.c | 23 +++++++--------- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index 0832bedcb3b4..9df4b9df7a82 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -29,11 +29,9 @@ static void ionic_get_stats_strings(struct ionic_lif *lif, u8 *buf) static void ionic_get_stats(struct net_device *netdev, struct ethtool_stats *stats, u64 *buf) { - struct ionic_lif *lif; + struct ionic_lif *lif = netdev_priv(netdev); u32 i; - lif = netdev_priv(netdev); - memset(buf, 0, stats->n_stats * sizeof(*buf)); for (i = 0; i < ionic_num_stats_grps; i++) ionic_stats_groups[i].get_values(lif, &buf); @@ -264,12 +262,10 @@ static int ionic_set_link_ksettings(struct net_device *netdev, const struct ethtool_link_ksettings *ks) { struct ionic_lif *lif = netdev_priv(netdev); + struct ionic_dev *idev = &lif->ionic->idev; struct ionic *ionic = lif->ionic; - struct ionic_dev *idev; int err = 0; - idev = &lif->ionic->idev; - /* set autoneg */ if (ks->base.autoneg != idev->port_info->config.an_enable) { mutex_lock(&ionic->dev_cmd_lock); diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h index 31ccfcdc2b0a..40bd72bb5148 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h @@ -320,7 +320,7 @@ struct ionic_lif_identify_comp { /** * enum ionic_lif_capability - LIF capabilities * @IONIC_LIF_CAP_ETH: LIF supports Ethernet - * @IONIC_LIF_CAP_RDMA: LIF support RDMA + * @IONIC_LIF_CAP_RDMA: LIF supports RDMA */ enum ionic_lif_capability { IONIC_LIF_CAP_ETH = BIT(0), @@ -404,7 +404,7 @@ union ionic_lif_config { * @max_ucast_filters: Number of perfect unicast addresses supported * @max_mcast_filters: Number of perfect multicast addresses supported * @min_frame_size: Minimum size of frames to be sent - * @max_frame_size: Maximim size of frames to be sent + * @max_frame_size: Maximum size of frames to be sent * @config: LIF config struct with features, mtu, mac, q counts * * @rdma: RDMA identify structure @@ -692,7 +692,7 @@ enum ionic_txq_desc_opcode { * checksums are also updated. * * IONIC_TXQ_DESC_OPCODE_TSO: - * Device preforms TCP segmentation offload + * Device performs TCP segmentation offload * (TSO). @hdr_len is the number of bytes * to the end of TCP header (the offset to * the TCP payload). @mss is the desired @@ -982,13 +982,13 @@ struct ionic_rxq_comp { }; enum ionic_pkt_type { - IONIC_PKT_TYPE_NON_IP = 0x000, - IONIC_PKT_TYPE_IPV4 = 0x001, - IONIC_PKT_TYPE_IPV4_TCP = 0x003, - IONIC_PKT_TYPE_IPV4_UDP = 0x005, - IONIC_PKT_TYPE_IPV6 = 0x008, - IONIC_PKT_TYPE_IPV6_TCP = 0x018, - IONIC_PKT_TYPE_IPV6_UDP = 0x028, + IONIC_PKT_TYPE_NON_IP = 0x00, + IONIC_PKT_TYPE_IPV4 = 0x01, + IONIC_PKT_TYPE_IPV4_TCP = 0x03, + IONIC_PKT_TYPE_IPV4_UDP = 0x05, + IONIC_PKT_TYPE_IPV6 = 0x08, + IONIC_PKT_TYPE_IPV6_TCP = 0x18, + IONIC_PKT_TYPE_IPV6_UDP = 0x28, /* below types are only used if encap offloads are enabled on lif */ IONIC_PKT_TYPE_ENCAP_NON_IP = 0x40, IONIC_PKT_TYPE_ENCAP_IPV4 = 0x41, @@ -1331,7 +1331,7 @@ enum ionic_stats_ctl_cmd { * @IONIC_PORT_ATTR_STATE: Port state attribute * @IONIC_PORT_ATTR_SPEED: Port speed attribute * @IONIC_PORT_ATTR_MTU: Port MTU attribute - * @IONIC_PORT_ATTR_AUTONEG: Port autonegotation attribute + * @IONIC_PORT_ATTR_AUTONEG: Port autonegotiation attribute * @IONIC_PORT_ATTR_FEC: Port FEC attribute * @IONIC_PORT_ATTR_PAUSE: Port pause attribute * @IONIC_PORT_ATTR_LOOPBACK: Port loopback attribute @@ -1951,8 +1951,8 @@ enum ionic_qos_sched_type { * @pfc_cos: Priority-Flow Control class of service * @dwrr_weight: QoS class scheduling weight * @strict_rlmt: Rate limit for strict priority scheduling - * @rw_dot1q_pcp: Rewrite dot1q pcp to this value (valid iff F_RW_DOT1Q_PCP) - * @rw_ip_dscp: Rewrite ip dscp to this value (valid iff F_RW_IP_DSCP) + * @rw_dot1q_pcp: Rewrite dot1q pcp to value (valid iff F_RW_DOT1Q_PCP) + * @rw_ip_dscp: Rewrite ip dscp to value (valid iff F_RW_IP_DSCP) * @dot1q_pcp: Dot1q pcp value * @ndscp: Number of valid dscp values in the ip_dscp field * @ip_dscp: IP dscp values diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 48d3c7685b6c..7ee6d2dbbb34 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -124,19 +124,16 @@ static void ionic_link_status_check(struct ionic_lif *lif) link_up = link_status == IONIC_PORT_OPER_STATUS_UP; if (link_up) { - if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) { + if (netdev->flags & IFF_UP && netif_running(netdev)) { mutex_lock(&lif->queue_lock); ionic_start_queues(lif); mutex_unlock(&lif->queue_lock); } if (!netif_carrier_ok(netdev)) { - u32 link_speed; - ionic_port_identify(lif->ionic); - link_speed = le32_to_cpu(lif->info->status.link_speed); netdev_info(netdev, "Link up - %d Gbps\n", - link_speed / 1000); + le32_to_cpu(lif->info->status.link_speed) / 1000); netif_carrier_on(netdev); } } else { @@ -145,7 +142,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) netif_carrier_off(netdev); } - if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) { + if (netdev->flags & IFF_UP && netif_running(netdev)) { mutex_lock(&lif->queue_lock); ionic_stop_queues(lif); mutex_unlock(&lif->queue_lock); @@ -839,7 +836,7 @@ static bool ionic_notifyq_service(struct ionic_cq *cq, switch (le16_to_cpu(comp->event.ecode)) { case IONIC_EVENT_LINK_CHANGE: - ionic_link_status_check_request(lif, false); + ionic_link_status_check_request(lif, CAN_NOT_SLEEP); break; case IONIC_EVENT_RESET: work = kzalloc(sizeof(*work), GFP_ATOMIC); @@ -1443,7 +1440,7 @@ static int ionic_start_queues_reconfig(struct ionic_lif *lif) */ err = ionic_txrx_init(lif); mutex_unlock(&lif->queue_lock); - ionic_link_status_check_request(lif, true); + ionic_link_status_check_request(lif, CAN_SLEEP); netif_device_attach(lif->netdev); return err; @@ -1863,7 +1860,7 @@ static int ionic_open(struct net_device *netdev) err = ionic_txrx_init(lif); if (err) - goto err_out; + goto err_txrx_free; err = netif_set_real_num_tx_queues(netdev, lif->nxqs); if (err) @@ -1884,7 +1881,7 @@ static int ionic_open(struct net_device *netdev) err_txrx_deinit: ionic_txrx_deinit(lif); -err_out: +err_txrx_free: ionic_txrx_free(lif); return err; } @@ -2356,7 +2353,7 @@ int ionic_reconfigure_queues(struct ionic_lif *lif, swap(lif->nxqs, qparam->nxqs); err_out_reinit_unlock: - /* re-init the queues, but don't loose an error code */ + /* re-init the queues, but don't lose an error code */ if (err) ionic_start_queues_reconfig(lif); else @@ -2605,7 +2602,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) } clear_bit(IONIC_LIF_F_FW_RESET, lif->state); - ionic_link_status_check_request(lif, true); + ionic_link_status_check_request(lif, CAN_SLEEP); netif_device_attach(lif->netdev); dev_info(ionic->dev, "FW Up: LIFs restarted\n"); @@ -2976,7 +2973,7 @@ int ionic_lif_register(struct ionic_lif *lif) return err; } - ionic_link_status_check_request(lif, true); + ionic_link_status_check_request(lif, CAN_SLEEP); lif->registered = true; ionic_lif_set_netdev_info(lif); From patchwork Fri Mar 19 00:48:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149513 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 F24FAC433E6 for ; Fri, 19 Mar 2021 00:49:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C760164DE4 for ; Fri, 19 Mar 2021 00:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233380AbhCSAtZ (ORCPT ); Thu, 18 Mar 2021 20:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232570AbhCSAsv (ORCPT ); Thu, 18 Mar 2021 20:48:51 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6770DC06174A for ; Thu, 18 Mar 2021 17:48:51 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id v186so2550632pgv.7 for ; Thu, 18 Mar 2021 17:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jdvpti7gDLJUD7WSK/dQGqLb41HeEAoSo8BbTXmzOBc=; b=t+XGdZeaWam7sikJiCOVQKru/cxnQkVUFLck1o0OJLvjFyFFt9YhEr/E15npjycMSX GOE8K3/p/1wnaetfxFUfzQpHOjLZ+u1yftcEMXv5ZqbwQUllMbbRiKSeo5STd4rFNjOI qsIURA78OxJ1qJ1vilq/avsLAdGzqdwYz9YiLrHTxKXuF43Wd5exog3Ihh4Syc/X8RpQ tkAo+qoZwKZadQ3ml4MtVyPytpy08G626GHXtDHqPR4SR7sAaP5AI58NIztOVrIhQVJl VtipmcbZNL7/ungOCY5+iiG8/7PhjB6mRiTWfkWWRzR+rIHB9SlVWmwmTnwv9GT395fb Pc7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jdvpti7gDLJUD7WSK/dQGqLb41HeEAoSo8BbTXmzOBc=; b=HZl0byFqGlMnpMoB55FmWPWEV5kge3DY5DGt4YzjYXPss82xiy9MWMYuYEy/eHTFbT vaCIDdmZzCshpw/S1zROb8EfLHgegaTcu8+OAhLek9caBqyTPeGhcdRbGjfLt58g8/xW Y+fx8Mi+SEk/z7eStG5rDU4v6fhEsn3K+52IPaURpe8m0hU1rKk0Ufxtt0j3tYGWCwF9 98NwkpGoeycZ0QmDovBH9aLFeWnB49bR9bshsoOUp7F5a6uVsWTDz5Vi7fpuQSYNPm70 M4YmdrF7A/Qhl33nMzUGWNNFv83G0Mw8bAp6YIa821LOCtjYuL7i7hVR9KqD9cK1cWFz cQWA== X-Gm-Message-State: AOAM532JQjdHOwXI4p6qTu+oLfu1ckCFX52UG9UMtL3YJfeDdj5hNRtK 6SoIDnVLVFLHGZ1+w487ajPPioHojfmCEQ== X-Google-Smtp-Source: ABdhPJzxVkDtGb7jIPaJfTU/3peTFrb1MSnnYQNv1awcdHQUPv9fVMUi63SOleVQ1PN60whG2ZTMYw== X-Received: by 2002:a65:4588:: with SMTP id o8mr8990930pgq.243.1616114930714; Thu, 18 Mar 2021 17:48:50 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:50 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 2/7] ionic: simplify the intr_index use in txq_init Date: Thu, 18 Mar 2021 17:48:05 -0700 Message-Id: <20210319004810.4825-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The qcq->intr.index was set when the queue was allocated, there is no need to reach around to find it. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 7ee6d2dbbb34..83ec3c664790 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -715,10 +715,8 @@ static int ionic_lif_txq_init(struct ionic_lif *lif, struct ionic_qcq *qcq) unsigned int intr_index; int err; - if (qcq->flags & IONIC_QCQ_F_INTR) - intr_index = qcq->intr.index; - else - intr_index = lif->rxqcqs[q->index]->intr.index; + intr_index = qcq->intr.index; + ctx.cmd.q_init.intr_index = cpu_to_le16(intr_index); dev_dbg(dev, "txq_init.pid %d\n", ctx.cmd.q_init.pid); From patchwork Fri Mar 19 00:48:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149511 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 1ED3EC433E9 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE83464E83 for ; Fri, 19 Mar 2021 00:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233391AbhCSAtZ (ORCPT ); Thu, 18 Mar 2021 20:49:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232573AbhCSAsw (ORCPT ); Thu, 18 Mar 2021 20:48:52 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75562C06174A for ; Thu, 18 Mar 2021 17:48:52 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id j25so4682774pfe.2 for ; Thu, 18 Mar 2021 17:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=phmLneIwxWYJqm2E7oyjHLE5MF057wY3DtrYLKn96UY=; b=Dkx82eZYC1zOKg1YtdVEL/hz6mcV4nn93Ji9cDOyfoKKM030raBuchGjjlD0jiXZ96 L/BtfLfjPmKFHya6fqjBYj9lu3em4fiHRViezYvXfz/nzfKqJGW1bu2uyHni+VA7iTSg iEVSLFSfsdUcK8QIjC7G9z1Cc0qSqGRYWRDqGsNuKVw80D7Nd7HUyIsaWGK+FxCoWsp/ xCffcEDCsrfWFeGmSX85Ep1B8Rd0MZCYlSks2y5XyVLTAOEmjPjacbdyNcrTTiSvzEHI HmNCsrzCyvJ7p18oLifPgDi3JKY7+ni7QY/Dn5W5ecjW09tLYWDut4l2MErSLLqvqSUE LuGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=phmLneIwxWYJqm2E7oyjHLE5MF057wY3DtrYLKn96UY=; b=G1xSltaD5fAeo3Pz8NQwGEpMsySHQS8XNHtvBAMd1DS9FZKVe/tRWNa3B6TuNkKyyb ZCmqYQBoGeqP4pT6fm+STsZVsBZ94aQeaErM0iAOQ0J+00mUU1t4TFX9GMLwgRx3OtmZ 2GO7d6b752we1ETk5Vewag//Cik+KyaR0A+wrBYMZhRm72GYUaDoMsZ6NS96Kh0mfGnT pJjgx2hZLA/4gO7AwwiLSQdq3J1vs6wtYcicjjE4k7gelMqnsblr9KsY8lfx6ddq1ifv M9VotTDx+87laFn+HocwH9Wmc0YEn2JkKKtFNqaojew4395hTJFx6NNG8nLOFfrOzKzI jheg== X-Gm-Message-State: AOAM5313yw9IqpBwx5A0JhXlg2c4O6jxOB+3i6IARV3sqOdWq9Ms5l5m /xuPKKxEWkYxGxqmLFS0AnuhJ3rK0RI9bQ== X-Google-Smtp-Source: ABdhPJzuu9SeoZqSdkm2B7I/axma3ldsh3lV7lHE6pW6BJmS66VbO4XumWtoPIKJarwkno457KOWiA== X-Received: by 2002:a63:ab05:: with SMTP id p5mr9212869pgf.149.1616114931747; Thu, 18 Mar 2021 17:48:51 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:51 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 3/7] ionic: fix unchecked reference Date: Thu, 18 Mar 2021 17:48:06 -0700 Message-Id: <20210319004810.4825-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We can get to the counter without going through the pointer that the robot complained about. Reported-by: kernel test robot Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 83ec3c664790..18fcba4fc413 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -888,7 +888,7 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) work_done = max(n_work, a_work); if (work_done < budget && napi_complete_done(napi, work_done)) { flags |= IONIC_INTR_CRED_UNMASK; - lif->adminqcq->cq.bound_intr->rearm_count++; + intr->rearm_count++; } if (work_done || flags) { From patchwork Fri Mar 19 00:48:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149517 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 4593AC4332D for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AE3664DE4 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233401AbhCSAt0 (ORCPT ); Thu, 18 Mar 2021 20:49:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232674AbhCSAsx (ORCPT ); Thu, 18 Mar 2021 20:48:53 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 725DCC06174A for ; Thu, 18 Mar 2021 17:48:53 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id v2so2552302pgk.11 for ; Thu, 18 Mar 2021 17:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DjbQqNDuT2ROMaS4/zyuviHOW40z0MnWjplzC78XgvA=; b=NZp03VOsce0LNT7U+VhPE5/94kf4mjWmPl7GhjgK/JCGJzIZfH9/cyiSrIDhgOSrSh UFic+edlrKjRHbQhU22n30XL/KhfcWJAGZXQMCZcyoBlm0Ns4xc/kOzBQMKXVg5LLFbT buFF0icbWF3sW80KZ2NJGqrVocDA6P52UmPArx8dFp2wUqyDkVAVHE5FjjF46CWpHtmL pjP3QHj13K+MwavucCfnUQZ6AqohfYLgZhpmxiBp1WDbqd34B9NLt9oXCUr5CWi8kAzN y6SBAYT7hcOizP/PLolDwvvZspWw2xJ7UcGXHqusagyLjWDZzqIFzZgiK3FswH4DelyF SrdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DjbQqNDuT2ROMaS4/zyuviHOW40z0MnWjplzC78XgvA=; b=YtHv4bs3AAHzxO3uB6gbubNvf/stxHf8rYYWCADpJDZYALnldprj8SIihstw6LNFS5 oT0jpXkLDr/m5CBhDalIWfo4R3q/GIEY5Ccyc2XA8dY93k8rcl1CLwvz1gTwWm55KKgv TdGv5D8b6aG255NYsimKU4mJNOqQQ7m48kCStZThKX8p9S3AHKcqNEBHrQCQNi4MJcq1 YzB9t1ZsaWZCTSuOZ+1niWTBVOplppuZdIVGzDdKwkGynPg5sokuwk9X8F0dtbEcH6dt s6LjkfpH71Twf/MT+mkt9qGddEWvvwZHIrWlHtMjJ2ar5DiaTymg171jLgkj2YEAP9/v 3hWw== X-Gm-Message-State: AOAM533H3TsQmqHd8lSuQBtCA1YtNViCdXx6vPG2oOiU9FLLI/d77DGJ /9TUav2dDzDKrUTr8xZZfk249avE6lRzaw== X-Google-Smtp-Source: ABdhPJwwu8VNBx2LgvkMOpoyMAeIx5z4ch80G/tmQseZP+342cVHKH+/GU3ibqQRE+mc+XCMa7K7rw== X-Received: by 2002:a63:520e:: with SMTP id g14mr9091089pgb.350.1616114932743; Thu, 18 Mar 2021 17:48:52 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:52 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 4/7] ionic: update ethtool support bits for BASET Date: Thu, 18 Mar 2021 17:48:07 -0700 Message-Id: <20210319004810.4825-5-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add support in get_link_ksettings for a couple of new BASET connections. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_ethtool.c | 8 ++++++++ drivers/net/ethernet/pensando/ionic/ionic_if.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c index 9df4b9df7a82..b1e78b452fad 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_ethtool.c @@ -207,6 +207,14 @@ static int ionic_get_link_ksettings(struct net_device *netdev, ethtool_link_ksettings_add_link_mode(ks, supported, 10000baseER_Full); break; + case IONIC_XCVR_PID_SFP_10GBASE_T: + ethtool_link_ksettings_add_link_mode(ks, supported, + 10000baseT_Full); + break; + case IONIC_XCVR_PID_SFP_1000BASE_T: + ethtool_link_ksettings_add_link_mode(ks, supported, + 1000baseT_Full); + break; case IONIC_XCVR_PID_UNKNOWN: /* This means there's no module plugged in */ break; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h index 40bd72bb5148..88210142395d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h @@ -1111,6 +1111,8 @@ enum ionic_xcvr_pid { IONIC_XCVR_PID_QSFP_100G_CWDM4 = 69, IONIC_XCVR_PID_QSFP_100G_PSM4 = 70, IONIC_XCVR_PID_SFP_25GBASE_ACC = 71, + IONIC_XCVR_PID_SFP_10GBASE_T = 72, + IONIC_XCVR_PID_SFP_1000BASE_T = 73, }; /** From patchwork Fri Mar 19 00:48:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149521 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 74DA9C43331 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36FE364F10 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233407AbhCSAt1 (ORCPT ); Thu, 18 Mar 2021 20:49:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233279AbhCSAsy (ORCPT ); Thu, 18 Mar 2021 20:48:54 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA627C06174A for ; Thu, 18 Mar 2021 17:48:54 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id ga23-20020a17090b0397b02900c0b81bbcd4so5903803pjb.0 for ; Thu, 18 Mar 2021 17:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vlDkzhG208rz3UoSz9hxhQbEQocMwtSUkUwBtKeX6uU=; b=fBxDzSSrv+eYz2aScysiMmG/AeZNFXvqdUXYXCyK+lT/KOHQSIffzyBkMdxTj/qZ0m zxTFjitZ2WVURq2Mg5Q6/sY8zR6x49L31ih/RRPZcDnA5q8ZXEojmxVU0l8UZmX9vGo8 WvgyApPLEK/UkuLyNlouRH2qA6f854hH+jR1gL0jtrY0kiJO+hD736FREq7/AgVAF8/F g4UkRUom0VC6bMBiXdhTPvGPVM390R4k3UuaBms0lGuq+kTSFmUvAQ5V2qg6ff7J1/qo EMnxO8NpfW/vUNzU3GtNHRwa3vyWx9htqzdOv+zYRhmsNZUCGBtCmNuGWRccm7Dz8ze+ P/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vlDkzhG208rz3UoSz9hxhQbEQocMwtSUkUwBtKeX6uU=; b=ti6dq9/Y3Mq5lSbfWChxLVPmv+apHjiQo9w+yf6eXi3hPTRRISrvPej7L6Kk/Ae7Jc PdoMI5Lhj6EA041MNLjtj68F04MxsOvxhAXKXxNCfxZcm0SaXBgXVdXAhbDi5uDkmDbX 9TqJAiTYkfxIeocwg5rWeqae7+3uz5hjct+VzZ1+wiA89k3+d1EtFHZYrFB9UJr+4FKw 8QIgm+BcskAGQcuYmCXQzxvQEF74EYv9RHCVDW4fl/dY+0UgTdvuomgx2gXKaEztIiW/ Po1ifKX7ni7VIh5BBiebPghwPKlPgepT8MxLHZWfoK2W1eDtKAxJdmN8y42xt2Nxsazl UJfA== X-Gm-Message-State: AOAM532iGZ9f+51AJunxMvNvJY02y/I6qG5ZDep4OKw+cm+yWWgOfWqq 4eT9Q7UGIJRZuhKW5qlwZ04aClkTu6nRcw== X-Google-Smtp-Source: ABdhPJylhqm3xVfwurqCaSX/+Gg/OmItHwnFUZOAMj98R+lcwLFgYFNkzcn7duGY2OJ/GZjoCnGpoA== X-Received: by 2002:a17:902:d706:b029:e6:90aa:24e0 with SMTP id w6-20020a170902d706b02900e690aa24e0mr12367697ply.42.1616114933970; Thu, 18 Mar 2021 17:48:53 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:53 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 5/7] ionic: block actions during fw reset Date: Thu, 18 Mar 2021 17:48:08 -0700 Message-Id: <20210319004810.4825-6-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Block some actions while the FW is in a reset activity and the queues are not configured. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 4 ++++ drivers/net/ethernet/pensando/ionic/ionic_dev.c | 8 +++++--- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 7 ++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index b0d8499d373b..e4a5416adc80 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -184,6 +184,10 @@ static int ionic_sriov_configure(struct pci_dev *pdev, int num_vfs) struct device *dev = ionic->dev; int ret = 0; + if (ionic->lif && + test_bit(IONIC_LIF_F_FW_RESET, ionic->lif->state)) + return -EBUSY; + if (num_vfs > 0) { ret = pci_enable_sriov(pdev, num_vfs); if (ret) { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.c b/drivers/net/ethernet/pensando/ionic/ionic_dev.c index b951bf5bbdc4..0532f7cf086d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.c @@ -14,18 +14,20 @@ static void ionic_watchdog_cb(struct timer_list *t) { struct ionic *ionic = from_timer(ionic, t, watchdog_timer); + struct ionic_lif *lif = ionic->lif; int hb; mod_timer(&ionic->watchdog_timer, round_jiffies(jiffies + ionic->watchdog_period)); - if (!ionic->lif) + if (!lif) return; hb = ionic_heartbeat_check(ionic); - if (hb >= 0) - ionic_link_status_check_request(ionic->lif, CAN_NOT_SLEEP); + if (hb >= 0 && + !test_bit(IONIC_LIF_F_FW_RESET, lif->state)) + ionic_link_status_check_request(lif, CAN_NOT_SLEEP); } void ionic_init_devinfo(struct ionic *ionic) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 18fcba4fc413..4f4ca183830b 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1477,7 +1477,8 @@ static void ionic_tx_timeout_work(struct work_struct *ws) { struct ionic_lif *lif = container_of(ws, struct ionic_lif, tx_timeout_work); - netdev_info(lif->netdev, "Tx Timeout recovery\n"); + if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) + return; /* if we were stopped before this scheduled job was launched, * don't bother the queues as they are already stopped. @@ -1493,6 +1494,7 @@ static void ionic_tx_timeout(struct net_device *netdev, unsigned int txqueue) { struct ionic_lif *lif = netdev_priv(netdev); + netdev_info(lif->netdev, "Tx Timeout triggered - txq %d\n", txqueue); schedule_work(&lif->tx_timeout_work); } @@ -1834,6 +1836,9 @@ static int ionic_start_queues(struct ionic_lif *lif) { int err; + if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) + return -EBUSY; + if (test_and_set_bit(IONIC_LIF_F_UP, lif->state)) return 0; From patchwork Fri Mar 19 00:48:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149515 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 41AA8C43381 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 248A164F11 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233416AbhCSAt2 (ORCPT ); Thu, 18 Mar 2021 20:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233290AbhCSAs4 (ORCPT ); Thu, 18 Mar 2021 20:48:56 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F29C06174A for ; Thu, 18 Mar 2021 17:48:56 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id l3so4690819pfc.7 for ; Thu, 18 Mar 2021 17:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7Z1W874oYykgTPXqxR8IoTTpuoVTHxIFrkm+0NrM8RQ=; b=lxPdtYHCkV0ZOyPHCyracbbBvI2yXoubson7QbbKcJDnBxY42gUmaJ0W8r9Mm0B0Lo NXurac/GgZZ+Gy1MqY6HN3QKMAtVb/KxtoQy5mhyQDKUfw/OeoDOnMEsgRvfkG/j8ujO dZKojcxCFul+9G28iYoE4EHp/OaMtwg0OWcyf07aU1hi0l00xFczqw9KHMLF1d36DOw+ 0wHk1fzCUus+DTwMjq8AvFi5jo7EbfiNuRLxwxffG0HK+b/M64gVB4hNnJsUsSfjc+7+ NxnQTaCT13KZ7+KvYy6ptwrO3tH7EENsbqO8FIHAG0WxxTDVGTKimaN8kA+mzbppifn6 IdIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7Z1W874oYykgTPXqxR8IoTTpuoVTHxIFrkm+0NrM8RQ=; b=BMSMddo3RVBsrQ9tBzhZcwGTJFmfLeU3tzsMLn0GUKR4p0CSPrSF+v2Fi+1+VL669v ofdnbjOuL8X3ca0eu+xT/IxY/6Hq8g8vlLKaE3K2BFfKnZW0/ncOAbGv2oxCZef0f1F1 MQKRrW4o0YXRh02Fz59QNtha4FqPn19pr1Dyqa4UB1nkWcL2aDuyNpNbz187Rm5BqsS8 M2E6vyzUoTylK+qeuo8VwkIpT5fa2CCk8SXw+LNY6Ga4/c/gQEyQZmt6ErUCYJLlXksw nnMBS0yoolmnCVtFs+XghDBclxRjVpq5keVEsa3HNouHS0bDjDpuuErv3zmqoI5zlo98 vXLw== X-Gm-Message-State: AOAM531NHY2l73mHI5smhRh39v3k9/A3nWNVygOTDa9/8yluzqqvJAn7 XfOUC4meiugEwGh1TNQRCy6UcOMTjEf/+Q== X-Google-Smtp-Source: ABdhPJwEkoSnGRZTr4ErYgyGoYP3pfLuyfN5Qb4lRhtVIAZueiFD74nhbG7JxUm+TyEIIDzQP57ifA== X-Received: by 2002:a62:8782:0:b029:1f7:74b0:d0eb with SMTP id i124-20020a6287820000b02901f774b0d0ebmr6481681pfe.18.1616114935249; Thu, 18 Mar 2021 17:48:55 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:54 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 6/7] ionic: stop watchdog when in broken state Date: Thu, 18 Mar 2021 17:48:09 -0700 Message-Id: <20210319004810.4825-7-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Up to now we've been ignoring any error return from the queue starting in the link status check, so we fix that here. If the driver had to reset and couldn't get things running properly again, for example after a Tx Timeout and the FW is not responding to commands, don't let the link watchdog try to restart the queues. At this point the user can try to DOWN and UP the device to clear the errors. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 25 +++++++++++++++++-- .../net/ethernet/pensando/ionic/ionic_lif.h | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 4f4ca183830b..9b3afedbc083 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -120,17 +120,31 @@ static void ionic_link_status_check(struct ionic_lif *lif) if (!test_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state)) return; + /* Don't put carrier back up if we're in a broken state */ + if (test_bit(IONIC_LIF_F_BROKEN, lif->state)) { + clear_bit(IONIC_LIF_F_LINK_CHECK_REQUESTED, lif->state); + return; + } + link_status = le16_to_cpu(lif->info->status.link_status); link_up = link_status == IONIC_PORT_OPER_STATUS_UP; if (link_up) { + int err = 0; + if (netdev->flags & IFF_UP && netif_running(netdev)) { mutex_lock(&lif->queue_lock); - ionic_start_queues(lif); + err = ionic_start_queues(lif); + if (err) { + netdev_err(lif->netdev, + "Failed to start queues: %d\n", err); + set_bit(IONIC_LIF_F_BROKEN, lif->state); + netif_carrier_off(lif->netdev); + } mutex_unlock(&lif->queue_lock); } - if (!netif_carrier_ok(netdev)) { + if (!err && !netif_carrier_ok(netdev)) { ionic_port_identify(lif->ionic); netdev_info(netdev, "Link up - %d Gbps\n", le32_to_cpu(lif->info->status.link_speed) / 1000); @@ -1836,6 +1850,9 @@ static int ionic_start_queues(struct ionic_lif *lif) { int err; + if (test_bit(IONIC_LIF_F_BROKEN, lif->state)) + return -EIO; + if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) return -EBUSY; @@ -1857,6 +1874,10 @@ static int ionic_open(struct net_device *netdev) struct ionic_lif *lif = netdev_priv(netdev); int err; + /* If recovering from a broken state, clear the bit and we'll try again */ + if (test_and_clear_bit(IONIC_LIF_F_BROKEN, lif->state)) + netdev_info(netdev, "clearing broken state\n"); + err = ionic_txrx_alloc(lif); if (err) return err; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index 8ffda32a0a7d..be5cc89b2bd9 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -139,6 +139,7 @@ enum ionic_lif_state_flags { IONIC_LIF_F_LINK_CHECK_REQUESTED, IONIC_LIF_F_FW_RESET, IONIC_LIF_F_SPLIT_INTR, + IONIC_LIF_F_BROKEN, IONIC_LIF_F_TX_DIM_INTR, IONIC_LIF_F_RX_DIM_INTR, From patchwork Fri Mar 19 00:48:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 12149519 X-Patchwork-Delegate: kuba@kernel.org 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,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 70C73C4332B for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48E6E64E83 for ; Fri, 19 Mar 2021 00:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbhCSAt3 (ORCPT ); Thu, 18 Mar 2021 20:49:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233291AbhCSAs5 (ORCPT ); Thu, 18 Mar 2021 20:48:57 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62763C06174A for ; Thu, 18 Mar 2021 17:48:57 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id l1so2144738plg.12 for ; Thu, 18 Mar 2021 17:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VcL2PRC649t7/2/e96ZBhHWaTie3wVSR1kURoD0b1Fg=; b=eWN8Acv2AHpW4fKApNqZyl3idPds9cemFoUN/0YyQyXITEFGFps3WZYeMyh8hAfPTb /VTIYih4wC60XvCPLRKFhGgXEyCyiglaZAj6+oqNLH8xDCLUlLNdXipH4qZ0ZtYLNs0B EUgp+O5igx9mvYD6uRirgVfW/1GDICUE1kzxPWpKDb2OfDPTvsYZkk3m8U27hPt3B1Jf lAbO/NmqogN7DHHIfNhNmSeux00oZ09CiTyp4B5OLvnNhWgpfYvVtN2eZc584cHDav7y bN+p+cGLn7gFnweXMmjAC4tCHNZmfRChdYck5yDXMBc5SCc1L6cawsqk2Xxbne/rARmF Acog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VcL2PRC649t7/2/e96ZBhHWaTie3wVSR1kURoD0b1Fg=; b=flo9g9NhNU38VRqeaqBo3iHUliCzbGo4HqskZDWnPyFYQKoyVDlCilAUHJbF19L7u1 uPWHg+e+Wou83ZAP5NIJWuRGOEOXhJ4ECshxXyxmUJcwL8DoH/9QPgza3rQGj7/q8K55 AA/QIlGy3j51IJk3m3bvjyYl+vQMia0+bdDtAyo2Z9LO1wuO1Odqj4b6miXKIhSxl8Jk zQurcB9pPwnt9mbNhVxYBN2+2HPBifK1VVWqt7KEqbYR0HATCJoj0swwd/fV+Vk0OzvI RUOFGGDh/T2ibw7i1lIAMIDJVUS7AT1ShYA1Jr/2Z+QZ/TLEgJcu/xsNrqHBG+ZW2Ebw 8/gg== X-Gm-Message-State: AOAM533ZpYVl8gtiTt08pn/GCFEQlextHpYCnOkCK1kb7QeAHbN8R5/M EC33REkKn+QxGi41gEOgJCobhWmQCCqj5A== X-Google-Smtp-Source: ABdhPJz76PBdetiB1hTzeC9KaBb4ulVJXpNplBdElbYjwqGNYZc1moMLVTtpFMx4RKCKmvP4nSluDQ== X-Received: by 2002:a17:902:b7c9:b029:e6:3d74:5dc5 with SMTP id v9-20020a170902b7c9b02900e63d745dc5mr12102692plz.16.1616114936277; Thu, 18 Mar 2021 17:48:56 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id i7sm3592949pfq.184.2021.03.18.17.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 17:48:55 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 7/7] ionic: protect adminq from early destroy Date: Thu, 18 Mar 2021 17:48:10 -0700 Message-Id: <20210319004810.4825-8-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319004810.4825-1-snelson@pensando.io> References: <20210319004810.4825-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Don't destroy the adminq while there is an outstanding request. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 14 ++++++++++-- .../net/ethernet/pensando/ionic/ionic_main.c | 22 ++++++++++++++----- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 9b3afedbc083..889d234e2ffa 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -393,6 +393,8 @@ static void ionic_qcq_free(struct ionic_lif *lif, struct ionic_qcq *qcq) static void ionic_qcqs_free(struct ionic_lif *lif) { struct device *dev = lif->ionic->dev; + struct ionic_qcq *adminqcq; + unsigned long irqflags; if (lif->notifyqcq) { ionic_qcq_free(lif, lif->notifyqcq); @@ -401,9 +403,14 @@ static void ionic_qcqs_free(struct ionic_lif *lif) } if (lif->adminqcq) { - ionic_qcq_free(lif, lif->adminqcq); - devm_kfree(dev, lif->adminqcq); + spin_lock_irqsave(&lif->adminq_lock, irqflags); + adminqcq = READ_ONCE(lif->adminqcq); lif->adminqcq = NULL; + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + if (adminqcq) { + ionic_qcq_free(lif, adminqcq); + devm_kfree(dev, adminqcq); + } } if (lif->rxqcqs) { @@ -886,6 +893,7 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) struct ionic_intr_info *intr = napi_to_cq(napi)->bound_intr; struct ionic_lif *lif = napi_to_cq(napi)->lif; struct ionic_dev *idev = &lif->ionic->idev; + unsigned long irqflags; unsigned int flags = 0; int n_work = 0; int a_work = 0; @@ -895,9 +903,11 @@ static int ionic_adminq_napi(struct napi_struct *napi, int budget) n_work = ionic_cq_service(&lif->notifyqcq->cq, budget, ionic_notifyq_service, NULL, NULL); + spin_lock_irqsave(&lif->adminq_lock, irqflags); if (lif->adminqcq && lif->adminqcq->flags & IONIC_QCQ_F_INITED) a_work = ionic_cq_service(&lif->adminqcq->cq, budget, ionic_adminq_service, NULL, NULL); + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); work_done = max(n_work, a_work); if (work_done < budget && napi_complete_done(napi, work_done)) { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 14ece909a451..c4b2906a2ae6 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -187,10 +187,17 @@ static const char *ionic_opcode_to_str(enum ionic_cmd_opcode opcode) static void ionic_adminq_flush(struct ionic_lif *lif) { - struct ionic_queue *q = &lif->adminqcq->q; struct ionic_desc_info *desc_info; + unsigned long irqflags; + struct ionic_queue *q; + + spin_lock_irqsave(&lif->adminq_lock, irqflags); + if (!lif->adminqcq) { + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); + return; + } - spin_lock(&lif->adminq_lock); + q = &lif->adminqcq->q; while (q->tail_idx != q->head_idx) { desc_info = &q->info[q->tail_idx]; @@ -199,7 +206,7 @@ static void ionic_adminq_flush(struct ionic_lif *lif) desc_info->cb_arg = NULL; q->tail_idx = (q->tail_idx + 1) & (q->num_descs - 1); } - spin_unlock(&lif->adminq_lock); + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); } static int ionic_adminq_check_err(struct ionic_lif *lif, @@ -252,15 +259,18 @@ static void ionic_adminq_cb(struct ionic_queue *q, static int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) { struct ionic_desc_info *desc_info; + unsigned long irqflags; struct ionic_queue *q; int err = 0; - if (!lif->adminqcq) + spin_lock_irqsave(&lif->adminq_lock, irqflags); + if (!lif->adminqcq) { + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); return -EIO; + } q = &lif->adminqcq->q; - spin_lock(&lif->adminq_lock); if (!ionic_q_has_space(q, 1)) { err = -ENOSPC; goto err_out; @@ -280,7 +290,7 @@ static int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) ionic_q_post(q, true, ionic_adminq_cb, ctx); err_out: - spin_unlock(&lif->adminq_lock); + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); return err; }