From 85365caae6ffc64cac24ad5165033294f7266d4a Mon Sep 17 00:00:00 2001 From: Madalin Bucur Date: Tue, 17 Mar 2015 10:55:57 +0200 Subject: dpaa_eth: use proper recycling condition The condition that needs to be evaluated to determine if a certain fd is to be recycled (buffers released in the buffer pool by HW) is (fd.bpid != 0xff). Several places in the code were using the previous condition (fd.cmd & FM_FD_CMD_FCO) that is always true after the unification of the recycling and confirmation paths. Signed-off-by: Madalin Bucur Change-Id: I23789acc6879086f356ca9accfe400122fd4f0f3 Reviewed-on: http://git.am.freescale.net:8181/32879 Reviewed-by: Marian Cristian Rotariu diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 4167268..e0fdf7c 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -299,7 +299,7 @@ static void _dpa_tx_error(struct net_device *net_dev, /* If we intended the buffers from this frame to go into the bpools * when the FMan transmit was done, we need to put it in manually. */ - if (fd->cmd & FM_FD_CMD_FCO) { + if (fd->bpid != 0xff) { dpa_fd_release(net_dev, fd); return; } @@ -554,7 +554,7 @@ static void priv_ern(struct qman_portal *portal, * when the FM was done, we need to put it in * manually. */ - if (msg->ern.fd.cmd & FM_FD_CMD_FCO) { + if (msg->ern.fd.bpid != 0xff) { dpa_fd_release(net_dev, &fd); return; } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 2e541a8..a601adb 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -958,7 +958,7 @@ int __hot dpa_tx(struct sk_buff *skb, struct net_device *net_dev) return NETDEV_TX_OK; xmit_failed: - if (fd.cmd & FM_FD_CMD_FCO) { + if (fd.bpid != 0xff) { (*countptr)--; percpu_priv->tx_returned--; dpa_fd_release(net_dev, &fd); -- cgit v0.10.2 From 5e8856a84e130b6cf307f50844bc8f28142ac60c Mon Sep 17 00:00:00 2001 From: Madalin Bucur Date: Wed, 18 Mar 2015 12:10:50 +0200 Subject: dpaa_eth: remove unused argument Removed unnecessary argument to dpa_bp_free(). Signed-off-by: Madalin Bucur Change-Id: Ib16b37b0057857875805eb5692e1fd5a273883cb Reviewed-on: http://git.am.freescale.net:8181/32981 Reviewed-by: Cristian-Constantin Sovaiala Reviewed-by: Marian Cristian Rotariu diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index e0fdf7c..7c051c8 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -846,7 +846,7 @@ static int dpa_priv_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, int err; err = dpa_bp_alloc(&dpa_bp[i]); if (err < 0) { - dpa_bp_free(priv, dpa_bp); + dpa_bp_free(priv); priv->dpa_bp = NULL; return err; } @@ -1093,7 +1093,7 @@ rx_cgr_init_failed: tx_cgr_init_failed: add_channel_failed: get_channel_failed: - dpa_bp_free(priv, priv->dpa_bp); + dpa_bp_free(priv); bp_create_failed: fq_probe_failed: alloc_failed: diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c index 9c2204d..021d013 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c @@ -220,7 +220,7 @@ int dpa_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, int err; err = dpa_bp_alloc(&dpa_bp[i]); if (err < 0) { - dpa_bp_free(priv, dpa_bp); + dpa_bp_free(priv); priv->dpa_bp = NULL; return err; } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index 6e12a81..20bfedf 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -521,7 +521,7 @@ int __cold dpa_remove(struct platform_device *of_dev) dpa_private_napi_del(net_dev); - dpa_bp_free(priv, priv->dpa_bp); + dpa_bp_free(priv); if (priv->buf_layout) devm_kfree(dev, priv->buf_layout); @@ -842,7 +842,7 @@ _dpa_bp_free(struct dpa_bp *dpa_bp) } void __cold __attribute__((nonnull)) -dpa_bp_free(struct dpa_priv_s *priv, struct dpa_bp *dpa_bp) +dpa_bp_free(struct dpa_priv_s *priv) { int i; diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h index ee1c853..d89afd1 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.h @@ -160,7 +160,7 @@ void dpa_set_buffers_layout(struct mac_device *mac_dev, int __attribute__((nonnull)) dpa_bp_alloc(struct dpa_bp *dpa_bp); void __cold __attribute__((nonnull)) -dpa_bp_free(struct dpa_priv_s *priv, struct dpa_bp *dpa_bp); +dpa_bp_free(struct dpa_priv_s *priv); struct dpa_bp *dpa_bpid2pool(int bpid); void dpa_bpid2pool_map(int bpid, struct dpa_bp *dpa_bp); bool dpa_bpid2pool_use(int bpid); diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c index f78e176..27b7c8f 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c @@ -1373,7 +1373,7 @@ static int dpa_generic_remove(struct platform_device *of_dev) /* TODO: this is for private dirver also; make generic */ #if 0 - dpa_bp_free(priv, priv->dpa_bp); + dpa_bp_free(priv); devm_kfree(dev, priv->dpa_bp); if (priv->buf_layout) diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c index c13e5cd..bd97536 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c @@ -454,7 +454,7 @@ fq_alloc_failed: add_channel_failed: get_channel_failed: if (net_dev) - dpa_bp_free(priv, priv->dpa_bp); + dpa_bp_free(priv); bp_create_failed: fq_probe_failed: dev_set_drvdata(dev, NULL); diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c index 1ac0007..db62cbe 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c @@ -838,7 +838,7 @@ cgr_init_failed: add_channel_failed: get_channel_failed: if (net_dev) - dpa_bp_free(priv, priv->dpa_bp); + dpa_bp_free(priv); bp_create_failed: fq_probe_failed: devm_kfree(dev, buf_layout); -- cgit v0.10.2 From e5fe7726f7d2cc04095d29687539d729ef400dad Mon Sep 17 00:00:00 2001 From: Cristian Sovaiala Date: Mon, 23 Mar 2015 17:42:40 +0200 Subject: dpaa_eth: Fix Shared-MAC and MACless compilation issue Signed-off-by: Cristian Sovaiala Change-Id: Icdfb39e75fd1c7268b26209f1bcd9b0755e6192f Reviewed-on: http://git.am.freescale.net:8181/33299 Reviewed-by: Madalin-Cristian Bucur Tested-by: Cristian-Constantin Sovaiala diff --git a/drivers/net/ethernet/freescale/dpa/Makefile b/drivers/net/ethernet/freescale/dpa/Makefile index 1d1b506..e611377 100644 --- a/drivers/net/ethernet/freescale/dpa/Makefile +++ b/drivers/net/ethernet/freescale/dpa/Makefile @@ -24,13 +24,16 @@ fsl_mac-objs += mac.o mac-api.o # Advanced drivers ifeq ($(CONFIG_FSL_DPAA_ADVANCED_DRIVERS),y) obj-$(CONFIG_FSL_DPAA_ETH) += fsl_advanced.o +obj-$(CONFIG_FSL_DPAA_ETH) += fsl_proxy.o +obj-$(CONFIG_FSL_DPAA_ETH) += fsl_dpa_shared.o +obj-$(CONFIG_FSL_DPAA_ETH) += fsl_dpa_macless.o fsl_advanced-objs += dpaa_eth_base.o # suport for multiple drivers per kernel module comes in kernel 3.14 # so we are forced to generate several modules for the advanced drivers fsl_proxy-objs += dpaa_eth_proxy.o -fsl_shared-objs += dpaa_eth_shared.o -fsl_macless-objs += dpaa_eth_macless.o +fsl_dpa_shared-objs += dpaa_eth_shared.o +fsl_dpa_macless-objs += dpaa_eth_macless.o ifeq ($(CONFIG_FSL_DPAA_OFFLINE_PORTS),y) obj-$(CONFIG_FSL_DPAA_ETH) += fsl_oh.o diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c index 021d013..9a0309d 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.c @@ -59,6 +59,7 @@ MODULE_LICENSE("Dual BSD/GPL"); uint8_t advanced_debug = -1; module_param(advanced_debug, byte, S_IRUGO); MODULE_PARM_DESC(advanced_debug, "Module/Driver verbosity level"); +EXPORT_SYMBOL(advanced_debug); static int dpa_bp_cmp(const void *dpa_bp0, const void *dpa_bp1) { @@ -161,6 +162,7 @@ _return_of_node_put: return dpa_bp; } +EXPORT_SYMBOL(dpa_bp_probe); int dpa_bp_shared_port_seed(struct dpa_bp *bp) { @@ -206,6 +208,7 @@ int dpa_bp_shared_port_seed(struct dpa_bp *bp) return 0; } +EXPORT_SYMBOL(dpa_bp_shared_port_seed); int dpa_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, size_t count) @@ -228,6 +231,7 @@ int dpa_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, return 0; } +EXPORT_SYMBOL(dpa_bp_create); static int __init __cold dpa_advanced_load(void) { diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.h index a75e270..6f57041 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_base.h @@ -46,11 +46,5 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count); int dpa_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, size_t count); int dpa_bp_shared_port_seed(struct dpa_bp *bp); -int __init __cold dpa_proxy_load(void); -int __init __cold dpa_shared_load(void); -int __init __cold dpa_macless_load(void); -void __exit __cold dpa_proxy_unload(void); -void __exit __cold dpa_shared_unload(void); -void __exit __cold dpa_macless_unload(void); #endif /* __DPAA_ETH_BASE_H */ diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index 20bfedf..ec5c11a 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -1235,6 +1235,7 @@ void dpa_fq_setup(struct dpa_priv_s *priv, const struct dpa_fq_cbs_t *fq_cbs, } } } +EXPORT_SYMBOL(dpa_fq_setup); int dpa_fq_init(struct dpa_fq *dpa_fq, bool td_enable) { diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c index 8f58203..bc8f5f7 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_proxy.c @@ -220,6 +220,7 @@ int dpa_proxy_set_mac_address(struct proxy_device *proxy_dev, return 0; } +EXPORT_SYMBOL(dpa_proxy_set_mac_address); int dpa_proxy_set_rx_mode(struct proxy_device *proxy_dev, struct net_device *net_dev) @@ -233,6 +234,7 @@ int dpa_proxy_set_rx_mode(struct proxy_device *proxy_dev, return 0; } +EXPORT_SYMBOL(dpa_proxy_set_rx_mode); int dpa_proxy_start(struct net_device *net_dev) { @@ -276,6 +278,7 @@ port_enable_fail: return _errno; } +EXPORT_SYMBOL(dpa_proxy_start); int dpa_proxy_stop(struct proxy_device *proxy_dev, struct net_device *net_dev) { @@ -302,6 +305,7 @@ int dpa_proxy_stop(struct proxy_device *proxy_dev, struct net_device *net_dev) return _errno; } +EXPORT_SYMBOL(dpa_proxy_stop); static int __cold dpa_eth_proxy_remove(struct platform_device *of_dev) { diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c index db62cbe..8f26f7b 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c @@ -107,6 +107,7 @@ const struct dpa_fq_cbs_t shared_fq_cbs = { .tx_errq = { .cb = { .dqrr = shared_tx_error_dqrr } }, .egress_ern = { .cb = { .ern = shared_ern } } }; +EXPORT_SYMBOL(shared_fq_cbs); static inline void * __must_check __attribute__((nonnull)) dpa_phys2virt(const struct dpa_bp *dpa_bp, dma_addr_t addr) @@ -580,6 +581,7 @@ buf_acquire_failed: /* err remains unused, NETDEV_TX_OK must be returned here */ return NETDEV_TX_OK; } +EXPORT_SYMBOL(dpa_shared_tx); static int dpa_shared_netdev_init(struct device_node *dpa_node, struct net_device *net_dev) -- cgit v0.10.2