Skip to contentSkip to conversation

liquidio: replace skb_tx_hash with fallback

PATCH In review Felix Manlunas 3 participants 3 messages Jan 12, 2017

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

PATCH 1/1 liquidio: replace skb_tx_hash with fallback

From: Satanand Burla <[email protected]>

Use fallback instead of skb_tx_hash for selecting txq

---
 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(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +2 -8
index b8b579d..90f000f 100644
@@ -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.
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +2 -9
index ad2e72d..a7478eb 100644
@@ -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.
#1 lore raw
Quoted 47 lines · Felix Manlunas

From: Satanand Burla <[email protected]>

Use fallback instead of skb_tx_hash for selecting txq

---
 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(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +2 -8
index b8b579d..90f000f 100644
@@ -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.
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1 -3
index ad2e72d..a7478eb 100644
@@ -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;

drivers/net/ethernet/cavium/liquidio/lio_vf_main.c static void if_cfg_callback(struct octeon_device *oct, · line 1471

Quoted 10 lines
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +1 -6
-
-	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.

maintainer
#2 lore raw

From: Eric Dumazet <[email protected]>
Date: Thu, 12 Jan 2017 11:10:18 -0800

Quoted 5 lines

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.