Skip to contentSkip to conversation

tg3: Fix NETIF_F_LOOPBACK error

PATCH Superseded Matt Carlson 3 participants 5 messages May 20, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tg3: Fix NETIF_F_LOOPBACK error

Mahesh Bandewar noticed that the features cleanup in commit 0da0606f493c5cdab74bdcc96b12f4305ad94085, entitled "tg3: Consolidate all netdev feature assignments", mistakenly sets NETIF_F_LOOPBACK by default. This patch corrects the error.

---
 drivers/net/tg3.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/tg3.c +2 -1
index 012ce70..0b78c5d 100644
@@ -15080,6 +15080,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 			features |= NETIF_F_TSO_ECN;
 	}
 
+	dev->features |= features;
+
 	/*
 	 * Add loopback capability only for a subset of devices that support
 	 * MAC-LOOPBACK. Eventually this need to be enhanced to allow INT-PHY
@@ -15090,7 +15092,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 		/* Add the loopback capability */
 		features |= NETIF_F_LOOPBACK;
 
-	dev->features |= features;
 	dev->hw_features |= features;
 	dev->vlan_features |= features;
 
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 24 lines · Matt Carlson

Mahesh Bandewar noticed that the features cleanup in commit 0da0606f493c5cdab74bdcc96b12f4305ad94085, entitled "tg3: Consolidate all netdev feature assignments", mistakenly sets NETIF_F_LOOPBACK by default.  This patch corrects the error.

---
 drivers/net/tg3.c |    3 ++-

 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/tg3.c +2 -0
index 012ce70..0b78c5d 100644
@@ -15080,6 +15080,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
                        features |= NETIF_F_TSO_ECN;
        }
 
+       dev->features |= features;
+
        /*
         * Add loopback capability only for a subset of devices that support
         * MAC-LOOPBACK. Eventually this need to be enhanced to allow INT-PHY

drivers/net/tg3.c static int __devinit tg3_init_one(struct pci_dev *pdev, · line 15096

Quoted 6 lines
drivers/net/tg3.c +0 -1
@@ -15090,7 +15092,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
                /* Add the loopback capability */
                features |= NETIF_F_LOOPBACK;
 
-       dev->features |= features;
        dev->hw_features |= features;
        dev->vlan_features |= features;

I think this line should go up too. Otherwise newly created vlan device(s) will have spurious loopback bit set.

Quoted 10 lines
drivers/net/tg3.c +0 -1
--

1.7.3.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 28 lines · Mahesh Bandewar
Quoted 27 lines · Matt Carlson

Mahesh Bandewar noticed that the features cleanup in commit 0da0606f493c5cdab74bdcc96b12f4305ad94085, entitled "tg3: Consolidate all netdev feature assignments", mistakenly sets NETIF_F_LOOPBACK by default. ?This patch corrects the error.

---
?drivers/net/tg3.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

drivers/net/tg3.c +2 -0
index 012ce70..0b78c5d 100644
@@ -15080,6 +15080,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 ? ? ? ? ? ? ? ? ? ? ? ?features |= NETIF_F_TSO_ECN;
 ? ? ? ?}
 
+ ? ? ? dev->features |= features;
+

? ? ? ?/*
? ? ? ? * Add loopback capability only for a subset of devices that support ? ? ? ? * MAC-LOOPBACK. Eventually this need to be enhanced to allow INT-PHY

drivers/net/tg3.c +0 -0
@@ -15090,7 +15092,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,

? ? ? ? ? ? ? ?/* Add the loopback capability */
? ? ? ? ? ? ? ?features |= NETIF_F_LOOPBACK;

Quoted 5 lines
Quoted 3 lines

- ? ? ? dev->features |= features;
? ? ? ?dev->hw_features |= features;
? ? ? ?dev->vlan_features |= features;

I think this line should go up too. Otherwise newly created vlan device(s) will have spurious loopback bit set.

