1 From 357ab2939dbddfb6849c55be9de577db078d9037 Mon Sep 17 00:00:00 2001
2 From: Madalin Bucur <madalin.bucur@nxp.com>
3 Date: Fri, 12 Oct 2018 16:56:57 +0300
4 Subject: [PATCH] sdk_dpaa: remove FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
6 Remove FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE and record the
7 receive CPU in skb queue mapping to maintain the same CPU
8 for tx in forwarding scenarios.
10 Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
12 drivers/net/ethernet/freescale/sdk_dpaa/Kconfig | 13 +------------
13 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c | 2 +-
14 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 12 ++----------
15 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 3 +--
16 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h | 2 +-
17 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 2 ++
18 6 files changed, 8 insertions(+), 26 deletions(-)
20 --- a/drivers/net/ethernet/freescale/sdk_dpaa/Kconfig
21 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/Kconfig
22 @@ -96,17 +96,6 @@ config FSL_DPAA_1588
24 Enable IEEE1588 support code.
26 -config FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
27 - bool "Use driver's Tx queue selection mechanism"
29 - depends on FSL_SDK_DPAA_ETH
31 - The DPAA-Ethernet driver defines a ndo_select_queue() callback for optimal selection
32 - of the egress FQ. That will override the XPS support for this netdevice.
33 - If for whatever reason you want to be in control of the egress FQ-to-CPU selection and mapping,
34 - or simply don't want to use the driver's ndo_select_queue() callback, then unselect this
35 - and use the standard XPS support instead.
37 config FSL_DPAA_ETH_MAX_BUF_COUNT
38 int "Maximum nuber of buffers in private bpool"
39 depends on FSL_SDK_DPAA_ETH
40 @@ -178,7 +167,7 @@ config FSL_DPAA_ETH_DEBUG
42 config FSL_DPAA_DBG_LOOP
43 bool "DPAA Ethernet Debug loopback"
44 - depends on FSL_DPAA_ETH_DEBUGFS && FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
45 + depends on FSL_DPAA_ETH_DEBUGFS
48 This option allows to divert all received traffic on a certain interface A towards a
49 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c
50 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c
51 @@ -678,7 +678,7 @@ static const struct net_device_ops dpa_p
52 .ndo_get_stats64 = dpa_get_stats64,
53 .ndo_set_mac_address = dpa_set_mac_address,
54 .ndo_validate_addr = eth_validate_addr,
55 -#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
56 +#ifdef CONFIG_FMAN_PFC
57 .ndo_select_queue = dpa_select_queue,
59 .ndo_set_rx_mode = dpa_set_rx_mode,
60 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
61 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
62 @@ -635,23 +635,15 @@ static inline void _dpa_assign_wq(struct
66 -#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
67 -/* Use in lieu of skb_get_queue_mapping() */
68 #ifdef CONFIG_FMAN_PFC
69 +/* Use in lieu of skb_get_queue_mapping() */
70 #define dpa_get_queue_mapping(skb) \
71 (((skb)->priority < CONFIG_FMAN_PFC_COS_COUNT) ? \
72 ((skb)->priority * dpa_num_cpus + smp_processor_id()) : \
73 ((CONFIG_FMAN_PFC_COS_COUNT - 1) * \
74 dpa_num_cpus + smp_processor_id()));
77 -#define dpa_get_queue_mapping(skb) \
78 - raw_smp_processor_id()
81 -/* Use the queue selected by XPS */
82 -#define dpa_get_queue_mapping(skb) \
83 - skb_get_queue_mapping(skb)
84 +#define dpa_get_queue_mapping(skb) skb_get_queue_mapping(skb)
87 #ifdef CONFIG_PTP_1588_CLOCK_DPAA
88 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
89 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
90 @@ -841,14 +841,13 @@ bool dpa_bpid2pool_use(int bpid)
94 -#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
95 +#ifdef CONFIG_FMAN_PFC
96 u16 dpa_select_queue(struct net_device *net_dev, struct sk_buff *skb,
97 struct net_device *sb_dev,
98 select_queue_fallback_t fallback)
100 return dpa_get_queue_mapping(skb);
102 -EXPORT_SYMBOL(dpa_select_queue);
105 struct dpa_fq *dpa_fq_alloc(struct device *dev,
106 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h
107 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h
108 @@ -172,7 +172,7 @@ struct dpa_bp *dpa_bpid2pool(int bpid);
109 void dpa_bpid2pool_map(int bpid, struct dpa_bp *dpa_bp);
110 bool dpa_bpid2pool_use(int bpid);
111 void dpa_bp_drain(struct dpa_bp *bp);
112 -#ifdef CONFIG_FSL_DPAA_ETH_USE_NDO_SELECT_QUEUE
113 +#ifdef CONFIG_FMAN_PFC
114 u16 dpa_select_queue(struct net_device *net_dev, struct sk_buff *skb,
115 struct net_device *sb_dev,
116 select_queue_fallback_t fallback);
117 --- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
118 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
119 @@ -648,6 +648,8 @@ void __hot _dpa_rx(struct net_device *ne
123 + skb_record_rx_queue(skb, raw_smp_processor_id());
126 gro_result_t gro_result;
127 const struct qman_portal_config *pc =