Commit c7757fdb authored by Breno Leitao's avatar Breno Leitao Committed by David S. Miller

ehea: Fixing LRO configuration

In order to set LRO on ehea, the user must set a module parameter, which
is not the standard way to do so. This patch adds a way to set LRO using
the ethtool tool.
Signed-off-by: default avatarBreno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 67631510
...@@ -261,6 +261,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev, ...@@ -261,6 +261,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
} }
static int ehea_set_flags(struct net_device *dev, u32 data)
{
return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO
| ETH_FLAG_TXVLAN
| ETH_FLAG_RXVLAN);
}
const struct ethtool_ops ehea_ethtool_ops = { const struct ethtool_ops ehea_ethtool_ops = {
.get_settings = ehea_get_settings, .get_settings = ehea_get_settings,
.get_drvinfo = ehea_get_drvinfo, .get_drvinfo = ehea_get_drvinfo,
...@@ -273,6 +280,8 @@ const struct ethtool_ops ehea_ethtool_ops = { ...@@ -273,6 +280,8 @@ const struct ethtool_ops ehea_ethtool_ops = {
.get_ethtool_stats = ehea_get_ethtool_stats, .get_ethtool_stats = ehea_get_ethtool_stats,
.get_rx_csum = ehea_get_rx_csum, .get_rx_csum = ehea_get_rx_csum,
.set_settings = ehea_set_settings, .set_settings = ehea_set_settings,
.get_flags = ethtool_op_get_flags,
.set_flags = ehea_set_flags,
.nway_reset = ehea_nway_reset, /* Restart autonegotiation */ .nway_reset = ehea_nway_reset, /* Restart autonegotiation */
}; };
......
...@@ -683,7 +683,7 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, ...@@ -683,7 +683,7 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) &&
pr->port->vgrp); pr->port->vgrp);
if (use_lro) { if (skb->dev->features & NETIF_F_LRO) {
if (vlan_extracted) if (vlan_extracted)
lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb,
pr->port->vgrp, pr->port->vgrp,
...@@ -787,7 +787,7 @@ static int ehea_proc_rwqes(struct net_device *dev, ...@@ -787,7 +787,7 @@ static int ehea_proc_rwqes(struct net_device *dev,
} }
cqe = ehea_poll_rq1(qp, &wqe_index); cqe = ehea_poll_rq1(qp, &wqe_index);
} }
if (use_lro) if (dev->features & NETIF_F_LRO)
lro_flush_all(&pr->lro_mgr); lro_flush_all(&pr->lro_mgr);
pr->rx_packets += processed; pr->rx_packets += processed;
...@@ -3278,6 +3278,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, ...@@ -3278,6 +3278,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
| NETIF_F_LLTX; | NETIF_F_LLTX;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
if (use_lro)
dev->features |= NETIF_F_LRO;
INIT_WORK(&port->reset_task, ehea_reset_port); INIT_WORK(&port->reset_task, ehea_reset_port);
ret = register_netdev(dev); ret = register_netdev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment