diff mbox series

[net-next,2/2] net-gro: remove GRO_DROP

Message ID 20210108113903.3779510-3-eric.dumazet@gmail.com (mailing list archive)
State Accepted
Commit 1d11fa696733ffb9ac24771716b1b1b9953e5a48
Delegated to: Netdev Maintainers
Headers show
Series net-gro: GRO_DROP deprecation | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 7 maintainers not CCed: ast@kernel.org bjorn.topel@intel.com daniel@iogearbox.net andriin@fb.com ap420073@gmail.com xiyou.wangcong@gmail.com jiri@mellanox.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 7182 this patch: 7182
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 36 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 7587 this patch: 7587
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Eric Dumazet Jan. 8, 2021, 11:39 a.m. UTC
From: Eric Dumazet <edumazet@google.com>

GRO_DROP can only be returned from napi_gro_frags()
if the skb has not been allocated by a prior napi_get_frags()

Since drivers must use napi_get_frags() and test its result
before populating the skb with metadata, we can safely remove
GRO_DROP since it offers no practical use.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
 include/linux/netdevice.h |  1 -
 net/core/dev.c            | 11 -----------
 2 files changed, 12 deletions(-)

Comments

Edward Cree Jan. 8, 2021, 12:32 p.m. UTC | #1
On 08/01/2021 11:39, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> GRO_DROP can only be returned from napi_gro_frags()
> if the skb has not been allocated by a prior napi_get_frags()
> 
> Since drivers must use napi_get_frags() and test its result
> before populating the skb with metadata, we can safely remove
> GRO_DROP since it offers no practical use.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>

Fwiw,
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
diff mbox series

Patch

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1ec3ac5d5bbffe6062216fbd4009e88d8c909fa9..5b949076ed2319fc676a7172350480efea5807d9 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -376,7 +376,6 @@  enum gro_result {
 	GRO_MERGED_FREE,
 	GRO_HELD,
 	GRO_NORMAL,
-	GRO_DROP,
 	GRO_CONSUMED,
 };
 typedef enum gro_result gro_result_t;
diff --git a/net/core/dev.c b/net/core/dev.c
index 7afbb642e203ad1556e96e2fc7595b6289152201..e4d77c8abe761408caf3a0d1880727f33b5134b6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6070,10 +6070,6 @@  static gro_result_t napi_skb_finish(struct napi_struct *napi,
 		gro_normal_one(napi, skb);
 		break;
 
-	case GRO_DROP:
-		kfree_skb(skb);
-		break;
-
 	case GRO_MERGED_FREE:
 		if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD)
 			napi_skb_free_stolen_head(skb);
@@ -6158,10 +6154,6 @@  static gro_result_t napi_frags_finish(struct napi_struct *napi,
 			gro_normal_one(napi, skb);
 		break;
 
-	case GRO_DROP:
-		napi_reuse_skb(napi, skb);
-		break;
-
 	case GRO_MERGED_FREE:
 		if (NAPI_GRO_CB(skb)->free == NAPI_GRO_FREE_STOLEN_HEAD)
 			napi_skb_free_stolen_head(skb);
@@ -6223,9 +6215,6 @@  gro_result_t napi_gro_frags(struct napi_struct *napi)
 	gro_result_t ret;
 	struct sk_buff *skb = napi_frags_skb(napi);
 
-	if (!skb)
-		return GRO_DROP;
-
 	trace_napi_gro_frags_entry(skb);
 
 	ret = napi_frags_finish(napi, skb, dev_gro_receive(napi, skb));