[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=hENeGisVP1Nx87_V5kW5y-YAaYF7Xj_aakEz0Cc6mswJqdA@mail.gmail.com>
Date: Wed, 27 Jul 2016 15:31:40 +0800
From: zhuyj <zyjzyj2000@...il.com>
To: Michael Chan <michael.chan@...adcom.com>
Cc: "David S. Miller" <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2 2/3] bnxt_en: Log a message, if enabling
NTUPLE filtering fails.
+ if (vnics > pf->max_rsscos_ctxs || vnics > pf->max_vnics) {
<-----Does this happen very rarely? If so,
if (unlikely(vnics > pf->max_rsscos_ctxs || vnics > pf->max_vnics) { is better?
+ netdev_warn(bp->dev,
+ "Not enough resources to support NTUPLE
filters, enough resources for up to %d rx rings\n",
+ min(pf->max_rsscos_ctxs - 1, pf->max_vnics - 1));
return false;
+ }
On Tue, Jul 26, 2016 at 12:33 AM, Michael Chan
<michael.chan@...adcom.com> wrote:
> From: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
>
> If there are not enough resources to enable ntuple filtering,
> log a warning message.
>
> v2: Use single message and add missing newline.
>
> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
> Signed-off-by: Michael Chan <michael.chan@...adcom.com>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 7de7d7a..eac0f2b 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -5790,8 +5790,12 @@ static bool bnxt_rfs_capable(struct bnxt *bp)
> return false;
>
> vnics = 1 + bp->rx_nr_rings;
> - if (vnics > pf->max_rsscos_ctxs || vnics > pf->max_vnics)
> + if (vnics > pf->max_rsscos_ctxs || vnics > pf->max_vnics) {
> + netdev_warn(bp->dev,
> + "Not enough resources to support NTUPLE filters, enough resources for up to %d rx rings\n",
> + min(pf->max_rsscos_ctxs - 1, pf->max_vnics - 1));
> return false;
> + }
>
> return true;
> #else
> @@ -5804,7 +5808,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
> {
> struct bnxt *bp = netdev_priv(dev);
>
> - if (!bnxt_rfs_capable(bp))
> + if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
> features &= ~NETIF_F_NTUPLE;
>
> /* Both CTAG and STAG VLAN accelaration on the RX side have to be
> --
> 1.8.3.1
>
Powered by blists - more mailing lists