From patchwork Wed Dec 27 04:21:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 135600 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D0DF437A1; Wed, 27 Dec 2023 05:23:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 72F4640DFB; Wed, 27 Dec 2023 05:21:48 +0100 (CET) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by mails.dpdk.org (Postfix) with ESMTP id D3F2D4067A for ; Wed, 27 Dec 2023 05:21:42 +0100 (CET) Received: by mail-qt1-f181.google.com with SMTP id d75a77b69052e-427e7aa0207so3779011cf.2 for ; Tue, 26 Dec 2023 20:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1703650902; x=1704255702; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=f3j5Whb0nYLfca2DHDYMnzqwU0qXgggExxRZF6YuPQE=; b=HsakXjUxk53fJ4c6Mfp2UNTlFLdryVX27Ia5tMLoq1Be6DIO1cfyqoYLQ6PioaZbk9 /0Oco+QuT3LAyK4/a3Pcv891bxT/odrYurrpXKWt6Um3GsUUQSSEw24JR1uPliaLuPd0 qUUbT/vZtHjSYtY73N5xQOHv/UaG39O37t0XY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703650902; x=1704255702; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f3j5Whb0nYLfca2DHDYMnzqwU0qXgggExxRZF6YuPQE=; b=DPKsXp+ZZHgZS3434VgQFaFNXAo85aBvtJxw94EqQUrvjTn6Ey+nnImNBr2zIH2SLg o8Os3NwfpLkDGXDsFOzKV4pQfw2QzrNZR/6r9LGOQ5LnfstjAuXk9KQJt3tgl2tNsCkt icXvvCItGbf4TMegWPyhmneg0/B1ShcDErk2rjYsRNR5dLrFerFoRiENJk3cWHcP4/LS 9QSqY36hyCZoeyjmX3gKx2VbA72w2wA7BHaR7ZQUzGGIH0E5nrmYqgigfJPQoqJD4sV+ ascpFhHrsFXqJLUoxmMiSunCsLhidRHVsP5mr2A0ArwLCkHEdq/7YkVSnZf4oLt0OPsE iq9g== X-Gm-Message-State: AOJu0YxLTTQp7NbIQb8r8sqFus6KY/djaxI8wicixh2eGzWVon8hwx1h I5AU/LjzE7EuVE4HS1VX7kX3z/cFV+hgGrPizEKdBmAseSbSPsk7o8LjGhtXMOwqi9qA1isVGq/ z4B9CmE0qZeGYBv89l0a9Sfr4T7vGjbflp/hZOcGTCQ7uhkH6RnNGJVpnNkJ20SbG5DwPJ49yxT c= X-Google-Smtp-Source: AGHT+IH4I4OFL2zWuirJIcPM6x16jiyAa9EWSIvlzlB7M50m1bRdn1JQVlcU9vR7a6KgqiFM+3yWBg== X-Received: by 2002:ac8:7f0c:0:b0:427:86ad:47dd with SMTP id f12-20020ac87f0c000000b0042786ad47ddmr10879215qtk.16.1703650901739; Tue, 26 Dec 2023 20:21:41 -0800 (PST) Received: from localhost.localdomain ([2605:a601:a780:1400:c066:75e3:74c8:50e6]) by smtp.gmail.com with ESMTPSA id bt7-20020ac86907000000b00427e120889bsm1415488qtb.91.2023.12.26.20.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 20:21:41 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: Damodharam Ammepalli Subject: [PATCH v3 12/18] net/bnxt: set allmulti mode if multicast filter fails Date: Tue, 26 Dec 2023 20:21:13 -0800 Message-Id: <20231227042119.72469-13-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20231227042119.72469-1-ajit.khaparde@broadcom.com> References: <20231227042119.72469-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Fallback to all multicast mode if FW rejects multicast filter programming. The firmware can reject the MC filter programming request if it is running low in resources when there is a large number of functions. The driver must be prepared to fallback to the all-multicast mode if the original MC filter programming request is rejected. Signed-off-by: Ajit Khaparde Reviewed-by: Damodharam Ammepalli --- drivers/net/bnxt/bnxt_ethdev.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 5b775e7716..7aed6d3ab6 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -2947,7 +2947,17 @@ bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev, vnic->flags &= ~BNXT_VNIC_INFO_MCAST; allmulti: - return bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL); + rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, vnic, 0, NULL); + if (rc == -ENOSPC && (vnic->flags & BNXT_VNIC_INFO_MCAST)) { + /* If MCAST addition failed because FW ran out of + * multicast filters, enable all multicast mode. + */ + vnic->flags &= ~BNXT_VNIC_INFO_MCAST; + vnic->flags |= BNXT_VNIC_INFO_ALLMULTI; + goto allmulti; + } + + return rc; } static int