Skip to content

Commit 63e5f95

Browse files
bwhacksdavem330
authored andcommitted
RDMA/nes: Replace LRO with GRO
GRO is simpler to use than the old inet_lro library, and is compatible with forwarding and bridging configurations. Compile-tested only. Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a4f9cdb commit 63e5f95

File tree

4 files changed

+1
-58
lines changed

4 files changed

+1
-58
lines changed

drivers/infiniband/hw/nes/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ config INFINIBAND_NES
22
tristate "NetEffect RNIC Driver"
33
depends on PCI && INET && INFINIBAND
44
select LIBCRC32C
5-
select INET_LRO
65
---help---
76
This is the RDMA Network Interface Card (RNIC) driver for
87
NetEffect Ethernet Cluster Server Adapters.

drivers/infiniband/hw/nes/nes_hw.c

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,11 @@
3535
#include <linux/moduleparam.h>
3636
#include <linux/netdevice.h>
3737
#include <linux/etherdevice.h>
38-
#include <linux/ip.h>
39-
#include <linux/tcp.h>
4038
#include <linux/if_vlan.h>
41-
#include <linux/inet_lro.h>
4239
#include <linux/slab.h>
4340

4441
#include "nes.h"
4542

46-
static unsigned int nes_lro_max_aggr = NES_LRO_MAX_AGGR;
47-
module_param(nes_lro_max_aggr, uint, 0444);
48-
MODULE_PARM_DESC(nes_lro_max_aggr, "NIC LRO max packet aggregation");
49-
5043
static int wide_ppm_offset;
5144
module_param(wide_ppm_offset, int, 0644);
5245
MODULE_PARM_DESC(wide_ppm_offset, "Increase CX4 interface clock ppm offset, 0=100ppm (default), 1=300ppm");
@@ -1642,25 +1635,6 @@ static void nes_rq_wqes_timeout(unsigned long parm)
16421635
}
16431636

16441637

1645-
static int nes_lro_get_skb_hdr(struct sk_buff *skb, void **iphdr,
1646-
void **tcph, u64 *hdr_flags, void *priv)
1647-
{
1648-
unsigned int ip_len;
1649-
struct iphdr *iph;
1650-
skb_reset_network_header(skb);
1651-
iph = ip_hdr(skb);
1652-
if (iph->protocol != IPPROTO_TCP)
1653-
return -1;
1654-
ip_len = ip_hdrlen(skb);
1655-
skb_set_transport_header(skb, ip_len);
1656-
*tcph = tcp_hdr(skb);
1657-
1658-
*hdr_flags = LRO_IPV4 | LRO_TCP;
1659-
*iphdr = iph;
1660-
return 0;
1661-
}
1662-
1663-
16641638
/**
16651639
* nes_init_nic_qp
16661640
*/
@@ -1895,14 +1869,6 @@ int nes_init_nic_qp(struct nes_device *nesdev, struct net_device *netdev)
18951869
return -ENOMEM;
18961870
}
18971871

1898-
nesvnic->lro_mgr.max_aggr = nes_lro_max_aggr;
1899-
nesvnic->lro_mgr.max_desc = NES_MAX_LRO_DESCRIPTORS;
1900-
nesvnic->lro_mgr.lro_arr = nesvnic->lro_desc;
1901-
nesvnic->lro_mgr.get_skb_header = nes_lro_get_skb_hdr;
1902-
nesvnic->lro_mgr.features = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
1903-
nesvnic->lro_mgr.dev = netdev;
1904-
nesvnic->lro_mgr.ip_summed = CHECKSUM_UNNECESSARY;
1905-
nesvnic->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;
19061872
return 0;
19071873
}
19081874

@@ -2809,13 +2775,10 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
28092775
u16 pkt_type;
28102776
u16 rqes_processed = 0;
28112777
u8 sq_cqes = 0;
2812-
u8 nes_use_lro = 0;
28132778

28142779
head = cq->cq_head;
28152780
cq_size = cq->cq_size;
28162781
cq->cqes_pending = 1;
2817-
if (nesvnic->netdev->features & NETIF_F_LRO)
2818-
nes_use_lro = 1;
28192782
do {
28202783
if (le32_to_cpu(cq->cq_vbase[head].cqe_words[NES_NIC_CQE_MISC_IDX]) &
28212784
NES_NIC_CQE_VALID) {
@@ -2950,10 +2913,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
29502913

29512914
__vlan_hwaccel_put_tag(rx_skb, htons(ETH_P_8021Q), vlan_tag);
29522915
}
2953-
if (nes_use_lro)
2954-
lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
2955-
else
2956-
netif_receive_skb(rx_skb);
2916+
napi_gro_receive(&nesvnic->napi, rx_skb);
29572917

29582918
skip_rx_indicate0:
29592919
;
@@ -2984,8 +2944,6 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq)
29842944

29852945
} while (1);
29862946

2987-
if (nes_use_lro)
2988-
lro_flush_all(&nesvnic->lro_mgr);
29892947
if (sq_cqes) {
29902948
barrier();
29912949
/* restart the queue if it had been stopped */

drivers/infiniband/hw/nes/nes_hw.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
#ifndef __NES_HW_H
3434
#define __NES_HW_H
3535

36-
#include <linux/inet_lro.h>
37-
3836
#define NES_PHY_TYPE_CX4 1
3937
#define NES_PHY_TYPE_1G 2
4038
#define NES_PHY_TYPE_ARGUS 4
@@ -1049,8 +1047,6 @@ struct nes_hw_tune_timer {
10491047
#define NES_TIMER_ENABLE_LIMIT 4
10501048
#define NES_MAX_LINK_INTERRUPTS 128
10511049
#define NES_MAX_LINK_CHECK 200
1052-
#define NES_MAX_LRO_DESCRIPTORS 32
1053-
#define NES_LRO_MAX_AGGR 64
10541050

10551051
struct nes_adapter {
10561052
u64 fw_ver;
@@ -1263,9 +1259,6 @@ struct nes_vnic {
12631259
u8 next_qp_nic_index;
12641260
u8 of_device_registered;
12651261
u8 rdma_enabled;
1266-
u32 lro_max_aggr;
1267-
struct net_lro_mgr lro_mgr;
1268-
struct net_lro_desc lro_desc[NES_MAX_LRO_DESCRIPTORS];
12691262
struct timer_list event_timer;
12701263
enum ib_event_type delayed_event;
12711264
enum ib_event_type last_dispatched_event;

drivers/infiniband/hw/nes/nes_nic.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,9 +1085,6 @@ static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = {
10851085
"Free 4Kpbls",
10861086
"Free 256pbls",
10871087
"Timer Inits",
1088-
"LRO aggregated",
1089-
"LRO flushed",
1090-
"LRO no_desc",
10911088
"PAU CreateQPs",
10921089
"PAU DestroyQPs",
10931090
};
@@ -1302,9 +1299,6 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev,
13021299
target_stat_values[++index] = nesadapter->free_4kpbl;
13031300
target_stat_values[++index] = nesadapter->free_256pbl;
13041301
target_stat_values[++index] = int_mod_timer_init;
1305-
target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated;
1306-
target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed;
1307-
target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc;
13081302
target_stat_values[++index] = atomic_read(&pau_qps_created);
13091303
target_stat_values[++index] = atomic_read(&pau_qps_destroyed);
13101304
}
@@ -1709,7 +1703,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
17091703
netdev->hw_features |= NETIF_F_TSO;
17101704

17111705
netdev->features = netdev->hw_features | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_TX;
1712-
netdev->hw_features |= NETIF_F_LRO;
17131706

17141707
nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d,"
17151708
" nic_index = %d, logical_port = %d, mac_index = %d.\n",

0 commit comments

Comments
 (0)