aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-03-04 19:08:08 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:23:30 -0400
commitd5f1ce9a5e80fb315c86b036a89b1237fdf11938 (patch)
tree2b483d400c7372060ad5d18fd02d0e5317bd0620 /net/core
parent5fa6fc76f55c5c42fff52ae1d57a685b9373fcdc (diff)
[PKTGEN]: don't use __constant_htonl()
The existing htonl() macro is smart enough to do the same code as using __constant_htonl() and it looks cleaner. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/pktgen.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3b2556d01ad6..edf46fbb27d1 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -168,7 +168,7 @@
168#define LAT_BUCKETS_MAX 32 168#define LAT_BUCKETS_MAX 32
169#define IP_NAME_SZ 32 169#define IP_NAME_SZ 32
170#define MAX_MPLS_LABELS 16 /* This is the max label stack depth */ 170#define MAX_MPLS_LABELS 16 /* This is the max label stack depth */
171#define MPLS_STACK_BOTTOM __constant_htonl(0x00000100) 171#define MPLS_STACK_BOTTOM htonl(0x00000100)
172 172
173/* Device flag bits */ 173/* Device flag bits */
174#define F_IPSRC_RND (1<<0) /* IP-Src Random */ 174#define F_IPSRC_RND (1<<0) /* IP-Src Random */
@@ -2298,7 +2298,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
2298 int datalen, iplen; 2298 int datalen, iplen;
2299 struct iphdr *iph; 2299 struct iphdr *iph;
2300 struct pktgen_hdr *pgh = NULL; 2300 struct pktgen_hdr *pgh = NULL;
2301 __be16 protocol = __constant_htons(ETH_P_IP); 2301 __be16 protocol = htons(ETH_P_IP);
2302 __be32 *mpls; 2302 __be32 *mpls;
2303 __be16 *vlan_tci = NULL; /* Encapsulates priority and VLAN ID */ 2303 __be16 *vlan_tci = NULL; /* Encapsulates priority and VLAN ID */
2304 __be16 *vlan_encapsulated_proto = NULL; /* packet type ID field (or len) for VLAN tag */ 2304 __be16 *vlan_encapsulated_proto = NULL; /* packet type ID field (or len) for VLAN tag */
@@ -2307,10 +2307,10 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
2307 2307
2308 2308
2309 if (pkt_dev->nr_labels) 2309 if (pkt_dev->nr_labels)
2310 protocol = __constant_htons(ETH_P_MPLS_UC); 2310 protocol = htons(ETH_P_MPLS_UC);
2311 2311
2312 if (pkt_dev->vlan_id != 0xffff) 2312 if (pkt_dev->vlan_id != 0xffff)
2313 protocol = __constant_htons(ETH_P_8021Q); 2313 protocol = htons(ETH_P_8021Q);
2314 2314
2315 /* Update any of the values, used when we're incrementing various 2315 /* Update any of the values, used when we're incrementing various
2316 * fields. 2316 * fields.
@@ -2342,14 +2342,14 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
2342 pkt_dev->svlan_cfi, 2342 pkt_dev->svlan_cfi,
2343 pkt_dev->svlan_p); 2343 pkt_dev->svlan_p);
2344 svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2344 svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
2345 *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q); 2345 *svlan_encapsulated_proto = htons(ETH_P_8021Q);
2346 } 2346 }
2347 vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); 2347 vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
2348 *vlan_tci = build_tci(pkt_dev->vlan_id, 2348 *vlan_tci = build_tci(pkt_dev->vlan_id,
2349 pkt_dev->vlan_cfi, 2349 pkt_dev->vlan_cfi,
2350 pkt_dev->vlan_p); 2350 pkt_dev->vlan_p);
2351 vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2351 vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
2352 *vlan_encapsulated_proto = __constant_htons(ETH_P_IP); 2352 *vlan_encapsulated_proto = htons(ETH_P_IP);
2353 } 2353 }
2354 2354
2355 iph = (struct iphdr *)skb_put(skb, sizeof(struct iphdr)); 2355 iph = (struct iphdr *)skb_put(skb, sizeof(struct iphdr));
@@ -2636,7 +2636,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2636 int datalen; 2636 int datalen;
2637 struct ipv6hdr *iph; 2637 struct ipv6hdr *iph;
2638 struct pktgen_hdr *pgh = NULL; 2638 struct pktgen_hdr *pgh = NULL;
2639 __be16 protocol = __constant_htons(ETH_P_IPV6); 2639 __be16 protocol = htons(ETH_P_IPV6);
2640 __be32 *mpls; 2640 __be32 *mpls;
2641 __be16 *vlan_tci = NULL; /* Encapsulates priority and VLAN ID */ 2641 __be16 *vlan_tci = NULL; /* Encapsulates priority and VLAN ID */
2642 __be16 *vlan_encapsulated_proto = NULL; /* packet type ID field (or len) for VLAN tag */ 2642 __be16 *vlan_encapsulated_proto = NULL; /* packet type ID field (or len) for VLAN tag */
@@ -2644,10 +2644,10 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2644 __be16 *svlan_encapsulated_proto = NULL; /* packet type ID field (or len) for SVLAN tag */ 2644 __be16 *svlan_encapsulated_proto = NULL; /* packet type ID field (or len) for SVLAN tag */
2645 2645
2646 if (pkt_dev->nr_labels) 2646 if (pkt_dev->nr_labels)
2647 protocol = __constant_htons(ETH_P_MPLS_UC); 2647 protocol = htons(ETH_P_MPLS_UC);
2648 2648
2649 if (pkt_dev->vlan_id != 0xffff) 2649 if (pkt_dev->vlan_id != 0xffff)
2650 protocol = __constant_htons(ETH_P_8021Q); 2650 protocol = htons(ETH_P_8021Q);
2651 2651
2652 /* Update any of the values, used when we're incrementing various 2652 /* Update any of the values, used when we're incrementing various
2653 * fields. 2653 * fields.
@@ -2678,14 +2678,14 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2678 pkt_dev->svlan_cfi, 2678 pkt_dev->svlan_cfi,
2679 pkt_dev->svlan_p); 2679 pkt_dev->svlan_p);
2680 svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2680 svlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
2681 *svlan_encapsulated_proto = __constant_htons(ETH_P_8021Q); 2681 *svlan_encapsulated_proto = htons(ETH_P_8021Q);
2682 } 2682 }
2683 vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16)); 2683 vlan_tci = (__be16 *)skb_put(skb, sizeof(__be16));
2684 *vlan_tci = build_tci(pkt_dev->vlan_id, 2684 *vlan_tci = build_tci(pkt_dev->vlan_id,
2685 pkt_dev->vlan_cfi, 2685 pkt_dev->vlan_cfi,
2686 pkt_dev->vlan_p); 2686 pkt_dev->vlan_p);
2687 vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16)); 2687 vlan_encapsulated_proto = (__be16 *)skb_put(skb, sizeof(__be16));
2688 *vlan_encapsulated_proto = __constant_htons(ETH_P_IPV6); 2688 *vlan_encapsulated_proto = htons(ETH_P_IPV6);
2689 } 2689 }
2690 2690
2691 iph = (struct ipv6hdr *)skb_put(skb, sizeof(struct ipv6hdr)); 2691 iph = (struct ipv6hdr *)skb_put(skb, sizeof(struct ipv6hdr));
@@ -2711,7 +2711,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
2711 udph->len = htons(datalen + sizeof(struct udphdr)); 2711 udph->len = htons(datalen + sizeof(struct udphdr));
2712 udph->check = 0; /* No checksum */ 2712 udph->check = 0; /* No checksum */
2713 2713
2714 *(__be32 *) iph = __constant_htonl(0x60000000); /* Version + flow */ 2714 *(__be32 *) iph = htonl(0x60000000); /* Version + flow */
2715 2715
2716 if (pkt_dev->traffic_class) { 2716 if (pkt_dev->traffic_class) {
2717 /* Version + traffic class + flow (0) */ 2717 /* Version + traffic class + flow (0) */