aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_ksz.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dsa/tag_ksz.c')
-rw-r--r--net/dsa/tag_ksz.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
index 010ca0a336c4..0f62effad88f 100644
--- a/net/dsa/tag_ksz.c
+++ b/net/dsa/tag_ksz.c
@@ -34,7 +34,7 @@
static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev)
{
- struct dsa_slave_priv *p = netdev_priv(dev);
+ struct dsa_port *dp = dsa_slave_to_port(dev);
struct sk_buff *nskb;
int padlen;
u8 *tag;
@@ -72,7 +72,7 @@ static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev)
tag = skb_put(nskb, KSZ_INGRESS_TAG_LEN);
tag[0] = 0;
- tag[1] = 1 << p->dp->index; /* destination port */
+ tag[1] = 1 << dp->index; /* destination port */
return nskb;
}
@@ -80,22 +80,19 @@ static struct sk_buff *ksz_xmit(struct sk_buff *skb, struct net_device *dev)
static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
- struct dsa_switch_tree *dst = dev->dsa_ptr;
- struct dsa_port *cpu_dp = dsa_get_cpu_port(dst);
- struct dsa_switch *ds = cpu_dp->ds;
u8 *tag;
int source_port;
tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
source_port = tag[0] & 7;
- if (source_port >= ds->num_ports || !ds->ports[source_port].netdev)
+
+ skb->dev = dsa_master_find_slave(dev, 0, source_port);
+ if (!skb->dev)
return NULL;
pskb_trim_rcsum(skb, skb->len - KSZ_EGRESS_TAG_LEN);
- skb->dev = ds->ports[source_port].netdev;
-
return skb;
}
td>drm/amdgpu: Replace ttm_bo_reference with ttm_bo_getThomas Zimmermann1-1/+1 2018-07-31drm/scheduler: stop setting rq to NULLChristian König1-27/+8 2018-07-31drm/scheduler: only kill entity if last user is killed v2Christian König2-1/+7 2018-07-31drm/amdgpu: create an empty bo_list if no handle is providedChristian König1-65/+46 2018-07-31drm/amdgpu: allocate the bo_list array after the listChristian König2-74/+57 2018-07-31drm/amdgpu: add bo_list iteratorsChristian König3-39/+43 2018-07-31drm/amdgpu: nuke amdgpu_bo_list_freeChristian König3-14/+2 2018-07-31drm/amdgpu: always recreate bo_listChristian König3-15/+12 2018-07-31drm/amdgpu: move bo_list defines to amdgpu_bo_list.hChristian König2-39/+71 2018-07-31drm/amdgpu: add new amdgpu_vm_bo_trace_cs() function v2Christian König4-0/+37 2018-07-31drm/amdgpu: return error if both BOs and bo_list handle is givenChristian König1-3/+6 2018-07-31drm/amdgpu: fix total size calculationChristian König1-1/+1 2018-07-31drm/sched: remove unneeded -Iinclude/drm compiler flagMasahiro Yamada1-1/+0 2018-07-31drm/amdgpu: add proper error handling to amdgpu_bo_list_getChristian König3-23/+20 2018-07-31drm/amdgpu: fix a reversed conditionRex Zhu1-1/+1 2018-07-31drm/amd/pp: Convert voltage unit in mV*4 to mV on CZ/STRex Zhu1-2/+3 2018-07-31drm/amd/pp: Delete unused temp variablesRex Zhu1-16/+6 2018-07-31drm/amd/pp/Polaris12: Fix a chunk of registers missed to programRex Zhu1-0/+43 2018-07-27drm/amdgpu: clean up the superfluous space and align the comment text for amd...Huang Rui1-56/+51 2018-07-27drm/amdgpu: correct evict flag for bo moveJunwei Zhang1-2/+2 2018-07-27drm/ttm: Merge hugepage attr changes in ttm_dma_page_put. (v2)Bas Nieuwenhuizen1-7/+4 2018-07-27drm/ttm: clean up non-x86 definitions on ttm_page_allocHuang Rui1-57/+5 2018-07-27drm/ttm: clean up non-x86 definitions on ttm_page_alloc_dmaHuang Rui1-44/+4