Skip to contentSkip to conversation

netpoll: Trivial updates

PATCH Applied Joe Perches 4 participants 18 messages Jul 1, 2011 – Jul 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover netpoll: Trivial updates

cc WANG Cong <[email protected]>

Joe Perches (2):
netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev
netpoll: Remove trivial wrapper function netpoll_poll

 include/linux/netpoll.h |    2 --
 net/core/netpoll.c      |   13 +++----------
 2 files changed, 3 insertions(+), 12 deletions(-)
Signature · 1 line
1.7.6.rc1
#1 lore raw

PATCH 1/2 netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev

Unused symbols waste space.

Commit 0e34e93177fb
"(netpoll: add generic support for bridge and bonding devices)" added the symbol more than a year ago with the promise of "future use".

Because it is so far unused, remove it for now.
It can be easily readded if or when it actually needs to be used.

---
 include/linux/netpoll.h |    2 --
 net/core/netpoll.c      |    6 ++----
 2 files changed, 2 insertions(+), 6 deletions(-)
include/linux/netpoll.h +0 -2
index 79358bb..5dfa091 100644
@@ -40,8 +40,6 @@ struct netpoll_info {
 	struct netpoll *netpoll;
 };
 
-void netpoll_poll_dev(struct net_device *dev);
-void netpoll_poll(struct netpoll *np);
 void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
 void netpoll_print_options(struct netpoll *np);
 int netpoll_parse_options(struct netpoll *np, char *opt);
net/core/netpoll.c +2 -4
index 18d9cbd..4ce595e 100644
@@ -177,7 +177,7 @@ static void service_arp_queue(struct netpoll_info *npi)
 	}
 }
 
-void netpoll_poll_dev(struct net_device *dev)
+static void netpoll_poll_dev(struct net_device *dev)
 {
 	const struct net_device_ops *ops;
 
@@ -208,13 +208,11 @@ void netpoll_poll_dev(struct net_device *dev)
 
 	zap_completion_queue();
 }
-EXPORT_SYMBOL(netpoll_poll_dev);
 
-void netpoll_poll(struct netpoll *np)
+static void netpoll_poll(struct netpoll *np)
 {
 	netpoll_poll_dev(np->dev);
 }
-EXPORT_SYMBOL(netpoll_poll);
 
 static void refill_skbs(void)
 {
Signature · 1 line
1.7.6.rc1
maintainer Applied
#2 lore raw

Re: [PATCH 1/2] netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev

From: Joe Perches <[email protected]>
Date: Thu, 30 Jun 2011 18:08:57 -0700

Quoted 11 lines

Unused symbols waste space.

Commit 0e34e93177fb
"(netpoll: add generic support for bridge and bonding devices)" added the symbol more than a year ago with the promise of "future use".

Because it is so far unused, remove it for now.
It can be easily readded if or when it actually needs to be used.

Applied.

#3 lore raw

Re: [PATCH 1/2] netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev

In reply to Joe Perches
Quoted 34 lines · Joe Perches

Unused symbols waste space.

Commit 0e34e93177fb
"(netpoll: add generic support for bridge and bonding devices)" added the symbol more than a year ago with the promise of "future use".

Because it is so far unused, remove it for now.
It can be easily readded if or when it actually needs to be used.

---
 include/linux/netpoll.h |    2 --
 net/core/netpoll.c      |    6 ++----
 2 files changed, 2 insertions(+), 6 deletions(-)
include/linux/netpoll.h +0 -2
index 79358bb..5dfa091 100644
@@ -40,8 +40,6 @@ struct netpoll_info {
 	struct netpoll *netpoll;
 };
 
-void netpoll_poll_dev(struct net_device *dev);
-void netpoll_poll(struct netpoll *np);
 void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
 void netpoll_print_options(struct netpoll *np);
 int netpoll_parse_options(struct netpoll *np, char *opt);
net/core/netpoll.c +0 -0
index 18d9cbd..4ce595e 100644

net/core/netpoll.c static void service_arp_queue(struct netpoll_info *npi) · line 180

Quoted 5 lines
net/core/netpoll.c +1 -1
@@ -177,7 +177,7 @@ static void service_arp_queue(struct netpoll_info *npi)
 	}
 }
 
-void netpoll_poll_dev(struct net_device *dev)
+static void netpoll_poll_dev(struct net_device *dev)

