Remove the inet_lro library
Subsystems (3)
cover Remove the inet_lro library
The old inet_lro library has been deprecated ever since GRO was introduced, but there are still a few drivers using it. Convert them to GRO and remove it.
Ben.
Ben Hutchings (3):
pasemi_mac: Replace LRO with GRO
RDMA/nes: Replace LRO with GRO
ipv4: Remove inet_lro library
drivers/infiniband/hw/nes/Kconfig | 1 - drivers/infiniband/hw/nes/nes_hw.c | 44 +-- drivers/infiniband/hw/nes/nes_hw.h | 7 - drivers/infiniband/hw/nes/nes_nic.c | 7 - drivers/net/ethernet/pasemi/Kconfig | 5 +- drivers/net/ethernet/pasemi/pasemi_mac.c | 50 +-- drivers/net/ethernet/pasemi/pasemi_mac.h | 4 - drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c | 1 - include/linux/inet_lro.h | 142 --------- net/ipv4/Kconfig | 8 - net/ipv4/Makefile | 1 - net/ipv4/inet_lro.c | 374 ----------------------- 12 files changed, 4 insertions(+), 640 deletions(-) delete mode 100644 include/linux/inet_lro.h delete mode 100644 net/ipv4/inet_lro.c
PATCH 1/3 pasemi_mac: 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.
--- drivers/net/ethernet/pasemi/Kconfig | 5 +-- drivers/net/ethernet/pasemi/pasemi_mac.c | 50 +----------------------- drivers/net/ethernet/pasemi/pasemi_mac.h | 4 -- drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c | 1 - 4 files changed, 3 insertions(+), 57 deletions(-)
drivers/net/ethernet/pasemi/Kconfig +2 -3
@@ -5,7 +5,7 @@ config NET_VENDOR_PASEMI bool "PA Semi devices" default y - depends on PPC_PASEMI && PCI && INET + depends on PPC_PASEMI && PCI ---help--- If you have a network (Ethernet) card belonging to this class, say Y.
@@ -18,9 +18,8 @@ if NET_VENDOR_PASEMI config PASEMI_MAC tristate "PA Semi 1/10Gbit MAC" - depends on PPC_PASEMI && PCI && INET + depends on PPC_PASEMI && PCI select PHYLIB - select INET_LRO ---help--- This driver supports the on-chip 1/10Gbit Ethernet controller on PA Semi's PWRficient line of chips.
drivers/net/ethernet/pasemi/pasemi_mac.c +1 -49
90 lines not on this page · raw message
drivers/net/ethernet/pasemi/pasemi_mac.h +0 -4
@@ -31,7 +31,6 @@#define CS_RING_SIZE (TX_RING_SIZE*2) -#define MAX_LRO_DESCRIPTORS 8#define MAX_CS 2struct pasemi_mac_txring {
@@ -84,10 +83,7 @@ struct pasemi_mac {u8 mac_addr[ETH_ALEN ]; -struct net_lro_mgr lro_mgr; -struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS ];struct timer_list rxtimer; -unsigned int lro_max_aggr;struct pasemi_mac_txring *tx;struct pasemi_mac_rxring *rx;
drivers/net/ethernet/pasemi/pasemi_mac_ethtool.c +0 -1
@@ -20,7 +20,6 @@#include <linux/netdevice.h> #include <linux/ethtool.h> #include <linux/pci.h> -#include <linux/inet_lro.h> #include <asm/pasemi_dma.h> #include "pasemi_mac.h"
PATCH 2/3 RDMA/nes: Replace LRO with GRO
In reply to Ben HutchingsGRO is simpler to use than the old inet_lro library, and is compatible with forwarding and bridging configurations.
Compile-tested only.
--- drivers/infiniband/hw/nes/Kconfig | 1 - drivers/infiniband/hw/nes/nes_hw.c | 44 +------------------------------------ drivers/infiniband/hw/nes/nes_hw.h | 7 ------ drivers/infiniband/hw/nes/nes_nic.c | 7 ------ 4 files changed, 1 insertion(+), 58 deletions(-)
drivers/infiniband/hw/nes/Kconfig +0 -1
@@ -2,7 +2,6 @@ config INFINIBAND_NES tristate "NetEffect RNIC Driver" depends on PCI && INET && INFINIBAND select LIBCRC32C - select INET_LRO ---help--- This is the RDMA Network Interface Card (RNIC) driver for NetEffect Ethernet Cluster Server Adapters.
drivers/infiniband/hw/nes/nes_hw.c +1 -43
89 lines not on this page · raw message
drivers/infiniband/hw/nes/nes_hw.h +0 -7
@@ -33,8 +33,6 @@#ifndef __NES_HW_H#define __NES_HW_H -#include <linux/inet_lro.h> -#define NES_PHY_TYPE_CX4 1#define NES_PHY_TYPE_1G 2#define NES_PHY_TYPE_ARGUS 4
@@ -1049,8 +1047,6 @@ struct nes_hw_tune_timer {#define NES_TIMER_ENABLE_LIMIT 4#define NES_MAX_LINK_INTERRUPTS 128#define NES_MAX_LINK_CHECK 200 -#define NES_MAX_LRO_DESCRIPTORS 32 -#define NES_LRO_MAX_AGGR 64struct nes_adapter {u64 fw_ver;
@@ -1263,9 +1259,6 @@ struct nes_vnic {u8 next_qp_nic_index;u8 of_device_registered;u8 rdma_enabled; -u32 lro_max_aggr; -struct net_lro_mgr lro_mgr; -struct net_lro_desc lro_desc[NES_MAX_LRO_DESCRIPTORS ];struct timer_list event_timer;enum ib_event_type delayed_event;enum ib_event_type last_dispatched_event;
drivers/infiniband/hw/nes/nes_nic.c +0 -7
@@ -1085,9 +1085,6 @@ static const char nes_ethtool_stringset[][ETH_GSTRING_LEN] = {"Free 4Kpbls" ,"Free 256pbls" ,"Timer Inits" , -"LRO aggregated" , -"LRO flushed" , -"LRO no_desc" ,"PAU CreateQPs" , "PAU DestroyQPs", };
@@ -1302,9 +1299,6 @@ static void nes_netdev_get_ethtool_stats(struct net_device *netdev, target_stat_values[++index] = nesadapter->free_4kpbl; target_stat_values[++index] = nesadapter->free_256pbl; target_stat_values[++index] = int_mod_timer_init; - target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated; - target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed; - target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc; target_stat_values[++index] =atomic_read (&pau_qps_created); target_stat_values[++index] =atomic_read (&pau_qps_destroyed); }
@@ -1709,7 +1703,6 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev, netdev->hw_features |=NETIF_F_TSO ; netdev->features = netdev->hw_features |NETIF_F_HIGHDMA |NETIF_F_HW_VLAN_CTAG_TX ; - netdev->hw_features |=NETIF_F_LRO ; nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d," " nic_index = %d, logical_port = %d, mac_index = %d.\n",
PATCH 3/3 ipv4: Remove inet_lro library
In reply to Ben HutchingsThere are no longer any in-tree drivers that use it.
--- include/linux/inet_lro.h | 142 ------------------ net/ipv4/Kconfig | 8 - net/ipv4/Makefile | 1 - net/ipv4/inet_lro.c | 374 ----------------------------------------------- 4 files changed, 525 deletions(-) delete mode 100644 include/linux/inet_lro.h delete mode 100644 net/ipv4/inet_lro.c
include/linux/inet_lro.h deleted +0 -142
@@ -1,142 +0,0 @@ -/* -* linux/include/linux/inet_lro.h -* -* Large Receive Offload (ipv4 / tcp) -* -* (C) Copyright IBM Corp. 2007 -* -* Authors: -* Jan-Bernd Themann <[email protected]> -* Christoph Raisch <[email protected]> -* -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2, or (at your option) -* any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __INET_LRO_H_ -#define __INET_LRO_H_ - -#include <net/ip.h> -#include <net/tcp.h> - -/* -* LRO statistics -*/ - -struct net_lro_stats { -unsigned long aggregated; -unsigned long flushed; -unsigned long no_desc; -}; - -/* -* LRO descriptor for a tcp session -*/ -struct net_lro_desc { -struct sk_buff *parent; -struct sk_buff *last_skb; -struct skb_frag_struct *next_frag; -struct iphdr *iph; -struct tcphdr *tcph; -__wsum data_csum; -__be32 tcp_rcv_tsecr; -__be32 tcp_rcv_tsval; -__be32 tcp_ack; -u32 tcp_next_seq; -u32 skb_tot_frags_len; -u16 ip_tot_len; -u16 tcp_saw_tstamp;/* timestamps enabled */ -__be16 tcp_window; -int pkt_aggr_cnt;/* counts aggregated packets */ -int vlan_packet; -int mss; -int active; -}; - -/* -* Large Receive Offload (LRO) Manager -* -* Fields must be set by driver -*/ - -struct net_lro_mgr { -struct net_device *dev; -struct net_lro_stats stats; - -/* LRO features */ -unsigned long features; -#define LRO_F_NAPI 1/* Pass packets to stack via NAPI */ -#define LRO_F_EXTRACT_VLAN_ID 2/* Set flag if VLAN IDs are extracted -from received packets and eth protocol -is still ETH_P_8021Q */ - -/* -* Set for generated SKBs that are not added to -* the frag list in fragmented mode -*/ -u32 ip_summed; -u32 ip_summed_aggr;/* Set in aggregated SKBs: CHECKSUM_UNNECESSARY -* or CHECKSUM_NONE */ - -int max_desc;/* Max number of LRO descriptors */ -int max_aggr;/* Max number of LRO packets to be aggregated */ - -int frag_align_pad;/* Padding required to properly align layer 3 -* headers in generated skb when using frags */ - -struct net_lro_desc *lro_arr;/* Array of LRO descriptors */ - -/* -* Optimized driver functions -* -* get_skb_header: returns tcp and ip header for packet in SKB -*/ -int (*get_skb_header)(struct sk_buff *skb,void **ip_hdr, -void **tcpudp_hdr,u64 *hdr_flags,void *priv); - -/* hdr_flags: */ -#define LRO_IPV4 1/* ip_hdr is IPv4 header */ -#define LRO_TCP 2/* tcpudp_hdr is TCP header */ - -/* -* get_frag_header: returns mac, tcp and ip header for packet in SKB -* -* @hdr_flags: Indicate what kind of LRO has to be done -* (IPv4/IPv6/TCP/UDP) -*/ -int (*get_frag_header)(struct skb_frag_struct *frag,void **mac_hdr, -void **ip_hdr,void **tcpudp_hdr,u64 *hdr_flags, -void *priv); -}; - -/* -* Processes a SKB -* -* @lro_mgr: LRO manager to use -* @skb: SKB to aggregate -* @priv: Private data that may be used by driver functions -* (for example get_tcp_ip_hdr) -*/ - -void lro_receive_skb (struct net_lro_mgr *lro_mgr, -struct sk_buff *skb, -void *priv); -/* -* Forward all aggregated SKBs held by lro_mgr to network stack -*/ - -void lro_flush_all (struct net_lro_mgr *lro_mgr); - -#endif
net/ipv4/Kconfig +0 -8
@@ -405,14 +405,6 @@ config INET_XFRM_MODE_BEET If unsure, say Y. -config INET_LRO - tristate "Large Receive Offload (ipv4/tcp)" - default y - ---help--- - Support for Large Receive Offload (ipv4/tcp). - - If unsure, say Y. - config INET_DIAG tristate "INET: socket monitoring interface" default y
net/ipv4/Makefile +0 -1
@@ -32,7 +32,6 @@ obj-$(CONFIG_INET_ESP) += esp4.o obj-$(CONFIG_INET_IPCOMP) += ipcomp.o obj-$(CONFIG_INET_XFRM_TUNNEL) += xfrm4_tunnel.o obj-$(CONFIG_INET_XFRM_MODE_BEET) += xfrm4_mode_beet.o -obj-$(CONFIG_INET_LRO) += inet_lro.o obj-$(CONFIG_INET_TUNNEL) += tunnel4.o obj-$(CONFIG_INET_XFRM_MODE_TRANSPORT) += xfrm4_mode_transport.o obj-$(CONFIG_INET_XFRM_MODE_TUNNEL) += xfrm4_mode_tunnel.o
net/ipv4/inet_lro.c deleted +0 -374
374 lines not on this page · raw message
From: Ben Hutchings <[email protected]>
Date: Mon, 15 Feb 2016 21:23:52 +0000
Quoted 3 lines
The old
inet_lrolibrary has been deprecated ever since GRO was introduced, but there are still a few drivers using it. Convert them to GRO and remove it.
A nice and long overdue cleanups.
Applied, thanks Ben.