diff mbox

[RFC,V2,04/25] net/netpolicy: get CPU information

Message ID 1470339389-8542-5-git-send-email-kan.liang@intel.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

kan.liang@intel.com Aug. 4, 2016, 7:36 p.m. UTC
From: Kan Liang <kan.liang@intel.com>

Net policy also needs to know CPU information. Currently, online
CPU number is enough.

Signed-off-by: Kan Liang <kan.liang@intel.com>
---
 net/core/netpolicy.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sergei Shtylyov Aug. 5, 2016, 11 a.m. UTC | #1
Hello.

On 8/4/2016 10:36 PM, kan.liang@intel.com wrote:

> From: Kan Liang <kan.liang@intel.com>
>
> Net policy also needs to know CPU information. Currently, online
> CPU number is enough.

    s/number/count/. Or "the number of online CPUs".

>
> Signed-off-by: Kan Liang <kan.liang@intel.com>
> ---
>  net/core/netpolicy.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/net/core/netpolicy.c b/net/core/netpolicy.c
> index 7c34c8a..075aaca 100644
> --- a/net/core/netpolicy.c
> +++ b/net/core/netpolicy.c
> @@ -49,6 +49,11 @@ static void netpolicy_free_dev_info(struct netpolicy_dev_info *d_info)
>  	kfree(d_info->tx_irq);
>  }
>
> +static u32 netpolicy_get_cpu_information(void)
> +{
> +	return num_online_cpus();
> +}
> +
>  const char *policy_name[NET_POLICY_MAX] = {
>  	"NONE"
>  };

MBR, Sergei
diff mbox

Patch

diff --git a/net/core/netpolicy.c b/net/core/netpolicy.c
index 7c34c8a..075aaca 100644
--- a/net/core/netpolicy.c
+++ b/net/core/netpolicy.c
@@ -49,6 +49,11 @@  static void netpolicy_free_dev_info(struct netpolicy_dev_info *d_info)
 	kfree(d_info->tx_irq);
 }
 
+static u32 netpolicy_get_cpu_information(void)
+{
+	return num_online_cpus();
+}
+
 const char *policy_name[NET_POLICY_MAX] = {
 	"NONE"
 };