mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-02 16:44:59 +00:00
net: ethernet: mtk-ppe: fix traffic offload with bridged wlan
A typical flow offload scenario for OpenWrt users is routed traffic received by the wan interface that is redirected to a wlan device belonging to the lan bridge. Current implementation fails to fill wdma offload info in mtk_flow_get_wdma_info() since odev device is the local bridge. Fix the issue running dev_fill_forward_path routine in mtk_flow_get_wdma_info in order to identify the wlan device. Tested-by: Paolo Valerio <pvalerio@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
360f9f3152
commit
2830e31477
@ -88,32 +88,28 @@ mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth)
|
|||||||
static int
|
static int
|
||||||
mtk_flow_get_wdma_info(struct net_device *dev, const u8 *addr, struct mtk_wdma_info *info)
|
mtk_flow_get_wdma_info(struct net_device *dev, const u8 *addr, struct mtk_wdma_info *info)
|
||||||
{
|
{
|
||||||
struct net_device_path_ctx ctx = {
|
struct net_device_path_stack stack;
|
||||||
.dev = dev,
|
struct net_device_path *path;
|
||||||
};
|
int err;
|
||||||
struct net_device_path path = {};
|
|
||||||
|
|
||||||
if (!ctx.dev)
|
if (!dev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
memcpy(ctx.daddr, addr, sizeof(ctx.daddr));
|
|
||||||
|
|
||||||
if (!IS_ENABLED(CONFIG_NET_MEDIATEK_SOC_WED))
|
if (!IS_ENABLED(CONFIG_NET_MEDIATEK_SOC_WED))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!dev->netdev_ops->ndo_fill_forward_path)
|
err = dev_fill_forward_path(dev, addr, &stack);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
path = &stack.path[stack.num_paths - 1];
|
||||||
|
if (path->type != DEV_PATH_MTK_WDMA)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (dev->netdev_ops->ndo_fill_forward_path(&ctx, &path))
|
info->wdma_idx = path->mtk_wdma.wdma_idx;
|
||||||
return -1;
|
info->queue = path->mtk_wdma.queue;
|
||||||
|
info->bss = path->mtk_wdma.bss;
|
||||||
if (path.type != DEV_PATH_MTK_WDMA)
|
info->wcid = path->mtk_wdma.wcid;
|
||||||
return -1;
|
|
||||||
|
|
||||||
info->wdma_idx = path.mtk_wdma.wdma_idx;
|
|
||||||
info->queue = path.mtk_wdma.queue;
|
|
||||||
info->bss = path.mtk_wdma.bss;
|
|
||||||
info->wcid = path.mtk_wdma.wcid;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user