diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2013-06-17 17:16:11 -0400 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2013-06-24 11:40:32 -0400 |
commit | 4ad169300a7350a034b86c543070aed109882a86 (patch) | |
tree | dd760dcedaa64785c95505728c361aef21351e3a /drivers/net | |
parent | ebf4063e869d959daf75efb4ef1c7bc80dcd4800 (diff) |
vxlan: make vxlan_xmit_one void
The function vxlan_xmit_one always returns NETDEV_TX_OK, so there
is no point in keeping track of return values etc.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/vxlan.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 500f9ce437ec..e65241c3d176 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1008,8 +1008,8 @@ static void vxlan_encap_bypass(struct sk_buff *skb, struct vxlan_dev *src_vxlan, | |||
1008 | } | 1008 | } |
1009 | } | 1009 | } |
1010 | 1010 | ||
1011 | static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | 1011 | static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, |
1012 | struct vxlan_rdst *rdst, bool did_rsc) | 1012 | struct vxlan_rdst *rdst, bool did_rsc) |
1013 | { | 1013 | { |
1014 | struct vxlan_dev *vxlan = netdev_priv(dev); | 1014 | struct vxlan_dev *vxlan = netdev_priv(dev); |
1015 | struct rtable *rt; | 1015 | struct rtable *rt; |
@@ -1032,7 +1032,7 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | |||
1032 | if (did_rsc) { | 1032 | if (did_rsc) { |
1033 | /* short-circuited back to local bridge */ | 1033 | /* short-circuited back to local bridge */ |
1034 | vxlan_encap_bypass(skb, vxlan, vxlan); | 1034 | vxlan_encap_bypass(skb, vxlan, vxlan); |
1035 | return NETDEV_TX_OK; | 1035 | return; |
1036 | } | 1036 | } |
1037 | goto drop; | 1037 | goto drop; |
1038 | } | 1038 | } |
@@ -1088,7 +1088,7 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | |||
1088 | if (!dst_vxlan) | 1088 | if (!dst_vxlan) |
1089 | goto tx_error; | 1089 | goto tx_error; |
1090 | vxlan_encap_bypass(skb, vxlan, dst_vxlan); | 1090 | vxlan_encap_bypass(skb, vxlan, dst_vxlan); |
1091 | return NETDEV_TX_OK; | 1091 | return; |
1092 | } | 1092 | } |
1093 | vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh)); | 1093 | vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh)); |
1094 | vxh->vx_flags = htonl(VXLAN_FLAGS); | 1094 | vxh->vx_flags = htonl(VXLAN_FLAGS); |
@@ -1116,7 +1116,7 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, | |||
1116 | IPPROTO_UDP, tos, ttl, df); | 1116 | IPPROTO_UDP, tos, ttl, df); |
1117 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 1117 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |
1118 | 1118 | ||
1119 | return NETDEV_TX_OK; | 1119 | return; |
1120 | 1120 | ||
1121 | drop: | 1121 | drop: |
1122 | dev->stats.tx_dropped++; | 1122 | dev->stats.tx_dropped++; |
@@ -1126,7 +1126,6 @@ tx_error: | |||
1126 | dev->stats.tx_errors++; | 1126 | dev->stats.tx_errors++; |
1127 | tx_free: | 1127 | tx_free: |
1128 | dev_kfree_skb(skb); | 1128 | dev_kfree_skb(skb); |
1129 | return NETDEV_TX_OK; | ||
1130 | } | 1129 | } |
1131 | 1130 | ||
1132 | /* Transmit local packets over Vxlan | 1131 | /* Transmit local packets over Vxlan |
@@ -1142,7 +1141,6 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1142 | bool did_rsc = false; | 1141 | bool did_rsc = false; |
1143 | struct vxlan_rdst *rdst0, *rdst; | 1142 | struct vxlan_rdst *rdst0, *rdst; |
1144 | struct vxlan_fdb *f; | 1143 | struct vxlan_fdb *f; |
1145 | int rc1, rc; | ||
1146 | 1144 | ||
1147 | skb_reset_mac_header(skb); | 1145 | skb_reset_mac_header(skb); |
1148 | eth = eth_hdr(skb); | 1146 | eth = eth_hdr(skb); |
@@ -1170,24 +1168,18 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1170 | } else | 1168 | } else |
1171 | rdst0 = &f->remote; | 1169 | rdst0 = &f->remote; |
1172 | 1170 | ||
1173 | rc = NETDEV_TX_OK; | ||
1174 | 1171 | ||
1175 | /* if there are multiple destinations, send copies */ | 1172 | /* if there are multiple destinations, send copies */ |
1176 | for (rdst = rdst0->remote_next; rdst; rdst = rdst->remote_next) { | 1173 | for (rdst = rdst0->remote_next; rdst; rdst = rdst->remote_next) { |
1177 | struct sk_buff *skb1; | 1174 | struct sk_buff *skb1; |
1178 | 1175 | ||
1179 | skb1 = skb_clone(skb, GFP_ATOMIC); | 1176 | skb1 = skb_clone(skb, GFP_ATOMIC); |
1180 | if (skb1) { | 1177 | if (skb1) |
1181 | rc1 = vxlan_xmit_one(skb1, dev, rdst, did_rsc); | 1178 | vxlan_xmit_one(skb1, dev, rdst, did_rsc); |
1182 | if (rc == NETDEV_TX_OK) | ||
1183 | rc = rc1; | ||
1184 | } | ||
1185 | } | 1179 | } |
1186 | 1180 | ||
1187 | rc1 = vxlan_xmit_one(skb, dev, rdst0, did_rsc); | 1181 | vxlan_xmit_one(skb, dev, rdst0, did_rsc); |
1188 | if (rc == NETDEV_TX_OK) | 1182 | return NETDEV_TX_OK; |
1189 | rc = rc1; | ||
1190 | return rc; | ||
1191 | } | 1183 | } |
1192 | 1184 | ||
1193 | /* Walk the forwarding table and purge stale entries */ | 1185 | /* Walk the forwarding table and purge stale entries */ |