netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] liquidio: replace skb_tx_hash with fallback
@ 2017-01-12 18:46 Felix Manlunas
  2017-01-12 19:10 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Manlunas @ 2017-01-12 18:46 UTC (permalink / raw)
  To: davem; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla

From: Satanand Burla <satananda.burla@cavium.com>

Use fallback instead of skb_tx_hash for selecting txq

Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
---
 drivers/net/ethernet/cavium/liquidio/lio_main.c    | 10 ++--------
 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 11 ++---------
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index b8b579d..90f000f 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -2231,15 +2231,9 @@ static void if_cfg_callback(struct octeon_device *oct,
  */
 static u16 select_q(struct net_device *dev, struct sk_buff *skb,
 		    void *accel_priv __attribute__((unused)),
-		    select_queue_fallback_t fallback __attribute__((unused)))
+		    select_queue_fallback_t fallback)
 {
-	u32 qindex = 0;
-	struct lio *lio;
-
-	lio = GET_LIO(dev);
-	qindex = skb_tx_hash(dev, skb);
-
-	return (u16)(qindex % (lio->linfo.num_txpciq));
+	return fallback(dev, skb);
 }
 
 /** Routine to push packets arriving on Octeon interface upto network layer.
diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index ad2e72d..a7478eb 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -1463,16 +1463,9 @@ static void if_cfg_callback(struct octeon_device *oct,
  */
 static u16 select_q(struct net_device *dev, struct sk_buff *skb,
 		    void *accel_priv __attribute__((unused)),
-		    select_queue_fallback_t fallback __attribute__((unused)))
+		    select_queue_fallback_t fallback)
 {
-	struct lio *lio;
-	u32 qindex;
-
-	lio = GET_LIO(dev);
-
-	qindex = skb_tx_hash(dev, skb);
-
-	return (u16)(qindex % (lio->linfo.num_txpciq));
+	return fallback(dev, skb);
 }
 
 /** Routine to push packets arriving on Octeon interface upto network layer.

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

* Re: [PATCH net-next] liquidio: replace skb_tx_hash with fallback
  2017-01-12 18:46 [PATCH net-next] liquidio: replace skb_tx_hash with fallback Felix Manlunas
@ 2017-01-12 19:10 ` Eric Dumazet
  2017-01-12 21:51   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2017-01-12 19:10 UTC (permalink / raw)
  To: Felix Manlunas
  Cc: davem, netdev, raghu.vatsavayi, derek.chickles, satananda.burla

On Thu, 2017-01-12 at 10:46 -0800, Felix Manlunas wrote:
> From: Satanand Burla <satananda.burla@cavium.com>
> 
> Use fallback instead of skb_tx_hash for selecting txq
> 
> Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
> ---
>  drivers/net/ethernet/cavium/liquidio/lio_main.c    | 10 ++--------
>  drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 11 ++---------
>  2 files changed, 4 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> index b8b579d..90f000f 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
> @@ -2231,15 +2231,9 @@ static void if_cfg_callback(struct octeon_device *oct,
>   */
>  static u16 select_q(struct net_device *dev, struct sk_buff *skb,
>  		    void *accel_priv __attribute__((unused)),
> -		    select_queue_fallback_t fallback __attribute__((unused)))
> +		    select_queue_fallback_t fallback)
>  {
> -	u32 qindex = 0;
> -	struct lio *lio;
> -
> -	lio = GET_LIO(dev);
> -	qindex = skb_tx_hash(dev, skb);
> -
> -	return (u16)(qindex % (lio->linfo.num_txpciq));
> +	return fallback(dev, skb);
>  }
>  
>  /** Routine to push packets arriving on Octeon interface upto network layer.
> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> index ad2e72d..a7478eb 100644
> --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
> @@ -1463,16 +1463,9 @@ static void if_cfg_callback(struct octeon_device *oct,
>   */
>  static u16 select_q(struct net_device *dev, struct sk_buff *skb,
>  		    void *accel_priv __attribute__((unused)),
> -		    select_queue_fallback_t fallback __attribute__((unused)))
> +		    select_queue_fallback_t fallback)
>  {
> -	struct lio *lio;
> -	u32 qindex;
> -
> -	lio = GET_LIO(dev);
> -
> -	qindex = skb_tx_hash(dev, skb);
> -
> -	return (u16)(qindex % (lio->linfo.num_txpciq));
> +	return fallback(dev, skb);
>  }
>  
>  /** Routine to push packets arriving on Octeon interface upto network layer.


Why are you keeping these functions then ?

Remove them completely, and remove .ndo_select_queue from your ops.

Core networking stack will fallback automatically.

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

* Re: [PATCH net-next] liquidio: replace skb_tx_hash with fallback
  2017-01-12 19:10 ` Eric Dumazet
@ 2017-01-12 21:51   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2017-01-12 21:51 UTC (permalink / raw)
  To: eric.dumazet
  Cc: felix.manlunas, netdev, raghu.vatsavayi, derek.chickles,
	satananda.burla

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 12 Jan 2017 11:10:18 -0800

> Why are you keeping these functions then ?
> 
> Remove them completely, and remove .ndo_select_queue from your ops.
> 
> Core networking stack will fallback automatically.

Agreed, if all the queue selection function is doing is invoking the
fallback, get rid of it.

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

end of thread, other threads:[~2017-01-12 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 18:46 [PATCH net-next] liquidio: replace skb_tx_hash with fallback Felix Manlunas
2017-01-12 19:10 ` Eric Dumazet
2017-01-12 21:51   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).