]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bnxt_en: Log a message, if enabling NTUPLE filtering fails.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Mon, 25 Jul 2016 16:33:36 +0000 (12:33 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Jul 2016 04:43:31 +0000 (21:43 -0700)
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@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 7de7d7ac7c3a6584c6645d57832e521996700b8a..eac0f2b9133c4846ab84c020ec8c908e1182361f 100644 (file)
@@ -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