Hi Joe,
You have removed the function declaration in include/linux/netpoll.h. And you changed the function like
static void netpoll_poll_dev(...)

{
	...
}

But i don't know its usage.
The 'static' before this function just says the active area of 'netpoll_poll_dev' is in the file net/core/netpoll.c. What is the purpose? Could you please tell me?

Thanks in advance.

Quoted 20 lines
net/core/netpoll.c +1 -3
 {
 	const struct net_device_ops *ops;
 
@@ -208,13 +208,11 @@ void netpoll_poll_dev(struct net_device *dev)
 
 	zap_completion_queue();
 }
-EXPORT_SYMBOL(netpoll_poll_dev);
 
-void netpoll_poll(struct netpoll *np)
+static void netpoll_poll(struct netpoll *np)
 {
 	netpoll_poll_dev(np->dev);
 }
-EXPORT_SYMBOL(netpoll_poll);
 
 static void refill_skbs(void)
 {
Signature · 1 line
1.7.6.rc1
#4 lore raw

Re: [PATCH 1/2] netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev

Quoted 14 lines · Harry Wei

include/linux/netpoll.h

Quoted 13 lines · Joe Perches

Unused symbols waste space.
Commit 0e34e93177fb
"(netpoll: add generic support for bridge and bonding devices)" added the symbol more than a year ago with the promise of "future use". Because it is so far unused, remove it for now.
It can be easily readded if or when it actually needs to be used.

---
 include/linux/netpoll.h |    2 --
 net/core/netpoll.c      |    6 ++----
 2 files changed, 2 insertions(+), 6 deletions(-)
include/linux/netpoll.h +0 -0

[]

Quoted 17 lines
Quoted 17 lines
include/linux/netpoll.h +0 -2
@@ -40,8 +40,6 @@ struct netpoll_info {
 	struct netpoll *netpoll;
 };
 
-void netpoll_poll_dev(struct net_device *dev);
-void netpoll_poll(struct netpoll *np);
 void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
 void netpoll_print_options(struct netpoll *np);
 int netpoll_parse_options(struct netpoll *np, char *opt);
net/core/netpoll.c +0 -0
index 18d9cbd..4ce595e 100644
@@ -177,7 +177,7 @@ static void service_arp_queue(struct netpoll_info *npi)
 	}
 }
 
Quoted 3 lines

net/core/netpoll.c static void service_arp_queue(struct netpoll_info *npi) · line 180

Quoted 2 lines
net/core/netpoll.c +1 -1
-void netpoll_poll_dev(struct net_device *dev)
+static void netpoll_poll_dev(struct net_device *dev)

You have removed the function declaration in include/linux/netpoll.h.

Because it's unused by anything in the tree
but netpoll.c

Quoted 6 lines

And you changed the function like
static void netpoll_poll_dev(...)

{
	...
}

But i don't know its usage.

It's now a local function to netpoll.c

Quoted 2 lines

The 'static' before this function just says the active area of 'netpoll_poll_dev' is in the file net/core/netpoll.c. What is the purpose? Could you please tell me?

It prods the device to perform network work.

	/* Process pending work on NIC */
	ops->ndo_poll_controller(dev);

	poll_napi(dev);
#5 lore raw

Re: [PATCH 1/2] netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev

On Mon, Jul 04, 2011 at 12:46:29AM -0700, Joe Perches wrote:
[...]

Quoted 4 lines
Quoted 1 line

You have removed the function declaration in include/linux/netpoll.h.

Because it's unused by anything in the tree
but netpoll.c

Hmmmm..., so sorry. I misunderstood your 'unused', which i thought there was also no use in netpoll.c :-/

Quoted 9 lines
Quoted 7 lines

And you changed the function like
static void netpoll_poll_dev(...)

{
	...
}

But i don't know its usage.

It's now a local function to netpoll.c

Yeah, it's true.

Quoted 10 lines
Quoted 3 lines

The 'static' before this function just says the active area of 'netpoll_poll_dev' is in the file net/core/netpoll.c. What is the purpose? Could you please tell me?

It prods the device to perform network work.

	/* Process pending work on NIC */
	ops->ndo_poll_controller(dev);

	poll_napi(dev);

Yeah, i will read the codes.

Thanks so much
Harry Wei

#6 lore raw

PATCH 2/2 netpoll: Remove wrapper function netpoll_poll

In reply to Joe Perches

Too trivial to live.

---
 net/core/netpoll.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