Yes. You are right. I thought vlan_features functioned like hw_features.

#3 lore raw

2011/5/20 Matt Carlson <[email protected]>:

Quoted 29 lines · Mahesh Bandewar
Quoted 28 lines · Matt Carlson
Quoted 27 lines

Mahesh Bandewar noticed that the features cleanup in commit 0da0606f493c5cdab74bdcc96b12f4305ad94085, entitled "tg3: Consolidate all netdev feature assignments", mistakenly sets NETIF_F_LOOPBACK by default. ?This patch corrects the error.

---
?drivers/net/tg3.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

drivers/net/tg3.c +2 -0
index 012ce70..0b78c5d 100644
@@ -15080,6 +15080,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 ? ? ? ? ? ? ? ? ? ? ? ?features |= NETIF_F_TSO_ECN;
 ? ? ? ?}
 
+ ? ? ? dev->features |= features;
+

? ? ? ?/*
? ? ? ? * Add loopback capability only for a subset of devices that support ? ? ? ? * MAC-LOOPBACK. Eventually this need to be enhanced to allow INT-PHY

drivers/net/tg3.c +0 -0
@@ -15090,7 +15092,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,

? ? ? ? ? ? ? ?/* Add the loopback capability */
? ? ? ? ? ? ? ?features |= NETIF_F_LOOPBACK;

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

- ? ? ? dev->features |= features;
? ? ? ?dev->hw_features |= features;
? ? ? ?dev->vlan_features |= features;

I think this line should go up too. Otherwise newly created vlan device(s) will have spurious loopback bit set.

Yes.  You are right.  I thought vlan_features functioned like hw_features.

Probably NETIF_F_LOOPBACK should be forcibly set on VLAN devices when underlying device has it enabled. Just a quick thought for discussion.

Best Regards,
Michał Mirosław

#4 lore raw
Quoted 35 lines · Michał Mirosław

2011/5/20 Matt Carlson <[email protected]>:

Quoted 34 lines · Mahesh Bandewar
Quoted 33 lines · Matt Carlson
Quoted 27 lines

Mahesh Bandewar noticed that the features cleanup in commit 0da0606f493c5cdab74bdcc96b12f4305ad94085, entitled "tg3: Consolidate all netdev feature assignments", mistakenly sets NETIF_F_LOOPBACK by default. ?This patch corrects the error.

---
?drivers/net/tg3.c | ? ?3 ++-
?1 files changed, 2 insertions(+), 1 deletions(-)

drivers/net/tg3.c +2 -0
index 012ce70..0b78c5d 100644
@@ -15080,6 +15080,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 ? ? ? ? ? ? ? ? ? ? ? ?features |= NETIF_F_TSO_ECN;
 ? ? ? ?}
 
+ ? ? ? dev->features |= features;
+

? ? ? ?/*
? ? ? ? * Add loopback capability only for a subset of devices that support ? ? ? ? * MAC-LOOPBACK. Eventually this need to be enhanced to allow INT-PHY

drivers/net/tg3.c +0 -0
@@ -15090,7 +15092,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,

? ? ? ? ? ? ? ?/* Add the loopback capability */
? ? ? ? ? ? ? ?features |= NETIF_F_LOOPBACK;

Quoted 3 lines

- ? ? ? dev->features |= features;
? ? ? ?dev->hw_features |= features;
? ? ? ?dev->vlan_features |= features;

I think this line should go up too. Otherwise newly created vlan device(s) will have spurious loopback bit set.

Quoted 6 lines
Quoted 2 lines

Yes.  You are right.  I thought vlan_features functioned like hw_features.

Probably NETIF_F_LOOPBACK should be forcibly set on VLAN devices when underlying device has it enabled. Just a quick thought for discussion.

I think that's a good idea for the sake of correctness and should be done when we enable / disable loopback.

--mahesh..

Quoted 3 lines

Best Regards,
Michał Mirosław