From b12cef51b537d869f423c0f4bb2d2245ce2e5619 Mon Sep 17 00:00:00 2001 From: Ioana Radulescu Date: Fri, 12 Oct 2018 16:27:25 +0000 Subject: [PATCH 1/6] dpaa2-eth: Fix Kconfig dependencies Both ARCH_LAYERSCAPE and COMPILE_TEST dependencies are already implied through the FSL_MC_BUS dep, so there's no need to state it explicitly. Also, the fsl-mc bus depends on COMPILE_TEST only for some architectures (arm, arm64, ppc, x86), so it's not correct to claim build support unconditionally. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/dpaa2/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/Kconfig b/drivers/net/ethernet/freescale/dpaa2/Kconfig index a7f365db0eed..809a155eb193 100644 --- a/drivers/net/ethernet/freescale/dpaa2/Kconfig +++ b/drivers/net/ethernet/freescale/dpaa2/Kconfig @@ -1,7 +1,6 @@ config FSL_DPAA2_ETH tristate "Freescale DPAA2 Ethernet" depends on FSL_MC_BUS && FSL_MC_DPIO - depends on ARCH_LAYERSCAPE || COMPILE_TEST help This is the DPAA2 Ethernet driver supporting Freescale SoCs with DPAA2 (DataPath Acceleration Architecture v2). From 3233c1514f757350c17fa8ba929ee91165fc854c Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Fri, 12 Oct 2018 16:27:29 +0000 Subject: [PATCH 2/6] dpaa2-eth: make dpaa2_eth_set_dist_key static The dpaa2_eth_set_dist_key function is only used in a single file. Make it static. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 156080d42a6c..cf6de0658480 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -2172,8 +2172,8 @@ int dpaa2_eth_cls_fld_off(int prot, int field) /* Set Rx distribution (hash or flow classification) key * flags is a combination of RXH_ bits */ -int dpaa2_eth_set_dist_key(struct net_device *net_dev, - enum dpaa2_eth_rx_dist type, u64 flags) +static int dpaa2_eth_set_dist_key(struct net_device *net_dev, + enum dpaa2_eth_rx_dist type, u64 flags) { struct device *dev = net_dev->dev.parent; struct dpaa2_eth_priv *priv = netdev_priv(net_dev); From 85b7a342baf58c42199795cbb2d60ab98ef298ad Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Fri, 12 Oct 2018 16:27:33 +0000 Subject: [PATCH 3/6] dpaa2-eth: fix uninitialized variable warnings All 3 cases of possible uninitialized variables are false positives since they are used only as output parameters. Nonetheless, fix the warnings. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index cf6de0658480..dedbd67cd357 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -935,7 +935,7 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget) struct dpaa2_eth_channel *ch; struct dpaa2_eth_priv *priv; int rx_cleaned = 0, txconf_cleaned = 0; - enum dpaa2_eth_fq_type type; + enum dpaa2_eth_fq_type type = 0; int store_cleaned; int err; @@ -1002,7 +1002,7 @@ static void disable_ch_napi(struct dpaa2_eth_priv *priv) static int link_state_update(struct dpaa2_eth_priv *priv) { - struct dpni_link_state state; + struct dpni_link_state state = {0}; int err; err = dpni_get_link_state(priv->mc_io, 0, priv->mc_token, &state); @@ -1116,7 +1116,7 @@ static u32 drain_ingress_frames(struct dpaa2_eth_priv *priv) static int dpaa2_eth_stop(struct net_device *net_dev) { struct dpaa2_eth_priv *priv = netdev_priv(net_dev); - int dpni_enabled; + int dpni_enabled = 0; int retries = 10; u32 drained; From fdb6ca9e46745c24d4a9c23d05c4188957721f27 Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Fri, 12 Oct 2018 16:27:35 +0000 Subject: [PATCH 4/6] dpaa2-eth: remove unused priv parameter The priv parameter is never used in the build_linear_skb and drain_channel function. Remove it from the function definitions. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index dedbd67cd357..119551e7145c 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -98,8 +98,7 @@ static void free_rx_fd(struct dpaa2_eth_priv *priv, } /* Build a linear skb based on a single-buffer frame descriptor */ -static struct sk_buff *build_linear_skb(struct dpaa2_eth_priv *priv, - struct dpaa2_eth_channel *ch, +static struct sk_buff *build_linear_skb(struct dpaa2_eth_channel *ch, const struct dpaa2_fd *fd, void *fd_vaddr) { @@ -233,7 +232,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, percpu_extras = this_cpu_ptr(priv->percpu_extras); if (fd_format == dpaa2_fd_single) { - skb = build_linear_skb(priv, ch, fd, vaddr); + skb = build_linear_skb(ch, fd, vaddr); } else if (fd_format == dpaa2_fd_sg) { skb = build_frag_skb(priv, ch, buf_data); skb_free_frag(vaddr); @@ -1085,8 +1084,7 @@ static int dpaa2_eth_open(struct net_device *net_dev) /* The DPIO store must be empty when we call this, * at the end of every NAPI cycle. */ -static u32 drain_channel(struct dpaa2_eth_priv *priv, - struct dpaa2_eth_channel *ch) +static u32 drain_channel(struct dpaa2_eth_channel *ch) { u32 drained = 0, total = 0; @@ -1107,7 +1105,7 @@ static u32 drain_ingress_frames(struct dpaa2_eth_priv *priv) for (i = 0; i < priv->num_channels; i++) { ch = priv->channel[i]; - drained += drain_channel(priv, ch); + drained += drain_channel(ch); } return drained; From b00c898c00e11dd98516f31810013be4b768130f Mon Sep 17 00:00:00 2001 From: Ioana Ciornei Date: Fri, 12 Oct 2018 16:27:38 +0000 Subject: [PATCH 5/6] dpaa2-eth: mark unused parameter in dpaa2_eth_tx_conf The ch parameter is never used in the dpaa2_eth_tx_conf function but since its prototype must match the type defined in the consume field of struct dpaa2_eth_fq, just mark it as __always_unused. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 119551e7145c..85628e6ab9cc 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -659,7 +659,7 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) /* Tx confirmation frame processing routine */ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv, - struct dpaa2_eth_channel *ch, + struct dpaa2_eth_channel *ch __always_unused, const struct dpaa2_fd *fd, struct napi_struct *napi __always_unused, u16 queue_id __always_unused) From b948c8c6a77944486ea4de909bc6790c334ebf07 Mon Sep 17 00:00:00 2001 From: Ioana Radulescu Date: Fri, 12 Oct 2018 16:27:40 +0000 Subject: [PATCH 6/6] dpaa2-eth: remove unused FD field According to the hardware ArchDef, the PTV1 field in FD[CTRL] is ignored by WRIOP, so setting it for Tx FDs is pointless. Remove all references to it from the code. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller --- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index 85628e6ab9cc..88f7acce38dc 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -437,7 +437,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv, dpaa2_fd_set_format(fd, dpaa2_fd_sg); dpaa2_fd_set_addr(fd, addr); dpaa2_fd_set_len(fd, skb->len); - dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA | FD_CTRL_PTV1); + dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA); if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) enable_tx_tstamp(fd, sgt_buf); @@ -490,7 +490,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv, dpaa2_fd_set_offset(fd, (u16)(skb->data - buffer_start)); dpaa2_fd_set_len(fd, skb->len); dpaa2_fd_set_format(fd, dpaa2_fd_single); - dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA | FD_CTRL_PTV1); + dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA); if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) enable_tx_tstamp(fd, buffer_start);