From patchwork Fri Aug 27 18:55: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: 503988 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 6954BC4320A for ; Fri, 27 Aug 2021 18:55:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 448E460FE6 for ; Fri, 27 Aug 2021 18:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbhH0S4N (ORCPT ); Fri, 27 Aug 2021 14:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbhH0S4N (ORCPT ); Fri, 27 Aug 2021 14:56:13 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0154DC061757 for ; Fri, 27 Aug 2021 11:55:24 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id 7so6420590pfl.10 for ; Fri, 27 Aug 2021 11:55:23 -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=qDj+peibpF6aWHTuweOTmL1ikJ2XXD7k5JRDbYtvR+c=; b=RJfuwMzNaHoYFucd2um+N7RIXTZQq7J2VH1WYGyRXTfkRYUMhewKtBmKb+RRgZMDpJ obVOcvjwPuFahcZwxqiF73Jl7Du0YWu9cVqullhwgegSmv+tInGNHaA4xHoNN6sD1FF8 4vEMDc66AAkMwpjewx6QVnVfLx0rwqFa3f/3cK5yy3WTA3IZ+akMYzB1IjxD7pfpuGvT 0AJn8L+gnWXci40M41/m5BWluoVnHYftD1g/tos0GekiL9GtyPWqftMRrHB7vKGp4vkt bWuV5M5rkZhsI5nJzPdzrX+HWAwrLKVFkOOt4WzsQ2U6HUSc0wRMlX/7esi8A4vKcOHs KF4g== 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=qDj+peibpF6aWHTuweOTmL1ikJ2XXD7k5JRDbYtvR+c=; b=m3eIkT0dxnfs7OYILYbHXTKDNoYP54rJHZSGpcouwinPWZN69M50ytxIg44EX1TM2k eQaTRV2ehZNT+4qgmVdMVN9KoAZxPoPtEotgesii5Jyc67CN91RkV8KSzLD/pMMAOmzh 221eWrFebX4WDqFV/W3VZ9ChMtsz4Np2slnOu76OezOi/reo+bQAmTBIGp5qmLYKusfJ Q8nqWa0xbNaZqzEa5RTjvnUeJOhXDTgrILZCeanW/9fclOMsh7oQACCR72q6pUP9pBh0 BLuemZ0tiuFoGFDEcQJj3CRn0tmQasq9bfOPh5g+vqO8JmEXz3pJwZnZgFYh83fSaGb2 vx+w== X-Gm-Message-State: AOAM53027sWaVIVS7InvAk3ylhQawMdfNJdnXxoYCbV9lSG3hfuugAAt AU7R44gMgZ3xTR3VAD9oeAwR7w== X-Google-Smtp-Source: ABdhPJy6wKXe42UwyoJuyYvZdm+J0IzQ57O5dBivH+w5XHHSzHqQKSssNgVJ2Hnq/ioiD3iaFMRguw== X-Received: by 2002:aa7:8e4e:0:b029:3e0:28db:d73b with SMTP id d14-20020aa78e4e0000b02903e028dbd73bmr10371477pfr.8.1630090523566; Fri, 27 Aug 2021 11:55:23 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id f10sm7565975pgm.77.2021.08.27.11.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 11:55:22 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, jtoppins@redhat.com, Shannon Nelson Subject: [PATCH net-next 1/6] ionic: fire watchdog again after fw_down Date: Fri, 27 Aug 2021 11:55:07 -0700 Message-Id: <20210827185512.50206-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210827185512.50206-1-snelson@pensando.io> References: <20210827185512.50206-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In some cases of fw_down it was called because there was a fw_generation change, and the firmware is already back up. In order to keep the down time to a minimum, don't wait for the next watchdog polling cycle, fire another watchdog off as soon as we can - an out-of-cycle check won't hurt, and may well speed up the recovery. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index e494d6b909c7..df0137044c03 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -93,10 +93,17 @@ static void ionic_lif_deferred_work(struct work_struct *work) ionic_link_status_check(lif); break; case IONIC_DW_TYPE_LIF_RESET: - if (w->fw_status) + if (w->fw_status) { ionic_lif_handle_fw_up(lif); - else + } else { ionic_lif_handle_fw_down(lif); + + /* Fire off another watchdog to see + * if the FW is already back rather than + * waiting another whole cycle + */ + mod_timer(&lif->ionic->watchdog_timer, jiffies + 1); + } break; default: break; From patchwork Fri Aug 27 18:55: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: 503653 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 AAAC5C432BE for ; Fri, 27 Aug 2021 18:55:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C7A760FE7 for ; Fri, 27 Aug 2021 18:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230511AbhH0S4S (ORCPT ); Fri, 27 Aug 2021 14:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230486AbhH0S4O (ORCPT ); Fri, 27 Aug 2021 14:56:14 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3DA4C061796 for ; Fri, 27 Aug 2021 11:55:24 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id g184so6679631pgc.6 for ; Fri, 27 Aug 2021 11:55:24 -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=nySngVUTww6UW7BGlhAtc2/QKSILuAYZFWa6WE0dRx0=; b=xuheY/IOcr9hL6C1wQMLB5BZwatOAM/30YysX8482n7vG2/f9vpMmVBrM307MtHtjt QJGkz/20dPFMKt66j9MTeWTDD0eYWE3pDc8J/7zEFUWWQTpwiHq2xg8Ro+PWB4MzAdQX UX4CpRHaF1IykesUsQ+fA62jhLntYpvNSsMZQC4VXyMVjSUizUmp6hsDXZ8B7pwEli9T 8ObVvJ99T8VGTtYWUUGlo/zfB4pVAi5/3ZbZr2qPFz5r6k9claW+4FoYRXv2v9r6Y9gR lV9J+LamlUjViA5NubF+fbmyRrxM0aJwv3tm16w4k69tLbW3YzyrKYZyjSU0qFu2GZ4c 7Pmg== 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=nySngVUTww6UW7BGlhAtc2/QKSILuAYZFWa6WE0dRx0=; b=BctFkabBYPuThCWsiHT3QSNFxgLCHC4Xp01IH/NELAtzw+X1PxIUmmypH+C1hStC1m xIWsHlJx1HeQMZ+adNull/kvohhFwGKAqm0irqfstOriMlHMMWwOMcegIkDZmOEP741c +2NVueWbUhkcOL+yIYh4o9BdHYxXcq4gzrhlObnJ1OqSC7ZJx+4ALyUX9sBinqM9mZvJ OFQ+C2na30TYRWGiZwFW+iAeJAVyWoQYoCMmp+BN2gD1CiTz09oprAnH1FjWbExhmfuv 7DCP4C8bcMA+vYLM97wzULblsG7y0G6ciqwxdhDgb33bFph4arw9vSoGYZ4UpM+u+oYS OpgA== X-Gm-Message-State: AOAM531rqG99+XFeC1bBdRj5IIyPpnF20V7CcQRhTKq8IWtGyrag2Pug +QhSzXZm2GKV/B3xlK6Z1ErY9ozy2e0JTow8 X-Google-Smtp-Source: ABdhPJzSrT7334ZbGcwW/Xnf0yZyhJgyOTUakO99UYInvfi+5skY9l/pJWSsxq+kchVnbqAhikWY0Q== X-Received: by 2002:a62:cf86:0:b029:3e0:7cef:9e03 with SMTP id b128-20020a62cf860000b02903e07cef9e03mr10704085pfg.0.1630090524565; Fri, 27 Aug 2021 11:55:24 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id f10sm7565975pgm.77.2021.08.27.11.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 11:55:24 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, jtoppins@redhat.com, Shannon Nelson Subject: [PATCH net-next 2/6] ionic: squelch unnecessary fw halted message Date: Fri, 27 Aug 2021 11:55:08 -0700 Message-Id: <20210827185512.50206-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210827185512.50206-1-snelson@pensando.io> References: <20210827185512.50206-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since the heartbeat check will already have complained about the firmware status, don't bother complaining about the DEVCMD failing. We'll keep the print message but demote it to a debug messages so that we normally no longer see it. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 5f1e5b6e85c3..6f07bf509efe 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -375,8 +375,8 @@ int ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds) * heartbeat check but is still alive and will process this * request, so don't clean the dev_cmd in this case. */ - dev_warn(ionic->dev, "DEVCMD %s (%d) failed - FW halted\n", - ionic_opcode_to_str(opcode), opcode); + dev_dbg(ionic->dev, "DEVCMD %s (%d) failed - FW halted\n", + ionic_opcode_to_str(opcode), opcode); return -ENXIO; } From patchwork Fri Aug 27 18:55: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: 503987 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 33BAEC4320E for ; Fri, 27 Aug 2021 18:55:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17F9460E73 for ; Fri, 27 Aug 2021 18:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230160AbhH0S4T (ORCPT ); Fri, 27 Aug 2021 14:56:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbhH0S4O (ORCPT ); Fri, 27 Aug 2021 14:56:14 -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 DEBDAC061757 for ; Fri, 27 Aug 2021 11:55:25 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so5465861pjq.1 for ; Fri, 27 Aug 2021 11:55:25 -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=Cp7i7K6OSDhMAGdsX8KhMSF7bSObvG7DbX9s/VitGZU=; b=bnoGDWQYSM1894pNm5b5IAjSp1cHyvywunI+x6p1RKjiNsMArldtesI3Tafwilftr8 E9Hu/c5B86nYiYCCsCf+iXiaiEKajiDmtYC431H3Ur3vjr6NvxC4jXyKflu8TfoBSOgT HZYv6Q56D6ro1sVUb3kfC6V5Oh5Izw37nw9lXREMgTlnvFkb2RWoQU+1yQI9wzLGCYz9 2+RjvK039YGRjUx5vDZnaRizN1wcs1+kovpU8EdgaL6JrqcDebBoby5o+AFB9XXsyw06 Cu++HOXoCpF8MhC5nw7+rGIW71YNvifrhqtm1D1kJpJuWPUu4+Opxt22OXbTXpAmC3y/ OHhQ== 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=Cp7i7K6OSDhMAGdsX8KhMSF7bSObvG7DbX9s/VitGZU=; b=UDq1QpKtuxJgw8nHLS6lIvJUxTmjwpxgkuojxyU9+2cr2P2gRQxk9D17ymVsWn20Bg tJhfJa113CXpRaTxhKUzxeJPQNL0qwLpkgTdSw/6galBWhqal9dzQ1+JIuPHKLVUPVe2 LDLUZ2C/HitOJMAJzwjf79DOXXZplhfgQ9RACQla3MpSmZnwEWB8MMTTyciqghLv7jLo Y5wioLk5Gk14msHKDFehhkWeCqWBThXAcFCY/q89r4qNnKFXQN7pGLM19iQB1s8spMwD N9cyIcRoMB5X+f0nAEdu77BjpwM8YInpl3Pdib+yIVOoluX0csQRQ5KYd0z8roSB+Ypv /Few== X-Gm-Message-State: AOAM530C4pJyLHP+oRLtoOs5XXLF7jI+xIMJOQtXX1FzvLJPvqE+YObs v3sA7QEpYygEh2FTnQlgOCzO7A== X-Google-Smtp-Source: ABdhPJwdSbgVChWCYAXLDoebNBNYCxlwuFRlOBjDQaFROvgIWkITiaP+24D++NAruxjGmNEpuRRGSQ== X-Received: by 2002:a17:90a:5d16:: with SMTP id s22mr25229741pji.69.1630090525515; Fri, 27 Aug 2021 11:55:25 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id f10sm7565975pgm.77.2021.08.27.11.55.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 11:55:25 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, jtoppins@redhat.com, Shannon Nelson Subject: [PATCH net-next 3/6] ionic: fill mac addr earlier in add_addr Date: Fri, 27 Aug 2021 11:55:09 -0700 Message-Id: <20210827185512.50206-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210827185512.50206-1-snelson@pensando.io> References: <20210827185512.50206-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Make sure the ctx struct has the new mac address before any save operations happen. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index df0137044c03..d69c80c3eaa2 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1268,6 +1268,8 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) struct ionic_rx_filter *f; int err = 0; + memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN); + spin_lock_bh(&lif->rx_filters.lock); f = ionic_rx_filter_by_addr(lif, addr); if (f) { @@ -1281,7 +1283,6 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) f->state = IONIC_FILTER_STATE_SYNCED; } else { /* save as SYNCED to catch any DEL requests while processing */ - memcpy(ctx.cmd.rx_filter_add.mac.addr, addr, ETH_ALEN); err = ionic_rx_filter_save(lif, 0, IONIC_RXQ_INDEX_ANY, 0, &ctx, IONIC_FILTER_STATE_SYNCED); } From patchwork Fri Aug 27 18:55: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: 503652 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 74346C432BE for ; Fri, 27 Aug 2021 18:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C01260E73 for ; Fri, 27 Aug 2021 18:55:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231138AbhH0S4Z (ORCPT ); Fri, 27 Aug 2021 14:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbhH0S4Q (ORCPT ); Fri, 27 Aug 2021 14:56:16 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C2CC0613CF for ; Fri, 27 Aug 2021 11:55:27 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id u6so5810881pfi.0 for ; Fri, 27 Aug 2021 11:55:27 -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=pJ8GFZx7XOL6yF08w/X1W+vpgdS0xQQNLQv88RdbUj0=; b=kGNm3YMGR/erX0lA8oLgJHrqwRHUiFZyqAteRD1SmbdKQKaU/e8JcZtZfHCh0Lbl7Q PEQ51isGpyh6By24FEvId6fFLl3dgln4v9ZC0N5azJzwDJvvj0eX9U34aMFYoIBg5iAQ Jv48KXuuo5UH76V8ZD13rr6698ckOKWJOb8gFcUYNfJt5aDIhGkeW5IGe9CmJvfVR4Jf llFfRBzqCQb3QRKBJGR56LDT6YxlZwthPFGCM2hTWzkGmpV4y9yF7ykVlnakIx0M1S1J SgeeB5N/+7jiuAtn+E4kEGiVe+oeLCryuziXhipSoe3AXJR28BhtBiUcBhNqS2F6LiqA EQ9Q== 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=pJ8GFZx7XOL6yF08w/X1W+vpgdS0xQQNLQv88RdbUj0=; b=XO83pvCPPQRltpCh2WdUOCkl5E1mm+Owewl5AuElTp1YAHTNb+9drkv9V3nRS2Uvzq 7i9i2rnBMMbpIqkDtDKK2sGaygTQ0tA7ThjJJDGdgz+q0lfdlNGRwQt62cMXNgNPISmq N0cHHjHSmboDX9rPl/M4oIFl18EDipfhYW+MD8BoBxn00/SU0OcUYMGKnz+AA5MlIpx+ UjgPkQyzaAOK/vSIkLzqaJ2pF3NmUMnVsNDT7eTg9jf3HWz/CkKaBY/0rFjhZKVh8E/b c8ds4QZF2QCf+e8tX0Q5n+XiGfS3cHjBiD3K3Dx3qmpBsBtJuJjRM7/DHO/BJpTYumYO 0fqA== X-Gm-Message-State: AOAM530TgwBiOx8vC7k23x0AagxQzcf/EHiXdbCNXDriQzLlrXiKjGU7 mwn5hDVC8vJu6IkHl4y7Au18Rw== X-Google-Smtp-Source: ABdhPJx0L03x8XVAj5387Tp0GREX+wC+U7eo8cJFjYPuKKzMiG2vrCQ9ga7wCW13Gh7icb/nif/Fpw== X-Received: by 2002:a65:62d5:: with SMTP id m21mr8988105pgv.124.1630090526942; Fri, 27 Aug 2021 11:55:26 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id f10sm7565975pgm.77.2021.08.27.11.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 11:55:26 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, jtoppins@redhat.com, Shannon Nelson Subject: [PATCH net-next 4/6] ionic: add queue lock around open and stop Date: Fri, 27 Aug 2021 11:55:10 -0700 Message-Id: <20210827185512.50206-5-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210827185512.50206-1-snelson@pensando.io> References: <20210827185512.50206-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add the queue configuration lock to ionic_open() and ionic_stop() so that they don't collide with other in parallel queue configuration actions such as MTU changes as can be demonstrated with a tight loop of ifup/change-mtu/ifdown. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index d69c80c3eaa2..1d31b9385849 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2233,9 +2233,11 @@ static int ionic_open(struct net_device *netdev) if (test_and_clear_bit(IONIC_LIF_F_BROKEN, lif->state)) netdev_info(netdev, "clearing broken state\n"); + mutex_lock(&lif->queue_lock); + err = ionic_txrx_alloc(lif); if (err) - return err; + goto err_unlock; err = ionic_txrx_init(lif); if (err) @@ -2256,12 +2258,15 @@ static int ionic_open(struct net_device *netdev) goto err_txrx_deinit; } + mutex_unlock(&lif->queue_lock); return 0; err_txrx_deinit: ionic_txrx_deinit(lif); err_txrx_free: ionic_txrx_free(lif); +err_unlock: + mutex_unlock(&lif->queue_lock); return err; } @@ -2281,9 +2286,11 @@ static int ionic_stop(struct net_device *netdev) if (test_bit(IONIC_LIF_F_FW_RESET, lif->state)) return 0; + mutex_lock(&lif->queue_lock); ionic_stop_queues(lif); ionic_txrx_deinit(lif); ionic_txrx_free(lif); + mutex_unlock(&lif->queue_lock); return 0; } From patchwork Fri Aug 27 18:55:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 503986 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 70784C43214 for ; Fri, 27 Aug 2021 18:55:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5589660EFF for ; Fri, 27 Aug 2021 18:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbhH0S40 (ORCPT ); Fri, 27 Aug 2021 14:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230493AbhH0S4R (ORCPT ); Fri, 27 Aug 2021 14:56:17 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BAFC0613D9 for ; Fri, 27 Aug 2021 11:55:28 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id y11so6414222pfl.13 for ; Fri, 27 Aug 2021 11:55:28 -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=4elQmY/V4Npq+q1KxpteukQ6ePQZJcGD7cE3YtVPLGE=; b=ZAWJTHkc+Hqq8fVdr1gLV/mmkFI1+rNMGnGYFa92b+xQikB9i3OmnAY7F/azwoqWUu etSuSzqJA4O9ssTFlxIpY49s/jtadEiYBTlAdfroBLg/ueVVwfEl9xHyu/v6val9Acpe fTw3FIGEt7PQTbsCfpEodghyVIwxIy6GYQArTiPCD7tObUjY7VEQKSABIn3TTFaQ0BuS EDmANwiF88qKlptXq2mzEne2MBDAVXiObqw4l5F6Atfu843rkpbpkOgux+Fk2w2tWB2H eyZfvNEaOr70SZkD79NWmlSpgLJX/ZIEiVBuJU5Jwf94SWdEgvR2VZr3X9wDxTSIi5VT BQFQ== 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=4elQmY/V4Npq+q1KxpteukQ6ePQZJcGD7cE3YtVPLGE=; b=sxOaFs6CKOJxq+pKnRLSafIFBIowNgqDWJzs7AgjEUAzNgENqkA2TC7irSHwPyuiD2 e94lquaSQM6u8QsR4KtW/HpRVvISG33Bi1t5/TB4KSWLtKe2wWhy6xKCd14hCMsw7OFi NslCw2bAx5lf/4L5SLniYJJCnWCKmY04O+N6skYFpMmEjNIaVbgAy5DHwewxBX99nJ0u aRhkBiBKYby+UC5wTbXi6zPCCk+MoUpOBb4dSXCoiGuyKd6vsVmoK9jxQKuY/fLtrlwT SjgOPNzHCzcb06hRytt7hfx/c0cjUPNjj2OJnwvhQqlD75y+JZfD6yUFo772eHmuyA+3 tdVw== X-Gm-Message-State: AOAM530JMNF+2SNyiOyX6Dxaqc5fq8cF79QWtY7Ol8SZj2gaB8TFzzVf 6eEhtlyq3OxZJltkkxOTJ74UvA== X-Google-Smtp-Source: ABdhPJxCUaenIjQVKqug+64edlBW4SjkN7OH0C7CNvlXx/lMlDEZ1pM/1U4GUk4T6jb4gXNU9put7A== X-Received: by 2002:a65:5acc:: with SMTP id d12mr9223274pgt.68.1630090527918; Fri, 27 Aug 2021 11:55:27 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id f10sm7565975pgm.77.2021.08.27.11.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 11:55:27 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, jtoppins@redhat.com, Shannon Nelson Subject: [PATCH net-next 5/6] ionic: pull hwstamp queue_lock up a level Date: Fri, 27 Aug 2021 11:55:11 -0700 Message-Id: <20210827185512.50206-6-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210827185512.50206-1-snelson@pensando.io> References: <20210827185512.50206-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Move the hwstamp configuration use of queue_lock up a level to simplify use and error handling. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 16 ++-------------- drivers/net/ethernet/pensando/ionic/ionic_phc.c | 4 ++++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 1d31b9385849..96e7e289b7d3 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -849,10 +849,8 @@ int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif) u64 features; int err; - mutex_lock(&lif->queue_lock); - if (lif->hwstamp_txq) - goto out; + return 0; features = IONIC_Q_F_2X_CQ_DESC | IONIC_TXQ_F_HWSTAMP; @@ -894,9 +892,6 @@ int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif) } } -out: - mutex_unlock(&lif->queue_lock); - return 0; err_qcq_enable: @@ -907,7 +902,6 @@ int ionic_lif_create_hwstamp_txq(struct ionic_lif *lif) ionic_qcq_free(lif, txq); devm_kfree(lif->ionic->dev, txq); err_qcq_alloc: - mutex_unlock(&lif->queue_lock); return err; } @@ -919,10 +913,8 @@ int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif) u64 features; int err; - mutex_lock(&lif->queue_lock); - if (lif->hwstamp_rxq) - goto out; + return 0; features = IONIC_Q_F_2X_CQ_DESC | IONIC_RXQ_F_HWSTAMP; @@ -960,9 +952,6 @@ int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif) } } -out: - mutex_unlock(&lif->queue_lock); - return 0; err_qcq_enable: @@ -973,7 +962,6 @@ int ionic_lif_create_hwstamp_rxq(struct ionic_lif *lif) ionic_qcq_free(lif, rxq); devm_kfree(lif->ionic->dev, rxq); err_qcq_alloc: - mutex_unlock(&lif->queue_lock); return err; } diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index afc45da399d4..c39790a6c436 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -194,7 +194,9 @@ int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) return -EFAULT; + mutex_lock(&lif->queue_lock); err = ionic_lif_hwstamp_set_ts_config(lif, &config); + mutex_unlock(&lif->queue_lock); if (err) { netdev_info(lif->netdev, "hwstamp set failed: %d\n", err); return err; @@ -213,7 +215,9 @@ void ionic_lif_hwstamp_replay(struct ionic_lif *lif) if (!lif->phc || !lif->phc->ptp) return; + mutex_lock(&lif->queue_lock); err = ionic_lif_hwstamp_set_ts_config(lif, NULL); + mutex_unlock(&lif->queue_lock); if (err) netdev_info(lif->netdev, "hwstamp replay failed: %d\n", err); } From patchwork Fri Aug 27 18:55:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 503651 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 5465FC43216 for ; Fri, 27 Aug 2021 18:55:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3D2A860EFF for ; Fri, 27 Aug 2021 18:55:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231130AbhH0S41 (ORCPT ); Fri, 27 Aug 2021 14:56:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbhH0S4S (ORCPT ); Fri, 27 Aug 2021 14:56:18 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F873C061757 for ; Fri, 27 Aug 2021 11:55:29 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id e1so4489983plt.11 for ; Fri, 27 Aug 2021 11:55:29 -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=9l2wt6OwJGcugjZsy/yl2WnDB+W5MZOOMtJkPLOAVNY=; b=UBKwNIJU709NSLtbx+MGb3wwZO5CxGg5+2u9Yei02VeOU0k/iK9yW6iCDjOfTG7eLn DUKStBF7DZcx3B+XqEzyGrtILzkU6lQEJnVZ27g74U0QA4lUGBbolCLa/v228FLQaHVF ltETxlMMsttroqU6v8Yk0RpFGfuPfdMxG87vrnd52zZW+0MsxRz1d7cto/BFw2h7If4R hfRjt0ZUEDIIi2uDiewAcazi551NaIVSIgPvVclRe/IUMpvnl6r/fsSI3JnKQsGhHIFq 5qUbBi5VRuD9gu2XiJWD9SsDHMeLSvPa4fpubVRcJpdi8bAH8aF4c2GaR0aTmFxZykx1 izAw== 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=9l2wt6OwJGcugjZsy/yl2WnDB+W5MZOOMtJkPLOAVNY=; b=AGm12dEBvW25ZCMyrgnYrzN6T7vX4yb/1ZP5ARbST00dCQTdNShC6v+MLgZl5wSUBt l2eDgk07Zc98saz9gL67mdp184HQGdeNmkamSBf6Ff0HLFfHZ/DSlovLc9RsLSvcxvF/ 5m7VuaJVIRzfQbTKXUIjpDUHfJ00SaRJL9GGZSXcxuUJD7lkcWRRXKcgjCqFzAP2qhHA 9b3kE0ZxoU8thVg9cJYQD+iQZQ7xO1pqK2oPCr14n7Vp2vqqaGpK6CR7jJjMIck+VveK pYbd4Dd27AYrdtzhQ8MqPfVxntNRNY9tfuMBUAqi5IXVoFvIyxnv+S1RUPvMjtzvFIMg P6aw== X-Gm-Message-State: AOAM531f9cBKOPi7mnCe9IkZn8LRyYS7bMm91c/MSDrzdSyoYVT60PgH brSWrSGJdqsEavZfj2SSFrEFkA== X-Google-Smtp-Source: ABdhPJwhHIbTyQrPWk2VyhpAwvVEke+B3xF0F6CGixcmDwIGaNIxXvc9KfH4+5cMCOwOd932a+XXFg== X-Received: by 2002:a17:902:ea89:b0:134:7eb7:b4d7 with SMTP id x9-20020a170902ea8900b001347eb7b4d7mr9921470plb.43.1630090529087; Fri, 27 Aug 2021 11:55:29 -0700 (PDT) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id f10sm7565975pgm.77.2021.08.27.11.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 11:55:28 -0700 (PDT) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org Cc: drivers@pensando.io, jtoppins@redhat.com, Shannon Nelson , Allen Hubbe Subject: [PATCH net-next 6/6] ionic: recreate hwstamp queues on ifup Date: Fri, 27 Aug 2021 11:55:12 -0700 Message-Id: <20210827185512.50206-7-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210827185512.50206-1-snelson@pensando.io> References: <20210827185512.50206-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The queues can be freed in ionic_close(). They need to be recreated after ionic_open(). It doesn't need to replay the whole config. It only needs to create the timestamping queues again. Signed-off-by: Allen Hubbe Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 6 +++++ .../net/ethernet/pensando/ionic/ionic_lif.h | 2 ++ .../net/ethernet/pensando/ionic/ionic_phc.c | 24 +++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 96e7e289b7d3..23c9e196a784 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2246,7 +2246,13 @@ static int ionic_open(struct net_device *netdev) goto err_txrx_deinit; } + /* If hardware timestamping is enabled, but the queues were freed by + * ionic_stop, those need to be reallocated and initialized, too. + */ + ionic_lif_hwstamp_recreate_queues(lif); + mutex_unlock(&lif->queue_lock); + return 0; err_txrx_deinit: diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index cad193d358e8..4915184f3efb 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -306,6 +306,7 @@ int ionic_lif_size(struct ionic *ionic); #if IS_ENABLED(CONFIG_PTP_1588_CLOCK) void ionic_lif_hwstamp_replay(struct ionic_lif *lif); +void ionic_lif_hwstamp_recreate_queues(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); @@ -315,6 +316,7 @@ void ionic_lif_alloc_phc(struct ionic_lif *lif); void ionic_lif_free_phc(struct ionic_lif *lif); #else static inline void ionic_lif_hwstamp_replay(struct ionic_lif *lif) {} +static inline void ionic_lif_hwstamp_recreate_queues(struct ionic_lif *lif) {} static inline int ionic_lif_hwstamp_set(struct ionic_lif *lif, struct ifreq *ifr) { diff --git a/drivers/net/ethernet/pensando/ionic/ionic_phc.c b/drivers/net/ethernet/pensando/ionic/ionic_phc.c index c39790a6c436..eed2db69d708 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_phc.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_phc.c @@ -222,6 +222,30 @@ void ionic_lif_hwstamp_replay(struct ionic_lif *lif) netdev_info(lif->netdev, "hwstamp replay failed: %d\n", err); } +void ionic_lif_hwstamp_recreate_queues(struct ionic_lif *lif) +{ + int err; + + if (!lif->phc || !lif->phc->ptp) + return; + + mutex_lock(&lif->phc->config_lock); + + if (lif->phc->ts_config_tx_mode) { + err = ionic_lif_create_hwstamp_txq(lif); + if (err) + netdev_info(lif->netdev, "hwstamp recreate txq failed: %d\n", err); + } + + if (lif->phc->ts_config_rx_filt) { + err = ionic_lif_create_hwstamp_rxq(lif); + if (err) + netdev_info(lif->netdev, "hwstamp recreate rxq failed: %d\n", err); + } + + mutex_unlock(&lif->phc->config_lock); +} + int ionic_lif_hwstamp_get(struct ionic_lif *lif, struct ifreq *ifr) { struct hwtstamp_config config;