From patchwork Wed Nov 4 22:33:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 11882279 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 7D9C2C388F7 for ; Wed, 4 Nov 2020 22:34:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29A802080D for ; Wed, 4 Nov 2020 22:34:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="zN25aHG8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732120AbgKDWeF (ORCPT ); Wed, 4 Nov 2020 17:34:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgKDWeE (ORCPT ); Wed, 4 Nov 2020 17:34:04 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401A7C0613CF for ; Wed, 4 Nov 2020 14:34:04 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id 62so46494pgg.12 for ; Wed, 04 Nov 2020 14:34:04 -0800 (PST) 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=2aWkMqo1r20Pi2OEYli1mBai8fEL99UyV8cr7SGRY3c=; b=zN25aHG8qzPSs09dSEr9A7pFvBy5+CmvGFlDUD63Qlk+qZ3VvZ/JYNh7uuL+5p8sqn AiOztMvWh+6wybyfoLfxfDGbtoqmNXwGTW1ZFV32F2A1u1vKa9Gbnsd3pihRcKsPx8YA BM5UZ/sKRedMGj6xEVOitw5vTy2ISmXOuikQZWMLtggts0tek3Eotz46uA2w4G2B2qVu 0fkerOZo6LTB0parWWtUdue3veQNj+zAkFAxx9ipHHlSWf/i6Sd9NsldTkCql/MUNqvG IaI7Cq34xMK2d9E+l2xNUOVb+274mZXOn2v72+QZpy3WJMtewi7pmV0IJH++Dri1MnXm PyBw== 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=2aWkMqo1r20Pi2OEYli1mBai8fEL99UyV8cr7SGRY3c=; b=FOxDMKq6sJL5iWm2bUF0/WRHfWQKvhKTrjJZoQZ+7RcNe6d9SqE0ewBSEvsZd2M9Mb tTLKwxRgPR5HT7wnceItHs64+E1YHvkmVVNiTcQuVbED1vdPQQWVEOsbnj3Glgcn9S1G ea80v+CK8DyhiK6flAUma/EsiGVD8YomZYBslm2iSPCY7bcFIgkfLtgE8uCAf0BTyoes ITnbF1e313V04addQv5S/BbmhlvuwEq0m6HY8KjT6g99nB7E0xiILf6pRHL1ua0O+Bwe lzg/pCFctNAGB989WCCJMggsPqU5NUyR8WQdEyGnAmZXZusni5mxE4GF6NaGtvE8GLo2 RbAg== X-Gm-Message-State: AOAM532vnQjmR4H5ETJH4HrbcVXX28hJknDlEPeTVhEeY9sSRda0SOSn S6f9VKjO7982a9e+wCSn91ClUbbzbX05cA== X-Google-Smtp-Source: ABdhPJwIi4Y4TVDsWiQmKBcEDrDuKDwKyaOlHLJTU6vKmxStBL5goBbGkw1OaZJqukxZtJLHDYJ+uA== X-Received: by 2002:a63:9d8d:: with SMTP id i135mr150846pgd.213.1604529243603; Wed, 04 Nov 2020 14:34:03 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id z10sm3284559pff.218.2020.11.04.14.34.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 14:34:03 -0800 (PST) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 1/6] ionic: start queues before announcing link up Date: Wed, 4 Nov 2020 14:33:49 -0800 Message-Id: <20201104223354.63856-2-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104223354.63856-1-snelson@pensando.io> References: <20201104223354.63856-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Change the order of operations in the link_up handling to be sure that the queues are up and ready before we announce that the link is up. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index a12df3946a07..5457fb5d69ed 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -123,6 +123,12 @@ 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)) { + mutex_lock(&lif->queue_lock); + ionic_start_queues(lif); + mutex_unlock(&lif->queue_lock); + } + if (!netif_carrier_ok(netdev)) { u32 link_speed; @@ -132,12 +138,6 @@ static void ionic_link_status_check(struct ionic_lif *lif) link_speed / 1000); netif_carrier_on(netdev); } - - if (lif->netdev->flags & IFF_UP && netif_running(lif->netdev)) { - mutex_lock(&lif->queue_lock); - ionic_start_queues(lif); - mutex_unlock(&lif->queue_lock); - } } else { if (netif_carrier_ok(netdev)) { netdev_info(netdev, "Link down\n"); From patchwork Wed Nov 4 22:33:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 11882275 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 DC0B5C2D0A3 for ; Wed, 4 Nov 2020 22:34:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76F8420825 for ; Wed, 4 Nov 2020 22:34:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="HecjOmll" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732152AbgKDWeH (ORCPT ); Wed, 4 Nov 2020 17:34:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgKDWeF (ORCPT ); Wed, 4 Nov 2020 17:34:05 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6109AC0613CF for ; Wed, 4 Nov 2020 14:34:05 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id f21so11652plr.5 for ; Wed, 04 Nov 2020 14:34:05 -0800 (PST) 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=RzMJ5I54EBNjTKdQhYz0zoJbUVPD0Jjli8LFYU8UorI=; b=HecjOmllXgSCtf/4tjaZiOrCgJv4u+6yIkO5iXYKZyvaCdQIgnlAyz54K790Slx4Sw m0Udv99gljJuDLU6LvMXhc3k/rb5XNWCImvIgvZq8G+I+istGsfbbpx1gSSCNUCVagdj Fotoi+wqRRNKFW6EIz6cQ4Yhb9Ahg7Tng9DCZmAc2LeDmJepfeB3l5kstH40xB9NfwqE Sw6FGYab3qrzJ4Z5k5mjiSroOLXSEcXc5iNyzHorA+YOxKpMc2Wq3dq9YIvJ7xwyi45y DK7vxiH5tLkYfnAwEPm5Q6ve12TfSZCd+Gks3Sgto7ovz1jPOcnHv9pflLuD264fK22c gxbA== 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=RzMJ5I54EBNjTKdQhYz0zoJbUVPD0Jjli8LFYU8UorI=; b=YfNN024ea0gYUNti3W4Ube0qZAday2mWVKP/27SNdLmvmWxK6Tj0RyXbb8tsT8K7iE gGl6fBZaTJaQ00yqbslIxUkU3UYlxqqJnjiCsKIrczWjQbpottJxCjK1H8zCQcE32IFg jGeOLLDjyJVZWSvEF/DhV6UnTWC3Q+30QzhKhaQrHmafMG4HonrKhZ/hoA6R7YMoJRbl HQDb+uNr2LoJMAOxRyMNx4uT0bKco/DjSVxWH+mKJoGZzQxLgJfmnzjtUd7DqnjGa0tw b+7237Ci6XyJtDufcP/+NXAjokH7xQr46ZHrnTI+ypedh8txvt8effSP+iy9on5/6s6q ajIg== X-Gm-Message-State: AOAM532U/KRE+y+kVKS8BfcYGq7c/133mrDnTbGgumKgV48g9Up6EnuF hODA4WiadwgW6FoxeR+wmBx+Yur3NqYYlQ== X-Google-Smtp-Source: ABdhPJwle21v3ebYBwObKUHEa+HJ6uA57+j+aQ3wGOPqepv9kmJz5xs5wm7bOgk45FACXdHmW5FqAQ== X-Received: by 2002:a17:902:7004:b029:d6:489b:6657 with SMTP id y4-20020a1709027004b02900d6489b6657mr17560plk.20.1604529244707; Wed, 04 Nov 2020 14:34:04 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id z10sm3284559pff.218.2020.11.04.14.34.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 14:34:04 -0800 (PST) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 2/6] ionic: check for link after netdev registration Date: Wed, 4 Nov 2020 14:33:50 -0800 Message-Id: <20201104223354.63856-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104223354.63856-1-snelson@pensando.io> References: <20201104223354.63856-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Request a link check as soon as the netdev is registered rather than waiting for the watchdog to go off in order to get the interface operational a little more quickly. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 5457fb5d69ed..519d544821af 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -2959,6 +2959,8 @@ int ionic_lif_register(struct ionic_lif *lif) dev_err(lif->ionic->dev, "Cannot register net device, aborting\n"); return err; } + + ionic_link_status_check_request(lif, true); lif->registered = true; ionic_lif_set_netdev_info(lif); From patchwork Wed Nov 4 22:33:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 11882285 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 49615C4741F for ; Wed, 4 Nov 2020 22:34:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8BFE20825 for ; Wed, 4 Nov 2020 22:34:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="G/Tykc36" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732378AbgKDWeN (ORCPT ); Wed, 4 Nov 2020 17:34:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729163AbgKDWeG (ORCPT ); Wed, 4 Nov 2020 17:34:06 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C2EBC0613CF for ; Wed, 4 Nov 2020 14:34:06 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id r10so54643pgb.10 for ; Wed, 04 Nov 2020 14:34:06 -0800 (PST) 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=vJc4De0lJJqWH98ugIkZZ8d6bxE3OdbpvFhviZ678gM=; b=G/Tykc36AiASWvaTpQBJ1F1HTuVIDcy2KVKH+Hk7yWjNcyFmRNtpVg9s9xO4O8eaQz i5BziMMMsVY2uXlDFxrXG2cnZcVrm0cMo1fA6XJ6Pb21S0m3/7QvGz6znIACQv5QTzca juNQKN72XSqNL2Pa6XLos1kcc3oMc0k62A8DUm6QKtj8m+dTnrIXmlaUKnknqHBwDdOT qiFIOKS9JQeXrp8Tf7v1kjmfqdzJuqQcbZz4a7/w01qTW5EjuIHL3PSMxwnWIWniFCB/ k3emdTCrFo1WH38sQSKpK0ry53s9sbLiC8cluZPAvTOs+ggMEHU4rK4Qo09hF0F25HNI jo0A== 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=vJc4De0lJJqWH98ugIkZZ8d6bxE3OdbpvFhviZ678gM=; b=T5DsPxLsPKUrHG+dsymi12rVuDvDGgDCZ44sF8hYPUyDN0AMAOLnbd1qIA52seNnDQ xsxJLKbmBtpnZkXrbybw8QkvSyD1M7HKPMjvM/pt1Y5vfPVITTDr671Xwu97Ri4edvw2 xAl3hKaQLPRn5QHIJF0vSbvxoCDHsJ3YE56FxRC3OMzRe8KHps9Ck0FMRJTNkPhLa6rD tn9Dh8t8SC51keR/UtUmCjWo555h4zi1/b+8iRxylk+ssYWF/Qd50ZIGoomcul9vSXHn Bpn4tU0bI6f9trdIU02z6kQHPl8mu+Y5QjMTzkqcVtGLbnaponFS01PhQa8SgSbzVRBY 2khQ== X-Gm-Message-State: AOAM530rcWS8lZPyj6O6AGKh6lQQxzZ5gO70X4+ufszJR1FT6KFwBHKi LIfzi0RhQEKl6zUR2qdBCPQRuvr2/cCyKw== X-Google-Smtp-Source: ABdhPJyRDwGn5aBggJ8V0Q6PxnRkHu+nn5XbD6PvgRsqDQiArrwh8jeNcg+b8/dlWEMNfE7qs+0C3g== X-Received: by 2002:a62:3:0:b029:160:d92:2680 with SMTP id 3-20020a6200030000b02901600d922680mr34130pfa.44.1604529245703; Wed, 04 Nov 2020 14:34:05 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id z10sm3284559pff.218.2020.11.04.14.34.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 14:34:05 -0800 (PST) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 3/6] ionic: add lif quiesce Date: Wed, 4 Nov 2020 14:33:51 -0800 Message-Id: <20201104223354.63856-4-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104223354.63856-1-snelson@pensando.io> References: <20201104223354.63856-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org After the queues are stopped, expressly quiesce the lif. This assures that even if the queues were in an odd state, the firmware will close up everything cleanly. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_lif.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 519d544821af..28044240caf2 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1625,6 +1625,28 @@ static void ionic_lif_rss_deinit(struct ionic_lif *lif) ionic_lif_rss_config(lif, 0x0, NULL, NULL); } +static int ionic_lif_quiesce(struct ionic_lif *lif) +{ + struct ionic_admin_ctx ctx = { + .work = COMPLETION_INITIALIZER_ONSTACK(ctx.work), + .cmd.lif_setattr = { + .opcode = IONIC_CMD_LIF_SETATTR, + .index = cpu_to_le16(lif->index), + .attr = IONIC_LIF_ATTR_STATE, + .state = IONIC_LIF_QUIESCE, + }, + }; + int err; + + err = ionic_adminq_post_wait(lif, &ctx); + if (err) { + netdev_err(lif->netdev, "lif quiesce failed %d\n", err); + return err; + } + + return 0; +} + static void ionic_txrx_disable(struct ionic_lif *lif) { unsigned int i; @@ -1639,6 +1661,8 @@ static void ionic_txrx_disable(struct ionic_lif *lif) for (i = 0; i < lif->nxqs; i++) err = ionic_qcq_disable(lif->rxqcqs[i], (err != -ETIMEDOUT)); } + + ionic_lif_quiesce(lif); } static void ionic_txrx_deinit(struct ionic_lif *lif) From patchwork Wed Nov 4 22:33:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 11882277 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 DA1A3C388F7 for ; Wed, 4 Nov 2020 22:34:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 910372080D for ; Wed, 4 Nov 2020 22:34:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="neISJ2EC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732297AbgKDWeK (ORCPT ); Wed, 4 Nov 2020 17:34:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732162AbgKDWeH (ORCPT ); Wed, 4 Nov 2020 17:34:07 -0500 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 65991C0613CF for ; Wed, 4 Nov 2020 14:34:07 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id c20so18519503pfr.8 for ; Wed, 04 Nov 2020 14:34:07 -0800 (PST) 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=T4Y3nDGLzMHA66yGPJNoaME43oRNIcZvy5J8hI+97Ds=; b=neISJ2ECmPxvt58psg1thJFFYJjoRLJojqw4u7m/OOkZndVJhwAVySxXoZ1DXnVqM9 0Cf+GQ75cRRmxBKbD0GEFPrA35oey/gW75voTaW9Dyy2utd1C69n6ak14UQQYKwGkVVx a5O8xvPdDwfEM2iE6idQeNyD2d3T+x+xLUg8jlI74KyW37yMDJ35ZElZYHE3OR+lFIMW 6IbWf3lZSOtYqBbxvoTITUP5yAi3l19aZAk+Krsi/E1rZDJABJOkBy2RdEi0FOIW5iLy Qvni+LOfEr1QD4OrcTxhIY4qK6vQe6ZRI9yU9fsdAcY+45b6DTNB2droPuRrbX0HJe6+ T+XA== 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=T4Y3nDGLzMHA66yGPJNoaME43oRNIcZvy5J8hI+97Ds=; b=Lb5CtoQruvnENUisuvuAaOxo3qJuUwUswAKh1X1Ah14VT4+MDxuUkOw1yRq/296BCT pgiJvltIzFtOl6SWMR4FQiyvjcibCZHuGKOw/OEHw+CsNUO0z8VkXn1psFrcWgBevT0E gLQBR9uBK+KBXuSWi8Au+t19kyY0ZudltnotMSNkrDQCrZH5WzPUG4Eq9pOMAqENV0cb o9Afej5xvNwQIJVjc7jvwNrce9bgD26x5pApIR1VAIbkqX9+ILf66suJ0sB2Bq9KiBgC M4ibM0teWxCVdUKGbMduZPOj3KBGEkE6+hioJQj8r8uqasEv1LV2c4PNZ7d/MmeAmeoI bkKQ== X-Gm-Message-State: AOAM5332BQt+xUzRt1LKZ7/xZYaP1xl68bZ4cMY/dqO7BwnInWcBM8Pf vzRts46L4wSZ5hIrffUN9SHXtSgpmTXwsA== X-Google-Smtp-Source: ABdhPJzokIcjzJ2zSGjoPbLj3aDG4ktxvYauqdx3D7KVYf6Ma3rrP22KirJj8hYr/SoF0rUCF3fWbw== X-Received: by 2002:aa7:9f90:0:b029:164:bcf:de16 with SMTP id z16-20020aa79f900000b02901640bcfde16mr17605pfr.3.1604529246715; Wed, 04 Nov 2020 14:34:06 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id z10sm3284559pff.218.2020.11.04.14.34.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 14:34:06 -0800 (PST) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 4/6] ionic: batch rx buffer refilling Date: Wed, 4 Nov 2020 14:33:52 -0800 Message-Id: <20201104223354.63856-5-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104223354.63856-1-snelson@pensando.io> References: <20201104223354.63856-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We don't need to refill the rx descriptors on every napi if only a few were handled. Waiting until we can batch up a few together will save us a few Rx cycles. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_dev.h | 4 +++- .../net/ethernet/pensando/ionic/ionic_txrx.c | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h index 6c243b17312c..9064222a087a 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h @@ -12,8 +12,10 @@ #define IONIC_MAX_TX_DESC 8192 #define IONIC_MAX_RX_DESC 16384 -#define IONIC_MIN_TXRX_DESC 16 +#define IONIC_MIN_TXRX_DESC 64 #define IONIC_DEF_TXRX_DESC 4096 +#define IONIC_RX_FILL_THRESHOLD 64 +#define IONIC_RX_FILL_DIV 8 #define IONIC_LIFS_MAX 1024 #define IONIC_WATCHDOG_SECS 5 #define IONIC_ITR_COAL_USEC_DEFAULT 64 diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index b3d2250c77d0..9156c9825a16 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -392,11 +392,6 @@ void ionic_rx_fill(struct ionic_queue *q) q->dbval | q->head_idx); } -static void ionic_rx_fill_cb(void *arg) -{ - ionic_rx_fill(arg); -} - void ionic_rx_empty(struct ionic_queue *q) { struct ionic_desc_info *desc_info; @@ -480,6 +475,7 @@ int ionic_rx_napi(struct napi_struct *napi, int budget) struct ionic_cq *cq = napi_to_cq(napi); struct ionic_dev *idev; struct ionic_lif *lif; + u16 rx_fill_threshold; u32 work_done = 0; u32 flags = 0; @@ -489,7 +485,9 @@ int ionic_rx_napi(struct napi_struct *napi, int budget) work_done = ionic_cq_service(cq, budget, ionic_rx_service, NULL, NULL); - if (work_done) + rx_fill_threshold = min_t(u16, IONIC_RX_FILL_THRESHOLD, + cq->num_descs / IONIC_RX_FILL_DIV); + if (work_done && ionic_q_space_avail(cq->bound_q) >= rx_fill_threshold) ionic_rx_fill(cq->bound_q); if (work_done < budget && napi_complete_done(napi, work_done)) { @@ -518,6 +516,7 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) struct ionic_dev *idev; struct ionic_lif *lif; struct ionic_cq *txcq; + u16 rx_fill_threshold; u32 rx_work_done = 0; u32 tx_work_done = 0; u32 flags = 0; @@ -531,8 +530,11 @@ int ionic_txrx_napi(struct napi_struct *napi, int budget) rx_work_done = ionic_cq_service(rxcq, budget, ionic_rx_service, NULL, NULL); - if (rx_work_done) - ionic_rx_fill_cb(rxcq->bound_q); + + rx_fill_threshold = min_t(u16, IONIC_RX_FILL_THRESHOLD, + rxcq->num_descs / IONIC_RX_FILL_DIV); + if (rx_work_done && ionic_q_space_avail(rxcq->bound_q) >= rx_fill_threshold) + ionic_rx_fill(rxcq->bound_q); if (rx_work_done < budget && napi_complete_done(napi, rx_work_done)) { ionic_dim_update(qcq); From patchwork Wed Nov 4 22:33:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 11882287 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 ABE80C2D0A3 for ; Wed, 4 Nov 2020 22:34:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50D5C2080D for ; Wed, 4 Nov 2020 22:34:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="uWAw1HiQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732319AbgKDWeL (ORCPT ); Wed, 4 Nov 2020 17:34:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgKDWeJ (ORCPT ); Wed, 4 Nov 2020 17:34:09 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF41EC0613CF for ; Wed, 4 Nov 2020 14:34:08 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id 133so18519249pfx.11 for ; Wed, 04 Nov 2020 14:34:08 -0800 (PST) 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=OCmgQu7BenHssMoseN6UpJ97h++GTY8j0hPVyIa/xQw=; b=uWAw1HiQkcf7TxfNY1eCWxS0MC3bRWNEd8O8XSkzNUn3R1pZNoSc7Qdk8dpCyDx9sd BHM/VDeFuGJDLIzqIhIZzuWiKSomS1z22oaHJ9nOHufLyEW2nqcwVgtE/9VM0grRd6m8 2gfkx9ritLUimXcQCq6PvYos7QfREps3Gu9bece8HAX3Iy3smg7Odlssivua6+zygZe5 wYXJARi98mL1bhLRrDzlPg8zNCisr3k1b39SboOcouOxOumwLj2+UhRgrrUy5XFH0Sg4 jtO6zthlOXiD0ZEsy812BTrtZNBn86RyVtjg13KyBdtXx5mcymDsofjzKwiQbCwtse1u G5Yw== 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=OCmgQu7BenHssMoseN6UpJ97h++GTY8j0hPVyIa/xQw=; b=BqKIkkWAbF0rteS+C6+CE6wMMfpGs/Jafa6AYNbFUTvHs9+TQo68sdrGWmKCJdkxIg 8v6aQTG9uL/ro27oPoiP+NByWUIjjXxvntcmAt/27T+p3XFrxsm0IMT5a3/k1Ajup4x0 xjM2VRj7jaJOZACTSj66n79CWyABYHgNhJd+/GI0IFAtsmQcMg33vlvhJf7k3uJSjhDS y+yHnWnOI0Tpui3gtGMQ6+W8bnWbr9LAhMXd0QY740rwbglrKn7CNrKDTDkv2kUhRjip 1gkhLtO2km64jGxlh8hHDGM8S09mycp7ynriCvo7jhFl6E3481DSsRsTevyMygMRWY5y HGUA== X-Gm-Message-State: AOAM532uSxGidENtfaSvLaEUy7YBNh6ifYtBr+7BdOpkJdxJJmSWPYEi KPzE9i/3RVdR8lNPOZSa2HabZPi9KlBQBw== X-Google-Smtp-Source: ABdhPJxH9W+vYnFqGCVH9nmWOXoyHTeOhgmZ+9/pMB5R0p2MYASLlmgkl4grWe/gmj/WByvXXmLL5Q== X-Received: by 2002:a62:64c1:0:b029:18a:d791:8162 with SMTP id y184-20020a6264c10000b029018ad7918162mr201285pfb.24.1604529248166; Wed, 04 Nov 2020 14:34:08 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id z10sm3284559pff.218.2020.11.04.14.34.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 14:34:07 -0800 (PST) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 5/6] ionic: use mc sync for multicast filters Date: Wed, 4 Nov 2020 14:33:53 -0800 Message-Id: <20201104223354.63856-6-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104223354.63856-1-snelson@pensando.io> References: <20201104223354.63856-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org We should be using the multicast sync routines for the multicast filters. Fixes: 1800eee16676 ("net: ionic: Replace in_interrupt() usage.") Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 28044240caf2..a58bb572b23b 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1158,6 +1158,14 @@ static void ionic_dev_uc_sync(struct net_device *netdev, bool from_ndo) } +static void ionic_dev_mc_sync(struct net_device *netdev, bool from_ndo) +{ + if (from_ndo) + __dev_mc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del); + else + __dev_mc_sync(netdev, ionic_addr_add, ionic_addr_del); +} + static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) { struct ionic_lif *lif = netdev_priv(netdev); @@ -1189,7 +1197,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) } /* same for multicast */ - ionic_dev_uc_sync(netdev, from_ndo); + ionic_dev_mc_sync(netdev, from_ndo); nfilters = le32_to_cpu(lif->identity->eth.max_mcast_filters); if (netdev_mc_count(netdev) > nfilters) { rx_mode |= IONIC_RX_MODE_F_ALLMULTI; From patchwork Wed Nov 4 22:33:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 11882283 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=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 017CFC4741F for ; Wed, 4 Nov 2020 22:34:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A713E2080D for ; Wed, 4 Nov 2020 22:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pensando.io header.i=@pensando.io header.b="fVSxzvQf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732449AbgKDWeO (ORCPT ); Wed, 4 Nov 2020 17:34:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732250AbgKDWeK (ORCPT ); Wed, 4 Nov 2020 17:34:10 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0241AC0613CF for ; Wed, 4 Nov 2020 14:34:10 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id t14so88235pgg.1 for ; Wed, 04 Nov 2020 14:34:09 -0800 (PST) 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=nGSoe4Dy6+c/A+ugpSKq4ECZ+0Rs3hgJNVkOfrFbJs8=; b=fVSxzvQf4JQWN49jxW1tYgeqKxrJZDrwhHs0vzdOauWzj69O9e7X+BYAHaQ8YGWg7d y6tKlApCW3eIbeBYd8Tq+duIrVK8z7FUgb8S/ChxdjewNStXMHXf+ZItyvWvYXW9STu8 PyL3uPcYntjFpD9NImPAk5E6uU9DLsx7pljihuBpmiD5ygVK94A4Ttf4qzyFJ4t/M5BM 1zEvpW0H/gn6WJBG/7qlHoQY9pjy2m/JMSMLYui+P/o5GstFO6QuSMkamx7MFv/LyvFn tL+7HJfMNilhlaWI0P/IrksFRQuSZ8QPGUVvfWnuZWSvmdBsq6IRX9Q8fFjnJvJELH0c pxog== 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=nGSoe4Dy6+c/A+ugpSKq4ECZ+0Rs3hgJNVkOfrFbJs8=; b=uGZPpG20qZvUY8MfvxamdqqI1nf6ixi63wWr0mnZBYAZUCvrr4Aszv1hGxQqM2OJ+x mwh7xae2MYYeaol0q6WGHLxSJVUo8fHvlZpbeYqAg8cEX4S0ahPfKSvrhmtPBS99eAG0 JFs2PQo/Eh+JDhGasqQSm8jo59rCnanyuohE5Aa2ulG6UM8q7NmhLhNKJyYZSgrvRRnN LryPgJJ0XkujMATbJ4wEu6IQRjw3x3E1M7K9h6s1QNmaF4fp+Kf2+qkwpTAvEU376ZfZ NsyFFGP5+U89T7A/GUzTCCswOOe8akO8gZB5960/67JvFH1b6B+sr/wZhQHPI/s483mP A1Tw== X-Gm-Message-State: AOAM530PF9SDwFEA/3nzKG/Q5IXsEco2bp0VWdV4F8MKOjZAJuT0G1we 47cEYLIawDsP/7DOjQG791QcPPF7qpr+zA== X-Google-Smtp-Source: ABdhPJzkjznxtnBPi37fFauLfe7YVTZTE/UdRgJYEsb6B/JLscIZgkh1Ly9ATBAXPDerVz73rNac5Q== X-Received: by 2002:a17:90a:8b93:: with SMTP id z19mr75142pjn.123.1604529249341; Wed, 04 Nov 2020 14:34:09 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id z10sm3284559pff.218.2020.11.04.14.34.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Nov 2020 14:34:08 -0800 (PST) From: Shannon Nelson To: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org Cc: Shannon Nelson Subject: [PATCH net-next 6/6] ionic: useful names for booleans Date: Wed, 4 Nov 2020 14:33:54 -0800 Message-Id: <20201104223354.63856-7-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201104223354.63856-1-snelson@pensando.io> References: <20201104223354.63856-1-snelson@pensando.io> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org With a few more uses of true and false in function calls, we need to give them some useful names so we can tell from the calling point what we're doing. Signed-off-by: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 16 ++++++++-------- drivers/net/ethernet/pensando/ionic/ionic_lif.h | 8 ++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index a58bb572b23b..a0d2989a0d8d 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1074,22 +1074,22 @@ static int ionic_lif_addr(struct ionic_lif *lif, const u8 *addr, bool add, static int ionic_addr_add(struct net_device *netdev, const u8 *addr) { - return ionic_lif_addr(netdev_priv(netdev), addr, true, true); + return ionic_lif_addr(netdev_priv(netdev), addr, ADD_ADDR, CAN_SLEEP); } static int ionic_ndo_addr_add(struct net_device *netdev, const u8 *addr) { - return ionic_lif_addr(netdev_priv(netdev), addr, true, false); + return ionic_lif_addr(netdev_priv(netdev), addr, ADD_ADDR, CAN_NOT_SLEEP); } static int ionic_addr_del(struct net_device *netdev, const u8 *addr) { - return ionic_lif_addr(netdev_priv(netdev), addr, false, true); + return ionic_lif_addr(netdev_priv(netdev), addr, DEL_ADDR, CAN_SLEEP); } static int ionic_ndo_addr_del(struct net_device *netdev, const u8 *addr) { - return ionic_lif_addr(netdev_priv(netdev), addr, false, false); + return ionic_lif_addr(netdev_priv(netdev), addr, DEL_ADDR, CAN_NOT_SLEEP); } static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode) @@ -1214,7 +1214,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) static void ionic_ndo_set_rx_mode(struct net_device *netdev) { - ionic_set_rx_mode(netdev, true); + ionic_set_rx_mode(netdev, FROM_NDO); } static __le64 ionic_netdev_features_to_nic(netdev_features_t features) @@ -1805,7 +1805,7 @@ static int ionic_txrx_init(struct ionic_lif *lif) if (lif->netdev->features & NETIF_F_RXHASH) ionic_lif_rss_init(lif); - ionic_set_rx_mode(lif->netdev, false); + ionic_set_rx_mode(lif->netdev, NOT_FROM_NDO); return 0; @@ -2813,7 +2813,7 @@ static int ionic_station_set(struct ionic_lif *lif) */ if (!ether_addr_equal(ctx.comp.lif_getattr.mac, netdev->dev_addr)) - ionic_lif_addr(lif, netdev->dev_addr, true, true); + ionic_lif_addr(lif, netdev->dev_addr, ADD_ADDR, CAN_SLEEP); } else { /* Update the netdev mac with the device's mac */ memcpy(addr.sa_data, ctx.comp.lif_getattr.mac, netdev->addr_len); @@ -2830,7 +2830,7 @@ static int ionic_station_set(struct ionic_lif *lif) netdev_dbg(lif->netdev, "adding station MAC addr %pM\n", netdev->dev_addr); - ionic_lif_addr(lif, netdev->dev_addr, true, true); + ionic_lif_addr(lif, netdev->dev_addr, ADD_ADDR, CAN_SLEEP); return 0; } diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.h b/drivers/net/ethernet/pensando/ionic/ionic_lif.h index 0224dfd24b8a..493de679b498 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.h @@ -13,6 +13,14 @@ #define IONIC_MAX_NUM_NAPI_CNTR (NAPI_POLL_WEIGHT + 1) #define IONIC_MAX_NUM_SG_CNTR (IONIC_TX_MAX_SG_ELEMS + 1) + +#define ADD_ADDR true +#define DEL_ADDR false +#define CAN_SLEEP true +#define CAN_NOT_SLEEP false +#define FROM_NDO true +#define NOT_FROM_NDO false + #define IONIC_RX_COPYBREAK_DEFAULT 256 #define IONIC_TX_BUDGET_DEFAULT 256