Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: flowtable: remove hw_ifidx

hw_ifidx was originally introduced to store the real netdevice as a
requirement for the hardware offload support in:

73f97025a972 ("netfilter: nft_flow_offload: use direct xmit if hardware offload is enabled")

Since ("netfilter: flowtable: consolidate xmit path"), ifidx and
hw_ifidx points to the real device in the xmit path, remove it.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

+1 -6
-1
include/net/netfilter/nf_flow_table.h
··· 146 146 }; 147 147 struct { 148 148 u32 ifidx; 149 - u32 hw_ifidx; 150 149 u8 h_source[ETH_ALEN]; 151 150 u8 h_dest[ETH_ALEN]; 152 151 } out;
-1
net/netfilter/nf_flow_table_core.c
··· 127 127 memcpy(flow_tuple->out.h_source, route->tuple[dir].out.h_source, 128 128 ETH_ALEN); 129 129 flow_tuple->out.ifidx = route->tuple[dir].out.ifindex; 130 - flow_tuple->out.hw_ifidx = route->tuple[dir].out.hw_ifindex; 131 130 dst_release(dst); 132 131 break; 133 132 case FLOW_OFFLOAD_XMIT_XFRM:
+1 -1
net/netfilter/nf_flow_table_offload.c
··· 555 555 switch (this_tuple->xmit_type) { 556 556 case FLOW_OFFLOAD_XMIT_DIRECT: 557 557 this_tuple = &flow->tuplehash[dir].tuple; 558 - ifindex = this_tuple->out.hw_ifidx; 558 + ifindex = this_tuple->out.ifidx; 559 559 break; 560 560 case FLOW_OFFLOAD_XMIT_NEIGH: 561 561 other_tuple = &flow->tuplehash[!dir].tuple;
-3
net/netfilter/nf_flow_table_path.c
··· 75 75 struct nft_forward_info { 76 76 const struct net_device *indev; 77 77 const struct net_device *outdev; 78 - const struct net_device *hw_outdev; 79 78 struct id { 80 79 __u16 id; 81 80 __be16 proto; ··· 158 159 } 159 160 } 160 161 info->outdev = info->indev; 161 - info->hw_outdev = info->indev; 162 162 163 163 if (nf_flowtable_hw_offload(flowtable) && 164 164 nft_is_valid_ether_device(info->indev)) ··· 210 212 if (info.xmit_type == FLOW_OFFLOAD_XMIT_DIRECT) { 211 213 memcpy(route->tuple[dir].out.h_source, info.h_source, ETH_ALEN); 212 214 memcpy(route->tuple[dir].out.h_dest, info.h_dest, ETH_ALEN); 213 - route->tuple[dir].out.hw_ifindex = info.hw_outdev->ifindex; 214 215 route->tuple[dir].xmit_type = info.xmit_type; 215 216 } 216 217 }