Commit 0697fecf authored by David S. Miller's avatar David S. Miller

Merge branch 'dpaa2-eth-add-a-dpaa2_eth_-prefix-to-all-functions'

Ioana Ciornei says:

====================
dpaa2-eth: add a dpaa2_eth_ prefix to all functions

This is just a quick cleanup that aims at adding a dpaa2_eth_ prefix to
all functions within the dpaa2-eth driver even if those are static and
private to the driver. The main reason for doing this is that looking a
perf top, for example, is becoming an inconvenience because one cannot
easily determine which entries are dpaa2-eth related or not.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e0afe914 8d138373
...@@ -17,12 +17,12 @@ static int dpaa2_eth_dcbnl_ieee_getpfc(struct net_device *net_dev, ...@@ -17,12 +17,12 @@ static int dpaa2_eth_dcbnl_ieee_getpfc(struct net_device *net_dev,
return 0; return 0;
} }
static inline bool is_prio_enabled(u8 pfc_en, u8 tc) static inline bool dpaa2_eth_is_prio_enabled(u8 pfc_en, u8 tc)
{ {
return !!(pfc_en & (1 << tc)); return !!(pfc_en & (1 << tc));
} }
static int set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en) static int dpaa2_eth_set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en)
{ {
struct dpni_congestion_notification_cfg cfg = {0}; struct dpni_congestion_notification_cfg cfg = {0};
int i, err; int i, err;
...@@ -33,7 +33,7 @@ static int set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en) ...@@ -33,7 +33,7 @@ static int set_pfc_cn(struct dpaa2_eth_priv *priv, u8 pfc_en)
cfg.message_ctx = 0ULL; cfg.message_ctx = 0ULL;
for (i = 0; i < dpaa2_eth_tc_count(priv); i++) { for (i = 0; i < dpaa2_eth_tc_count(priv); i++) {
if (is_prio_enabled(pfc_en, i)) { if (dpaa2_eth_is_prio_enabled(pfc_en, i)) {
cfg.threshold_entry = DPAA2_ETH_CN_THRESH_ENTRY(priv); cfg.threshold_entry = DPAA2_ETH_CN_THRESH_ENTRY(priv);
cfg.threshold_exit = DPAA2_ETH_CN_THRESH_EXIT(priv); cfg.threshold_exit = DPAA2_ETH_CN_THRESH_EXIT(priv);
} else { } else {
...@@ -93,7 +93,7 @@ static int dpaa2_eth_dcbnl_ieee_setpfc(struct net_device *net_dev, ...@@ -93,7 +93,7 @@ static int dpaa2_eth_dcbnl_ieee_setpfc(struct net_device *net_dev,
} }
/* Configure congestion notifications for the enabled priorities */ /* Configure congestion notifications for the enabled priorities */
err = set_pfc_cn(priv, pfc->pfc_en); err = dpaa2_eth_set_pfc_cn(priv, pfc->pfc_en);
if (err) if (err)
return err; return err;
......
...@@ -40,7 +40,7 @@ static void *dpaa2_iova_to_virt(struct iommu_domain *domain, ...@@ -40,7 +40,7 @@ static void *dpaa2_iova_to_virt(struct iommu_domain *domain,
return phys_to_virt(phys_addr); return phys_to_virt(phys_addr);
} }
static void validate_rx_csum(struct dpaa2_eth_priv *priv, static void dpaa2_eth_validate_rx_csum(struct dpaa2_eth_priv *priv,
u32 fd_status, u32 fd_status,
struct sk_buff *skb) struct sk_buff *skb)
{ {
...@@ -62,7 +62,7 @@ static void validate_rx_csum(struct dpaa2_eth_priv *priv, ...@@ -62,7 +62,7 @@ static void validate_rx_csum(struct dpaa2_eth_priv *priv,
/* Free a received FD. /* Free a received FD.
* Not to be used for Tx conf FDs or on any other paths. * Not to be used for Tx conf FDs or on any other paths.
*/ */
static void free_rx_fd(struct dpaa2_eth_priv *priv, static void dpaa2_eth_free_rx_fd(struct dpaa2_eth_priv *priv,
const struct dpaa2_fd *fd, const struct dpaa2_fd *fd,
void *vaddr) void *vaddr)
{ {
...@@ -100,7 +100,7 @@ static void free_rx_fd(struct dpaa2_eth_priv *priv, ...@@ -100,7 +100,7 @@ static void free_rx_fd(struct dpaa2_eth_priv *priv,
} }
/* Build a linear skb based on a single-buffer frame descriptor */ /* Build a linear skb based on a single-buffer frame descriptor */
static struct sk_buff *build_linear_skb(struct dpaa2_eth_channel *ch, static struct sk_buff *dpaa2_eth_build_linear_skb(struct dpaa2_eth_channel *ch,
const struct dpaa2_fd *fd, const struct dpaa2_fd *fd,
void *fd_vaddr) void *fd_vaddr)
{ {
...@@ -121,7 +121,7 @@ static struct sk_buff *build_linear_skb(struct dpaa2_eth_channel *ch, ...@@ -121,7 +121,7 @@ static struct sk_buff *build_linear_skb(struct dpaa2_eth_channel *ch,
} }
/* Build a non linear (fragmented) skb based on a S/G table */ /* Build a non linear (fragmented) skb based on a S/G table */
static struct sk_buff *build_frag_skb(struct dpaa2_eth_priv *priv, static struct sk_buff *dpaa2_eth_build_frag_skb(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, struct dpaa2_eth_channel *ch,
struct dpaa2_sg_entry *sgt) struct dpaa2_sg_entry *sgt)
{ {
...@@ -204,7 +204,8 @@ static struct sk_buff *build_frag_skb(struct dpaa2_eth_priv *priv, ...@@ -204,7 +204,8 @@ static struct sk_buff *build_frag_skb(struct dpaa2_eth_priv *priv,
/* Free buffers acquired from the buffer pool or which were meant to /* Free buffers acquired from the buffer pool or which were meant to
* be released in the pool * be released in the pool
*/ */
static void free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array, int count) static void dpaa2_eth_free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array,
int count)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
void *vaddr; void *vaddr;
...@@ -218,7 +219,7 @@ static void free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array, int count) ...@@ -218,7 +219,7 @@ static void free_bufs(struct dpaa2_eth_priv *priv, u64 *buf_array, int count)
} }
} }
static void xdp_release_buf(struct dpaa2_eth_priv *priv, static void dpaa2_eth_xdp_release_buf(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, struct dpaa2_eth_channel *ch,
dma_addr_t addr) dma_addr_t addr)
{ {
...@@ -238,7 +239,7 @@ static void xdp_release_buf(struct dpaa2_eth_priv *priv, ...@@ -238,7 +239,7 @@ static void xdp_release_buf(struct dpaa2_eth_priv *priv,
} }
if (err) { if (err) {
free_bufs(priv, ch->xdp.drop_bufs, ch->xdp.drop_cnt); dpaa2_eth_free_bufs(priv, ch->xdp.drop_bufs, ch->xdp.drop_cnt);
ch->buf_count -= ch->xdp.drop_cnt; ch->buf_count -= ch->xdp.drop_cnt;
} }
...@@ -274,7 +275,7 @@ static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv, ...@@ -274,7 +275,7 @@ static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv,
return total_enqueued; return total_enqueued;
} }
static void xdp_tx_flush(struct dpaa2_eth_priv *priv, static void dpaa2_eth_xdp_tx_flush(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, struct dpaa2_eth_channel *ch,
struct dpaa2_eth_fq *fq) struct dpaa2_eth_fq *fq)
{ {
...@@ -295,14 +296,14 @@ static void xdp_tx_flush(struct dpaa2_eth_priv *priv, ...@@ -295,14 +296,14 @@ static void xdp_tx_flush(struct dpaa2_eth_priv *priv,
ch->stats.xdp_tx++; ch->stats.xdp_tx++;
} }
for (i = enqueued; i < fq->xdp_tx_fds.num; i++) { for (i = enqueued; i < fq->xdp_tx_fds.num; i++) {
xdp_release_buf(priv, ch, dpaa2_fd_get_addr(&fds[i])); dpaa2_eth_xdp_release_buf(priv, ch, dpaa2_fd_get_addr(&fds[i]));
percpu_stats->tx_errors++; percpu_stats->tx_errors++;
ch->stats.xdp_tx_err++; ch->stats.xdp_tx_err++;
} }
fq->xdp_tx_fds.num = 0; fq->xdp_tx_fds.num = 0;
} }
static void xdp_enqueue(struct dpaa2_eth_priv *priv, static void dpaa2_eth_xdp_enqueue(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, struct dpaa2_eth_channel *ch,
struct dpaa2_fd *fd, struct dpaa2_fd *fd,
void *buf_start, u16 queue_id) void *buf_start, u16 queue_id)
...@@ -333,10 +334,10 @@ static void xdp_enqueue(struct dpaa2_eth_priv *priv, ...@@ -333,10 +334,10 @@ static void xdp_enqueue(struct dpaa2_eth_priv *priv,
if (fq->xdp_tx_fds.num < DEV_MAP_BULK_SIZE) if (fq->xdp_tx_fds.num < DEV_MAP_BULK_SIZE)
return; return;
xdp_tx_flush(priv, ch, fq); dpaa2_eth_xdp_tx_flush(priv, ch, fq);
} }
static u32 run_xdp(struct dpaa2_eth_priv *priv, static u32 dpaa2_eth_run_xdp(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, struct dpaa2_eth_channel *ch,
struct dpaa2_eth_fq *rx_fq, struct dpaa2_eth_fq *rx_fq,
struct dpaa2_fd *fd, void *vaddr) struct dpaa2_fd *fd, void *vaddr)
...@@ -372,7 +373,7 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv, ...@@ -372,7 +373,7 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv,
case XDP_PASS: case XDP_PASS:
break; break;
case XDP_TX: case XDP_TX:
xdp_enqueue(priv, ch, fd, vaddr, rx_fq->flowid); dpaa2_eth_xdp_enqueue(priv, ch, fd, vaddr, rx_fq->flowid);
break; break;
default: default:
bpf_warn_invalid_xdp_action(xdp_act); bpf_warn_invalid_xdp_action(xdp_act);
...@@ -381,7 +382,7 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv, ...@@ -381,7 +382,7 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv,
trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act); trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act);
/* fall through */ /* fall through */
case XDP_DROP: case XDP_DROP:
xdp_release_buf(priv, ch, addr); dpaa2_eth_xdp_release_buf(priv, ch, addr);
ch->stats.xdp_drop++; ch->stats.xdp_drop++;
break; break;
case XDP_REDIRECT: case XDP_REDIRECT:
...@@ -441,7 +442,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, ...@@ -441,7 +442,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
percpu_extras = this_cpu_ptr(priv->percpu_extras); percpu_extras = this_cpu_ptr(priv->percpu_extras);
if (fd_format == dpaa2_fd_single) { if (fd_format == dpaa2_fd_single) {
xdp_act = run_xdp(priv, ch, fq, (struct dpaa2_fd *)fd, vaddr); xdp_act = dpaa2_eth_run_xdp(priv, ch, fq, (struct dpaa2_fd *)fd, vaddr);
if (xdp_act != XDP_PASS) { if (xdp_act != XDP_PASS) {
percpu_stats->rx_packets++; percpu_stats->rx_packets++;
percpu_stats->rx_bytes += dpaa2_fd_get_len(fd); percpu_stats->rx_bytes += dpaa2_fd_get_len(fd);
...@@ -450,13 +451,13 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, ...@@ -450,13 +451,13 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
dma_unmap_page(dev, addr, priv->rx_buf_size, dma_unmap_page(dev, addr, priv->rx_buf_size,
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
skb = build_linear_skb(ch, fd, vaddr); skb = dpaa2_eth_build_linear_skb(ch, fd, vaddr);
} else if (fd_format == dpaa2_fd_sg) { } else if (fd_format == dpaa2_fd_sg) {
WARN_ON(priv->xdp_prog); WARN_ON(priv->xdp_prog);
dma_unmap_page(dev, addr, priv->rx_buf_size, dma_unmap_page(dev, addr, priv->rx_buf_size,
DMA_BIDIRECTIONAL); DMA_BIDIRECTIONAL);
skb = build_frag_skb(priv, ch, buf_data); skb = dpaa2_eth_build_frag_skb(priv, ch, buf_data);
free_pages((unsigned long)vaddr, 0); free_pages((unsigned long)vaddr, 0);
percpu_extras->rx_sg_frames++; percpu_extras->rx_sg_frames++;
percpu_extras->rx_sg_bytes += dpaa2_fd_get_len(fd); percpu_extras->rx_sg_bytes += dpaa2_fd_get_len(fd);
...@@ -485,7 +486,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, ...@@ -485,7 +486,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
/* Check if we need to validate the L4 csum */ /* Check if we need to validate the L4 csum */
if (likely(dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV)) { if (likely(dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV)) {
status = le32_to_cpu(fas->status); status = le32_to_cpu(fas->status);
validate_rx_csum(priv, status, skb); dpaa2_eth_validate_rx_csum(priv, status, skb);
} }
skb->protocol = eth_type_trans(skb, priv->net_dev); skb->protocol = eth_type_trans(skb, priv->net_dev);
...@@ -499,7 +500,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, ...@@ -499,7 +500,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
return; return;
err_build_skb: err_build_skb:
free_rx_fd(priv, fd, vaddr); dpaa2_eth_free_rx_fd(priv, fd, vaddr);
err_frame_format: err_frame_format:
percpu_stats->rx_dropped++; percpu_stats->rx_dropped++;
} }
...@@ -510,7 +511,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv, ...@@ -510,7 +511,7 @@ static void dpaa2_eth_rx(struct dpaa2_eth_priv *priv,
* *
* Observance of NAPI budget is not our concern, leaving that to the caller. * Observance of NAPI budget is not our concern, leaving that to the caller.
*/ */
static int consume_frames(struct dpaa2_eth_channel *ch, static int dpaa2_eth_consume_frames(struct dpaa2_eth_channel *ch,
struct dpaa2_eth_fq **src) struct dpaa2_eth_fq **src)
{ {
struct dpaa2_eth_priv *priv = ch->priv; struct dpaa2_eth_priv *priv = ch->priv;
...@@ -560,7 +561,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch, ...@@ -560,7 +561,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch,
} }
/* Configure the egress frame annotation for timestamp update */ /* Configure the egress frame annotation for timestamp update */
static void enable_tx_tstamp(struct dpaa2_fd *fd, void *buf_start) static void dpaa2_eth_enable_tx_tstamp(struct dpaa2_fd *fd, void *buf_start)
{ {
struct dpaa2_faead *faead; struct dpaa2_faead *faead;
u32 ctrl, frc; u32 ctrl, frc;
...@@ -582,7 +583,7 @@ static void enable_tx_tstamp(struct dpaa2_fd *fd, void *buf_start) ...@@ -582,7 +583,7 @@ static void enable_tx_tstamp(struct dpaa2_fd *fd, void *buf_start)
} }
/* Create a frame descriptor based on a fragmented skb */ /* Create a frame descriptor based on a fragmented skb */
static int build_sg_fd(struct dpaa2_eth_priv *priv, static int dpaa2_eth_build_sg_fd(struct dpaa2_eth_priv *priv,
struct sk_buff *skb, struct sk_buff *skb,
struct dpaa2_fd *fd) struct dpaa2_fd *fd)
{ {
...@@ -673,7 +674,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv, ...@@ -673,7 +674,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,
dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA); dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA);
if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
enable_tx_tstamp(fd, sgt_buf); dpaa2_eth_enable_tx_tstamp(fd, sgt_buf);
return 0; return 0;
...@@ -692,7 +693,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv, ...@@ -692,7 +693,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv,
* enough for the HW requirements, thus instead of realloc-ing the skb we * enough for the HW requirements, thus instead of realloc-ing the skb we
* create a SG frame descriptor with only one entry. * create a SG frame descriptor with only one entry.
*/ */
static int build_sg_fd_single_buf(struct dpaa2_eth_priv *priv, static int dpaa2_eth_build_sg_fd_single_buf(struct dpaa2_eth_priv *priv,
struct sk_buff *skb, struct sk_buff *skb,
struct dpaa2_fd *fd) struct dpaa2_fd *fd)
{ {
...@@ -751,7 +752,7 @@ static int build_sg_fd_single_buf(struct dpaa2_eth_priv *priv, ...@@ -751,7 +752,7 @@ static int build_sg_fd_single_buf(struct dpaa2_eth_priv *priv,
dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA); dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA);
if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
enable_tx_tstamp(fd, sgt_buf); dpaa2_eth_enable_tx_tstamp(fd, sgt_buf);
return 0; return 0;
...@@ -767,7 +768,7 @@ static int build_sg_fd_single_buf(struct dpaa2_eth_priv *priv, ...@@ -767,7 +768,7 @@ static int build_sg_fd_single_buf(struct dpaa2_eth_priv *priv,
} }
/* Create a frame descriptor based on a linear skb */ /* Create a frame descriptor based on a linear skb */
static int build_single_fd(struct dpaa2_eth_priv *priv, static int dpaa2_eth_build_single_fd(struct dpaa2_eth_priv *priv,
struct sk_buff *skb, struct sk_buff *skb,
struct dpaa2_fd *fd) struct dpaa2_fd *fd)
{ {
...@@ -807,7 +808,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv, ...@@ -807,7 +808,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA); dpaa2_fd_set_ctrl(fd, FD_CTRL_PTA);
if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
enable_tx_tstamp(fd, buffer_start); dpaa2_eth_enable_tx_tstamp(fd, buffer_start);
return 0; return 0;
} }
...@@ -819,7 +820,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv, ...@@ -819,7 +820,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv,
* This can be called either from dpaa2_eth_tx_conf() or on the error path of * This can be called either from dpaa2_eth_tx_conf() or on the error path of
* dpaa2_eth_tx(). * dpaa2_eth_tx().
*/ */
static void free_tx_fd(const struct dpaa2_eth_priv *priv, static void dpaa2_eth_free_tx_fd(const struct dpaa2_eth_priv *priv,
struct dpaa2_eth_fq *fq, struct dpaa2_eth_fq *fq,
const struct dpaa2_fd *fd, bool in_napi) const struct dpaa2_fd *fd, bool in_napi)
{ {
...@@ -954,17 +955,17 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) ...@@ -954,17 +955,17 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
memset(&fd, 0, sizeof(fd)); memset(&fd, 0, sizeof(fd));
if (skb_is_nonlinear(skb)) { if (skb_is_nonlinear(skb)) {
err = build_sg_fd(priv, skb, &fd); err = dpaa2_eth_build_sg_fd(priv, skb, &fd);
percpu_extras->tx_sg_frames++; percpu_extras->tx_sg_frames++;
percpu_extras->tx_sg_bytes += skb->len; percpu_extras->tx_sg_bytes += skb->len;
} else if (skb_headroom(skb) < needed_headroom) { } else if (skb_headroom(skb) < needed_headroom) {
err = build_sg_fd_single_buf(priv, skb, &fd); err = dpaa2_eth_build_sg_fd_single_buf(priv, skb, &fd);
percpu_extras->tx_sg_frames++; percpu_extras->tx_sg_frames++;
percpu_extras->tx_sg_bytes += skb->len; percpu_extras->tx_sg_bytes += skb->len;
percpu_extras->tx_converted_sg_frames++; percpu_extras->tx_converted_sg_frames++;
percpu_extras->tx_converted_sg_bytes += skb->len; percpu_extras->tx_converted_sg_bytes += skb->len;
} else { } else {
err = build_single_fd(priv, skb, &fd); err = dpaa2_eth_build_single_fd(priv, skb, &fd);
} }
if (unlikely(err)) { if (unlikely(err)) {
...@@ -1010,7 +1011,7 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev) ...@@ -1010,7 +1011,7 @@ static netdev_tx_t dpaa2_eth_tx(struct sk_buff *skb, struct net_device *net_dev)
if (unlikely(err < 0)) { if (unlikely(err < 0)) {
percpu_stats->tx_errors++; percpu_stats->tx_errors++;
/* Clean up everything, including freeing the skb */ /* Clean up everything, including freeing the skb */
free_tx_fd(priv, fq, &fd, false); dpaa2_eth_free_tx_fd(priv, fq, &fd, false);
netdev_tx_completed_queue(nq, 1, fd_len); netdev_tx_completed_queue(nq, 1, fd_len);
} else { } else {
percpu_stats->tx_packets++; percpu_stats->tx_packets++;
...@@ -1045,7 +1046,7 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv, ...@@ -1045,7 +1046,7 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
/* Check frame errors in the FD field */ /* Check frame errors in the FD field */
fd_errors = dpaa2_fd_get_ctrl(fd) & DPAA2_FD_TX_ERR_MASK; fd_errors = dpaa2_fd_get_ctrl(fd) & DPAA2_FD_TX_ERR_MASK;
free_tx_fd(priv, fq, fd, true); dpaa2_eth_free_tx_fd(priv, fq, fd, true);
if (likely(!fd_errors)) if (likely(!fd_errors))
return; return;
...@@ -1059,7 +1060,7 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv, ...@@ -1059,7 +1060,7 @@ static void dpaa2_eth_tx_conf(struct dpaa2_eth_priv *priv,
percpu_stats->tx_errors++; percpu_stats->tx_errors++;
} }
static int set_rx_csum(struct dpaa2_eth_priv *priv, bool enable) static int dpaa2_eth_set_rx_csum(struct dpaa2_eth_priv *priv, bool enable)
{ {
int err; int err;
...@@ -1082,7 +1083,7 @@ static int set_rx_csum(struct dpaa2_eth_priv *priv, bool enable) ...@@ -1082,7 +1083,7 @@ static int set_rx_csum(struct dpaa2_eth_priv *priv, bool enable)
return 0; return 0;
} }
static int set_tx_csum(struct dpaa2_eth_priv *priv, bool enable) static int dpaa2_eth_set_tx_csum(struct dpaa2_eth_priv *priv, bool enable)
{ {
int err; int err;
...@@ -1106,7 +1107,7 @@ static int set_tx_csum(struct dpaa2_eth_priv *priv, bool enable) ...@@ -1106,7 +1107,7 @@ static int set_tx_csum(struct dpaa2_eth_priv *priv, bool enable)
/* Perform a single release command to add buffers /* Perform a single release command to add buffers
* to the specified buffer pool * to the specified buffer pool
*/ */
static int add_bufs(struct dpaa2_eth_priv *priv, static int dpaa2_eth_add_bufs(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, u16 bpid) struct dpaa2_eth_channel *ch, u16 bpid)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
...@@ -1155,7 +1156,7 @@ static int add_bufs(struct dpaa2_eth_priv *priv, ...@@ -1155,7 +1156,7 @@ static int add_bufs(struct dpaa2_eth_priv *priv,
* not much else we can do about it * not much else we can do about it
*/ */
if (err) { if (err) {
free_bufs(priv, buf_array, i); dpaa2_eth_free_bufs(priv, buf_array, i);
return 0; return 0;
} }
...@@ -1173,7 +1174,7 @@ static int add_bufs(struct dpaa2_eth_priv *priv, ...@@ -1173,7 +1174,7 @@ static int add_bufs(struct dpaa2_eth_priv *priv,
return 0; return 0;
} }
static int seed_pool(struct dpaa2_eth_priv *priv, u16 bpid) static int dpaa2_eth_seed_pool(struct dpaa2_eth_priv *priv, u16 bpid)
{ {
int i, j; int i, j;
int new_count; int new_count;
...@@ -1181,7 +1182,7 @@ static int seed_pool(struct dpaa2_eth_priv *priv, u16 bpid) ...@@ -1181,7 +1182,7 @@ static int seed_pool(struct dpaa2_eth_priv *priv, u16 bpid)
for (j = 0; j < priv->num_channels; j++) { for (j = 0; j < priv->num_channels; j++) {
for (i = 0; i < DPAA2_ETH_NUM_BUFS; for (i = 0; i < DPAA2_ETH_NUM_BUFS;
i += DPAA2_ETH_BUFS_PER_CMD) { i += DPAA2_ETH_BUFS_PER_CMD) {
new_count = add_bufs(priv, priv->channel[j], bpid); new_count = dpaa2_eth_add_bufs(priv, priv->channel[j], bpid);
priv->channel[j]->buf_count += new_count; priv->channel[j]->buf_count += new_count;
if (new_count < DPAA2_ETH_BUFS_PER_CMD) { if (new_count < DPAA2_ETH_BUFS_PER_CMD) {
...@@ -1197,7 +1198,7 @@ static int seed_pool(struct dpaa2_eth_priv *priv, u16 bpid) ...@@ -1197,7 +1198,7 @@ static int seed_pool(struct dpaa2_eth_priv *priv, u16 bpid)
* Drain the specified number of buffers from the DPNI's private buffer pool. * Drain the specified number of buffers from the DPNI's private buffer pool.
* @count must not exceeed DPAA2_ETH_BUFS_PER_CMD * @count must not exceeed DPAA2_ETH_BUFS_PER_CMD
*/ */
static void drain_bufs(struct dpaa2_eth_priv *priv, int count) static void dpaa2_eth_drain_bufs(struct dpaa2_eth_priv *priv, int count)
{ {
u64 buf_array[DPAA2_ETH_BUFS_PER_CMD]; u64 buf_array[DPAA2_ETH_BUFS_PER_CMD];
int retries = 0; int retries = 0;
...@@ -1213,17 +1214,17 @@ static void drain_bufs(struct dpaa2_eth_priv *priv, int count) ...@@ -1213,17 +1214,17 @@ static void drain_bufs(struct dpaa2_eth_priv *priv, int count)
netdev_err(priv->net_dev, "dpaa2_io_service_acquire() failed\n"); netdev_err(priv->net_dev, "dpaa2_io_service_acquire() failed\n");
return; return;
} }
free_bufs(priv, buf_array, ret); dpaa2_eth_free_bufs(priv, buf_array, ret);
retries = 0; retries = 0;
} while (ret); } while (ret);
} }
static void drain_pool(struct dpaa2_eth_priv *priv) static void dpaa2_eth_drain_pool(struct dpaa2_eth_priv *priv)
{ {
int i; int i;
drain_bufs(priv, DPAA2_ETH_BUFS_PER_CMD); dpaa2_eth_drain_bufs(priv, DPAA2_ETH_BUFS_PER_CMD);
drain_bufs(priv, 1); dpaa2_eth_drain_bufs(priv, 1);
for (i = 0; i < priv->num_channels; i++) for (i = 0; i < priv->num_channels; i++)
priv->channel[i]->buf_count = 0; priv->channel[i]->buf_count = 0;
...@@ -1232,7 +1233,7 @@ static void drain_pool(struct dpaa2_eth_priv *priv) ...@@ -1232,7 +1233,7 @@ static void drain_pool(struct dpaa2_eth_priv *priv)
/* Function is called from softirq context only, so we don't need to guard /* Function is called from softirq context only, so we don't need to guard
* the access to percpu count * the access to percpu count
*/ */
static int refill_pool(struct dpaa2_eth_priv *priv, static int dpaa2_eth_refill_pool(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *ch, struct dpaa2_eth_channel *ch,
u16 bpid) u16 bpid)
{ {
...@@ -1242,7 +1243,7 @@ static int refill_pool(struct dpaa2_eth_priv *priv, ...@@ -1242,7 +1243,7 @@ static int refill_pool(struct dpaa2_eth_priv *priv,
return 0; return 0;
do { do {
new_count = add_bufs(priv, ch, bpid); new_count = dpaa2_eth_add_bufs(priv, ch, bpid);
if (unlikely(!new_count)) { if (unlikely(!new_count)) {
/* Out of memory; abort for now, we'll try later on */ /* Out of memory; abort for now, we'll try later on */
break; break;
...@@ -1272,7 +1273,7 @@ static void dpaa2_eth_sgt_cache_drain(struct dpaa2_eth_priv *priv) ...@@ -1272,7 +1273,7 @@ static void dpaa2_eth_sgt_cache_drain(struct dpaa2_eth_priv *priv)
} }
} }
static int pull_channel(struct dpaa2_eth_channel *ch) static int dpaa2_eth_pull_channel(struct dpaa2_eth_channel *ch)
{ {
int err; int err;
int dequeues = -1; int dequeues = -1;
...@@ -1319,14 +1320,14 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget) ...@@ -1319,14 +1320,14 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget)
ch->rx_list = &rx_list; ch->rx_list = &rx_list;
do { do {
err = pull_channel(ch); err = dpaa2_eth_pull_channel(ch);
if (unlikely(err)) if (unlikely(err))
break; break;
/* Refill pool if appropriate */ /* Refill pool if appropriate */
refill_pool(priv, ch, priv->bpid); dpaa2_eth_refill_pool(priv, ch, priv->bpid);
store_cleaned = consume_frames(ch, &fq); store_cleaned = dpaa2_eth_consume_frames(ch, &fq);
if (store_cleaned <= 0) if (store_cleaned <= 0)
break; break;
if (fq->type == DPAA2_RX_FQ) { if (fq->type == DPAA2_RX_FQ) {
...@@ -1375,12 +1376,12 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget) ...@@ -1375,12 +1376,12 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget)
if (ch->xdp.res & XDP_REDIRECT) if (ch->xdp.res & XDP_REDIRECT)
xdp_do_flush_map(); xdp_do_flush_map();
else if (rx_cleaned && ch->xdp.res & XDP_TX) else if (rx_cleaned && ch->xdp.res & XDP_TX)
xdp_tx_flush(priv, ch, &priv->fq[flowid]); dpaa2_eth_xdp_tx_flush(priv, ch, &priv->fq[flowid]);
return work_done; return work_done;
} }
static void enable_ch_napi(struct dpaa2_eth_priv *priv) static void dpaa2_eth_enable_ch_napi(struct dpaa2_eth_priv *priv)
{ {
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
int i; int i;
...@@ -1391,7 +1392,7 @@ static void enable_ch_napi(struct dpaa2_eth_priv *priv) ...@@ -1391,7 +1392,7 @@ static void enable_ch_napi(struct dpaa2_eth_priv *priv)
} }
} }
static void disable_ch_napi(struct dpaa2_eth_priv *priv) static void dpaa2_eth_disable_ch_napi(struct dpaa2_eth_priv *priv)
{ {
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
int i; int i;
...@@ -1465,7 +1466,7 @@ void dpaa2_eth_set_rx_taildrop(struct dpaa2_eth_priv *priv, ...@@ -1465,7 +1466,7 @@ void dpaa2_eth_set_rx_taildrop(struct dpaa2_eth_priv *priv,
priv->rx_cgtd_enabled = td.enable; priv->rx_cgtd_enabled = td.enable;
} }
static int link_state_update(struct dpaa2_eth_priv *priv) static int dpaa2_eth_link_state_update(struct dpaa2_eth_priv *priv)
{ {
struct dpni_link_state state = {0}; struct dpni_link_state state = {0};
bool tx_pause; bool tx_pause;
...@@ -1517,7 +1518,7 @@ static int dpaa2_eth_open(struct net_device *net_dev) ...@@ -1517,7 +1518,7 @@ static int dpaa2_eth_open(struct net_device *net_dev)
struct dpaa2_eth_priv *priv = netdev_priv(net_dev); struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
int err; int err;
err = seed_pool(priv, priv->bpid); err = dpaa2_eth_seed_pool(priv, priv->bpid);
if (err) { if (err) {
/* Not much to do; the buffer pool, though not filled up, /* Not much to do; the buffer pool, though not filled up,
* may still contain some buffers which would enable us * may still contain some buffers which would enable us
...@@ -1541,7 +1542,7 @@ static int dpaa2_eth_open(struct net_device *net_dev) ...@@ -1541,7 +1542,7 @@ static int dpaa2_eth_open(struct net_device *net_dev)
*/ */
netif_carrier_off(net_dev); netif_carrier_off(net_dev);
} }
enable_ch_napi(priv); dpaa2_eth_enable_ch_napi(priv);
err = dpni_enable(priv->mc_io, 0, priv->mc_token); err = dpni_enable(priv->mc_io, 0, priv->mc_token);
if (err < 0) { if (err < 0) {
...@@ -1553,7 +1554,7 @@ static int dpaa2_eth_open(struct net_device *net_dev) ...@@ -1553,7 +1554,7 @@ static int dpaa2_eth_open(struct net_device *net_dev)
/* If the DPMAC object has already processed the link up /* If the DPMAC object has already processed the link up
* interrupt, we have to learn the link state ourselves. * interrupt, we have to learn the link state ourselves.
*/ */
err = link_state_update(priv); err = dpaa2_eth_link_state_update(priv);
if (err < 0) { if (err < 0) {
netdev_err(net_dev, "Can't update link state\n"); netdev_err(net_dev, "Can't update link state\n");
goto link_state_err; goto link_state_err;
...@@ -1566,13 +1567,13 @@ static int dpaa2_eth_open(struct net_device *net_dev) ...@@ -1566,13 +1567,13 @@ static int dpaa2_eth_open(struct net_device *net_dev)
link_state_err: link_state_err:
enable_err: enable_err:
disable_ch_napi(priv); dpaa2_eth_disable_ch_napi(priv);
drain_pool(priv); dpaa2_eth_drain_pool(priv);
return err; return err;
} }
/* Total number of in-flight frames on ingress queues */ /* Total number of in-flight frames on ingress queues */
static u32 ingress_fq_count(struct dpaa2_eth_priv *priv) static u32 dpaa2_eth_ingress_fq_count(struct dpaa2_eth_priv *priv)
{ {
struct dpaa2_eth_fq *fq; struct dpaa2_eth_fq *fq;
u32 fcnt = 0, bcnt = 0, total = 0; u32 fcnt = 0, bcnt = 0, total = 0;
...@@ -1591,13 +1592,13 @@ static u32 ingress_fq_count(struct dpaa2_eth_priv *priv) ...@@ -1591,13 +1592,13 @@ static u32 ingress_fq_count(struct dpaa2_eth_priv *priv)
return total; return total;
} }
static void wait_for_ingress_fq_empty(struct dpaa2_eth_priv *priv) static void dpaa2_eth_wait_for_ingress_fq_empty(struct dpaa2_eth_priv *priv)
{ {
int retries = 10; int retries = 10;
u32 pending; u32 pending;
do { do {
pending = ingress_fq_count(priv); pending = dpaa2_eth_ingress_fq_count(priv);
if (pending) if (pending)
msleep(100); msleep(100);
} while (pending && --retries); } while (pending && --retries);
...@@ -1605,7 +1606,7 @@ static void wait_for_ingress_fq_empty(struct dpaa2_eth_priv *priv) ...@@ -1605,7 +1606,7 @@ static void wait_for_ingress_fq_empty(struct dpaa2_eth_priv *priv)
#define DPNI_TX_PENDING_VER_MAJOR 7 #define DPNI_TX_PENDING_VER_MAJOR 7
#define DPNI_TX_PENDING_VER_MINOR 13 #define DPNI_TX_PENDING_VER_MINOR 13
static void wait_for_egress_fq_empty(struct dpaa2_eth_priv *priv) static void dpaa2_eth_wait_for_egress_fq_empty(struct dpaa2_eth_priv *priv)
{ {
union dpni_statistics stats; union dpni_statistics stats;
int retries = 10; int retries = 10;
...@@ -1651,7 +1652,7 @@ static int dpaa2_eth_stop(struct net_device *net_dev) ...@@ -1651,7 +1652,7 @@ static int dpaa2_eth_stop(struct net_device *net_dev)
* on WRIOP. After it finishes, wait until all remaining frames on Rx * on WRIOP. After it finishes, wait until all remaining frames on Rx
* and Tx conf queues are consumed on NAPI poll. * and Tx conf queues are consumed on NAPI poll.
*/ */
wait_for_egress_fq_empty(priv); dpaa2_eth_wait_for_egress_fq_empty(priv);
do { do {
dpni_disable(priv->mc_io, 0, priv->mc_token); dpni_disable(priv->mc_io, 0, priv->mc_token);
...@@ -1667,11 +1668,11 @@ static int dpaa2_eth_stop(struct net_device *net_dev) ...@@ -1667,11 +1668,11 @@ static int dpaa2_eth_stop(struct net_device *net_dev)
*/ */
} }
wait_for_ingress_fq_empty(priv); dpaa2_eth_wait_for_ingress_fq_empty(priv);
disable_ch_napi(priv); dpaa2_eth_disable_ch_napi(priv);
/* Empty the buffer pool */ /* Empty the buffer pool */
drain_pool(priv); dpaa2_eth_drain_pool(priv);
/* Empty the Scatter-Gather Buffer cache */ /* Empty the Scatter-Gather Buffer cache */
dpaa2_eth_sgt_cache_drain(priv); dpaa2_eth_sgt_cache_drain(priv);
...@@ -1725,7 +1726,7 @@ static void dpaa2_eth_get_stats(struct net_device *net_dev, ...@@ -1725,7 +1726,7 @@ static void dpaa2_eth_get_stats(struct net_device *net_dev,
/* Copy mac unicast addresses from @net_dev to @priv. /* Copy mac unicast addresses from @net_dev to @priv.
* Its sole purpose is to make dpaa2_eth_set_rx_mode() more readable. * Its sole purpose is to make dpaa2_eth_set_rx_mode() more readable.
*/ */
static void add_uc_hw_addr(const struct net_device *net_dev, static void dpaa2_eth_add_uc_hw_addr(const struct net_device *net_dev,
struct dpaa2_eth_priv *priv) struct dpaa2_eth_priv *priv)
{ {
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
...@@ -1744,7 +1745,7 @@ static void add_uc_hw_addr(const struct net_device *net_dev, ...@@ -1744,7 +1745,7 @@ static void add_uc_hw_addr(const struct net_device *net_dev,
/* Copy mac multicast addresses from @net_dev to @priv /* Copy mac multicast addresses from @net_dev to @priv
* Its sole purpose is to make dpaa2_eth_set_rx_mode() more readable. * Its sole purpose is to make dpaa2_eth_set_rx_mode() more readable.
*/ */
static void add_mc_hw_addr(const struct net_device *net_dev, static void dpaa2_eth_add_mc_hw_addr(const struct net_device *net_dev,
struct dpaa2_eth_priv *priv) struct dpaa2_eth_priv *priv)
{ {
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
...@@ -1810,7 +1811,7 @@ static void dpaa2_eth_set_rx_mode(struct net_device *net_dev) ...@@ -1810,7 +1811,7 @@ static void dpaa2_eth_set_rx_mode(struct net_device *net_dev)
err = dpni_clear_mac_filters(mc_io, 0, mc_token, 1, 0); err = dpni_clear_mac_filters(mc_io, 0, mc_token, 1, 0);
if (err) if (err)
netdev_warn(net_dev, "Can't clear uc filters\n"); netdev_warn(net_dev, "Can't clear uc filters\n");
add_uc_hw_addr(net_dev, priv); dpaa2_eth_add_uc_hw_addr(net_dev, priv);
/* Finally, clear uc promisc and set mc promisc as requested. */ /* Finally, clear uc promisc and set mc promisc as requested. */
err = dpni_set_unicast_promisc(mc_io, 0, mc_token, 0); err = dpni_set_unicast_promisc(mc_io, 0, mc_token, 0);
...@@ -1833,8 +1834,8 @@ static void dpaa2_eth_set_rx_mode(struct net_device *net_dev) ...@@ -1833,8 +1834,8 @@ static void dpaa2_eth_set_rx_mode(struct net_device *net_dev)
err = dpni_clear_mac_filters(mc_io, 0, mc_token, 1, 1); err = dpni_clear_mac_filters(mc_io, 0, mc_token, 1, 1);
if (err) if (err)
netdev_warn(net_dev, "Can't clear mac filters\n"); netdev_warn(net_dev, "Can't clear mac filters\n");
add_mc_hw_addr(net_dev, priv); dpaa2_eth_add_mc_hw_addr(net_dev, priv);
add_uc_hw_addr(net_dev, priv); dpaa2_eth_add_uc_hw_addr(net_dev, priv);
/* Now we can clear both ucast and mcast promisc, without risking /* Now we can clear both ucast and mcast promisc, without risking
* to drop legitimate frames anymore. * to drop legitimate frames anymore.
...@@ -1868,14 +1869,14 @@ static int dpaa2_eth_set_features(struct net_device *net_dev, ...@@ -1868,14 +1869,14 @@ static int dpaa2_eth_set_features(struct net_device *net_dev,
if (changed & NETIF_F_RXCSUM) { if (changed & NETIF_F_RXCSUM) {
enable = !!(features & NETIF_F_RXCSUM); enable = !!(features & NETIF_F_RXCSUM);
err = set_rx_csum(priv, enable); err = dpaa2_eth_set_rx_csum(priv, enable);
if (err) if (err)
return err; return err;
} }
if (changed & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) { if (changed & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) {
enable = !!(features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)); enable = !!(features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM));
err = set_tx_csum(priv, enable); err = dpaa2_eth_set_tx_csum(priv, enable);
if (err) if (err)
return err; return err;
} }
...@@ -1944,7 +1945,7 @@ static bool xdp_mtu_valid(struct dpaa2_eth_priv *priv, int mtu) ...@@ -1944,7 +1945,7 @@ static bool xdp_mtu_valid(struct dpaa2_eth_priv *priv, int mtu)
return true; return true;
} }
static int set_rx_mfl(struct dpaa2_eth_priv *priv, int mtu, bool has_xdp) static int dpaa2_eth_set_rx_mfl(struct dpaa2_eth_priv *priv, int mtu, bool has_xdp)
{ {
int mfl, err; int mfl, err;
...@@ -1978,7 +1979,7 @@ static int dpaa2_eth_change_mtu(struct net_device *dev, int new_mtu) ...@@ -1978,7 +1979,7 @@ static int dpaa2_eth_change_mtu(struct net_device *dev, int new_mtu)
if (!xdp_mtu_valid(priv, new_mtu)) if (!xdp_mtu_valid(priv, new_mtu))
return -EINVAL; return -EINVAL;
err = set_rx_mfl(priv, new_mtu, true); err = dpaa2_eth_set_rx_mfl(priv, new_mtu, true);
if (err) if (err)
return err; return err;
...@@ -1987,7 +1988,7 @@ static int dpaa2_eth_change_mtu(struct net_device *dev, int new_mtu) ...@@ -1987,7 +1988,7 @@ static int dpaa2_eth_change_mtu(struct net_device *dev, int new_mtu)
return 0; return 0;
} }
static int update_rx_buffer_headroom(struct dpaa2_eth_priv *priv, bool has_xdp) static int dpaa2_eth_update_rx_buffer_headroom(struct dpaa2_eth_priv *priv, bool has_xdp)
{ {
struct dpni_buffer_layout buf_layout = {0}; struct dpni_buffer_layout buf_layout = {0};
int err; int err;
...@@ -2013,7 +2014,7 @@ static int update_rx_buffer_headroom(struct dpaa2_eth_priv *priv, bool has_xdp) ...@@ -2013,7 +2014,7 @@ static int update_rx_buffer_headroom(struct dpaa2_eth_priv *priv, bool has_xdp)
return 0; return 0;
} }
static int setup_xdp(struct net_device *dev, struct bpf_prog *prog) static int dpaa2_eth_setup_xdp(struct net_device *dev, struct bpf_prog *prog)
{ {
struct dpaa2_eth_priv *priv = netdev_priv(dev); struct dpaa2_eth_priv *priv = netdev_priv(dev);
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
...@@ -2039,10 +2040,10 @@ static int setup_xdp(struct net_device *dev, struct bpf_prog *prog) ...@@ -2039,10 +2040,10 @@ static int setup_xdp(struct net_device *dev, struct bpf_prog *prog)
* so we are sure no old format buffers will be used from now on. * so we are sure no old format buffers will be used from now on.
*/ */
if (need_update) { if (need_update) {
err = set_rx_mfl(priv, dev->mtu, !!prog); err = dpaa2_eth_set_rx_mfl(priv, dev->mtu, !!prog);
if (err) if (err)
goto out_err; goto out_err;
err = update_rx_buffer_headroom(priv, !!prog); err = dpaa2_eth_update_rx_buffer_headroom(priv, !!prog);
if (err) if (err)
goto out_err; goto out_err;
} }
...@@ -2079,7 +2080,7 @@ static int dpaa2_eth_xdp(struct net_device *dev, struct netdev_bpf *xdp) ...@@ -2079,7 +2080,7 @@ static int dpaa2_eth_xdp(struct net_device *dev, struct netdev_bpf *xdp)
{ {
switch (xdp->command) { switch (xdp->command) {
case XDP_SETUP_PROG: case XDP_SETUP_PROG:
return setup_xdp(dev, xdp->prog); return dpaa2_eth_setup_xdp(dev, xdp->prog);
default: default:
return -EINVAL; return -EINVAL;
} }
...@@ -2316,7 +2317,7 @@ static const struct net_device_ops dpaa2_eth_ops = { ...@@ -2316,7 +2317,7 @@ static const struct net_device_ops dpaa2_eth_ops = {
.ndo_setup_tc = dpaa2_eth_setup_tc, .ndo_setup_tc = dpaa2_eth_setup_tc,
}; };
static void cdan_cb(struct dpaa2_io_notification_ctx *ctx) static void dpaa2_eth_cdan_cb(struct dpaa2_io_notification_ctx *ctx)
{ {
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
...@@ -2329,7 +2330,7 @@ static void cdan_cb(struct dpaa2_io_notification_ctx *ctx) ...@@ -2329,7 +2330,7 @@ static void cdan_cb(struct dpaa2_io_notification_ctx *ctx)
} }
/* Allocate and configure a DPCON object */ /* Allocate and configure a DPCON object */
static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv) static struct fsl_mc_device *dpaa2_eth_setup_dpcon(struct dpaa2_eth_priv *priv)
{ {
struct fsl_mc_device *dpcon; struct fsl_mc_device *dpcon;
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
...@@ -2373,7 +2374,7 @@ static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv) ...@@ -2373,7 +2374,7 @@ static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv)
return ERR_PTR(err); return ERR_PTR(err);
} }
static void free_dpcon(struct dpaa2_eth_priv *priv, static void dpaa2_eth_free_dpcon(struct dpaa2_eth_priv *priv,
struct fsl_mc_device *dpcon) struct fsl_mc_device *dpcon)
{ {
dpcon_disable(priv->mc_io, 0, dpcon->mc_handle); dpcon_disable(priv->mc_io, 0, dpcon->mc_handle);
...@@ -2381,8 +2382,7 @@ static void free_dpcon(struct dpaa2_eth_priv *priv, ...@@ -2381,8 +2382,7 @@ static void free_dpcon(struct dpaa2_eth_priv *priv,
fsl_mc_object_free(dpcon); fsl_mc_object_free(dpcon);
} }
static struct dpaa2_eth_channel * static struct dpaa2_eth_channel *dpaa2_eth_alloc_channel(struct dpaa2_eth_priv *priv)
alloc_channel(struct dpaa2_eth_priv *priv)
{ {
struct dpaa2_eth_channel *channel; struct dpaa2_eth_channel *channel;
struct dpcon_attr attr; struct dpcon_attr attr;
...@@ -2393,7 +2393,7 @@ alloc_channel(struct dpaa2_eth_priv *priv) ...@@ -2393,7 +2393,7 @@ alloc_channel(struct dpaa2_eth_priv *priv)
if (!channel) if (!channel)
return NULL; return NULL;
channel->dpcon = setup_dpcon(priv); channel->dpcon = dpaa2_eth_setup_dpcon(priv);
if (IS_ERR(channel->dpcon)) { if (IS_ERR(channel->dpcon)) {
err = PTR_ERR(channel->dpcon); err = PTR_ERR(channel->dpcon);
goto err_setup; goto err_setup;
...@@ -2413,23 +2413,23 @@ alloc_channel(struct dpaa2_eth_priv *priv) ...@@ -2413,23 +2413,23 @@ alloc_channel(struct dpaa2_eth_priv *priv)
return channel; return channel;
err_get_attr: err_get_attr:
free_dpcon(priv, channel->dpcon); dpaa2_eth_free_dpcon(priv, channel->dpcon);
err_setup: err_setup:
kfree(channel); kfree(channel);
return ERR_PTR(err); return ERR_PTR(err);
} }
static void free_channel(struct dpaa2_eth_priv *priv, static void dpaa2_eth_free_channel(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_channel *channel) struct dpaa2_eth_channel *channel)
{ {
free_dpcon(priv, channel->dpcon); dpaa2_eth_free_dpcon(priv, channel->dpcon);
kfree(channel); kfree(channel);
} }
/* DPIO setup: allocate and configure QBMan channels, setup core affinity /* DPIO setup: allocate and configure QBMan channels, setup core affinity
* and register data availability notifications * and register data availability notifications
*/ */
static int setup_dpio(struct dpaa2_eth_priv *priv) static int dpaa2_eth_setup_dpio(struct dpaa2_eth_priv *priv)
{ {
struct dpaa2_io_notification_ctx *nctx; struct dpaa2_io_notification_ctx *nctx;
struct dpaa2_eth_channel *channel; struct dpaa2_eth_channel *channel;
...@@ -2449,7 +2449,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -2449,7 +2449,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
cpumask_clear(&priv->dpio_cpumask); cpumask_clear(&priv->dpio_cpumask);
for_each_online_cpu(i) { for_each_online_cpu(i) {
/* Try to allocate a channel */ /* Try to allocate a channel */
channel = alloc_channel(priv); channel = dpaa2_eth_alloc_channel(priv);
if (IS_ERR_OR_NULL(channel)) { if (IS_ERR_OR_NULL(channel)) {
err = PTR_ERR_OR_ZERO(channel); err = PTR_ERR_OR_ZERO(channel);
if (err != -EPROBE_DEFER) if (err != -EPROBE_DEFER)
...@@ -2462,7 +2462,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -2462,7 +2462,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
nctx = &channel->nctx; nctx = &channel->nctx;
nctx->is_cdan = 1; nctx->is_cdan = 1;
nctx->cb = cdan_cb; nctx->cb = dpaa2_eth_cdan_cb;
nctx->id = channel->ch_id; nctx->id = channel->ch_id;
nctx->desired_cpu = i; nctx->desired_cpu = i;
...@@ -2510,14 +2510,14 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -2510,14 +2510,14 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
err_set_cdan: err_set_cdan:
dpaa2_io_service_deregister(channel->dpio, nctx, dev); dpaa2_io_service_deregister(channel->dpio, nctx, dev);
err_service_reg: err_service_reg:
free_channel(priv, channel); dpaa2_eth_free_channel(priv, channel);
err_alloc_ch: err_alloc_ch:
if (err == -EPROBE_DEFER) { if (err == -EPROBE_DEFER) {
for (i = 0; i < priv->num_channels; i++) { for (i = 0; i < priv->num_channels; i++) {
channel = priv->channel[i]; channel = priv->channel[i];
nctx = &channel->nctx; nctx = &channel->nctx;
dpaa2_io_service_deregister(channel->dpio, nctx, dev); dpaa2_io_service_deregister(channel->dpio, nctx, dev);
free_channel(priv, channel); dpaa2_eth_free_channel(priv, channel);
} }
priv->num_channels = 0; priv->num_channels = 0;
return err; return err;
...@@ -2534,7 +2534,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -2534,7 +2534,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
return 0; return 0;
} }
static void free_dpio(struct dpaa2_eth_priv *priv) static void dpaa2_eth_free_dpio(struct dpaa2_eth_priv *priv)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
...@@ -2544,11 +2544,11 @@ static void free_dpio(struct dpaa2_eth_priv *priv) ...@@ -2544,11 +2544,11 @@ static void free_dpio(struct dpaa2_eth_priv *priv)
for (i = 0; i < priv->num_channels; i++) { for (i = 0; i < priv->num_channels; i++) {
ch = priv->channel[i]; ch = priv->channel[i];
dpaa2_io_service_deregister(ch->dpio, &ch->nctx, dev); dpaa2_io_service_deregister(ch->dpio, &ch->nctx, dev);
free_channel(priv, ch); dpaa2_eth_free_channel(priv, ch);
} }
} }
static struct dpaa2_eth_channel *get_affine_channel(struct dpaa2_eth_priv *priv, static struct dpaa2_eth_channel *dpaa2_eth_get_affine_channel(struct dpaa2_eth_priv *priv,
int cpu) int cpu)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
...@@ -2566,7 +2566,7 @@ static struct dpaa2_eth_channel *get_affine_channel(struct dpaa2_eth_priv *priv, ...@@ -2566,7 +2566,7 @@ static struct dpaa2_eth_channel *get_affine_channel(struct dpaa2_eth_priv *priv,
return priv->channel[0]; return priv->channel[0];
} }
static void set_fq_affinity(struct dpaa2_eth_priv *priv) static void dpaa2_eth_set_fq_affinity(struct dpaa2_eth_priv *priv)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpaa2_eth_fq *fq; struct dpaa2_eth_fq *fq;
...@@ -2597,13 +2597,13 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv) ...@@ -2597,13 +2597,13 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv)
default: default:
dev_err(dev, "Unknown FQ type: %d\n", fq->type); dev_err(dev, "Unknown FQ type: %d\n", fq->type);
} }
fq->channel = get_affine_channel(priv, fq->target_cpu); fq->channel = dpaa2_eth_get_affine_channel(priv, fq->target_cpu);
} }
update_xps(priv); update_xps(priv);
} }
static void setup_fqs(struct dpaa2_eth_priv *priv) static void dpaa2_eth_setup_fqs(struct dpaa2_eth_priv *priv)
{ {
int i, j; int i, j;
...@@ -2627,11 +2627,11 @@ static void setup_fqs(struct dpaa2_eth_priv *priv) ...@@ -2627,11 +2627,11 @@ static void setup_fqs(struct dpaa2_eth_priv *priv)
} }
/* For each FQ, decide on which core to process incoming frames */ /* For each FQ, decide on which core to process incoming frames */
set_fq_affinity(priv); dpaa2_eth_set_fq_affinity(priv);
} }
/* Allocate and configure one buffer pool for each interface */ /* Allocate and configure one buffer pool for each interface */
static int setup_dpbp(struct dpaa2_eth_priv *priv) static int dpaa2_eth_setup_dpbp(struct dpaa2_eth_priv *priv)
{ {
int err; int err;
struct fsl_mc_device *dpbp_dev; struct fsl_mc_device *dpbp_dev;
...@@ -2690,15 +2690,15 @@ static int setup_dpbp(struct dpaa2_eth_priv *priv) ...@@ -2690,15 +2690,15 @@ static int setup_dpbp(struct dpaa2_eth_priv *priv)
return err; return err;
} }
static void free_dpbp(struct dpaa2_eth_priv *priv) static void dpaa2_eth_free_dpbp(struct dpaa2_eth_priv *priv)
{ {
drain_pool(priv); dpaa2_eth_drain_pool(priv);
dpbp_disable(priv->mc_io, 0, priv->dpbp_dev->mc_handle); dpbp_disable(priv->mc_io, 0, priv->dpbp_dev->mc_handle);
dpbp_close(priv->mc_io, 0, priv->dpbp_dev->mc_handle); dpbp_close(priv->mc_io, 0, priv->dpbp_dev->mc_handle);
fsl_mc_object_free(priv->dpbp_dev); fsl_mc_object_free(priv->dpbp_dev);
} }
static int set_buffer_layout(struct dpaa2_eth_priv *priv) static int dpaa2_eth_set_buffer_layout(struct dpaa2_eth_priv *priv)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpni_buffer_layout buf_layout = {0}; struct dpni_buffer_layout buf_layout = {0};
...@@ -2815,7 +2815,7 @@ static inline int dpaa2_eth_enqueue_fq_multiple(struct dpaa2_eth_priv *priv, ...@@ -2815,7 +2815,7 @@ static inline int dpaa2_eth_enqueue_fq_multiple(struct dpaa2_eth_priv *priv,
return 0; return 0;
} }
static void set_enqueue_mode(struct dpaa2_eth_priv *priv) static void dpaa2_eth_set_enqueue_mode(struct dpaa2_eth_priv *priv)
{ {
if (dpaa2_eth_cmp_dpni_ver(priv, DPNI_ENQUEUE_FQID_VER_MAJOR, if (dpaa2_eth_cmp_dpni_ver(priv, DPNI_ENQUEUE_FQID_VER_MAJOR,
DPNI_ENQUEUE_FQID_VER_MINOR) < 0) DPNI_ENQUEUE_FQID_VER_MINOR) < 0)
...@@ -2824,7 +2824,7 @@ static void set_enqueue_mode(struct dpaa2_eth_priv *priv) ...@@ -2824,7 +2824,7 @@ static void set_enqueue_mode(struct dpaa2_eth_priv *priv)
priv->enqueue = dpaa2_eth_enqueue_fq_multiple; priv->enqueue = dpaa2_eth_enqueue_fq_multiple;
} }
static int set_pause(struct dpaa2_eth_priv *priv) static int dpaa2_eth_set_pause(struct dpaa2_eth_priv *priv)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpni_link_cfg link_cfg = {0}; struct dpni_link_cfg link_cfg = {0};
...@@ -2851,7 +2851,7 @@ static int set_pause(struct dpaa2_eth_priv *priv) ...@@ -2851,7 +2851,7 @@ static int set_pause(struct dpaa2_eth_priv *priv)
return 0; return 0;
} }
static void update_tx_fqids(struct dpaa2_eth_priv *priv) static void dpaa2_eth_update_tx_fqids(struct dpaa2_eth_priv *priv)
{ {
struct dpni_queue_id qid = {0}; struct dpni_queue_id qid = {0};
struct dpaa2_eth_fq *fq; struct dpaa2_eth_fq *fq;
...@@ -2893,7 +2893,7 @@ static void update_tx_fqids(struct dpaa2_eth_priv *priv) ...@@ -2893,7 +2893,7 @@ static void update_tx_fqids(struct dpaa2_eth_priv *priv)
} }
/* Configure ingress classification based on VLAN PCP */ /* Configure ingress classification based on VLAN PCP */
static int set_vlan_qos(struct dpaa2_eth_priv *priv) static int dpaa2_eth_set_vlan_qos(struct dpaa2_eth_priv *priv)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpkg_profile_cfg kg_cfg = {0}; struct dpkg_profile_cfg kg_cfg = {0};
...@@ -3005,7 +3005,7 @@ static int set_vlan_qos(struct dpaa2_eth_priv *priv) ...@@ -3005,7 +3005,7 @@ static int set_vlan_qos(struct dpaa2_eth_priv *priv)
} }
/* Configure the DPNI object this interface is associated with */ /* Configure the DPNI object this interface is associated with */
static int setup_dpni(struct fsl_mc_device *ls_dev) static int dpaa2_eth_setup_dpni(struct fsl_mc_device *ls_dev)
{ {
struct device *dev = &ls_dev->dev; struct device *dev = &ls_dev->dev;
struct dpaa2_eth_priv *priv; struct dpaa2_eth_priv *priv;
...@@ -3053,20 +3053,20 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -3053,20 +3053,20 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
goto close; goto close;
} }
err = set_buffer_layout(priv); err = dpaa2_eth_set_buffer_layout(priv);
if (err) if (err)
goto close; goto close;
set_enqueue_mode(priv); dpaa2_eth_set_enqueue_mode(priv);
/* Enable pause frame support */ /* Enable pause frame support */
if (dpaa2_eth_has_pause_support(priv)) { if (dpaa2_eth_has_pause_support(priv)) {
err = set_pause(priv); err = dpaa2_eth_set_pause(priv);
if (err) if (err)
goto close; goto close;
} }
err = set_vlan_qos(priv); err = dpaa2_eth_set_vlan_qos(priv);
if (err && err != -EOPNOTSUPP) if (err && err != -EOPNOTSUPP)
goto close; goto close;
...@@ -3086,7 +3086,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -3086,7 +3086,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
return err; return err;
} }
static void free_dpni(struct dpaa2_eth_priv *priv) static void dpaa2_eth_free_dpni(struct dpaa2_eth_priv *priv)
{ {
int err; int err;
...@@ -3098,7 +3098,7 @@ static void free_dpni(struct dpaa2_eth_priv *priv) ...@@ -3098,7 +3098,7 @@ static void free_dpni(struct dpaa2_eth_priv *priv)
dpni_close(priv->mc_io, 0, priv->mc_token); dpni_close(priv->mc_io, 0, priv->mc_token);
} }
static int setup_rx_flow(struct dpaa2_eth_priv *priv, static int dpaa2_eth_setup_rx_flow(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_fq *fq) struct dpaa2_eth_fq *fq)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
...@@ -3150,7 +3150,7 @@ static int setup_rx_flow(struct dpaa2_eth_priv *priv, ...@@ -3150,7 +3150,7 @@ static int setup_rx_flow(struct dpaa2_eth_priv *priv,
return 0; return 0;
} }
static int setup_tx_flow(struct dpaa2_eth_priv *priv, static int dpaa2_eth_setup_tx_flow(struct dpaa2_eth_priv *priv,
struct dpaa2_eth_fq *fq) struct dpaa2_eth_fq *fq)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
...@@ -3266,7 +3266,7 @@ static const struct dpaa2_eth_dist_fields dist_fields[] = { ...@@ -3266,7 +3266,7 @@ static const struct dpaa2_eth_dist_fields dist_fields[] = {
}; };
/* Configure the Rx hash key using the legacy API */ /* Configure the Rx hash key using the legacy API */
static int config_legacy_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key) static int dpaa2_eth_config_legacy_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpni_rx_tc_dist_cfg dist_cfg; struct dpni_rx_tc_dist_cfg dist_cfg;
...@@ -3291,7 +3291,7 @@ static int config_legacy_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key) ...@@ -3291,7 +3291,7 @@ static int config_legacy_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
} }
/* Configure the Rx hash key using the new API */ /* Configure the Rx hash key using the new API */
static int config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key) static int dpaa2_eth_config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpni_rx_dist_cfg dist_cfg; struct dpni_rx_dist_cfg dist_cfg;
...@@ -3317,7 +3317,7 @@ static int config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key) ...@@ -3317,7 +3317,7 @@ static int config_hash_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
} }
/* Configure the Rx flow classification key */ /* Configure the Rx flow classification key */
static int config_cls_key(struct dpaa2_eth_priv *priv, dma_addr_t key) static int dpaa2_eth_config_cls_key(struct dpaa2_eth_priv *priv, dma_addr_t key)
{ {
struct device *dev = priv->net_dev->dev.parent; struct device *dev = priv->net_dev->dev.parent;
struct dpni_rx_dist_cfg dist_cfg; struct dpni_rx_dist_cfg dist_cfg;
...@@ -3452,11 +3452,11 @@ static int dpaa2_eth_set_dist_key(struct net_device *net_dev, ...@@ -3452,11 +3452,11 @@ static int dpaa2_eth_set_dist_key(struct net_device *net_dev,
if (type == DPAA2_ETH_RX_DIST_HASH) { if (type == DPAA2_ETH_RX_DIST_HASH) {
if (dpaa2_eth_has_legacy_dist(priv)) if (dpaa2_eth_has_legacy_dist(priv))
err = config_legacy_hash_key(priv, key_iova); err = dpaa2_eth_config_legacy_hash_key(priv, key_iova);
else else
err = config_hash_key(priv, key_iova); err = dpaa2_eth_config_hash_key(priv, key_iova);
} else { } else {
err = config_cls_key(priv, key_iova); err = dpaa2_eth_config_cls_key(priv, key_iova);
} }
dma_unmap_single(dev, key_iova, DPAA2_CLASSIFIER_DMA_SIZE, dma_unmap_single(dev, key_iova, DPAA2_CLASSIFIER_DMA_SIZE,
...@@ -3531,7 +3531,7 @@ static int dpaa2_eth_set_default_cls(struct dpaa2_eth_priv *priv) ...@@ -3531,7 +3531,7 @@ static int dpaa2_eth_set_default_cls(struct dpaa2_eth_priv *priv)
/* Bind the DPNI to its needed objects and resources: buffer pool, DPIOs, /* Bind the DPNI to its needed objects and resources: buffer pool, DPIOs,
* frame queues and channels * frame queues and channels
*/ */
static int bind_dpni(struct dpaa2_eth_priv *priv) static int dpaa2_eth_bind_dpni(struct dpaa2_eth_priv *priv)
{ {
struct net_device *net_dev = priv->net_dev; struct net_device *net_dev = priv->net_dev;
struct device *dev = net_dev->dev.parent; struct device *dev = net_dev->dev.parent;
...@@ -3579,10 +3579,10 @@ static int bind_dpni(struct dpaa2_eth_priv *priv) ...@@ -3579,10 +3579,10 @@ static int bind_dpni(struct dpaa2_eth_priv *priv)
for (i = 0; i < priv->num_fqs; i++) { for (i = 0; i < priv->num_fqs; i++) {
switch (priv->fq[i].type) { switch (priv->fq[i].type) {
case DPAA2_RX_FQ: case DPAA2_RX_FQ:
err = setup_rx_flow(priv, &priv->fq[i]); err = dpaa2_eth_setup_rx_flow(priv, &priv->fq[i]);
break; break;
case DPAA2_TX_CONF_FQ: case DPAA2_TX_CONF_FQ:
err = setup_tx_flow(priv, &priv->fq[i]); err = dpaa2_eth_setup_tx_flow(priv, &priv->fq[i]);
break; break;
default: default:
dev_err(dev, "Invalid FQ type %d\n", priv->fq[i].type); dev_err(dev, "Invalid FQ type %d\n", priv->fq[i].type);
...@@ -3603,7 +3603,7 @@ static int bind_dpni(struct dpaa2_eth_priv *priv) ...@@ -3603,7 +3603,7 @@ static int bind_dpni(struct dpaa2_eth_priv *priv)
} }
/* Allocate rings for storing incoming frame descriptors */ /* Allocate rings for storing incoming frame descriptors */
static int alloc_rings(struct dpaa2_eth_priv *priv) static int dpaa2_eth_alloc_rings(struct dpaa2_eth_priv *priv)
{ {
struct net_device *net_dev = priv->net_dev; struct net_device *net_dev = priv->net_dev;
struct device *dev = net_dev->dev.parent; struct device *dev = net_dev->dev.parent;
...@@ -3630,7 +3630,7 @@ static int alloc_rings(struct dpaa2_eth_priv *priv) ...@@ -3630,7 +3630,7 @@ static int alloc_rings(struct dpaa2_eth_priv *priv)
return -ENOMEM; return -ENOMEM;
} }
static void free_rings(struct dpaa2_eth_priv *priv) static void dpaa2_eth_free_rings(struct dpaa2_eth_priv *priv)
{ {
int i; int i;
...@@ -3638,7 +3638,7 @@ static void free_rings(struct dpaa2_eth_priv *priv) ...@@ -3638,7 +3638,7 @@ static void free_rings(struct dpaa2_eth_priv *priv)
dpaa2_io_store_destroy(priv->channel[i]->store); dpaa2_io_store_destroy(priv->channel[i]->store);
} }
static int set_mac_addr(struct dpaa2_eth_priv *priv) static int dpaa2_eth_set_mac_addr(struct dpaa2_eth_priv *priv)
{ {
struct net_device *net_dev = priv->net_dev; struct net_device *net_dev = priv->net_dev;
struct device *dev = net_dev->dev.parent; struct device *dev = net_dev->dev.parent;
...@@ -3703,7 +3703,7 @@ static int set_mac_addr(struct dpaa2_eth_priv *priv) ...@@ -3703,7 +3703,7 @@ static int set_mac_addr(struct dpaa2_eth_priv *priv)
return 0; return 0;
} }
static int netdev_init(struct net_device *net_dev) static int dpaa2_eth_netdev_init(struct net_device *net_dev)
{ {
struct device *dev = net_dev->dev.parent; struct device *dev = net_dev->dev.parent;
struct dpaa2_eth_priv *priv = netdev_priv(net_dev); struct dpaa2_eth_priv *priv = netdev_priv(net_dev);
...@@ -3716,7 +3716,7 @@ static int netdev_init(struct net_device *net_dev) ...@@ -3716,7 +3716,7 @@ static int netdev_init(struct net_device *net_dev)
net_dev->netdev_ops = &dpaa2_eth_ops; net_dev->netdev_ops = &dpaa2_eth_ops;
net_dev->ethtool_ops = &dpaa2_ethtool_ops; net_dev->ethtool_ops = &dpaa2_ethtool_ops;
err = set_mac_addr(priv); err = dpaa2_eth_set_mac_addr(priv);
if (err) if (err)
return err; return err;
...@@ -3771,13 +3771,13 @@ static int netdev_init(struct net_device *net_dev) ...@@ -3771,13 +3771,13 @@ static int netdev_init(struct net_device *net_dev)
return 0; return 0;
} }
static int poll_link_state(void *arg) static int dpaa2_eth_poll_link_state(void *arg)
{ {
struct dpaa2_eth_priv *priv = (struct dpaa2_eth_priv *)arg; struct dpaa2_eth_priv *priv = (struct dpaa2_eth_priv *)arg;
int err; int err;
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
err = link_state_update(priv); err = dpaa2_eth_link_state_update(priv);
if (unlikely(err)) if (unlikely(err))
return err; return err;
...@@ -3847,11 +3847,11 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg) ...@@ -3847,11 +3847,11 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
} }
if (status & DPNI_IRQ_EVENT_LINK_CHANGED) if (status & DPNI_IRQ_EVENT_LINK_CHANGED)
link_state_update(netdev_priv(net_dev)); dpaa2_eth_link_state_update(netdev_priv(net_dev));
if (status & DPNI_IRQ_EVENT_ENDPOINT_CHANGED) { if (status & DPNI_IRQ_EVENT_ENDPOINT_CHANGED) {
set_mac_addr(netdev_priv(net_dev)); dpaa2_eth_set_mac_addr(netdev_priv(net_dev));
update_tx_fqids(priv); dpaa2_eth_update_tx_fqids(priv);
rtnl_lock(); rtnl_lock();
if (priv->mac) if (priv->mac)
...@@ -3864,7 +3864,7 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg) ...@@ -3864,7 +3864,7 @@ static irqreturn_t dpni_irq0_handler_thread(int irq_num, void *arg)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int setup_irqs(struct fsl_mc_device *ls_dev) static int dpaa2_eth_setup_irqs(struct fsl_mc_device *ls_dev)
{ {
int err = 0; int err = 0;
struct fsl_mc_device_irq *irq; struct fsl_mc_device_irq *irq;
...@@ -3910,7 +3910,7 @@ static int setup_irqs(struct fsl_mc_device *ls_dev) ...@@ -3910,7 +3910,7 @@ static int setup_irqs(struct fsl_mc_device *ls_dev)
return err; return err;
} }
static void add_ch_napi(struct dpaa2_eth_priv *priv) static void dpaa2_eth_add_ch_napi(struct dpaa2_eth_priv *priv)
{ {
int i; int i;
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
...@@ -3923,7 +3923,7 @@ static void add_ch_napi(struct dpaa2_eth_priv *priv) ...@@ -3923,7 +3923,7 @@ static void add_ch_napi(struct dpaa2_eth_priv *priv)
} }
} }
static void del_ch_napi(struct dpaa2_eth_priv *priv) static void dpaa2_eth_del_ch_napi(struct dpaa2_eth_priv *priv)
{ {
int i; int i;
struct dpaa2_eth_channel *ch; struct dpaa2_eth_channel *ch;
...@@ -3970,26 +3970,26 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) ...@@ -3970,26 +3970,26 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
} }
/* MC objects initialization and configuration */ /* MC objects initialization and configuration */
err = setup_dpni(dpni_dev); err = dpaa2_eth_setup_dpni(dpni_dev);
if (err) if (err)
goto err_dpni_setup; goto err_dpni_setup;
err = setup_dpio(priv); err = dpaa2_eth_setup_dpio(priv);
if (err) if (err)
goto err_dpio_setup; goto err_dpio_setup;
setup_fqs(priv); dpaa2_eth_setup_fqs(priv);
err = setup_dpbp(priv); err = dpaa2_eth_setup_dpbp(priv);
if (err) if (err)
goto err_dpbp_setup; goto err_dpbp_setup;
err = bind_dpni(priv); err = dpaa2_eth_bind_dpni(priv);
if (err) if (err)
goto err_bind; goto err_bind;
/* Add a NAPI context for each channel */ /* Add a NAPI context for each channel */
add_ch_napi(priv); dpaa2_eth_add_ch_napi(priv);
/* Percpu statistics */ /* Percpu statistics */
priv->percpu_stats = alloc_percpu(*priv->percpu_stats); priv->percpu_stats = alloc_percpu(*priv->percpu_stats);
...@@ -4012,21 +4012,21 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) ...@@ -4012,21 +4012,21 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
goto err_alloc_sgt_cache; goto err_alloc_sgt_cache;
} }
err = netdev_init(net_dev); err = dpaa2_eth_netdev_init(net_dev);
if (err) if (err)
goto err_netdev_init; goto err_netdev_init;
/* Configure checksum offload based on current interface flags */ /* Configure checksum offload based on current interface flags */
err = set_rx_csum(priv, !!(net_dev->features & NETIF_F_RXCSUM)); err = dpaa2_eth_set_rx_csum(priv, !!(net_dev->features & NETIF_F_RXCSUM));
if (err) if (err)
goto err_csum; goto err_csum;
err = set_tx_csum(priv, !!(net_dev->features & err = dpaa2_eth_set_tx_csum(priv,
(NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM))); !!(net_dev->features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)));
if (err) if (err)
goto err_csum; goto err_csum;
err = alloc_rings(priv); err = dpaa2_eth_alloc_rings(priv);
if (err) if (err)
goto err_alloc_rings; goto err_alloc_rings;
...@@ -4039,10 +4039,10 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) ...@@ -4039,10 +4039,10 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
} }
#endif #endif
err = setup_irqs(dpni_dev); err = dpaa2_eth_setup_irqs(dpni_dev);
if (err) { if (err) {
netdev_warn(net_dev, "Failed to set link interrupt, fall back to polling\n"); netdev_warn(net_dev, "Failed to set link interrupt, fall back to polling\n");
priv->poll_thread = kthread_run(poll_link_state, priv, priv->poll_thread = kthread_run(dpaa2_eth_poll_link_state, priv,
"%s_poll_link", net_dev->name); "%s_poll_link", net_dev->name);
if (IS_ERR(priv->poll_thread)) { if (IS_ERR(priv->poll_thread)) {
dev_err(dev, "Error starting polling thread\n"); dev_err(dev, "Error starting polling thread\n");
...@@ -4076,7 +4076,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) ...@@ -4076,7 +4076,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
else else
fsl_mc_free_irqs(dpni_dev); fsl_mc_free_irqs(dpni_dev);
err_poll_thread: err_poll_thread:
free_rings(priv); dpaa2_eth_free_rings(priv);
err_alloc_rings: err_alloc_rings:
err_csum: err_csum:
err_netdev_init: err_netdev_init:
...@@ -4086,13 +4086,13 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev) ...@@ -4086,13 +4086,13 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
err_alloc_percpu_extras: err_alloc_percpu_extras:
free_percpu(priv->percpu_stats); free_percpu(priv->percpu_stats);
err_alloc_percpu_stats: err_alloc_percpu_stats:
del_ch_napi(priv); dpaa2_eth_del_ch_napi(priv);
err_bind: err_bind:
free_dpbp(priv); dpaa2_eth_free_dpbp(priv);
err_dpbp_setup: err_dpbp_setup:
free_dpio(priv); dpaa2_eth_free_dpio(priv);
err_dpio_setup: err_dpio_setup:
free_dpni(priv); dpaa2_eth_free_dpni(priv);
err_dpni_setup: err_dpni_setup:
fsl_mc_portal_free(priv->mc_io); fsl_mc_portal_free(priv->mc_io);
err_portal_alloc: err_portal_alloc:
...@@ -4126,15 +4126,15 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev) ...@@ -4126,15 +4126,15 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
else else
fsl_mc_free_irqs(ls_dev); fsl_mc_free_irqs(ls_dev);
free_rings(priv); dpaa2_eth_free_rings(priv);
free_percpu(priv->sgt_cache); free_percpu(priv->sgt_cache);
free_percpu(priv->percpu_stats); free_percpu(priv->percpu_stats);
free_percpu(priv->percpu_extras); free_percpu(priv->percpu_extras);
del_ch_napi(priv); dpaa2_eth_del_ch_napi(priv);
free_dpbp(priv); dpaa2_eth_free_dpbp(priv);
free_dpio(priv); dpaa2_eth_free_dpio(priv);
free_dpni(priv); dpaa2_eth_free_dpni(priv);
fsl_mc_portal_free(priv->mc_io); fsl_mc_portal_free(priv->mc_io);
......
...@@ -316,7 +316,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev, ...@@ -316,7 +316,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev,
dpaa2_mac_get_ethtool_stats(priv->mac, data + i); dpaa2_mac_get_ethtool_stats(priv->mac, data + i);
} }
static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask, static int dpaa2_eth_prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
void *key, void *mask, u64 *fields) void *key, void *mask, u64 *fields)
{ {
int off; int off;
...@@ -345,7 +345,7 @@ static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask, ...@@ -345,7 +345,7 @@ static int prep_eth_rule(struct ethhdr *eth_value, struct ethhdr *eth_mask,
return 0; return 0;
} }
static int prep_uip_rule(struct ethtool_usrip4_spec *uip_value, static int dpaa2_eth_prep_uip_rule(struct ethtool_usrip4_spec *uip_value,
struct ethtool_usrip4_spec *uip_mask, struct ethtool_usrip4_spec *uip_mask,
void *key, void *mask, u64 *fields) void *key, void *mask, u64 *fields)
{ {
...@@ -400,7 +400,7 @@ static int prep_uip_rule(struct ethtool_usrip4_spec *uip_value, ...@@ -400,7 +400,7 @@ static int prep_uip_rule(struct ethtool_usrip4_spec *uip_value,
return 0; return 0;
} }
static int prep_l4_rule(struct ethtool_tcpip4_spec *l4_value, static int dpaa2_eth_prep_l4_rule(struct ethtool_tcpip4_spec *l4_value,
struct ethtool_tcpip4_spec *l4_mask, struct ethtool_tcpip4_spec *l4_mask,
void *key, void *mask, u8 l4_proto, u64 *fields) void *key, void *mask, u8 l4_proto, u64 *fields)
{ {
...@@ -451,7 +451,7 @@ static int prep_l4_rule(struct ethtool_tcpip4_spec *l4_value, ...@@ -451,7 +451,7 @@ static int prep_l4_rule(struct ethtool_tcpip4_spec *l4_value,
return 0; return 0;
} }
static int prep_ext_rule(struct ethtool_flow_ext *ext_value, static int dpaa2_eth_prep_ext_rule(struct ethtool_flow_ext *ext_value,
struct ethtool_flow_ext *ext_mask, struct ethtool_flow_ext *ext_mask,
void *key, void *mask, u64 *fields) void *key, void *mask, u64 *fields)
{ {
...@@ -470,7 +470,7 @@ static int prep_ext_rule(struct ethtool_flow_ext *ext_value, ...@@ -470,7 +470,7 @@ static int prep_ext_rule(struct ethtool_flow_ext *ext_value,
return 0; return 0;
} }
static int prep_mac_ext_rule(struct ethtool_flow_ext *ext_value, static int dpaa2_eth_prep_mac_ext_rule(struct ethtool_flow_ext *ext_value,
struct ethtool_flow_ext *ext_mask, struct ethtool_flow_ext *ext_mask,
void *key, void *mask, u64 *fields) void *key, void *mask, u64 *fields)
{ {
...@@ -486,30 +486,30 @@ static int prep_mac_ext_rule(struct ethtool_flow_ext *ext_value, ...@@ -486,30 +486,30 @@ static int prep_mac_ext_rule(struct ethtool_flow_ext *ext_value,
return 0; return 0;
} }
static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask, static int dpaa2_eth_prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key,
u64 *fields) void *mask, u64 *fields)
{ {
int err; int err;
switch (fs->flow_type & 0xFF) { switch (fs->flow_type & 0xFF) {
case ETHER_FLOW: case ETHER_FLOW:
err = prep_eth_rule(&fs->h_u.ether_spec, &fs->m_u.ether_spec, err = dpaa2_eth_prep_eth_rule(&fs->h_u.ether_spec, &fs->m_u.ether_spec,
key, mask, fields); key, mask, fields);
break; break;
case IP_USER_FLOW: case IP_USER_FLOW:
err = prep_uip_rule(&fs->h_u.usr_ip4_spec, err = dpaa2_eth_prep_uip_rule(&fs->h_u.usr_ip4_spec,
&fs->m_u.usr_ip4_spec, key, mask, fields); &fs->m_u.usr_ip4_spec, key, mask, fields);
break; break;
case TCP_V4_FLOW: case TCP_V4_FLOW:
err = prep_l4_rule(&fs->h_u.tcp_ip4_spec, &fs->m_u.tcp_ip4_spec, err = dpaa2_eth_prep_l4_rule(&fs->h_u.tcp_ip4_spec, &fs->m_u.tcp_ip4_spec,
key, mask, IPPROTO_TCP, fields); key, mask, IPPROTO_TCP, fields);
break; break;
case UDP_V4_FLOW: case UDP_V4_FLOW:
err = prep_l4_rule(&fs->h_u.udp_ip4_spec, &fs->m_u.udp_ip4_spec, err = dpaa2_eth_prep_l4_rule(&fs->h_u.udp_ip4_spec, &fs->m_u.udp_ip4_spec,
key, mask, IPPROTO_UDP, fields); key, mask, IPPROTO_UDP, fields);
break; break;
case SCTP_V4_FLOW: case SCTP_V4_FLOW:
err = prep_l4_rule(&fs->h_u.sctp_ip4_spec, err = dpaa2_eth_prep_l4_rule(&fs->h_u.sctp_ip4_spec,
&fs->m_u.sctp_ip4_spec, key, mask, &fs->m_u.sctp_ip4_spec, key, mask,
IPPROTO_SCTP, fields); IPPROTO_SCTP, fields);
break; break;
...@@ -521,14 +521,14 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask, ...@@ -521,14 +521,14 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
return err; return err;
if (fs->flow_type & FLOW_EXT) { if (fs->flow_type & FLOW_EXT) {
err = prep_ext_rule(&fs->h_ext, &fs->m_ext, key, mask, fields); err = dpaa2_eth_prep_ext_rule(&fs->h_ext, &fs->m_ext, key, mask, fields);
if (err) if (err)
return err; return err;
} }
if (fs->flow_type & FLOW_MAC_EXT) { if (fs->flow_type & FLOW_MAC_EXT) {
err = prep_mac_ext_rule(&fs->h_ext, &fs->m_ext, key, mask, err = dpaa2_eth_prep_mac_ext_rule(&fs->h_ext, &fs->m_ext, key,
fields); mask, fields);
if (err) if (err)
return err; return err;
} }
...@@ -536,7 +536,7 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask, ...@@ -536,7 +536,7 @@ static int prep_cls_rule(struct ethtool_rx_flow_spec *fs, void *key, void *mask,
return 0; return 0;
} }
static int do_cls_rule(struct net_device *net_dev, static int dpaa2_eth_do_cls_rule(struct net_device *net_dev,
struct ethtool_rx_flow_spec *fs, struct ethtool_rx_flow_spec *fs,
bool add) bool add)
{ {
...@@ -561,7 +561,7 @@ static int do_cls_rule(struct net_device *net_dev, ...@@ -561,7 +561,7 @@ static int do_cls_rule(struct net_device *net_dev,
return -ENOMEM; return -ENOMEM;
/* Fill the key and mask memory areas */ /* Fill the key and mask memory areas */
err = prep_cls_rule(fs, key_buf, key_buf + rule_cfg.key_size, &fields); err = dpaa2_eth_prep_cls_rule(fs, key_buf, key_buf + rule_cfg.key_size, &fields);
if (err) if (err)
goto free_mem; goto free_mem;
...@@ -629,7 +629,7 @@ static int do_cls_rule(struct net_device *net_dev, ...@@ -629,7 +629,7 @@ static int do_cls_rule(struct net_device *net_dev,
return err; return err;
} }
static int num_rules(struct dpaa2_eth_priv *priv) static int dpaa2_eth_num_cls_rules(struct dpaa2_eth_priv *priv)
{ {
int i, rules = 0; int i, rules = 0;
...@@ -640,7 +640,7 @@ static int num_rules(struct dpaa2_eth_priv *priv) ...@@ -640,7 +640,7 @@ static int num_rules(struct dpaa2_eth_priv *priv)
return rules; return rules;
} }
static int update_cls_rule(struct net_device *net_dev, static int dpaa2_eth_update_cls_rule(struct net_device *net_dev,
struct ethtool_rx_flow_spec *new_fs, struct ethtool_rx_flow_spec *new_fs,
unsigned int location) unsigned int location)
{ {
...@@ -658,13 +658,14 @@ static int update_cls_rule(struct net_device *net_dev, ...@@ -658,13 +658,14 @@ static int update_cls_rule(struct net_device *net_dev,
/* If a rule is present at the specified location, delete it. */ /* If a rule is present at the specified location, delete it. */
if (rule->in_use) { if (rule->in_use) {
err = do_cls_rule(net_dev, &rule->fs, false); err = dpaa2_eth_do_cls_rule(net_dev, &rule->fs, false);
if (err) if (err)
return err; return err;
rule->in_use = 0; rule->in_use = 0;
if (!dpaa2_eth_fs_mask_enabled(priv) && !num_rules(priv)) if (!dpaa2_eth_fs_mask_enabled(priv) &&
!dpaa2_eth_num_cls_rules(priv))
priv->rx_cls_fields = 0; priv->rx_cls_fields = 0;
} }
...@@ -672,7 +673,7 @@ static int update_cls_rule(struct net_device *net_dev, ...@@ -672,7 +673,7 @@ static int update_cls_rule(struct net_device *net_dev,
if (!new_fs) if (!new_fs)
return err; return err;
err = do_cls_rule(net_dev, new_fs, true); err = dpaa2_eth_do_cls_rule(net_dev, new_fs, true);
if (err) if (err)
return err; return err;
...@@ -702,7 +703,7 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev, ...@@ -702,7 +703,7 @@ static int dpaa2_eth_get_rxnfc(struct net_device *net_dev,
break; break;
case ETHTOOL_GRXCLSRLCNT: case ETHTOOL_GRXCLSRLCNT:
rxnfc->rule_cnt = 0; rxnfc->rule_cnt = 0;
rxnfc->rule_cnt = num_rules(priv); rxnfc->rule_cnt = dpaa2_eth_num_cls_rules(priv);
rxnfc->data = max_rules; rxnfc->data = max_rules;
break; break;
case ETHTOOL_GRXCLSRULE: case ETHTOOL_GRXCLSRULE:
...@@ -744,10 +745,10 @@ static int dpaa2_eth_set_rxnfc(struct net_device *net_dev, ...@@ -744,10 +745,10 @@ static int dpaa2_eth_set_rxnfc(struct net_device *net_dev,
err = dpaa2_eth_set_hash(net_dev, rxnfc->data); err = dpaa2_eth_set_hash(net_dev, rxnfc->data);
break; break;
case ETHTOOL_SRXCLSRLINS: case ETHTOOL_SRXCLSRLINS:
err = update_cls_rule(net_dev, &rxnfc->fs, rxnfc->fs.location); err = dpaa2_eth_update_cls_rule(net_dev, &rxnfc->fs, rxnfc->fs.location);
break; break;
case ETHTOOL_SRXCLSRLDEL: case ETHTOOL_SRXCLSRLDEL:
err = update_cls_rule(net_dev, NULL, rxnfc->fs.location); err = dpaa2_eth_update_cls_rule(net_dev, NULL, rxnfc->fs.location);
break; break;
default: default:
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment