nfp: don't advertise hw-tc-offload on non-port netdevs

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/0b9de4ca853b6ba2c92ff0b4602281001b166639
Commit:     0b9de4ca853b6ba2c92ff0b4602281001b166639
Parent:     e3ac6c0737e2b17bf11210e3fd66565e9b818b87
Refname:    refs/heads/master
Author:     Jakub Kicinski <[email protected]>
AuthorDate: Wed Feb 7 20:55:23 2018 -0800
Committer:  David S. Miller <[email protected]>
CommitDate: Thu Feb 8 10:01:27 2018 -0500

    nfp: don't advertise hw-tc-offload on non-port netdevs
    
    nfp_port is a structure which represents an ASIC port, both
    PCIe vNIC (on a PF or a VF) or the external MAC port.  vNIC
    netdev (struct nfp_net) and pure representor netdev (struct
    nfp_repr) both have a pointer to this structure.  nfp_reprs
    always have a port associated.  nfp_nets, however, only represent
    a device port in legacy mode, where they are considered the
    MAC port. In switchdev mode they are just the CPU's side of
    the PCIe link.
    
    By definition TC offloads only apply to device ports.  Don't
    set the flag on vNICs without a port (i.e. in switchdev mode).
    
    Signed-off-by: Jakub Kicinski <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Tested-by: Pieter Jansen van Vuuren <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index c0fd351c86b1..fe77ea8b656c 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -3734,7 +3734,7 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
 
 	netdev->features = netdev->hw_features;
 
-	if (nfp_app_has_tc(nn->app))
+	if (nfp_app_has_tc(nn->app) && nn->port)
 		netdev->hw_features |= NETIF_F_HW_TC;
 
 	/* Advertise but disable TSO by default. */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.