From patchwork Sun Feb 20 09:05:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12752633 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E53FC4332F for ; Sun, 20 Feb 2022 09:06:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237656AbiBTJGp (ORCPT ); Sun, 20 Feb 2022 04:06:45 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243468AbiBTJGm (ORCPT ); Sun, 20 Feb 2022 04:06:42 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13EC631919 for ; Sun, 20 Feb 2022 01:06:22 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id 139so11683479pge.1 for ; Sun, 20 Feb 2022 01:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1OvWYX0z4JRtRR0V9MbS4YMsa6a9NCZJI4VjyxEp7/8=; b=IbBQtmsIzhRsB9fbfWRkhwhgkG5MpRPChxXpxHYnjqa3OfP2XJujz96XBFuEeAaGRK nfzzE9BWYGDqa/pBee1Vw3OFnrmXhqzfDdM37eZXwLlwe77WD6mng1mSrnkeplLB+Gop 60XG0wuEev/ZrMSD5H8BjIOs2VjlkLhpc/t/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1OvWYX0z4JRtRR0V9MbS4YMsa6a9NCZJI4VjyxEp7/8=; b=MZQYXYV2jLvEodMc6uJUCG15Ris8ktL2QXHQQBB2XvlTIfpk3VdsNl1VOkEqD9sGWd zkJvXzHRIW+6y/01njxW3OEs1P3x8YTbKbSnRO2Wl1GFJptnNdAFmR3MIsclpYuNl93A 3uX3G1GG0ig9GYsQ96zYQEQsepkdN7Lh9Snk4kypCVtfHpa0mXklIDtgn8JBa4PonIRy WoB30GWubay/UVjPp3acu6jrMl9t+RaoSrrwD65r+HtvFjyiC4Hp3Ht/ORRrbiwJqsbv qtCfOGF0zMmiSMTJGwBnUnzhMs5UOCJ5sNd54Tf0Dcfrh85AcnwL32hcKbGfgq5UEVaS n8ow== X-Gm-Message-State: AOAM530ey7cf1zxUvZbBNd3L2yl3M8+ivKu33BPdtocvXeRI7zMcwtmJ 5mZwi9uFESSqW+YNwRA2iZgXtA== X-Google-Smtp-Source: ABdhPJwB+nKqWpbHaZVjyBF1gtSdvjMcVnqfesnvJeunacua+7j6SkuHOJInS7wK+EvkYxgZ3PmE0A== X-Received: by 2002:a05:6a00:1d8b:b0:4f1:bd8:811 with SMTP id z11-20020a056a001d8b00b004f10bd80811mr4703174pfw.25.1645347981219; Sun, 20 Feb 2022 01:06:21 -0800 (PST) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id m5-20020a17090b068500b001b9bef22bf5sm4061865pjz.5.2022.02.20.01.06.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Feb 2022 01:06:20 -0800 (PST) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com, Pavan Chebbi Subject: [PATCH net 4/7] bnxt_en: Fix incorrect multicast rx mask setting when not requested Date: Sun, 20 Feb 2022 04:05:50 -0500 Message-Id: <1645347953-27003-5-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1645347953-27003-1-git-send-email-michael.chan@broadcom.com> References: <1645347953-27003-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Pavan Chebbi We should setup multicast only when net_device flags explicitly has IFF_MULTICAST set. Otherwise we will incorrectly turn it on even when not asked. Fix it by only passing the multicast table to the firmware if IFF_MULTICAST is set. Fixes: 7d2837dd7a32 ("bnxt_en: Setup multicast properly after resetting device.") Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 785436f6dd24..fc5b1d816bdb 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4747,8 +4747,10 @@ static int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt *bp, u16 vnic_id) return rc; req->vnic_id = cpu_to_le32(vnic->fw_vnic_id); - req->num_mc_entries = cpu_to_le32(vnic->mc_list_count); - req->mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping); + if (vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_MCAST) { + req->num_mc_entries = cpu_to_le32(vnic->mc_list_count); + req->mc_tbl_addr = cpu_to_le64(vnic->mc_list_mapping); + } req->mask = cpu_to_le32(vnic->rx_mask); return hwrm_req_send_silent(bp, req); } @@ -8651,7 +8653,7 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init) if (bp->dev->flags & IFF_ALLMULTI) { vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; vnic->mc_list_count = 0; - } else { + } else if (bp->dev->flags & IFF_MULTICAST) { u32 mask = 0; bnxt_mc_list_updated(bp, &mask); @@ -10779,7 +10781,7 @@ static void bnxt_set_rx_mode(struct net_device *dev) if (dev->flags & IFF_ALLMULTI) { mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; vnic->mc_list_count = 0; - } else { + } else if (dev->flags & IFF_MULTICAST) { mc_update = bnxt_mc_list_updated(bp, &mask); } @@ -10856,9 +10858,10 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp) !bnxt_promisc_ok(bp)) vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS; rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0); - if (rc && vnic->mc_list_count) { + if (rc && (vnic->rx_mask & CFA_L2_SET_RX_MASK_REQ_MASK_MCAST)) { netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n", rc); + vnic->rx_mask &= ~CFA_L2_SET_RX_MASK_REQ_MASK_MCAST; vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST; vnic->mc_list_count = 0; rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);