Skip to content

Commit c7757fd

Browse files
Breno Leitaodavem330
authored andcommitted
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: Breno Leitao <leitao@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6763151 commit c7757fd

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

‎drivers/net/ehea/ehea_ethtool.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
261261

262262
}
263263

264+
static int ehea_set_flags(struct net_device *dev, u32 data)
265+
{
266+
return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO
267+
| ETH_FLAG_TXVLAN
268+
| ETH_FLAG_RXVLAN);
269+
}
270+
264271
const struct ethtool_ops ehea_ethtool_ops = {
265272
.get_settings = ehea_get_settings,
266273
.get_drvinfo = ehea_get_drvinfo,
@@ -273,6 +280,8 @@ const struct ethtool_ops ehea_ethtool_ops = {
273280
.get_ethtool_stats = ehea_get_ethtool_stats,
274281
.get_rx_csum = ehea_get_rx_csum,
275282
.set_settings = ehea_set_settings,
283+
.get_flags = ethtool_op_get_flags,
284+
.set_flags = ehea_set_flags,
276285
.nway_reset = ehea_nway_reset, /* Restart autonegotiation */
277286
};
278287

‎drivers/net/ehea/ehea_main.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe,
683683
int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) &&
684684
pr->port->vgrp);
685685

686-
if (use_lro) {
686+
if (skb->dev->features & NETIF_F_LRO) {
687687
if (vlan_extracted)
688688
lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb,
689689
pr->port->vgrp,
@@ -787,7 +787,7 @@ static int ehea_proc_rwqes(struct net_device *dev,
787787
}
788788
cqe = ehea_poll_rq1(qp, &wqe_index);
789789
}
790-
if (use_lro)
790+
if (dev->features & NETIF_F_LRO)
791791
lro_flush_all(&pr->lro_mgr);
792792

793793
pr->rx_packets += processed;
@@ -3278,6 +3278,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
32783278
| NETIF_F_LLTX;
32793279
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
32803280

3281+
if (use_lro)
3282+
dev->features |= NETIF_F_LRO;
3283+
32813284
INIT_WORK(&port->reset_task, ehea_reset_port);
32823285

32833286
ret = register_netdev(dev);

0 commit comments

Comments
 (0)