patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
To: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH 19.11] net/bnxt: reset filter indices on free
Date: Thu, 3 Jun 2021 07:17:53 +0200
Message-ID: <CAATJJ0JjQ7XVzGTADQeeN3bgGVa6RbmuUpo3ihR0zJG4AJ6KQg@mail.gmail.com> (raw)
In-Reply-To: <20210429143622.27557-1-kalesh-anakkur.purayil@broadcom.com>

On Thu, Apr 29, 2021 at 4:14 PM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> [ upstream commit 7105de7085b022a84ffefbfad6a140e493ee0612 ]

Thanks for the backport, applied

> Fix bnxt_free_filter() to ensure that the filter indices
> are reset correctly when a filter is freed.
>
> This change helps in avoiding few duplicate code as well.
>
> Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array")
> Fixes: 5c1171c97216 ("net/bnxt: refactor filter/flow")
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 10 ----------
>  drivers/net/bnxt/bnxt_filter.c |  5 +++++
>  drivers/net/bnxt/bnxt_flow.c   |  1 -
>  3 files changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 06843d8..7ec72a1 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -1038,8 +1038,6 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
>                                 STAILQ_REMOVE(&vnic->filter, filter,
>                                                 bnxt_filter_info, next);
>                                 bnxt_hwrm_clear_l2_filter(bp, filter);
> -                               filter->mac_index = INVALID_MAC_INDEX;
> -                               memset(&filter->l2_addr, 0, RTE_ETHER_ADDR_LEN);
>                                 bnxt_free_filter(bp, filter);
>                         }
>                         filter = temp_filter;
> @@ -1086,7 +1084,6 @@ static int bnxt_add_mac_filter(struct bnxt *bp, struct bnxt_vnic_info *vnic,
>                 else
>                         STAILQ_INSERT_TAIL(&vnic->filter, filter, next);
>         } else {
> -               memset(&filter->l2_addr, 0, RTE_ETHER_ADDR_LEN);
>                 bnxt_free_filter(bp, filter);
>         }
>
> @@ -1841,7 +1838,6 @@ static int bnxt_add_vlan_filter(struct bnxt *bp, uint16_t vlan_id)
>                 /* Free the newly allocated filter as we were
>                  * not able to create the filter in hardware.
>                  */
> -               filter->fw_l2_filter_id = UINT64_MAX;
>                 bnxt_free_filter(bp, filter);
>                 return rc;
>         }
> @@ -1896,7 +1892,6 @@ static int bnxt_del_dflt_mac_filter(struct bnxt *bp,
>                                 STAILQ_REMOVE(&vnic->filter, filter,
>                                               bnxt_filter_info, next);
>                                 bnxt_free_filter(bp, filter);
> -                               filter->fw_l2_filter_id = UINT64_MAX;
>                         }
>                         return rc;
>                 }
> @@ -2845,14 +2840,11 @@ bnxt_cfg_ntuple_filter(struct bnxt *bp,
>
>                 STAILQ_REMOVE(&vnic->filter, mfilter, bnxt_filter_info, next);
>                 bnxt_free_filter(bp, mfilter);
> -               mfilter->fw_l2_filter_id = -1;
>                 bnxt_free_filter(bp, bfilter);
> -               bfilter->fw_l2_filter_id = -1;
>         }
>
>         return 0;
>  free_filter:
> -       bfilter->fw_l2_filter_id = -1;
>         bnxt_free_filter(bp, bfilter);
>         return ret;
>  }
> @@ -3250,7 +3242,6 @@ bnxt_fdir_filter(struct rte_eth_dev *dev,
>                         STAILQ_REMOVE(&vnic->filter, match,
>                                       bnxt_filter_info, next);
>                         bnxt_free_filter(bp, match);
> -                       filter->fw_l2_filter_id = -1;
>                         bnxt_free_filter(bp, filter);
>                 }
>                 break;
> @@ -3283,7 +3274,6 @@ bnxt_fdir_filter(struct rte_eth_dev *dev,
>         return ret;
>
>  free_filter:
> -       filter->fw_l2_filter_id = -1;
>         bnxt_free_filter(bp, filter);
>         return ret;
>  }
> diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
> index f4b18d5..2b33d26 100644
> --- a/drivers/net/bnxt/bnxt_filter.c
> +++ b/drivers/net/bnxt/bnxt_filter.c
> @@ -193,5 +193,10 @@ struct bnxt_filter_info *bnxt_get_unused_filter(struct bnxt *bp)
>
>  void bnxt_free_filter(struct bnxt *bp, struct bnxt_filter_info *filter)
>  {
> +       memset(filter, 0, sizeof(*filter));
> +       filter->mac_index = INVALID_MAC_INDEX;
> +       filter->fw_l2_filter_id = UINT64_MAX;
> +       filter->fw_ntuple_filter_id = UINT64_MAX;
> +       filter->fw_em_filter_id = UINT64_MAX;
>         STAILQ_INSERT_TAIL(&bp->free_filter_list, filter, next);
>  }
> diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
> index f069e5f..575924a 100644
> --- a/drivers/net/bnxt/bnxt_flow.c
> +++ b/drivers/net/bnxt/bnxt_flow.c
> @@ -1502,7 +1502,6 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
>
>  exit:
>         /* No need to hold on to this filter if we are just validating flow */
> -       filter->fw_l2_filter_id = UINT64_MAX;
>         bnxt_free_filter(bp, filter);
>         bnxt_release_flow_lock(bp);
>
> --
> 2.10.1
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

      reply	other threads:[~2021-06-03  5:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 14:36 Kalesh A P
2021-06-03  5:17 ` Christian Ehrhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAATJJ0JjQ7XVzGTADQeeN3bgGVa6RbmuUpo3ihR0zJG4AJ6KQg@mail.gmail.com \
    --to=christian.ehrhardt@canonical.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git