diff mbox

[net-next,01/11] ixgb: convert to ndo_fix_features

Message ID 20110917132153.GA32572@rere.qmqm.pl
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Michał Mirosław Sept. 17, 2011, 1:21 p.m. UTC
On Fri, Sep 16, 2011 at 07:15:42PM -0700, Jeff Kirsher wrote:
> From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
> Removing this needs deeper surgery.
[...]

Hmm. Looks like this patch is not complete: part removing get/set_flags
from ethtool_ops is missing. I don't remember if this was included or not
in the patch I sent originally. I'm attaching it now, rebased on current
net-next (not tested).

Best Regards,
Michał Mirosław 

---

Finish conversion to unified ethtool ops: convert get_flags.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

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

Comments

Kirsher, Jeffrey T Sept. 20, 2011, 12:02 a.m. UTC | #1
On Sat, 2011-09-17 at 06:21 -0700, Michał Mirosław wrote:
> On Fri, Sep 16, 2011 at 07:15:42PM -0700, Jeff Kirsher wrote:
> > From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > Private rx_csum flags are now duplicate of netdev->features &
> NETIF_F_RXCSUM.
> > Removing this needs deeper surgery.
> [...]
> 
> Hmm. Looks like this patch is not complete: part removing
> get/set_flags
> from ethtool_ops is missing. I don't remember if this was included or
> not
> in the patch I sent originally. I'm attaching it now, rebased on
> current
> net-next (not tested).
> 
> Best Regards,
> Michał Mirosław 
> 
> ---
> 
> Finish conversion to unified ethtool ops: convert get_flags.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> 

Thanks Michal, I have added the patch to my queue.
Michał Mirosław Sept. 23, 2011, 8:56 p.m. UTC | #2
On Mon, Sep 19, 2011 at 05:02:47PM -0700, Jeff Kirsher wrote:
> On Sat, 2011-09-17 at 06:21 -0700, Michał Mirosław wrote:
>> [patch finishing ixgb conversion to hw_features]
> Thanks Michal, I have added the patch to my queue.

I see that only a single driver left: igbvf. What's the status
on its conversion?

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Sept. 24, 2011, 4:47 a.m. UTC | #3
On Fri, 2011-09-23 at 13:56 -0700, Michał Mirosław wrote:
> On Mon, Sep 19, 2011 at 05:02:47PM -0700, Jeff Kirsher wrote:
> > On Sat, 2011-09-17 at 06:21 -0700, Michał Mirosław wrote:
> >> [patch finishing ixgb conversion to hw_features]
> > Thanks Michal, I have added the patch to my queue.
> 
> I see that only a single driver left: igbvf. What's the status
> on its conversion?
> 
> Best Regards,
> Michał Mirosław

Just waiting on validation at this point to verify the patch we have.  I
will see if I can get this patch verified and pushed asap.
Michał Mirosław Oct. 7, 2011, 8:47 p.m. UTC | #4
On Fri, Sep 23, 2011 at 09:47:36PM -0700, Jeff Kirsher wrote:
> On Fri, 2011-09-23 at 13:56 -0700, Michał Mirosław wrote:
> > On Mon, Sep 19, 2011 at 05:02:47PM -0700, Jeff Kirsher wrote:
> > > On Sat, 2011-09-17 at 06:21 -0700, Michał Mirosław wrote:
> > >> [patch finishing ixgb conversion to hw_features]
> > > Thanks Michal, I have added the patch to my queue.
> > I see that only a single driver left: igbvf. What's the status
> > on its conversion?
> Just waiting on validation at this point to verify the patch we have.  I
> will see if I can get this patch verified and pushed asap.

Ping?

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jeff Kirsher Oct. 8, 2011, 2:04 a.m. UTC | #5
On 10/07/2011 01:47 PM, � wrote:
>>> I see that only a single driver left: igbvf. What's the status
>>> > > on its conversion?
>> > Just waiting on validation at this point to verify the patch we have.  I
>> > will see if I can get this patch verified and pushed asap.
> Ping?

There is no change as of yet, all I can say is it will be done.  I am
almost at the point of submitting it upstream and fix it later at this
point.  I share any frustration you may have regarding this conversion.
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c b/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c
index fdb30cc..ab404e7 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c
@@ -634,43 +634,6 @@  ixgb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
 	}
 }
 
-static int ixgb_set_flags(struct net_device *netdev, u32 data)
-{
-	struct ixgb_adapter *adapter = netdev_priv(netdev);
-	bool need_reset;
-	int rc;
-
-	/*
-	 * Tx VLAN insertion does not work per HW design when Rx stripping is
-	 * disabled.  Disable txvlan when rxvlan is turned off, and enable
-	 * rxvlan when txvlan is turned on.
-	 */
-	if (!(data & ETH_FLAG_RXVLAN) &&
-	    (netdev->features & NETIF_F_HW_VLAN_TX))
-		data &= ~ETH_FLAG_TXVLAN;
-	else if (data & ETH_FLAG_TXVLAN)
-		data |= ETH_FLAG_RXVLAN;
-
-	need_reset = (data & ETH_FLAG_RXVLAN) !=
-		     (netdev->features & NETIF_F_HW_VLAN_RX);
-
-	rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_RXVLAN |
-						ETH_FLAG_TXVLAN);
-	if (rc)
-		return rc;
-
-	if (need_reset) {
-		if (netif_running(netdev)) {
-			ixgb_down(adapter, true);
-			ixgb_up(adapter);
-			ixgb_set_speed_duplex(netdev);
-		} else
-			ixgb_reset(adapter);
-	}
-
-	return 0;
-}
-
 static const struct ethtool_ops ixgb_ethtool_ops = {
 	.get_settings = ixgb_get_settings,
 	.set_settings = ixgb_set_settings,
@@ -691,8 +654,6 @@  static const struct ethtool_ops ixgb_ethtool_ops = {
 	.set_phys_id = ixgb_set_phys_id,
 	.get_sset_count = ixgb_get_sset_count,
 	.get_ethtool_stats = ixgb_get_ethtool_stats,
-	.get_flags = ethtool_op_get_flags,
-	.set_flags = ixgb_set_flags,
 };
 
 void ixgb_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index b8fb163..1bb794c 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -325,13 +325,26 @@  ixgb_reset(struct ixgb_adapter *adapter)
 	}
 }
 
+static u32
+ixgb_fix_features(struct net_device *netdev, u32 features)
+{
+	/*
+	 * Tx VLAN insertion does not work per HW design when Rx stripping is
+	 * disabled.
+	 */
+	if (!(features & NETIF_F_HW_VLAN_RX))
+		features &= ~NETIF_F_HW_VLAN_TX;
+
+	return features;
+}
+
 static int
 ixgb_set_features(struct net_device *netdev, u32 features)
 {
 	struct ixgb_adapter *adapter = netdev_priv(netdev);
 	u32 changed = features ^ netdev->features;
 
-	if (!(changed & NETIF_F_RXCSUM))
+	if (!(changed & (NETIF_F_RXCSUM|NETIF_F_HW_VLAN_RX)))
 		return 0;
 
 	adapter->rx_csum = !!(features & NETIF_F_RXCSUM);
@@ -362,6 +375,7 @@  static const struct net_device_ops ixgb_netdev_ops = {
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	.ndo_poll_controller	= ixgb_netpoll,
 #endif
+	.ndo_fix_features       = ixgb_fix_features,
 	.ndo_set_features       = ixgb_set_features,
 };
 
@@ -464,10 +478,10 @@  ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	netdev->hw_features = NETIF_F_SG |
 			   NETIF_F_TSO |
-			   NETIF_F_HW_CSUM;
-	netdev->features = netdev->hw_features |
+			   NETIF_F_HW_CSUM |
 			   NETIF_F_HW_VLAN_TX |
-			   NETIF_F_HW_VLAN_RX |
+			   NETIF_F_HW_VLAN_RX;
+	netdev->features = netdev->hw_features |
 			   NETIF_F_HW_VLAN_FILTER;
 	netdev->hw_features |= NETIF_F_RXCSUM;