pktgen: use pr_debug
Subsystems (2)
PATCH 1/4 pktgen: use pr_debug
Remove private debug macro and replace with standard version
--- net/core/pktgen.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-)
net/core/pktgen.c +15 -19
@@ -163,9 +163,6 @@#define VERSION "pktgen v2.68: Packet Generator for packet performance testing.\n" -/* #define PG_DEBUG(a) a */ -#define PG_DEBUG (a) -/* The buckets are exponential in 'width' */ #define LAT_BUCKETS_MAX 32#define IP_NAME_SZ 32
@@ -1856,8 +1853,7 @@int ret =0 ;mutex_lock (&pktgen_thread_lock); -PG_DEBUG (printk ("pktgen: pktgen_mark_device marking %s for removal\n" , - ifname)); +pr_debug ("pktgen: pktgen_mark_device marking %s for removal\n" , ifname);while (1 ) {
@@ -1866,8 +1862,8 @@break ;/* success */ mutex_unlock (&pktgen_thread_lock); -PG_DEBUG (printk ("pktgen: pktgen_mark_device waiting for %s " -"to disappear....\n" , ifname)); +pr_debug ("pktgen: pktgen_mark_device waiting for %s " +"to disappear....\n" , ifname);schedule_timeout_interruptible (msecs_to_jiffies (msec_per_try));mutex_lock (&pktgen_thread_lock);
@@ -2847,7 +2843,7 @@struct pktgen_dev *pkt_dev;int started =0 ; -PG_DEBUG (printk ("pktgen: entering pktgen_run. %p\n" , t)); +pr_debug ("pktgen: entering pktgen_run. %p\n" , t);if_lock (t);list_for_each_entry (pkt_dev, &t->if_list, list) {
@@ -2879,7 +2875,7 @@ {struct pktgen_thread *t; -PG_DEBUG (printk ("pktgen: entering pktgen_stop_all_threads_ifs.\n" )); +pr_debug ("pktgen: entering pktgen_stop_all_threads_ifs.\n" );mutex_lock (&pktgen_thread_lock);
@@ -2947,7 +2943,7 @@ {struct pktgen_thread *t; -PG_DEBUG (printk ("pktgen: entering pktgen_run_all_threads.\n" )); +pr_debug ("pktgen: entering pktgen_run_all_threads.\n" );mutex_lock (&pktgen_thread_lock);
@@ -3039,7 +3035,7 @@ {struct pktgen_dev *pkt_dev; -PG_DEBUG (printk ("pktgen: entering pktgen_stop\n" )); +pr_debug ("pktgen: entering pktgen_stop\n" );if_lock (t);
@@ -3063,7 +3059,7 @@struct list_head *q, *n;struct pktgen_dev *cur; -PG_DEBUG (printk ("pktgen: entering pktgen_rem_one_if\n" )); +pr_debug ("pktgen: entering pktgen_rem_one_if\n" );if_lock (t);
@@ -3092,7 +3088,7 @@/* Remove all devices, free mem */ -PG_DEBUG (printk ("pktgen: entering pktgen_rem_all_ifs\n" )); +pr_debug ("pktgen: entering pktgen_rem_all_ifs\n" );if_lock (t);list_for_each_safe (q, n, &t->if_list) {
@@ -3275,7 +3271,7 @@ t->pid = current->pid; -PG_DEBUG (printk ("pktgen: starting pktgen/%d: pid=%d\n" , cpu, current->pid)); +pr_debug ("pktgen: starting pktgen/%d: pid=%d\n" , cpu, current->pid); max_before_softirq = t->max_before_softirq;
@@ -3336,13 +3332,13 @@set_current_state (TASK_INTERRUPTIBLE ); } -PG_DEBUG (printk ("pktgen: %s stopping all device\n" , t->tsk->comm)); +pr_debug ("pktgen: %s stopping all device\n" , t->tsk->comm);pktgen_stop (t); -PG_DEBUG (printk ("pktgen: %s removing all device\n" , t->tsk->comm)); +pr_debug ("pktgen: %s removing all device\n" , t->tsk->comm);pktgen_rem_all_ifs (t); -PG_DEBUG (printk ("pktgen: %s removing thread.\n" , t->tsk->comm)); +pr_debug ("pktgen: %s removing thread.\n" , t->tsk->comm);pktgen_rem_thread (t);return 0 ;
@@ -3361,7 +3357,7 @@ }if_unlock (t); -PG_DEBUG (printk ("pktgen: find_dev(%s) returning %p\n" , ifname, pkt_dev)); +pr_debug ("pktgen: find_dev(%s) returning %p\n" , ifname, pkt_dev);return pkt_dev; }
@@ -3530,7 +3526,7 @@ struct pktgen_dev *pkt_dev) { -PG_DEBUG (printk ("pktgen: remove_device pkt_dev=%p\n" , pkt_dev)); +pr_debug ("pktgen: remove_device pkt_dev=%p\n" , pkt_dev);if (pkt_dev->running) {printk ("pktgen:WARNING: trying to remove a running interface, stopping it now.\n" );
PATCH 2/4 pktgen: use random32
Can use random32() now.
--- net/core/pktgen.c | 52 +++++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 33 deletions(-)
net/core/pktgen.c +19 -33
@@ -464,17 +464,6 @@return tmp; } -static inline u32 pktgen_random (void ) -{ -#if 0 -__u32 n; -get_random_bytes (&n,4 ); -return n; -#else -return net_random (); -#endif -} -static inline __u64 getCurMs (void ) {struct timeval tv;
@@ -2091,7 +2080,7 @@int flow =0 ;if (pkt_dev->cflows) { - flow =pktgen_random () % pkt_dev->cflows; + flow =random32 () % pkt_dev->cflows;if (pkt_dev->flows[flow].count > pkt_dev->lflow) pkt_dev->flows[flow].count =0 ;
@@ -2103,7 +2092,7 @@__u32 tmp;if (pkt_dev->flags &F_MACSRC_RND ) - mc =pktgen_random () % (pkt_dev->src_mac_count); + mc =random32 () % pkt_dev->src_mac_count;else { mc = pkt_dev->cur_src_mac_offset++; if (pkt_dev->cur_src_mac_offset >
@@ -2129,7 +2118,7 @@__u32 tmp;if (pkt_dev->flags &F_MACDST_RND ) - mc =pktgen_random () % (pkt_dev->dst_mac_count); + mc =random32 () % pkt_dev->dst_mac_count;else { mc = pkt_dev->cur_dst_mac_offset++;
@@ -2156,24 +2145,23 @@for (i =0 ; i < pkt_dev->nr_labels; i++)if (pkt_dev->labels[i] &MPLS_STACK_BOTTOM ) pkt_dev->labels[i] =MPLS_STACK_BOTTOM | - ((__force __be32 )pktgen_random () & + ((__force __be32 )random32 () &htonl (0x000fffff )); }if ((pkt_dev->flags &F_VID_RND ) && (pkt_dev->vlan_id !=0xffff )) { - pkt_dev->vlan_id =pktgen_random () %4096 ; + pkt_dev->vlan_id =random32 () & (4096 -1 ); }if ((pkt_dev->flags &F_SVID_RND ) && (pkt_dev->svlan_id !=0xffff )) { - pkt_dev->svlan_id =pktgen_random () %4096 ; + pkt_dev->svlan_id =random32 () & (4096 -1 ); }if (pkt_dev->udp_src_min < pkt_dev->udp_src_max) {if (pkt_dev->flags &F_UDPSRC_RND ) - pkt_dev->cur_udp_src = - ((pktgen_random () % - (pkt_dev->udp_src_max - pkt_dev->udp_src_min)) + - pkt_dev->udp_src_min); + pkt_dev->cur_udp_src =random32 () % + (pkt_dev->udp_src_max - pkt_dev->udp_src_min) + + pkt_dev->udp_src_min;else { pkt_dev->cur_udp_src++;
@@ -2184,10 +2172,9 @@if (pkt_dev->udp_dst_min < pkt_dev->udp_dst_max) {if (pkt_dev->flags &F_UDPDST_RND ) { - pkt_dev->cur_udp_dst = - ((pktgen_random () % - (pkt_dev->udp_dst_max - pkt_dev->udp_dst_min)) + - pkt_dev->udp_dst_min); + pkt_dev->cur_udp_dst =random32 () % + (pkt_dev->udp_dst_max - pkt_dev->udp_dst_min) + + pkt_dev->udp_dst_min; }else { pkt_dev->cur_udp_dst++;if (pkt_dev->cur_udp_dst >= pkt_dev->udp_dst_max)
@@ -2202,7 +2189,7 @@ saddr_max))) {__u32 t;if (pkt_dev->flags &F_IPSRC_RND ) - t = ((pktgen_random () % (imx - imn)) + imn); + t =random32 () % (imx - imn) + imn;else { t =ntohl (pkt_dev->cur_saddr); t++;
@@ -2223,14 +2210,13 @@__be32 s;if (pkt_dev->flags &F_IPDST_RND ) { - t =pktgen_random () % (imx - imn) + imn; + t =random32 () % (imx - imn) + imn; s =htonl (t);while (LOOPBACK (s) ||MULTICAST (s) ||BADCLASS (s) ||ZERONET (s) ||LOCAL_MCAST (s)) { - t = (pktgen_random () % - (imx - imn)) + imn; + t =random32 () % (imx - imn) + imn; s =htonl (t); } pkt_dev->cur_daddr = s;
@@ -2262,7 +2248,7 @@for (i =0 ; i <4 ; i++) { pkt_dev->cur_in6_daddr.s6_addr32[i] = - (((__force __be32 )pktgen_random () | + (((__force __be32 )random32 () | pkt_dev->min_in6_daddr.s6_addr32[i]) & pkt_dev->max_in6_daddr.s6_addr32[i]); }
@@ -2272,9 +2258,9 @@if (pkt_dev->min_pkt_size < pkt_dev->max_pkt_size) {__u32 t;if (pkt_dev->flags &F_TXSIZE_RND ) { - t = ((pktgen_random () % - (pkt_dev->max_pkt_size - pkt_dev->min_pkt_size)) - + pkt_dev->min_pkt_size); + t =random32 () % + (pkt_dev->max_pkt_size - pkt_dev->min_pkt_size) + + pkt_dev->min_pkt_size; }else { t = pkt_dev->cur_pkt_size +1 ;if (t > pkt_dev->max_pkt_size)
PATCH 2/4 pktgen: use random32
Thanks!
It seems like network code has preference for net_random() but they are the same now.
Cheers.
--ro
Quoted 152 lines · Stephen Hemminger
Can use
random32()now.Signed-off-by Stephen Hemminger <[email protected]>--- net/core/pktgen.c | 52 +++++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 33 deletions(-)net/core/pktgen.c +19
-34@@ -464,17 +464,6 @@return tmp; } -static inline u32 pktgen_random (void ) -{ -#if 0 -__u32 n; -get_random_bytes (&n,4 ); -return n; -#else -return net_random (); -#endif -} -static inline __u64 getCurMs (void ) {struct timeval tv;@@ -2091,7 +2080,7 @@int flow =0 ;if (pkt_dev->cflows) { - flow =pktgen_random () % pkt_dev->cflows; + flow =random32 () % pkt_dev->cflows;if (pkt_dev->flows[flow].count > pkt_dev->lflow) pkt_dev->flows[flow].count =0 ;@@ -2103,7 +2092,7 @@__u32 tmp;if (pkt_dev->flags &F_MACSRC_RND ) - mc =pktgen_random () % (pkt_dev->src_mac_count); + mc =random32 () % pkt_dev->src_mac_count;else { mc = pkt_dev->cur_src_mac_offset++; if (pkt_dev->cur_src_mac_offset >@@ -2129,7 +2118,7 @@__u32 tmp;if (pkt_dev->flags &F_MACDST_RND ) - mc =pktgen_random () % (pkt_dev->dst_mac_count); + mc =random32 () % pkt_dev->dst_mac_count;else { mc = pkt_dev->cur_dst_mac_offset++;@@ -2156,24 +2145,23 @@for (i =0 ; i < pkt_dev->nr_labels; i++)if (pkt_dev->labels[i] &MPLS_STACK_BOTTOM ) pkt_dev->labels[i] =MPLS_STACK_BOTTOM | - ((__force __be32 )pktgen_random () & + ((__force __be32 )random32 () &htonl (0x000fffff )); }if ((pkt_dev->flags &F_VID_RND ) && (pkt_dev->vlan_id !=0xffff )) { - pkt_dev->vlan_id =pktgen_random () %4096 ; + pkt_dev->vlan_id =random32 () & (4096 -1 ); }if ((pkt_dev->flags &F_SVID_RND ) && (pkt_dev->svlan_id !=0xffff )) { - pkt_dev->svlan_id =pktgen_random () %4096 ; + pkt_dev->svlan_id =random32 () & (4096 -1 ); }if (pkt_dev->udp_src_min < pkt_dev->udp_src_max) {if (pkt_dev->flags &F_UDPSRC_RND ) - pkt_dev->cur_udp_src = - ((pktgen_random () % - (pkt_dev->udp_src_max - pkt_dev->udp_src_min)) + - pkt_dev->udp_src_min); + pkt_dev->cur_udp_src =random32 () % + (pkt_dev->udp_src_max - pkt_dev->udp_src_min) + + pkt_dev->udp_src_min;else { pkt_dev->cur_udp_src++;@@ -2184,10 +2172,9 @@if (pkt_dev->udp_dst_min < pkt_dev->udp_dst_max) {if (pkt_dev->flags &F_UDPDST_RND ) { - pkt_dev->cur_udp_dst = - ((pktgen_random () % - (pkt_dev->udp_dst_max - pkt_dev->udp_dst_min)) + - pkt_dev->udp_dst_min); + pkt_dev->cur_udp_dst =random32 () % + (pkt_dev->udp_dst_max - pkt_dev->udp_dst_min) + + pkt_dev->udp_dst_min; }else { pkt_dev->cur_udp_dst++;if (pkt_dev->cur_udp_dst >= pkt_dev->udp_dst_max)@@ -2202,7 +2189,7 @@ saddr_max))) {__u32 t;if (pkt_dev->flags &F_IPSRC_RND ) - t = ((pktgen_random () % (imx - imn)) + imn); + t =random32 () % (imx - imn) + imn;else { t =ntohl (pkt_dev->cur_saddr); t++;@@ -2223,14 +2210,13 @@__be32 s;if (pkt_dev->flags &F_IPDST_RND ) { - t =pktgen_random () % (imx - imn) + imn; + t =random32 () % (imx - imn) + imn; s =htonl (t);while (LOOPBACK (s) ||MULTICAST (s) ||BADCLASS (s) ||ZERONET (s) ||LOCAL_MCAST (s)) { - t = (pktgen_random () % - (imx - imn)) + imn; + t =random32 () % (imx - imn) + imn; s =htonl (t); } pkt_dev->cur_daddr = s;@@ -2262,7 +2248,7 @@for (i =0 ; i <4 ; i++) { pkt_dev->cur_in6_daddr.s6_addr32[i] = - (((__force __be32 )pktgen_random () | + (((__force __be32 )random32 () | pkt_dev->min_in6_daddr.s6_addr32[i]) & pkt_dev->max_in6_daddr.s6_addr32[i]); }@@ -2272,9 +2258,9 @@if (pkt_dev->min_pkt_size < pkt_dev->max_pkt_size) {__u32 t;if (pkt_dev->flags &F_TXSIZE_RND ) { - t = ((pktgen_random () % - (pkt_dev->max_pkt_size - pkt_dev->min_pkt_size)) - + pkt_dev->min_pkt_size); + t =random32 () % + (pkt_dev->max_pkt_size - pkt_dev->min_pkt_size) + + pkt_dev->min_pkt_size; }else { t = pkt_dev->cur_pkt_size +1 ;if (t > pkt_dev->max_pkt_size) -To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/4 pktgen: don't use __constant_htonl()
In reply to Stephen HemmingerThe existing htonl() macro is smart enough to do the same code as using __constant_htonl() and it looks cleaner.
--- net/core/pktgen.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
net/core/pktgen.c +12 -12
@@ -167,7 +167,7 @@#define LAT_BUCKETS_MAX 32#define IP_NAME_SZ 32#define MAX_MPLS_LABELS 16/* This is the max label stack depth */ -#define MPLS_STACK_BOTTOM __constant_htonl(0x00000100) +#define MPLS_STACK_BOTTOM htonl(0x00000100)/* Device flag bits */ #define F_IPSRC_RND (1<<0)/* IP-Src Random */
@@ -2297,7 +2297,7 @@int datalen, iplen;struct iphdr *iph;struct pktgen_hdr *pgh =NULL ; -__be16 protocol =__constant_htons (ETH_P_IP ); +__be16 protocol =htons (ETH_P_IP );__be32 *mpls;__be16 *vlan_tci =NULL ;/* Encapsulates priority and VLAN ID */ __be16 *vlan_encapsulated_proto =NULL ;/* packet type ID field (or len) for VLAN tag */
@@ -2306,10 +2306,10 @@if (pkt_dev->nr_labels) - protocol =__constant_htons (ETH_P_MPLS_UC ); + protocol =htons (ETH_P_MPLS_UC );if (pkt_dev->vlan_id !=0xffff ) - protocol =__constant_htons (ETH_P_8021Q ); + protocol =htons (ETH_P_8021Q );/* Update any of the values, used when we're incrementing various * fields.
@@ -2341,14 +2341,14 @@ pkt_dev->svlan_cfi, pkt_dev->svlan_p); svlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *svlan_encapsulated_proto =__constant_htons (ETH_P_8021Q ); + *svlan_encapsulated_proto =htons (ETH_P_8021Q ); } vlan_tci = (__be16 *)skb_put (skb,sizeof (__be16)); *vlan_tci =build_tci (pkt_dev->vlan_id, pkt_dev->vlan_cfi, pkt_dev->vlan_p); vlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *vlan_encapsulated_proto =__constant_htons (ETH_P_IP ); + *vlan_encapsulated_proto =htons (ETH_P_IP ); } iph = (struct iphdr *)skb_put (skb,sizeof (struct iphdr ));
@@ -2635,7 +2635,7 @@int datalen;struct ipv6hdr *iph;struct pktgen_hdr *pgh =NULL ; -__be16 protocol =__constant_htons (ETH_P_IPV6 ); +__be16 protocol =htons (ETH_P_IPV6 );__be32 *mpls;__be16 *vlan_tci =NULL ;/* Encapsulates priority and VLAN ID */ __be16 *vlan_encapsulated_proto =NULL ;/* packet type ID field (or len) for VLAN tag */
@@ -2643,10 +2643,10 @@__be16 *svlan_encapsulated_proto =NULL ;/* packet type ID field (or len) for SVLAN tag */ if (pkt_dev->nr_labels) - protocol =__constant_htons (ETH_P_MPLS_UC ); + protocol =htons (ETH_P_MPLS_UC );if (pkt_dev->vlan_id !=0xffff ) - protocol =__constant_htons (ETH_P_8021Q ); + protocol =htons (ETH_P_8021Q );/* Update any of the values, used when we're incrementing various * fields.
@@ -2677,14 +2677,14 @@ pkt_dev->svlan_cfi, pkt_dev->svlan_p); svlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *svlan_encapsulated_proto =__constant_htons (ETH_P_8021Q ); + *svlan_encapsulated_proto =htons (ETH_P_8021Q ); } vlan_tci = (__be16 *)skb_put (skb,sizeof (__be16)); *vlan_tci =build_tci (pkt_dev->vlan_id, pkt_dev->vlan_cfi, pkt_dev->vlan_p); vlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *vlan_encapsulated_proto =__constant_htons (ETH_P_IPV6 ); + *vlan_encapsulated_proto =htons (ETH_P_IPV6 ); } iph = (struct ipv6hdr *)skb_put (skb,sizeof (struct ipv6hdr ));
@@ -2710,7 +2710,7 @@ udph->len =htons (datalen +sizeof (struct udphdr )); udph->check =0 ;/* No checksum */ - *(__be32 *) iph =__constant_htonl (0x60000000 );/* Version + flow */ + *(__be32 *) iph =htonl (0x60000000 );/* Version + flow */ if (pkt_dev->traffic_class) {/* Version + traffic class + flow (0) */
PATCH 3/4 pktgen: don't use __constant_htonl()
OK!
Cheers.
--ro
Quoted 111 lines · Stephen Hemminger
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 <[email protected]>--- net/core/pktgen.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)net/core/pktgen.c +12
-13@@ -167,7 +167,7 @@#define LAT_BUCKETS_MAX 32#define IP_NAME_SZ 32#define MAX_MPLS_LABELS 16/* This is the max label stack depth */ -#define MPLS_STACK_BOTTOM __constant_htonl(0x00000100) +#define MPLS_STACK_BOTTOM htonl(0x00000100)/* Device flag bits */ #define F_IPSRC_RND (1<<0)/* IP-Src Random */ @@ -2297,7 +2297,7 @@int datalen, iplen;struct iphdr *iph;struct pktgen_hdr *pgh =NULL ; -__be16 protocol =__constant_htons (ETH_P_IP ); +__be16 protocol =htons (ETH_P_IP );__be32 *mpls;__be16 *vlan_tci =NULL ;/* Encapsulates priority and VLAN ID */ __be16 *vlan_encapsulated_proto =NULL ;/* packet type ID field (or len) for VLAN tag */ @@ -2306,10 +2306,10 @@if (pkt_dev->nr_labels) - protocol =__constant_htons (ETH_P_MPLS_UC ); + protocol =htons (ETH_P_MPLS_UC );if (pkt_dev->vlan_id !=0xffff ) - protocol =__constant_htons (ETH_P_8021Q ); + protocol =htons (ETH_P_8021Q );/* Update any of the values, used when we're incrementing various * fields. @@ -2341,14 +2341,14 @@ pkt_dev->svlan_cfi, pkt_dev->svlan_p); svlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *svlan_encapsulated_proto =__constant_htons (ETH_P_8021Q ); + *svlan_encapsulated_proto =htons (ETH_P_8021Q ); } vlan_tci = (__be16 *)skb_put (skb,sizeof (__be16)); *vlan_tci =build_tci (pkt_dev->vlan_id, pkt_dev->vlan_cfi, pkt_dev->vlan_p); vlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *vlan_encapsulated_proto =__constant_htons (ETH_P_IP ); + *vlan_encapsulated_proto =htons (ETH_P_IP ); } iph = (struct iphdr *)skb_put (skb,sizeof (struct iphdr ));@@ -2635,7 +2635,7 @@int datalen;struct ipv6hdr *iph;struct pktgen_hdr *pgh =NULL ; -__be16 protocol =__constant_htons (ETH_P_IPV6 ); +__be16 protocol =htons (ETH_P_IPV6 );__be32 *mpls;__be16 *vlan_tci =NULL ;/* Encapsulates priority and VLAN ID */ __be16 *vlan_encapsulated_proto =NULL ;/* packet type ID field (or len) for VLAN tag */ @@ -2643,10 +2643,10 @@__be16 *svlan_encapsulated_proto =NULL ;/* packet type ID field (or len) for SVLAN tag */ if (pkt_dev->nr_labels) - protocol =__constant_htons (ETH_P_MPLS_UC ); + protocol =htons (ETH_P_MPLS_UC );if (pkt_dev->vlan_id !=0xffff ) - protocol =__constant_htons (ETH_P_8021Q ); + protocol =htons (ETH_P_8021Q );/* Update any of the values, used when we're incrementing various * fields. @@ -2677,14 +2677,14 @@ pkt_dev->svlan_cfi, pkt_dev->svlan_p); svlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *svlan_encapsulated_proto =__constant_htons (ETH_P_8021Q ); + *svlan_encapsulated_proto =htons (ETH_P_8021Q ); } vlan_tci = (__be16 *)skb_put (skb,sizeof (__be16)); *vlan_tci =build_tci (pkt_dev->vlan_id, pkt_dev->vlan_cfi, pkt_dev->vlan_p); vlan_encapsulated_proto = (__be16 *)skb_put (skb,sizeof (__be16)); - *vlan_encapsulated_proto =__constant_htons (ETH_P_IPV6 ); + *vlan_encapsulated_proto =htons (ETH_P_IPV6 ); } iph = (struct ipv6hdr *)skb_put (skb,sizeof (struct ipv6hdr ));@@ -2710,7 +2710,7 @@ udph->len =htons (datalen +sizeof (struct udphdr )); udph->check =0 ;/* No checksum */ - *(__be32 *) iph =__constant_htonl (0x60000000 );/* Version + flow */ + *(__be32 *) iph =htonl (0x60000000 );/* Version + flow */ if (pkt_dev->traffic_class) {/* Version + traffic class + flow (0) */ -To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 pktgen: fix device name handling
In reply to Stephen HemmingerSince devices can change name and other wierdness, don't hold onto a copy of device name, instead use pointer to output device.
Fix a couple of leaks in error handling path as well.
--- net/core/pktgen.c | 137 +++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 67 deletions(-)
net/core/pktgen.c +70 -67
@@ -210,15 +210,11 @@ };struct pktgen_dev { -/* * Try to keep frequent/infrequent used vars. separated. */ - -char ifname[IFNAMSIZ ]; -char result[512 ]; - -struct pktgen_thread *pg_thread;/* the owner */ +struct proc_dir_entry *entry;/* proc file */ +struct pktgen_thread *pg_thread;/* the owner */ struct list_head list;/* Used for chaining in the thread's run-queue */ int running;/* if this changes to false, the test will stop */
@@ -345,6 +341,8 @@unsigned cflows;/* Concurrent flows (config) */ unsigned lflow;/* Flow length (config) */ unsigned nflows;/* accumulated flows (stats) */ + +char result[512 ]; };struct pktgen_hdr {
@@ -497,7 +495,7 @@static int pktgen_stop_device (struct pktgen_dev *pkt_dev);static void pktgen_stop (struct pktgen_thread *t);static void pktgen_clear_counters (struct pktgen_dev *pkt_dev); -static int pktgen_mark_device (const char *ifname); +static unsigned int scan_ip6 (const char *s,char ip[16 ]);static unsigned int fmt_ip6 (char *s,const char ip[16 ]);
@@ -591,7 +589,7 @@" frags: %d delay: %u clone_skb: %d ifname: %s\n" , pkt_dev->nfrags,1000 * pkt_dev->delay_us + pkt_dev->delay_ns, - pkt_dev->clone_skb, pkt_dev->ifname); + pkt_dev->clone_skb, pkt_dev->odev->name);seq_printf (seq," flows: %u flowlen: %u\n" , pkt_dev->cflows, pkt_dev->lflow);
@@ -1682,13 +1680,13 @@if_lock (t);list_for_each_entry (pkt_dev, &t->if_list, list)if (pkt_dev->running) -seq_printf (seq,"%s " , pkt_dev->ifname); +seq_printf (seq,"%s " , pkt_dev->odev->name);seq_printf (seq,"\nStopped: " );list_for_each_entry (pkt_dev, &t->if_list, list)if (!pkt_dev->running) -seq_printf (seq,"%s " , pkt_dev->ifname); +seq_printf (seq,"%s " , pkt_dev->odev->name);if (t->result[0 ])seq_printf (seq,"\nResult: %s\n" , t->result);
@@ -1834,12 +1832,11 @@/* * mark a device for removal */ -static int pktgen_mark_device (const char *ifname) +static void pktgen_mark_device (const char *ifname) {struct pktgen_dev *pkt_dev =NULL ;const int max_tries =10 , msec_per_try =125 ;int i =0 ; -int ret =0 ;mutex_lock (&pktgen_thread_lock);pr_debug ("pktgen: pktgen_mark_device marking %s for removal\n" , ifname);
@@ -1860,32 +1857,49 @@printk ("pktgen_mark_device: timed out after waiting " "%d msec for device %s to be removed\n" , msec_per_try * i, ifname); - ret =1 ;break ; } }mutex_unlock (&pktgen_thread_lock); +} -return ret; +static void pktgen_change_name (struct net_device *dev) +{ +struct pktgen_thread *t; + +list_for_each_entry (t, &pktgen_threads, th_list) { +struct pktgen_dev *pkt_dev; + +list_for_each_entry (pkt_dev, &t->if_list, list) { +if (pkt_dev->odev != dev) +continue ; + +remove_proc_entry (pkt_dev->entry->name, pg_proc_dir); + + pkt_dev->entry =create_proc_entry (dev->name,0600 , + pg_proc_dir); +if (!pkt_dev->entry) +printk (KERN_ERR "pktgen: can't move proc " +" entry for '%s'\n" , dev->name); +break ; + } + } }static int pktgen_device_event (struct notifier_block *unused,unsigned long event,void *ptr) { -struct net_device *dev = (struct net_device *)(ptr); +struct net_device *dev = ptr;/* It is OK that we do not hold the group lock right now, * as we run under the RTNL lock. */ switch (event) { -case NETDEV_CHANGEADDR : -case NETDEV_GOING_DOWN : -case NETDEV_DOWN : -case NETDEV_UP : -/* Ignore for now */ +case NETDEV_CHANGENAME : +pktgen_change_name (dev);break ;case NETDEV_UNREGISTER :
@@ -1898,41 +1912,36 @@/* Associate pktgen_dev with a device. */ -static struct net_device *pktgen_setup_dev (struct pktgen_dev *pkt_dev) +static int pktgen_setup_dev (struct pktgen_dev *pkt_dev,const char *ifname) {struct net_device *odev; +int err;/* Clean old setups */ -if (pkt_dev->odev) {dev_put (pkt_dev->odev); pkt_dev->odev =NULL ; } - odev =dev_get_by_name (pkt_dev->ifname); - + odev =dev_get_by_name (ifname);if (!odev) { -printk ("pktgen: no such netdevice: \"%s\"\n" , pkt_dev->ifname); - goto out; +printk ("pktgen: no such netdevice: \"%s\"\n" , ifname); +return -ENODEV ; } +if (odev->type !=ARPHRD_ETHER ) { -printk ("pktgen: not an ethernet device: \"%s\"\n" , - pkt_dev->ifname); - goto out_put; - } -if (!netif_running (odev)) { -printk ("pktgen: device is down: \"%s\"\n" , pkt_dev->ifname); - goto out_put; +printk ("pktgen: not an ethernet device: \"%s\"\n" , ifname); + err = -EINVAL ; + }else if (!netif_running (odev)) { +printk ("pktgen: device is down: \"%s\"\n" , ifname); + err = -ENETDOWN ; + }else { + pkt_dev->odev = odev; +return 0 ; } - pkt_dev->odev = odev; - -return pkt_dev->odev; -out_put:dev_put (odev); -out: -return NULL ; - +return err; }/* Read pkt_dev from the interface and set up internal pktgen_dev
@@ -1940,10 +1949,6 @@*/ static void pktgen_setup_inject (struct pktgen_dev *pkt_dev) { -/* Try once more, just in case it works now. */ -if (!pkt_dev->odev) -pktgen_setup_dev (pkt_dev); -if (!pkt_dev->odev) {printk ("pktgen: ERROR: pkt_dev->odev == NULL in setup_inject.\n" ); sprintf(pkt_dev->result,
@@ -2987,7 +2992,7 @@if (!pkt_dev->running) {printk ("pktgen: interface: %s is already stopped\n" , - pkt_dev->ifname); + pkt_dev->odev->name);return -EINVAL ; }
@@ -3337,7 +3342,7 @@if_lock (t);list_for_each_entry (p, &t->if_list, list) -if (strncmp (p->ifname, ifname,IFNAMSIZ ) ==0 ) { +if (strncmp (p->odev->name, ifname,IFNAMSIZ ) ==0 ) { pkt_dev = p;break ; }
@@ -3378,7 +3383,7 @@static int pktgen_add_device (struct pktgen_thread *t,const char *ifname) {struct pktgen_dev *pkt_dev; -struct proc_dir_entry *pe; +int err;/* We don't allow a device to be on several threads */
@@ -3420,29 +3425,28 @@ pkt_dev->svlan_cfi =0 ; pkt_dev->svlan_id =0xffff ; -strncpy (pkt_dev->ifname, ifname,IFNAMSIZ ); + err =pktgen_setup_dev (pkt_dev, ifname); +if (err) + goto out1; -if (!pktgen_setup_dev (pkt_dev)) { -printk ("pktgen: ERROR: pktgen_setup_dev failed.\n" ); -if (pkt_dev->flows) -vfree (pkt_dev->flows); -kfree (pkt_dev); -return -ENODEV ; - } - - pe =create_proc_entry (ifname,0600 , pg_proc_dir); -if (!pe) { + pkt_dev->entry =create_proc_entry (ifname,0600 , pg_proc_dir); +if (!pkt_dev->entry) {printk ("pktgen: cannot create %s/%s procfs entry.\n" ,PG_PROC_DIR , ifname); -if (pkt_dev->flows) -vfree (pkt_dev->flows); -kfree (pkt_dev); -return -EINVAL ; + err = -EINVAL ; + goto out2; } - pe->proc_fops = &pktgen_if_fops; - pe->data = pkt_dev; + pkt_dev->entry->proc_fops = &pktgen_if_fops; + pkt_dev->entry->data = pkt_dev;return add_dev_to_thread (t, pkt_dev); +out2: +dev_put (pkt_dev->odev); +out1: +if (pkt_dev->flows) +vfree (pkt_dev->flows); +kfree (pkt_dev); +return err; }static int __init pktgen_create_thread (int cpu)
@@ -3530,9 +3534,8 @@_rem_dev_from_if_list (t, pkt_dev); -/* Clean up proc file system */ - -remove_proc_entry (pkt_dev->ifname, pg_proc_dir); +if (pkt_dev->entry) +remove_proc_entry (pkt_dev->entry->name, pg_proc_dir);if (pkt_dev->flows)vfree (pkt_dev->flows);
PATCH 4/4 pktgen: fix device name handling
Yes it seems be handle dev name change. So configuration scripts should use ifindex now :)
Cheers.
--ro
Quoted 303 lines · Stephen Hemminger
Since devices can change name and other wierdness, don't hold onto a copy of device name, instead use pointer to output device.
Fix a couple of leaks in error handling path as well.
Signed-off-by Stephen Hemminger <[email protected]>--- net/core/pktgen.c | 137 +++++++++++++++++++++++++++--------------------------- 1 file changed, 70 insertions(+), 67 deletions(-)net/core/pktgen.c +70
-68@@ -210,15 +210,11 @@ };struct pktgen_dev { -/* * Try to keep frequent/infrequent used vars. separated. */ - -char ifname[IFNAMSIZ ]; -char result[512 ]; - -struct pktgen_thread *pg_thread;/* the owner */ +struct proc_dir_entry *entry;/* proc file */ +struct pktgen_thread *pg_thread;/* the owner */ struct list_head list;/* Used for chaining in the thread's run-queue */ int running;/* if this changes to false, the test will stop */ @@ -345,6 +341,8 @@unsigned cflows;/* Concurrent flows (config) */ unsigned lflow;/* Flow length (config) */ unsigned nflows;/* accumulated flows (stats) */ + +char result[512 ]; };struct pktgen_hdr {@@ -497,7 +495,7 @@static int pktgen_stop_device (struct pktgen_dev *pkt_dev);static void pktgen_stop (struct pktgen_thread *t);static void pktgen_clear_counters (struct pktgen_dev *pkt_dev); -static int pktgen_mark_device (const char *ifname); +static unsigned int scan_ip6 (const char *s,char ip[16 ]);static unsigned int fmt_ip6 (char *s,const char ip[16 ]);@@ -591,7 +589,7 @@" frags: %d delay: %u clone_skb: %d ifname: %s\n" , pkt_dev->nfrags,1000 * pkt_dev->delay_us + pkt_dev->delay_ns, - pkt_dev->clone_skb, pkt_dev->ifname); + pkt_dev->clone_skb, pkt_dev->odev->name);seq_printf (seq," flows: %u flowlen: %u\n" , pkt_dev->cflows, pkt_dev->lflow);@@ -1682,13 +1680,13 @@if_lock (t);list_for_each_entry (pkt_dev, &t->if_list, list)if (pkt_dev->running) -seq_printf (seq,"%s " , pkt_dev->ifname); +seq_printf (seq,"%s " , pkt_dev->odev->name);seq_printf (seq,"\nStopped: " );list_for_each_entry (pkt_dev, &t->if_list, list)if (!pkt_dev->running) -seq_printf (seq,"%s " , pkt_dev->ifname); +seq_printf (seq,"%s " , pkt_dev->odev->name);if (t->result[0 ])seq_printf (seq,"\nResult: %s\n" , t->result);@@ -1834,12 +1832,11 @@/* * mark a device for removal */ -static int pktgen_mark_device (const char *ifname) +static void pktgen_mark_device (const char *ifname) {struct pktgen_dev *pkt_dev =NULL ;const int max_tries =10 , msec_per_try =125 ;int i =0 ; -int ret =0 ;mutex_lock (&pktgen_thread_lock);pr_debug ("pktgen: pktgen_mark_device marking %s for removal\n" , ifname);@@ -1860,32 +1857,49 @@printk ("pktgen_mark_device: timed out after waiting " "%d msec for device %s to be removed\n" , msec_per_try * i, ifname); - ret =1 ;break ; } }mutex_unlock (&pktgen_thread_lock); +} -return ret; +static void pktgen_change_name (struct net_device *dev) +{ +struct pktgen_thread *t; + +list_for_each_entry (t, &pktgen_threads, th_list) { +struct pktgen_dev *pkt_dev; + +list_for_each_entry (pkt_dev, &t->if_list, list) { +if (pkt_dev->odev != dev) +continue ; + +remove_proc_entry (pkt_dev->entry->name, pg_proc_dir); + + pkt_dev->entry =create_proc_entry (dev->name,0600 , + pg_proc_dir); +if (!pkt_dev->entry) +printk (KERN_ERR "pktgen: can't move proc " +" entry for '%s'\n" , dev->name); +break ; + } + } }static int pktgen_device_event (struct notifier_block *unused,unsigned long event,void *ptr) { -struct net_device *dev = (struct net_device *)(ptr); +struct net_device *dev = ptr;/* It is OK that we do not hold the group lock right now, * as we run under the RTNL lock. */ switch (event) { -case NETDEV_CHANGEADDR : -case NETDEV_GOING_DOWN : -case NETDEV_DOWN : -case NETDEV_UP : -/* Ignore for now */ +case NETDEV_CHANGENAME : +pktgen_change_name (dev);break ;case NETDEV_UNREGISTER :@@ -1898,41 +1912,36 @@/* Associate pktgen_dev with a device. */ -static struct net_device *pktgen_setup_dev (struct pktgen_dev *pkt_dev) +static int pktgen_setup_dev (struct pktgen_dev *pkt_dev,const char *ifname) {struct net_device *odev; +int err;/* Clean old setups */ -if (pkt_dev->odev) {dev_put (pkt_dev->odev); pkt_dev->odev =NULL ; } - odev =dev_get_by_name (pkt_dev->ifname); - + odev =dev_get_by_name (ifname);if (!odev) { -printk ("pktgen: no such netdevice: \"%s\"\n" , pkt_dev->ifname); - goto out; +printk ("pktgen: no such netdevice: \"%s\"\n" , ifname); +return -ENODEV ; } +if (odev->type !=ARPHRD_ETHER ) { -printk ("pktgen: not an ethernet device: \"%s\"\n" , - pkt_dev->ifname); - goto out_put; - } -if (!netif_running (odev)) { -printk ("pktgen: device is down: \"%s\"\n" , pkt_dev->ifname); - goto out_put; +printk ("pktgen: not an ethernet device: \"%s\"\n" , ifname); + err = -EINVAL ; + }else if (!netif_running (odev)) { +printk ("pktgen: device is down: \"%s\"\n" , ifname); + err = -ENETDOWN ; + }else { + pkt_dev->odev = odev; +return 0 ; } - pkt_dev->odev = odev; - -return pkt_dev->odev; -out_put:dev_put (odev); -out: -return NULL ; - +return err; }/* Read pkt_dev from the interface and set up internal pktgen_dev @@ -1940,10 +1949,6 @@*/ static void pktgen_setup_inject (struct pktgen_dev *pkt_dev) { -/* Try once more, just in case it works now. */ -if (!pkt_dev->odev) -pktgen_setup_dev (pkt_dev); -if (!pkt_dev->odev) {printk ("pktgen: ERROR: pkt_dev->odev == NULL in setup_inject.\n" ); sprintf(pkt_dev->result,@@ -2987,7 +2992,7 @@if (!pkt_dev->running) {printk ("pktgen: interface: %s is already stopped\n" , - pkt_dev->ifname); + pkt_dev->odev->name);return -EINVAL ; }@@ -3337,7 +3342,7 @@if_lock (t);list_for_each_entry (p, &t->if_list, list) -if (strncmp (p->ifname, ifname,IFNAMSIZ ) ==0 ) { +if (strncmp (p->odev->name, ifname,IFNAMSIZ ) ==0 ) { pkt_dev = p;break ; }@@ -3378,7 +3383,7 @@static int pktgen_add_device (struct pktgen_thread *t,const char *ifname) {struct pktgen_dev *pkt_dev; -struct proc_dir_entry *pe; +int err;/* We don't allow a device to be on several threads */ @@ -3420,29 +3425,28 @@ pkt_dev->svlan_cfi =0 ; pkt_dev->svlan_id =0xffff ; -strncpy (pkt_dev->ifname, ifname,IFNAMSIZ ); + err =pktgen_setup_dev (pkt_dev, ifname); +if (err) + goto out1; -if (!pktgen_setup_dev (pkt_dev)) { -printk ("pktgen: ERROR: pktgen_setup_dev failed.\n" ); -if (pkt_dev->flows) -vfree (pkt_dev->flows); -kfree (pkt_dev); -return -ENODEV ; - } - - pe =create_proc_entry (ifname,0600 , pg_proc_dir); -if (!pe) { + pkt_dev->entry =create_proc_entry (ifname,0600 , pg_proc_dir); +if (!pkt_dev->entry) {printk ("pktgen: cannot create %s/%s procfs entry.\n" ,PG_PROC_DIR , ifname); -if (pkt_dev->flows) -vfree (pkt_dev->flows); -kfree (pkt_dev); -return -EINVAL ; + err = -EINVAL ; + goto out2; } - pe->proc_fops = &pktgen_if_fops; - pe->data = pkt_dev; + pkt_dev->entry->proc_fops = &pktgen_if_fops; + pkt_dev->entry->data = pkt_dev;return add_dev_to_thread (t, pkt_dev); +out2: +dev_put (pkt_dev->odev); +out1: +if (pkt_dev->flows) +vfree (pkt_dev->flows); +kfree (pkt_dev); +return err; }static int __init pktgen_create_thread (int cpu)@@ -3530,9 +3534,8 @@_rem_dev_from_if_list (t, pkt_dev); -/* Clean up proc file system */ - -remove_proc_entry (pkt_dev->ifname, pg_proc_dir); +if (pkt_dev->entry) +remove_proc_entry (pkt_dev->entry->name, pg_proc_dir);if (pkt_dev->flows)vfree (pkt_dev->flows); -To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Miller
maintainerRe: [PATCH 4/4] pktgen: fix device name handling
From: Robert Olsson <[email protected]>
Date: Wed, 28 Feb 2007 18:07:09 +0100
Quoted 4 lines
Yes it seems be handle dev name change. So configuration scripts should use ifindex now :)
Signed-off-by Robert Olsson <[email protected]>
I will apply all 4 of these patches to net-2.6.22, thanks everyone.
PATCH 1/4 pktgen: use pr_debug
In reply to Stephen HemmingerThanks!
--ro
Quoted 144 lines · Stephen Hemminger
Remove private debug macro and replace with standard version
Signed-off-by Stephen Hemminger <[email protected]>--- net/core/pktgen.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-)net/core/pktgen.c +15
-20@@ -163,9 +163,6 @@#define VERSION "pktgen v2.68: Packet Generator for packet performance testing.\n" -/* #define PG_DEBUG(a) a */ -#define PG_DEBUG (a) -/* The buckets are exponential in 'width' */ #define LAT_BUCKETS_MAX 32#define IP_NAME_SZ 32@@ -1856,8 +1853,7 @@int ret =0 ;mutex_lock (&pktgen_thread_lock); -PG_DEBUG (printk ("pktgen: pktgen_mark_device marking %s for removal\n" , - ifname)); +pr_debug ("pktgen: pktgen_mark_device marking %s for removal\n" , ifname);while (1 ) {@@ -1866,8 +1862,8 @@break ;/* success */ mutex_unlock (&pktgen_thread_lock); -PG_DEBUG (printk ("pktgen: pktgen_mark_device waiting for %s " -"to disappear....\n" , ifname)); +pr_debug ("pktgen: pktgen_mark_device waiting for %s " +"to disappear....\n" , ifname);schedule_timeout_interruptible (msecs_to_jiffies (msec_per_try));mutex_lock (&pktgen_thread_lock);@@ -2847,7 +2843,7 @@struct pktgen_dev *pkt_dev;int started =0 ; -PG_DEBUG (printk ("pktgen: entering pktgen_run. %p\n" , t)); +pr_debug ("pktgen: entering pktgen_run. %p\n" , t);if_lock (t);list_for_each_entry (pkt_dev, &t->if_list, list) {@@ -2879,7 +2875,7 @@ {struct pktgen_thread *t; -PG_DEBUG (printk ("pktgen: entering pktgen_stop_all_threads_ifs.\n" )); +pr_debug ("pktgen: entering pktgen_stop_all_threads_ifs.\n" );mutex_lock (&pktgen_thread_lock);@@ -2947,7 +2943,7 @@ {struct pktgen_thread *t; -PG_DEBUG (printk ("pktgen: entering pktgen_run_all_threads.\n" )); +pr_debug ("pktgen: entering pktgen_run_all_threads.\n" );mutex_lock (&pktgen_thread_lock);@@ -3039,7 +3035,7 @@ {struct pktgen_dev *pkt_dev; -PG_DEBUG (printk ("pktgen: entering pktgen_stop\n" )); +pr_debug ("pktgen: entering pktgen_stop\n" );if_lock (t);@@ -3063,7 +3059,7 @@struct list_head *q, *n;struct pktgen_dev *cur; -PG_DEBUG (printk ("pktgen: entering pktgen_rem_one_if\n" )); +pr_debug ("pktgen: entering pktgen_rem_one_if\n" );if_lock (t);@@ -3092,7 +3088,7 @@/* Remove all devices, free mem */ -PG_DEBUG (printk ("pktgen: entering pktgen_rem_all_ifs\n" )); +pr_debug ("pktgen: entering pktgen_rem_all_ifs\n" );if_lock (t);list_for_each_safe (q, n, &t->if_list) {@@ -3275,7 +3271,7 @@ t->pid = current->pid; -PG_DEBUG (printk ("pktgen: starting pktgen/%d: pid=%d\n" , cpu, current->pid)); +pr_debug ("pktgen: starting pktgen/%d: pid=%d\n" , cpu, current->pid); max_before_softirq = t->max_before_softirq;@@ -3336,13 +3332,13 @@set_current_state (TASK_INTERRUPTIBLE ); } -PG_DEBUG (printk ("pktgen: %s stopping all device\n" , t->tsk->comm)); +pr_debug ("pktgen: %s stopping all device\n" , t->tsk->comm);pktgen_stop (t); -PG_DEBUG (printk ("pktgen: %s removing all device\n" , t->tsk->comm)); +pr_debug ("pktgen: %s removing all device\n" , t->tsk->comm);pktgen_rem_all_ifs (t); -PG_DEBUG (printk ("pktgen: %s removing thread.\n" , t->tsk->comm)); +pr_debug ("pktgen: %s removing thread.\n" , t->tsk->comm);pktgen_rem_thread (t);return 0 ;@@ -3361,7 +3357,7 @@ }if_unlock (t); -PG_DEBUG (printk ("pktgen: find_dev(%s) returning %p\n" , ifname, pkt_dev)); +pr_debug ("pktgen: find_dev(%s) returning %p\n" , ifname, pkt_dev);return pkt_dev; }@@ -3530,7 +3526,7 @@ struct pktgen_dev *pkt_dev) { -PG_DEBUG (printk ("pktgen: remove_device pkt_dev=%p\n" , pkt_dev)); +pr_debug ("pktgen: remove_device pkt_dev=%p\n" , pkt_dev);if (pkt_dev->running) {printk ("pktgen:WARNING: trying to remove a running interface, stopping it now.\n" ); -To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html