net/core/netpoll.c +2 -7
index 4ce595e..adf84dd 100644
@@ -209,11 +209,6 @@ static void netpoll_poll_dev(struct net_device *dev)
 	zap_completion_queue();
 }
 
-static void netpoll_poll(struct netpoll *np)
-{
-	netpoll_poll_dev(np->dev);
-}
-
 static void refill_skbs(void)
 {
 	struct sk_buff *skb;
@@ -273,7 +268,7 @@ repeat:
 
 	if (!skb) {
 		if (++count < 10) {
-			netpoll_poll(np);
+			netpoll_poll_dev(np->dev);
 			goto repeat;
 		}
 		return NULL;
@@ -334,7 +329,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
 			}
 
 			/* tickle device maybe there is some cleanup */
-			netpoll_poll(np);
+			netpoll_poll_dev(np->dev);
 
 			udelay(USEC_PER_POLL);
 		}
Signature · 1 line
1.7.6.rc1
#8 lore raw
In reply to Joe Perches
Quoted 10 lines · Joe Perches
cc WANG Cong<[email protected]>

Joe Perches (2):
netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev
netpoll: Remove trivial wrapper function netpoll_poll

  include/linux/netpoll.h |    2 --
  net/core/netpoll.c      |   13 +++----------
  2 files changed, 3 insertions(+), 12 deletions(-)

I am fine with patch 1/2, but not 2/2, since it is trivial, why touch it? With netpoll_poll(), we don't need to explore the details of struct netpoll, I think it is nice to have it.

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Thanks.

#9 lore raw
Quoted 11 lines · Cong Wang
Quoted 7 lines · Joe Perches

cc: WANG Cong<[email protected]>
Joe Perches (2):
netpoll: Remove unused EXPORT_SYMBOLs of netpoll_poll and netpoll_poll_dev
netpoll: Remove trivial wrapper function netpoll_poll

  include/linux/netpoll.h |    2 --
  net/core/netpoll.c      |   13 +++----------
  2 files changed, 3 insertions(+), 12 deletions(-)

I am fine with patch 1/2, but not 2/2, since it is trivial, why touch it? With netpoll_poll(), we don't need to explore the details of struct netpoll, I think it is nice to have it.

Shrug. Neither is used. Keep things minimal.

Quoted 1 line

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.

It's used in netpoll.h by netpoll_send_skb.
It could be called from anywhere.
It's currently called/used by bonding.h.

cheers, Joe

#10 lore raw
Quoted 8 lines · Joe Perches
Quoted 2 lines

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.

It's used in netpoll.h by netpoll_send_skb.
It could be called from anywhere.
It's currently called/used by bonding.h.

% git grep netpoll_send_skb_on_dev .
include/linux/netpoll.h:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
include/linux/netpoll.h: netpoll_send_skb_on_dev(np, skb, np->dev);
net/core/netpoll.c:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, net/core/netpoll.c:EXPORT_SYMBOL(netpoll_send_skb_on_dev);

No modules use it...

#11 lore raw
Quoted 6 lines · Cong Wang
Quoted 5 lines · Joe Perches
Quoted 1 line

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.
It's used in netpoll.h by netpoll_send_skb. It could be called from anywhere. It's currently called/used by bonding.h.

Quoted 6 lines

% git grep netpoll_send_skb_on_dev .
include/linux/netpoll.h:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
include/linux/netpoll.h: netpoll_send_skb_on_dev(np, skb, np->dev);
net/core/netpoll.c:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, net/core/netpoll.c:EXPORT_SYMBOL(netpoll_send_skb_on_dev);
No modules use it...

Read what I wrote.

Look up one level at where it's used by netpoll.h.

#12 lore raw
Quoted 14 lines · Joe Perches
Quoted 6 lines · Cong Wang
Quoted 5 lines · Joe Perches
Quoted 1 line

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.
It's used in netpoll.h by netpoll_send_skb. It could be called from anywhere. It's currently called/used by bonding.h.

Quoted 6 lines

% git grep netpoll_send_skb_on_dev .
include/linux/netpoll.h:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
include/linux/netpoll.h: netpoll_send_skb_on_dev(np, skb, np->dev);
net/core/netpoll.c:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, net/core/netpoll.c:EXPORT_SYMBOL(netpoll_send_skb_on_dev);
No modules use it...

Quoted 4 lines

Read what I wrote.

Look up one level at where it's used by netpoll.h.

