Skip to content

Commit

Permalink
net: airoha: Move REG_GDM_FWD_CFG() initialization in airoha_dev_init()
Browse files Browse the repository at this point in the history
Move REG_GDM_FWD_CFG() register initialization in airoha_dev_init
routine. Moreover, always send traffic PPE module in order to be
processed by hw accelerator.
This is a preliminary patch to enable netfilter flowtable hw offloading
on EN7581 SoC.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Lorenzo Bianconi authored and Paolo Abeni committed Mar 4, 2025
1 parent 8036968 commit 67fde5d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/net/ethernet/airoha/airoha_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,25 +107,20 @@ static void airoha_set_gdm_port_fwd_cfg(struct airoha_eth *eth, u32 addr,

static int airoha_set_gdm_port(struct airoha_eth *eth, int port, bool enable)
{
u32 val = enable ? FE_PSE_PORT_PPE1 : FE_PSE_PORT_DROP;
u32 vip_port, cfg_addr;
u32 vip_port;

switch (port) {
case XSI_PCIE0_PORT:
vip_port = XSI_PCIE0_VIP_PORT_MASK;
cfg_addr = REG_GDM_FWD_CFG(3);
break;
case XSI_PCIE1_PORT:
vip_port = XSI_PCIE1_VIP_PORT_MASK;
cfg_addr = REG_GDM_FWD_CFG(3);
break;
case XSI_USB_PORT:
vip_port = XSI_USB_VIP_PORT_MASK;
cfg_addr = REG_GDM_FWD_CFG(4);
break;
case XSI_ETH_PORT:
vip_port = XSI_ETH_VIP_PORT_MASK;
cfg_addr = REG_GDM_FWD_CFG(4);
break;
default:
return -EINVAL;
Expand All @@ -139,8 +134,6 @@ static int airoha_set_gdm_port(struct airoha_eth *eth, int port, bool enable)
airoha_fe_clear(eth, REG_FE_IFC_PORT_EN, vip_port);
}

airoha_set_gdm_port_fwd_cfg(eth, cfg_addr, val);

return 0;
}

Expand Down Expand Up @@ -177,8 +170,6 @@ static void airoha_fe_maccr_init(struct airoha_eth *eth)
airoha_fe_set(eth, REG_GDM_FWD_CFG(p),
GDM_TCP_CKSUM | GDM_UDP_CKSUM | GDM_IP4_CKSUM |
GDM_DROP_CRC_ERR);
airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(p),
FE_PSE_PORT_CDM1);
airoha_fe_rmw(eth, REG_GDM_LEN_CFG(p),
GDM_SHORT_LEN_MASK | GDM_LONG_LEN_MASK,
FIELD_PREP(GDM_SHORT_LEN_MASK, 60) |
Expand Down Expand Up @@ -1614,8 +1605,11 @@ static int airoha_dev_set_macaddr(struct net_device *dev, void *p)
static int airoha_dev_init(struct net_device *dev)
{
struct airoha_gdm_port *port = netdev_priv(dev);
struct airoha_eth *eth = port->qdma->eth;

airoha_set_macaddr(port, dev->dev_addr);
airoha_set_gdm_port_fwd_cfg(eth, REG_GDM_FWD_CFG(port->id),
FE_PSE_PORT_PPE1);

return 0;
}
Expand Down

0 comments on commit 67fde5d

Please sign in to comment.