From patchwork Wed Apr 7 23:19:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 418044 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 86798C433ED for ; Wed, 7 Apr 2021 23:20:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50FAD6124C for ; Wed, 7 Apr 2021 23:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbhDGXUY (ORCPT ); Wed, 7 Apr 2021 19:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbhDGXUX (ORCPT ); Wed, 7 Apr 2021 19:20:23 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C44FC061761 for ; Wed, 7 Apr 2021 16:20:13 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so323030pjv.1 for ; Wed, 07 Apr 2021 16:20:13 -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=WWFs2CvSTSC0cIwVlaRuaYTlAezQpAqLGtwVnAuh2fo=; b=TytgDHUN6OhblGqS86bK6ZBgpQg/WzwkyUFDPp6bp6BVY8hmqbC0L0+bgqaqK1ojeh I2VJ+oHjDVY8FYCDa4ZSdSufm3CzH5TepMGgQLT2ZiXwHtHVLZuDeWhQtb6v+2PGj2Og Ksq999qZNj9P0KujSkRf9G/2shqEjAhxAQo+3Ew47J5OpjMnuZE6GkN8pQXclU2FyAmP CfLJGa1Z07M7rklI1yO6LE24xk9w18ZkT1u2UFKJZaw2ugXG/poe9+NOzKXQG3Q6uwk9 HXmwphSYGG75hvagRhYNDbGMek5dtBQ87wEcxvHD4KSxmwegYwEF8VKDKMGEMkcjub8O 9DlQ== 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=WWFs2CvSTSC0cIwVlaRuaYTlAezQpAqLGtwVnAuh2fo=; b=DAEhQ1Sen4Ezfqf+lA7GvbHngiq1ODrprkBDxTgroruYjFlylLcg5LEa+9oT37cBZz ipso/Nl750zvZljBjOhhYkGSZLggu0WPh6LY62oAxJBByAWV1Zk4A01Uz8NlQlEOsU4R e4ui9Vq3vM0nhmzwUzKwLaCghpU4MrDhofCHBF2w7XDI+rCAKsrI6iolU6HrMRFxLbql JAe1xdUim/Vmw9I5BQrKPY8hyBbH3qGycv0qgfVnwWhUnpbnUTDVmSHpCqwbm62GWgo0 GfBEn/OSmpZjIFcbUzOSUIAnwosJQnTj1e78E6HQGrzWChJvUluaRDiP8dhuRR0qcUVI hXOA== X-Gm-Message-State: AOAM5322Wkd0tUnwrWJD7xu75hXiUO9KjC8NTlO0o4a0SVickEteHFnn 24DzefWFJnMlvwhOoiU/ZU1QeWSnhc4h7Q== X-Google-Smtp-Source: ABdhPJzIq+aykrc87FHWku9EAgtKzjNCgv8ZrcCbTO0NU36llmaiRlSkKerPT3B2mYytXL7Z9aQy+Q== X-Received: by 2002:a17:902:ce88:b029:e6:3a3c:2f65 with SMTP id f8-20020a170902ce88b02900e63a3c2f65mr5133142plg.66.1617837612962; Wed, 07 Apr 2021 16:20:12 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:12 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 1/8] ionic: fix up a couple of code style nits Date: Wed, 7 Apr 2021 16:19:54 -0700 Message-Id: <20210407232001.16670-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Clean up variable declarations. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index ee56fed12e07..4e22e50922cd 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2015,9 +2015,8 @@ static void ionic_txrx_free(struct ionic_lif *lif) static int ionic_txrx_alloc(struct ionic_lif *lif) { - unsigned int num_desc, desc_sz, comp_sz, sg_desc_sz; - unsigned int flags; - unsigned int i; + unsigned int comp_sz, desc_sz, num_desc, sg_desc_sz; + unsigned int flags, i; int err = 0; num_desc = lif->ntxq_descs; @@ -2584,12 +2583,11 @@ static void ionic_swap_queues(struct ionic_qcq *a, struct ionic_qcq *b) int ionic_reconfigure_queues(struct ionic_lif *lif, struct ionic_queue_params *qparam) { - unsigned int num_desc, desc_sz, comp_sz, sg_desc_sz; + unsigned int comp_sz, desc_sz, num_desc, sg_desc_sz; struct ionic_qcq **tx_qcqs = NULL; struct ionic_qcq **rx_qcqs = NULL; - unsigned int flags; + unsigned int flags, i; int err = -ENOMEM; - unsigned int i; /* allocate temporary qcq arrays to hold new queue structs */ if (qparam->nxqs != lif->nxqs || qparam->ntxq_descs != lif->ntxq_descs) { From patchwork Wed Apr 7 23:19:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 418043 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, URIBL_BLOCKED, 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 A1144C43461 for ; Wed, 7 Apr 2021 23:20:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 612B0611EE for ; Wed, 7 Apr 2021 23:20:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbhDGXU0 (ORCPT ); Wed, 7 Apr 2021 19:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229558AbhDGXUY (ORCPT ); Wed, 7 Apr 2021 19:20:24 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D70DC061761 for ; Wed, 7 Apr 2021 16:20:14 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id t23so122085pjy.3 for ; Wed, 07 Apr 2021 16:20:14 -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=m/9XuxMbW3hH3rKlIJe8JySYt6M7v6ziCPcT5/gS7As=; b=DDvrUSkuJFeQLI8dqpn3wTs6j0CVWLgf8p5+zw9lLG9UuuP76br1r5p5WIJshO3KpE hz5AH/HyX2TTjxRWUjs3oG1fGP8/zOxKlEZwbSzBYCv3+JLUd2vujHw+lnDbt3/tZh+b 1qKeuUgX1knIchj6OsaT0cM4ThPfrGQWqiP5sDWBWEnlXLgFbeGW9aaD4tO9FPhl3CHn TvRYT7Xys2oyc0EqqFA31NZ06PqaV8uSOVN2blL1V/pnOYJmd1UroUJXenCi9w2H0YuJ LadLT9ph1xm2Ug61fM4EwMzclwoaRBhRlR6YZxHaszc8UQUNw6QZhhEfEv1qAUVqHeAi Q6BA== 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=m/9XuxMbW3hH3rKlIJe8JySYt6M7v6ziCPcT5/gS7As=; b=iBdbsZtbzOn59y/kuNwAvd9fGL8TZaVi+W0u4+jqAnub28/qeDrxorsy7TCv4fpnSN z+/yo5QQw1KoBuKlAkeNWZ7aaJOMiSsszlc+WfJS/DDZsCgxkZ2a/hbFa1MA1FNvZY4r H+KXt9SP0l4LDV/XKb8vCyjYnKgupJIHD2VNZsGZgZNAvK5RQ2EVC+8Iv/YCGYtLn/OS O2T/LL+eaz+vsG/Tn3xHz0Z9cY9n8Y5gz9Q1si1al6yresF28bR3+cpHOIQkT66b3hlA z5dPE9+RIfXG7pn1nlxFcSE8/iNbplF5xTXzMDFA3A0MZoswXSioek7amEPAMhcJRrqP 3WDA== X-Gm-Message-State: AOAM532ndP5MTFNu+TeKmxSm2RiI88vLIbkMInf6FvELVooluP6yqEbv 9eib5Ud92MAjlhAkCUy8w+qiu4g9N/tUYA== X-Google-Smtp-Source: ABdhPJxjolUM6koz462IaZIh539ENUW38B9+H1G/HrJg/adHOpmWnnZrXPs7wdACaQVSJf+OrgnqRg== X-Received: by 2002:a17:90a:66c5:: with SMTP id z5mr5552101pjl.172.1617837613826; Wed, 07 Apr 2021 16:20:13 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:13 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 2/8] ionic: remove unnecessary compat ifdef Date: Wed, 7 Apr 2021 16:19:55 -0700 Message-Id: <20210407232001.16670-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We don't need to look for HAVE_HWSTAMP_TX_ONESTEP_P2P in the upstream kernel. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_phc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index 86ae5011ac9b..5d5da61284e7 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -18,10 +18,8 @@ static int ionic_hwstamp_tx_mode(int config_tx_type) return IONIC_TXSTAMP_ON; case HWTSTAMP_TX_ONESTEP_SYNC: return IONIC_TXSTAMP_ONESTEP_SYNC; -#ifdef HAVE_HWSTAMP_TX_ONESTEP_P2P case HWTSTAMP_TX_ONESTEP_P2P: return IONIC_TXSTAMP_ONESTEP_P2P; -#endif default: return -ERANGE; } From patchwork Wed Apr 7 23:19:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 417204 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, URIBL_BLOCKED, 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 819B8C433ED for ; Wed, 7 Apr 2021 23:20:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46A9F611EE for ; Wed, 7 Apr 2021 23:20:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbhDGXU3 (ORCPT ); Wed, 7 Apr 2021 19:20:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbhDGXU0 (ORCPT ); Wed, 7 Apr 2021 19:20:26 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78617C061760 for ; Wed, 7 Apr 2021 16:20:15 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id q6-20020a17090a4306b02900c42a012202so302297pjg.5 for ; Wed, 07 Apr 2021 16:20:15 -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=ZaJ/MDzWKqGaXCPj2y4btco5CAAlwR9jCavNfe6fR7w=; b=X2ZZbO2eo2TFbBmj8YXW1z8jcN8JA1Op6/nM1OE5gdNVWbuH+rGDqzVeGqJuxWkw6/ OyZBHpfPTOlybB/q0lyOCuzjPh8Wgvm6SAuflpywAIqFKso4JTXLh0ok6YzH3NbhYNDi q+lhAo7XQase4OmWcGemB97BPuG0pfjPQ+yDEwTyqbde1i9DmN6G7wmyCmfrPfYwkqok Tb4UfvCZB16+ROrlVTvf+5uPfmOzJxfnVuehcEhnXFH+giIywNIE/pEt5uyiXCrFsFQt kkyaWr5/q9wmGdzn39Hdez7X4/so0TJ8fgPUKsgjCz9omjjpz2tZAIpbQ/HUk0CHY/v3 sMPw== 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=ZaJ/MDzWKqGaXCPj2y4btco5CAAlwR9jCavNfe6fR7w=; b=JVtyJaUSiLYYINcIXDcf/MpzayxuzSxOCL0LRcMZ/GiUP/0nKMLfHTBbjFVGUvtOKj ekNQ5fiMe/Sg9vKONIBH5lOMDRIY0t3fs5iu8p1WJDGh+m65TdAm0exS0G+TwzACv+1N b6pBXww48NxpXr+ujC/lSWkYGhMseRy/nR2Pq1wduQK/dD7Nfl+cyA7XQwJZghQh2wB3 FFoHMp+lSS3hD5SJ1gMMpbf+sHS+amgI9D+AA/gaH4L3fQa7/TBBnTzxLkLf5kvvimq4 3fix/xBj6+OpwC1ick2wotBa76hc8k3q6wRlOM+MAXW8tSTxkJNCtEJpcd1ZWowZWMJJ I52Q== X-Gm-Message-State: AOAM530kpfMYbt/1o04c/koRPI3/CjTYWxTjV3W4KbF9JnUEgWv8946q WgdjS8k9udmls97CkqIxGgrEnWsPu7+Shw== X-Google-Smtp-Source: ABdhPJzAmZqGq1xtHg7GCPN03kjmyIpEIV7dCKkYfhEILbgHBZzRPD/l4JVdLNXW/zlnjoown2aJqw== X-Received: by 2002:a17:90b:1998:: with SMTP id mv24mr2645283pjb.67.1617837614777; Wed, 07 Apr 2021 16:20:14 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:14 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 3/8] ionic: check for valid tx_mode on SKBTX_HW_TSTAMP xmit Date: Wed, 7 Apr 2021 16:19:56 -0700 Message-Id: <20210407232001.16670-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Make sure the device is in a Tx offload mode before calling the hwstamp offload xmit. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 3478b0f2495f..765050a5f7a8 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -1233,7 +1233,7 @@ netdev_tx_t ionic_start_xmit(struct sk_buff *skb, struct net_device *netdev) } if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) - if (lif->hwstamp_txq) + if (lif->hwstamp_txq && lif->phc->ts_config_tx_mode) return ionic_start_hwstamp_xmit(skb, netdev); if (unlikely(queue_index >= lif->nxqs)) From patchwork Wed Apr 7 23:19:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 418042 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, URIBL_BLOCKED, 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 64C94C433B4 for ; Wed, 7 Apr 2021 23:20:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27CE2611EE for ; Wed, 7 Apr 2021 23:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbhDGXUc (ORCPT ); Wed, 7 Apr 2021 19:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbhDGXU0 (ORCPT ); Wed, 7 Apr 2021 19:20:26 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75E70C061761 for ; Wed, 7 Apr 2021 16:20:16 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id 7so52349plb.7 for ; Wed, 07 Apr 2021 16:20:16 -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=8Opzu0fD3XrLOvEra0X4fvAiqEviWMSZ9l4nBgHHiEs=; b=y8r9Hcw7cmspRn7jer2UxeGBO5NO3zbM9CnO1/hDcNkvsdFu0NH5DkaECKJl4Z3QUL o7XWr3bSGibC45fBngGH/nqkFeUaD0fR7HZZfMaBHgRgq8893gsBqsvTn/g8DNLLi2oh vHxIfpqqk/R40z0NXOTeMS3SOhzVZA+d+s8f8ssYDNl6poQDOHRIohUlvVL2vPjUYlA7 m4W6PTLBYnYoS2ogqTiEATGHItWfWm5vNuNoB1n8aUPuYGSomOrmzgh4roC1IRSI92Lf JBjcX/LGSO/tpwCBDLIhlB9vPrtHV7fHSrDEvmpE/ZfNJYhCyH+NQ82x/YOERScDB/zf 6Mgg== 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=8Opzu0fD3XrLOvEra0X4fvAiqEviWMSZ9l4nBgHHiEs=; b=IrdkxczdSnD8H3o4PYkYeTA6Czc4EWjdsZ2HCmoxSqkoL9c/CIohpxIQ2d8Psw/ta4 EGEt5KMT/thUwQ7lk73JVLo8WB6iitjExnDrBdJElhVG3LoC3P8ViFWTu/klDCnvSatQ 5GauXojffdh4UMV7xnMWGk0g8bNAsgNrtxSuH66rpAdI5YVXeH1XkjVPY4X1hyEGxzhs O78l8jg0V8YAAZSH1ibriyipowPuzhOhemyqdZOvL61XzQgq9xWZ4hMbdyp/hCgIqB9c 4WprTFyPQW7ZQLVLVsTjw0KfOjSYZW/YBjgIljUKUYmU2ufB+JDe2wdcubWxdsel6WUy UXNw== X-Gm-Message-State: AOAM5304T++VKb7HJJ/2nnPw0xbUkdcuib9L/aMscCOHOU4SS9m/HBgb YGxwBdrkgBqeAFKDMRPohI4GrPRWqdWtyA== X-Google-Smtp-Source: ABdhPJzZEeX/2NWIc/EhpQwaNd9SlGd7G1Kzf1GwRhdrWYtFOoJQW8H+oRjgPILi7T29do48ycrT/w== X-Received: by 2002:a17:90a:6e47:: with SMTP id s7mr5633955pjm.229.1617837615717; Wed, 07 Apr 2021 16:20:15 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:15 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 4/8] ionic: add SKBTX_IN_PROGRESS Date: Wed, 7 Apr 2021 16:19:57 -0700 Message-Id: <20210407232001.16670-5-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Set the SKBTX_IN_PROGRESS when offloading the Tx timestamp. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 765050a5f7a8..08934888575c 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -1203,6 +1203,7 @@ static netdev_tx_t ionic_start_hwstamp_xmit(struct sk_buff *skb, if (unlikely(!ionic_q_has_space(q, ndescs))) goto err_out_drop; + skb_shinfo(skb)->tx_flags |= SKBTX_HW_TSTAMP; if (skb_is_gso(skb)) err = ionic_tx_tso(q, skb); else From patchwork Wed Apr 7 23:19:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 417203 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, URIBL_BLOCKED, 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 05B54C433B4 for ; Wed, 7 Apr 2021 23:20:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCA03611EE for ; Wed, 7 Apr 2021 23:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229742AbhDGXUg (ORCPT ); Wed, 7 Apr 2021 19:20:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbhDGXU2 (ORCPT ); Wed, 7 Apr 2021 19:20:28 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 782FFC061760 for ; Wed, 7 Apr 2021 16:20:17 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id f2-20020a17090a4a82b02900c67bf8dc69so2129290pjh.1 for ; Wed, 07 Apr 2021 16:20:17 -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=LEdTzzJ3gkotOUEtB+vmtqn139+yQVRGV9zURMv9zhs=; b=qxrLrIL9zXYnAeKsvSBpMq2f9V0/ksLJydMVqEyb4FScBJFoac2WkJplt9FkvTBsmC 05rbRRJ7GH8lib2EmS40ehMmia7uoWVYoMUKZe6Nes00KmRDhzgDGGa2uKIUStULoGL4 d10mgjfJKPNzZ+9oCYUdIK2TKrZU9FhF/+s9t8z0JaqNqmOuavIUmWdg+lS8kHYbw53z 6sMWf6q8GgTUhMH19ftJ2B0TndmvbM28q0mixDSq3saXReXSWZreZXgFt5DQU4rJZvI6 jG6P2vbX3TJYsQKqiP11wOjBI4+qrmXW+fQLrhz/TMvAjx+kM4to4J481GdxQhStWDK4 4J4g== 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=LEdTzzJ3gkotOUEtB+vmtqn139+yQVRGV9zURMv9zhs=; b=YfnQAJidu4f7Jw7GtDNx52X+wZ30ecOBZ9vL0kPLRq7KBnbacWI+r9v2oKSSUUs12T lBHCntrxGHE18ECrYBaPvD7/IERNfVTgD1x1886kIOprURlr6uEP2uWggL55CcaT2uHs nm7pqvF2kItdU1S784l0fyCUwUMj1jEzfJ1+AZ0TkzoGjuHeHrCal6ec02StB7qeZXaE Kj5X7F2nqaXFyM75c81B5WOK22GzwL9v43UgtkC0k3Yo8ykXJ4x4wRHpZDmFCZ6GdqCi SapvRmTo20/h0MJI/ZBE6RjR6eKQgQyBgOi3zQ5GdcwxIGCZ5FRNktosnvCPEUm7S6uE T9aQ== X-Gm-Message-State: AOAM533s6uXuGVxxuMrM3Z9tXHIr6UK6NTJVv53eQTglUWzAtf+2CeKu vK0QSVh3sHEO2s7MLb/Cd1wMqpMii/mQFA== X-Google-Smtp-Source: ABdhPJyTk+jiteDhE4hG2hT+7v5qTn6FdvGvLyNLpdOagyJObzfBYediM4KEpG/cq2KZ7IdAT7R+1w== X-Received: by 2002:a17:90a:29a5:: with SMTP id h34mr1431811pjd.158.1617837616806; Wed, 07 Apr 2021 16:20:16 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:16 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 5/8] ionic: re-start ptp after queues up Date: Wed, 7 Apr 2021 16:19:58 -0700 Message-Id: <20210407232001.16670-6-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When returning after a firmware reset, re-start the PTP after we've restarted the general queues. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 4e22e50922cd..8cf6477b9899 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2987,14 +2987,14 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) goto err_txrx_free; } - /* restore the hardware timestamping queues */ - ionic_lif_hwstamp_set(lif, NULL); - clear_bit(IONIC_LIF_F_FW_RESET, lif->state); ionic_link_status_check_request(lif, CAN_SLEEP); netif_device_attach(lif->netdev); dev_info(ionic->dev, "FW Up: LIFs restarted\n"); + /* restore the hardware timestamping queues */ + ionic_lif_hwstamp_set(lif, NULL); + return; err_txrx_free: From patchwork Wed Apr 7 23:19:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 418041 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 C6198C433ED for ; Wed, 7 Apr 2021 23:20:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93609611C9 for ; Wed, 7 Apr 2021 23:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbhDGXUm (ORCPT ); Wed, 7 Apr 2021 19:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbhDGXU2 (ORCPT ); Wed, 7 Apr 2021 19:20:28 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9400FC061762 for ; Wed, 7 Apr 2021 16:20:18 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id i4so133055pjk.1 for ; Wed, 07 Apr 2021 16:20:18 -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=x/K6wJed0hbTMI3Iein/tFDJN8j04FfLnw2b+D/mh+E=; b=0OwH4cJzRymisNyO2E0OHyJ3pTHOmcbkl8tUTqW9QqtPAr6rDwaz2CnDOuTap+9a3C H8AWxC0GBVbdHA9aY/6N+KgJVQCk0Mk3lp5pwRU24o8wXoGtZPlOauJAjAiPydnrQ/k6 ThO9cG3DfrwcGS14BWps808/R7j1rMK3LfoxH8W4xxmEbl0CulSAw/WE3e4ljwKHorDP tZUvTgJbN7jGNsTkOP6O5F3Fdn7d5bjAWZvHPCKjGhoiXLX8Dr01VRezy+6O9rSuzpXf xbxil11iJB26HMRUgaCe964bL7iZtD3uJVVIWjf8FHo4nTXnsnx6wFE1KO4Yfmdi+OTe U1yA== 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=x/K6wJed0hbTMI3Iein/tFDJN8j04FfLnw2b+D/mh+E=; b=ptyWM1sgx+P6LG9p49cE0yuoyEAuYAvrfTfbhwkoz4y3o+rebKfPRxvWZAZi2W7J/a 4Tg7hhM9KopqQDrMV+skFKx0QEC2vhWbwcHggLEunov1Zw91r2bO+qQWlOfGd7huZ61B invthDIVXwmduhYLRc8ZKN8vYBIZ7OdJ4LDXD6d8d4gYlFA+gJN47TXrx9V8dy4SmVAG 8miKjoM5IGoqcmGR/zIHs39rX5SEC6axsDGvqcq1HzldRHiDiBiN5OFcirE1pw5fCu7r xjXslKKQMg6GBawAwQjk+SEpkfgfDYVO6/1Er137oY+sw6pjA5sKHnr04pO1Yuuxgpcu 6UEg== X-Gm-Message-State: AOAM530AoewOgFd+yqsA+ABjug1LHWbWK89JSMO1YszAbMunCLzRrJmq PpFRB2J6NoreNLZHLxr50CsfYtIhXMQH/w== X-Google-Smtp-Source: ABdhPJz6T0/VyVqrUS8+OcrqjKVU28F0kKlE+mikLDsXqNUrUJnX65lIRGHVJLHyU1kfaO1eQ+GPYQ== X-Received: by 2002:a17:90a:598e:: with SMTP id l14mr5323781pji.187.1617837617902; Wed, 07 Apr 2021 16:20:17 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:17 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 6/8] ionic: ignore EBUSY on queue start Date: Wed, 7 Apr 2021 16:19:59 -0700 Message-Id: <20210407232001.16670-7-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When starting the queues in the link-check, don't go into the BROKEN state if the return was EBUSY. 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 8cf6477b9899..eae774c0a2d9 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -135,7 +135,7 @@ static void ionic_link_status_check(struct ionic_lif *lif) if (netdev->flags & IFF_UP && netif_running(netdev)) { mutex_lock(&lif->queue_lock); err = ionic_start_queues(lif); - if (err) { + if (err && err != -EBUSY) { netdev_err(lif->netdev, "Failed to start queues: %d\n", err); set_bit(IONIC_LIF_F_BROKEN, lif->state); From patchwork Wed Apr 7 23:20:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 417202 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 35E47C433B4 for ; Wed, 7 Apr 2021 23:20:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EECE4611EE for ; Wed, 7 Apr 2021 23:20:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229796AbhDGXUt (ORCPT ); Wed, 7 Apr 2021 19:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbhDGXUa (ORCPT ); Wed, 7 Apr 2021 19:20:30 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBC9C061764 for ; Wed, 7 Apr 2021 16:20:19 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id nh5so117896pjb.5 for ; Wed, 07 Apr 2021 16:20:19 -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=unzw89ppabMkM4ijestM47VGkWVLzvnDd9OPBtJIspI=; b=ilENmXVAgs8ufGuIz9n04WwxLul8tOvFy+SS9FsklvixluEsn3ziNRb6Uf85139uon 3ZDpfaKpDYRorejTIkSza2LuC0wqUsHCptwWCeWWyRzj80nKuqAHCOhWncdGpW4xWu4K q7KYRtjwp5pPtPCk9uuiLIL0fIdpCl4g+3XCegfRd2rgU6IPqyNpAk2HTwwLMuw1Z/04 Faw9UXFstqYYF1ZMookmWY4/QcqP4WPbaqZsK/B3Gx9sU9NGZY9Tqs0nOf7IhesbQP3y dr4sQq+wrd2WKHMj4tw7nnQOit//Zv0O0rfelUweLo1h2X/k0HCzdV/JF+GxI6ROn7Ge kxGg== 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=unzw89ppabMkM4ijestM47VGkWVLzvnDd9OPBtJIspI=; b=EIkMnxLJj7PKo8mU4cFZNsQ8hkE+1r3nUiZ7D1ldJ2CLEQnV2hmmBSUZy8Ex6eA8f5 53b5gBRZxGEzdJJlvaiAs+SDrBQzODkkvCp1UvxbTq4Tzmw/p4fS9Oe1+a7EfYKB0OD4 yvGwVQ0K5DOOx4nHgZsTn1dzwEp23Yflj/ITk+tR2m4My6qqkv16J2VND6LvVbr57tu3 LPaWrd016XA4q+g8ozpmN7vUqR0Nb1a48q8O/9S+pA2IJEAxzelVP1G0uu73XVWg1v8p 1+vi5hdoyJWMC9hncwc/M2oen+np0J27JVwkZO+t0DUZVG135tFdCzqBpmI7xXI61zHA XBiQ== X-Gm-Message-State: AOAM530kJFPGy3MnhZ0HR6wO0C784UEdJsipzD97fpKnCfT/rapXsPXB mwT+xCLCNqEspJQM5rb15jUsRns7LXjlwA== X-Google-Smtp-Source: ABdhPJykZf4WqP58tqDbbJMdazbewlymAnxYO5GKrshiIIfIuvOkP1FHl8cmy1PHa4+PKRaDoJEP9g== X-Received: by 2002:a17:902:e84e:b029:e6:cbe6:34b5 with SMTP id t14-20020a170902e84eb02900e6cbe634b5mr5242089plg.42.1617837618859; Wed, 07 Apr 2021 16:20:18 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:18 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 7/8] ionic: add ts_config replay Date: Wed, 7 Apr 2021 16:20:00 -0700 Message-Id: <20210407232001.16670-8-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Split the call into ionic_lif_hwstamp_set() to have two separate interfaces, one from the ioctl() for changing the configuration and one for replaying the current configuration after a FW RESET. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 2 +- .../net/ethernet/pensando/ionic/ionic_lif.h | 6 ++ .../net/ethernet/pensando/ionic/ionic_phc.c | 84 ++++++++++++------- 3 files changed, 60 insertions(+), 32 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index eae774c0a2d9..af3a5368529c 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2993,7 +2993,7 @@ static void ionic_lif_handle_fw_up(struct ionic_lif *lif) dev_info(ionic->dev, "FW Up: LIFs restarted\n"); /* restore the hardware timestamping queues */ - ionic_lif_hwstamp_set(lif, NULL); + ionic_lif_hwstamp_replay(lif); return; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index ea3b086af179..346506f01715 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -302,6 +302,7 @@ int ionic_lif_identify(struct ionic *ionic, u8 lif_type, int ionic_lif_size(struct ionic *ionic); #if IS_ENABLED(CONFIG_PTP_1588_CLOCK) +int ionic_lif_hwstamp_replay(struct ionic_lif *lif); int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr); int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr); ktime_t ionic_lif_phc_ktime(struct ionic_lif *lif, u64 counter); @@ -310,6 +311,11 @@ void ionic_lif_unregister_phc(struct ionic_lif *lif); void ionic_lif_alloc_phc(struct ionic_lif *lif); void ionic_lif_free_phc(struct ionic_lif *lif); #else +static inline int ionic_lif_hwstamp_replay(struct ionic_lif *lif) +{ + return -EOPNOTSUPP; +} + static inline int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) { return -EOPNOTSUPP; diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index 5d5da61284e7..2bb749097d9e 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -64,10 +64,12 @@ static u64 ionic_hwstamp_rx_filt(int config_rx_filter) } } -int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) +static int ionic_lif_hwstamp_set_ts_config(struct ionic_lif *lif, + struct hwtstamp_config *new_ts) { struct ionic *ionic = lif->ionic; - struct hwtstamp_config config; + struct hwtstamp_config *config; + struct hwtstamp_config ts; int tx_mode = 0; u64 rx_filt = 0; int err, err2; @@ -77,18 +79,23 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) if (!lif->phc || !lif->phc->ptp) return -EOPNOTSUPP; - if (ifr) { - if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) - return -EFAULT; + if (new_ts) { + config = new_ts; } else { - /* if called with ifr == NULL, behave as if called with the - * current ts_config from the initial cleared state. + /* If called with new_ts == NULL, replay the previous request + * primarily for recovery after a FW_RESET. + * We saved the previous configuration request info, so copy + * the previous request for reference, clear the current state + * to match the device's reset state, and run with it. */ - memcpy(&config, &lif->phc->ts_config, sizeof(config)); - memset(&lif->phc->ts_config, 0, sizeof(config)); + config = &ts; + memcpy(config, &lif->phc->ts_config, sizeof(*config)); + memset(&lif->phc->ts_config, 0, sizeof(lif->phc->ts_config)); + lif->phc->ts_config_tx_mode = 0; + lif->phc->ts_config_rx_filt = 0; } - tx_mode = ionic_hwstamp_tx_mode(config.tx_type); + tx_mode = ionic_hwstamp_tx_mode(config->tx_type); if (tx_mode < 0) return tx_mode; @@ -96,18 +103,18 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) if ((ionic->ident.lif.eth.hwstamp_tx_modes & mask) != mask) return -ERANGE; - rx_filt = ionic_hwstamp_rx_filt(config.rx_filter); - rx_all = config.rx_filter != HWTSTAMP_FILTER_NONE && !rx_filt; + rx_filt = ionic_hwstamp_rx_filt(config->rx_filter); + rx_all = config->rx_filter != HWTSTAMP_FILTER_NONE && !rx_filt; mask = cpu_to_le64(rx_filt); if ((ionic->ident.lif.eth.hwstamp_rx_filters & mask) != mask) { rx_filt = 0; rx_all = true; - config.rx_filter = HWTSTAMP_FILTER_ALL; + config->rx_filter = HWTSTAMP_FILTER_ALL; } dev_dbg(ionic->dev, "config_rx_filter %d rx_filt %#llx rx_all %d\n", - config.rx_filter, rx_filt, rx_all); + config->rx_filter, rx_filt, rx_all); mutex_lock(&lif->phc->config_lock); @@ -141,15 +148,7 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) goto err_rxall; } - if (ifr) { - err = copy_to_user(ifr->ifr_data, &config, sizeof(config)); - if (err) { - err = -EFAULT; - goto err_final; - } - } - - memcpy(&lif->phc->ts_config, &config, sizeof(config)); + memcpy(&lif->phc->ts_config, config, sizeof(*config)); lif->phc->ts_config_rx_filt = rx_filt; lif->phc->ts_config_tx_mode = tx_mode; @@ -157,14 +156,6 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) return 0; -err_final: - if (rx_all != (lif->phc->ts_config.rx_filter == HWTSTAMP_FILTER_ALL)) { - rx_all = lif->phc->ts_config.rx_filter == HWTSTAMP_FILTER_ALL; - err2 = ionic_lif_config_hwstamp_rxq_all(lif, rx_all); - if (err2) - dev_err(ionic->dev, - "Failed to revert all-rxq timestamp config: %d\n", err2); - } err_rxall: if (rx_filt != lif->phc->ts_config_rx_filt) { rx_filt = lif->phc->ts_config_rx_filt; @@ -188,6 +179,37 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) return err; } +int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) +{ + struct hwtstamp_config config; + int err; + + if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) + return -EFAULT; + + err = ionic_lif_hwstamp_set_ts_config(lif, &config); + if (err) { + netdev_info(lif->netdev, "hwstamp set failed: %d\n", err); + return err; + } + + if (copy_to_user(ifr->ifr_data, &config, sizeof(config))) + return -EFAULT; + + return 0; +} + +int ionic_lif_hwstamp_replay(struct ionic_lif *lif) +{ + int err; + + err = ionic_lif_hwstamp_set_ts_config(lif, NULL); + if (err) + netdev_info(lif->netdev, "hwstamp replay failed: %d\n", err); + + return err; +} + int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr) { struct hwtstamp_config config; From patchwork Wed Apr 7 23:20:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 418040 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, URIBL_BLOCKED, 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 C318DC433ED for ; Wed, 7 Apr 2021 23:20:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B5F261245 for ; Wed, 7 Apr 2021 23:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbhDGXUw (ORCPT ); Wed, 7 Apr 2021 19:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbhDGXUc (ORCPT ); Wed, 7 Apr 2021 19:20:32 -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 78B65C061765 for ; Wed, 7 Apr 2021 16:20:20 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id p12so10175812pgj.10 for ; Wed, 07 Apr 2021 16:20:20 -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=Z5hTopG5DmQqhFIVp/3vpNpYzkhvWRurh+BVp+YoELI=; b=nYSmfM7g3wI5dEUls3t/qQHMIz1trYtpPshT2vxXGSr7PVsOtFLhmZFiMCRgiXV6ct b9QttrW6uVS++Tzn42ytC3IDq7gA/cDJ17muzS3R+dkipJQFedv61wry8MOczejT+Xvp EMNHXyTr/duexNptznrd513y92z8JzZJzXzyDvu8GTSAJja6KbYuSxufesRrYPJHAHcc 1o9GE5O2NVclh5aaVxBRtqKERrmzRWeNPLLQsHtB76uIc4ISib4Z/uIuYNtOjQL13nyk mdw8opgHgSS22C0NjzwXCyjihNxEEwn9Zo+l9BJP9+ZrrYCM1IAyQiyEoFmi1ykNWEeE JPWQ== 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=Z5hTopG5DmQqhFIVp/3vpNpYzkhvWRurh+BVp+YoELI=; b=T/8R82XHDqCYCRXH4ULWjgEG5WltoR85mIuDz2cTu99Ogef6PrAgZ30E1qUZtEX3k2 T9ZhPhVLNSz8ov/pALE3DHccPfrFref8rIq6x4+ssd0ti0AGV3o8XAbluqmYjUvv78XZ JtjpDH2pA31V9r2ykfecdpBMrwcdeICCMtLYHP9jY6UdYasjYQb0O5rwAF+uv09cMuiJ Rh5gdqj+oSklFxFnCbGwJSff73KitjehM4PbYnTO2tTKwdkCVVpxwFIuc06gtyNcCcox Qx+UJmaDfeK22krfmrcCYOOfpMcykQyCff2t32phRT16c6UkJc3PhxTHRE1zzCu2F4nQ HZlA== X-Gm-Message-State: AOAM532g7v3pecKFrt1bPBGQBvVfbSdEZA2Fljjeak36WglY07XiIqVl mbY+ruBu7NQOsZGQzDP7ZfIWCyvijmJkOg== X-Google-Smtp-Source: ABdhPJxXg1BTWT5A1b0ZWfc97T3fsTG0TVU9JSo9BJ1JDc4rRkJhfkEOcwDOIA1L+dKkH5UMHh3eFg== X-Received: by 2002:a63:b91b:: with SMTP id z27mr5393267pge.231.1617837619789; Wed, 07 Apr 2021 16:20:19 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id g3sm21422171pfk.186.2021.04.07.16.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Apr 2021 16:20:19 -0700 (PDT) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, richardcochran@gmail.com Cc: drivers@pensando.io, Shannon Nelson Subject: [PATCH net-next 8/8] ionic: extend ts_config set locking Date: Wed, 7 Apr 2021 16:20:01 -0700 Message-Id: <20210407232001.16670-9-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210407232001.16670-1-snelson@pensando.io> References: <20210407232001.16670-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Make sure the configuration is locked before operating on it for the replay. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_phc.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index 2bb749097d9e..177dbf89affd 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -79,6 +79,8 @@ static int ionic_lif_hwstamp_set_ts_config(struct ionic_lif *lif, if (!lif->phc || !lif->phc->ptp) return -EOPNOTSUPP; + mutex_lock(&lif->phc->config_lock); + if (new_ts) { config = new_ts; } else { @@ -96,12 +98,16 @@ static int ionic_lif_hwstamp_set_ts_config(struct ionic_lif *lif, } tx_mode = ionic_hwstamp_tx_mode(config->tx_type); - if (tx_mode < 0) - return tx_mode; + if (tx_mode < 0) { + err = tx_mode; + goto err_queues; + } mask = cpu_to_le64(BIT_ULL(tx_mode)); - if ((ionic->ident.lif.eth.hwstamp_tx_modes & mask) != mask) - return -ERANGE; + if ((ionic->ident.lif.eth.hwstamp_tx_modes & mask) != mask) { + err = -ERANGE; + goto err_queues; + } rx_filt = ionic_hwstamp_rx_filt(config->rx_filter); rx_all = config->rx_filter != HWTSTAMP_FILTER_NONE && !rx_filt; @@ -116,8 +122,6 @@ static int ionic_lif_hwstamp_set_ts_config(struct ionic_lif *lif, dev_dbg(ionic->dev, "config_rx_filter %d rx_filt %#llx rx_all %d\n", config->rx_filter, rx_filt, rx_all); - mutex_lock(&lif->phc->config_lock); - if (tx_mode) { err = ionic_lif_create_hwstamp_txq(lif); if (err)