All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: qcom/emac: Allocate buffers from local node
@ 2018-05-17  8:28 Hemanth Puranik
  2018-05-17 11:36 ` Timur Tabi
  2018-05-17 19:57 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Hemanth Puranik @ 2018-05-17  8:28 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: Timur Tabi, Hemanth Puranik

Currently we use non-NUMA aware allocation for TPD and RRD buffers,
this patch modifies to use NUMA friendly allocation.

Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
---
 drivers/net/ethernet/qualcomm/emac/emac-mac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
index 092718a..c3df86a 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
@@ -684,9 +684,10 @@ static int emac_tx_q_desc_alloc(struct emac_adapter *adpt,
 {
 	struct emac_ring_header *ring_header = &adpt->ring_header;
 	size_t size;
+	int node = dev_to_node(adpt->netdev->dev.parent);
 
 	size = sizeof(struct emac_buffer) * tx_q->tpd.count;
-	tx_q->tpd.tpbuff = kzalloc(size, GFP_KERNEL);
+	tx_q->tpd.tpbuff = kzalloc_node(size, GFP_KERNEL, node);
 	if (!tx_q->tpd.tpbuff)
 		return -ENOMEM;
 
@@ -725,9 +726,10 @@ static int emac_rx_descs_alloc(struct emac_adapter *adpt)
 	struct emac_ring_header *ring_header = &adpt->ring_header;
 	struct emac_rx_queue *rx_q = &adpt->rx_q;
 	size_t size;
+	int node = dev_to_node(adpt->netdev->dev.parent);
 
 	size = sizeof(struct emac_buffer) * rx_q->rfd.count;
-	rx_q->rfd.rfbuff = kzalloc(size, GFP_KERNEL);
+	rx_q->rfd.rfbuff = kzalloc_node(size, GFP_KERNEL, node);
 	if (!rx_q->rfd.rfbuff)
 		return -ENOMEM;
 
-- 
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: qcom/emac: Allocate buffers from local node
  2018-05-17  8:28 [PATCH] net: qcom/emac: Allocate buffers from local node Hemanth Puranik
@ 2018-05-17 11:36 ` Timur Tabi
  2018-05-17 19:57 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Timur Tabi @ 2018-05-17 11:36 UTC (permalink / raw)
  To: Hemanth Puranik, netdev, linux-kernel

On 5/17/18 3:28 AM, Hemanth Puranik wrote:
> Currently we use non-NUMA aware allocation for TPD and RRD buffers,
> this patch modifies to use NUMA friendly allocation.
> 
> Signed-off-by: Hemanth Puranik<hpuranik@codeaurora.org>

Acked-by: Timur Tabi <timur@codeaurora.org>

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc.  Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: qcom/emac: Allocate buffers from local node
  2018-05-17  8:28 [PATCH] net: qcom/emac: Allocate buffers from local node Hemanth Puranik
  2018-05-17 11:36 ` Timur Tabi
@ 2018-05-17 19:57 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-05-17 19:57 UTC (permalink / raw)
  To: hpuranik; +Cc: netdev, linux-kernel, timur

From: Hemanth Puranik <hpuranik@codeaurora.org>
Date: Thu, 17 May 2018 13:58:00 +0530

> Currently we use non-NUMA aware allocation for TPD and RRD buffers,
> this patch modifies to use NUMA friendly allocation.
> 
> Signed-off-by: Hemanth Puranik <hpuranik@codeaurora.org>
> ---
>  drivers/net/ethernet/qualcomm/emac/emac-mac.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
> index 092718a..c3df86a 100644
> --- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
> +++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
> @@ -684,9 +684,10 @@ static int emac_tx_q_desc_alloc(struct emac_adapter *adpt,
>  {
>  	struct emac_ring_header *ring_header = &adpt->ring_header;
>  	size_t size;
> +	int node = dev_to_node(adpt->netdev->dev.parent);

Please order local variable declarations from longest to shortest line
(ie. reverse christmas tree layout).

> @@ -725,9 +726,10 @@ static int emac_rx_descs_alloc(struct emac_adapter *adpt)
>  	struct emac_ring_header *ring_header = &adpt->ring_header;
>  	struct emac_rx_queue *rx_q = &adpt->rx_q;
>  	size_t size;
> +	int node = dev_to_node(adpt->netdev->dev.parent);

Likewise.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-17 19:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17  8:28 [PATCH] net: qcom/emac: Allocate buffers from local node Hemanth Puranik
2018-05-17 11:36 ` Timur Tabi
2018-05-17 19:57 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.