Then move netpoll_send_skb(), export it instead of netpoll_send_skb_on_dev()...

#13 lore raw
Quoted 11 lines · Cong Wang
Quoted 9 lines · Joe Perches
Quoted 6 lines · Cong Wang
Quoted 5 lines · Joe Perches
Quoted 1 line

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.
It's used in netpoll.h by netpoll_send_skb. It could be called from anywhere. It's currently called/used by bonding.h.

Read what I wrote.
Look up one level at where it's used by netpoll.h.

Then move netpoll_send_skb(), export it instead of netpoll_send_skb_on_dev()...

Submit that if you choose.

#14 lore raw
Quoted 9 lines · Joe Perches
Quoted 8 lines · Cong Wang
Quoted 7 lines · Joe Perches
Quoted 6 lines · Cong Wang
Quoted 5 lines · Joe Perches
Quoted 1 line

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.
It's used in netpoll.h by netpoll_send_skb. It could be called from anywhere. It's currently called/used by bonding.h.

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

Read what I wrote.
Look up one level at where it's used by netpoll.h.

Then move netpoll_send_skb(), export it instead of netpoll_send_skb_on_dev()...

Submit that if you choose.

Well, you are on it, I am fine to leave as it is, as you agree these changes are all trivial. :)

maintainer
#15 lore raw
In reply to Cong Wang

From: Cong Wang <[email protected]>
Date: Fri, 01 Jul 2011 11:49:23 +0800

Quoted 18 lines
Quoted 8 lines · Joe Perches
Quoted 2 lines

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.

It's used in netpoll.h by netpoll_send_skb.
It could be called from anywhere.
It's currently called/used by bonding.h.

% git grep netpoll_send_skb_on_dev . include/linux/netpoll.h:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
include/linux/netpoll.h: netpoll_send_skb_on_dev(np, skb, np->dev); net/core/netpoll.c:void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, net/core/netpoll.c:EXPORT_SYMBOL(netpoll_send_skb_on_dev);

Quoted 1 line

No modules use it...

Right, this is a relic that bonding was using at one point in the past but it no longer does.

#16 lore raw
Quoted 7 lines · David Miller

From: Cong Wang <[email protected]>

Quoted 6 lines
Quoted 5 lines
Quoted 1 line

BTW, you can kill the export of netpoll_send_skb_on_dev() too.

Not too sure about that.
It's used in netpoll.h by netpoll_send_skb. It could be called from anywhere. It's currently called/used by bonding.h.

% git grep netpoll_send_skb_on_dev .

[]

Quoted 3 lines
Quoted 1 line

No modules use it...

Right, this is a relic that bonding was using at one point in the past but it no longer does.

Are you sure?

netpoll.h:

void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,

			     struct net_device *dev);
static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
{
	netpoll_send_skb_on_dev(np, skb, np->dev);
}
$ grep -rP --include=*.[ch] -w netpoll_send_skb *
drivers/net/bonding/bonding.h:		netpoll_send_skb(np, skb);
include/linux/netpoll.h:static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
net/bridge/br_private.h:		netpoll_send_skb(np, skb);
net/core/netpoll.c:			"netpoll_send_skb(): %s enabled interrupts in poll (%pF)\n",
net/core/netpoll.c:	netpoll_send_skb(np, skb);
net/core/netpoll.c:		netpoll_send_skb(np, send_skb);

from bonding.h

#ifdef CONFIG_NET_POLL_CONTROLLER
static inline void bond_netpoll_send_skb(const struct slave *slave,
struct sk_buff *skb)

{
	struct netpoll *np = slave->np;

	if (np)
		netpoll_send_skb(np, skb);
}

and br_private.h

static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
struct sk_buff *skb)

{
	struct netpoll *np = p->np;

	if (np)
		netpoll_send_skb(np, skb);
}

These are inlined and dependent on CONFIG_NET_POLL_CONTROLLER in drivers/net/Kconfig so doesn't netpoll_send_skb_on_dev need to be SYMBOL_EXPORTed?

cheers, Joe

maintainer
#17 lore raw

From: Joe Perches <[email protected]>
Date: Fri, 01 Jul 2011 15:18:23 -0700

Quoted 3 lines

These are inlined and dependent on CONFIG_NET_POLL_CONTROLLER in drivers/net/Kconfig so doesn't netpoll_send_skb_on_dev need to be SYMBOL_EXPORTed?

Right I noticed this when I read the rest of the thread where this was discussed.