Home
last modified time | relevance | path

Searched refs:eth (Results 1 – 25 of 330) sorted by relevance

12345678910>>...14

/linux/drivers/net/ethernet/mediatek/
H A Dmtk_eth_soc.c290 void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg) in mtk_w32() argument
292 __raw_writel(val, eth->base + reg); in mtk_w32()
295 u32 mtk_r32(struct mtk_eth *eth, unsigned reg) in mtk_r32() argument
297 return __raw_readl(eth->base + reg); in mtk_r32()
300 u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned int reg) in mtk_m32() argument
304 val = mtk_r32(eth, reg); in mtk_m32()
307 mtk_w32(eth, val, reg); in mtk_m32()
311 static int mtk_mdio_busy_wait(struct mtk_eth *eth) in mtk_mdio_busy_wait() argument
316 if (!(mtk_r32(eth, MTK_PHY_IAC) & PHY_IAC_ACCESS)) in mtk_mdio_busy_wait()
323 dev_err(eth in mtk_mdio_busy_wait()
327 _mtk_mdio_write_c22(struct mtk_eth * eth,u32 phy_addr,u32 phy_reg,u32 write_data) _mtk_mdio_write_c22() argument
351 _mtk_mdio_write_c45(struct mtk_eth * eth,u32 phy_addr,u32 devad,u32 phy_reg,u32 write_data) _mtk_mdio_write_c45() argument
387 _mtk_mdio_read_c22(struct mtk_eth * eth,u32 phy_addr,u32 phy_reg) _mtk_mdio_read_c22() argument
409 _mtk_mdio_read_c45(struct mtk_eth * eth,u32 phy_addr,u32 devad,u32 phy_reg) _mtk_mdio_read_c45() argument
447 struct mtk_eth *eth = bus->priv; mtk_mdio_write_c22() local
455 struct mtk_eth *eth = bus->priv; mtk_mdio_write_c45() local
462 struct mtk_eth *eth = bus->priv; mtk_mdio_read_c22() local
470 struct mtk_eth *eth = bus->priv; mtk_mdio_read_c45() local
475 mt7621_gmac0_rgmii_adjust(struct mtk_eth * eth,phy_interface_t interface) mt7621_gmac0_rgmii_adjust() argument
489 mtk_gmac0_rgmii_adjust(struct mtk_eth * eth,phy_interface_t interface) mtk_gmac0_rgmii_adjust() argument
505 mtk_setup_bridge_switch(struct mtk_eth * eth) mtk_setup_bridge_switch() argument
523 struct mtk_eth *eth = mac->hw; mtk_mac_select_pcs() local
542 struct mtk_eth *eth = mac->hw; mtk_mac_prepare() local
562 struct mtk_eth *eth = mac->hw; mtk_mac_config() local
698 struct mtk_eth *eth = mac->hw; mtk_mac_finish() local
740 mtk_set_queue_speed(struct mtk_eth * eth,unsigned int idx,int speed) mtk_set_queue_speed() argument
902 struct mtk_eth *eth = mac->hw; mtk_mac_disable_tx_lpi() local
912 struct mtk_eth *eth = mac->hw; mtk_mac_enable_tx_lpi() local
982 mtk_mdio_config(struct mtk_eth * eth) mtk_mdio_config() argument
998 mtk_mdio_init(struct mtk_eth * eth) mtk_mdio_init() argument
1045 mtk_mdio_cleanup(struct mtk_eth * eth) mtk_mdio_cleanup() argument
1053 mtk_tx_irq_disable(struct mtk_eth * eth,u32 mask) mtk_tx_irq_disable() argument
1064 mtk_tx_irq_enable(struct mtk_eth * eth,u32 mask) mtk_tx_irq_enable() argument
1075 mtk_rx_irq_disable(struct mtk_eth * eth,u32 mask) mtk_rx_irq_disable() argument
1086 mtk_rx_irq_enable(struct mtk_eth * eth,u32 mask) mtk_rx_irq_enable() argument
1101 struct mtk_eth *eth = mac->hw; mtk_set_mac_address() local
1132 struct mtk_eth *eth = mac->hw; mtk_stats_update_mac() local
1197 mtk_stats_update(struct mtk_eth * eth) mtk_stats_update() argument
1265 mtk_rx_get_desc(struct mtk_eth * eth,struct mtk_rx_dma_v2 * rxd,struct mtk_rx_dma_v2 * dma_rxd) mtk_rx_get_desc() argument
1294 mtk_dma_ring_alloc(struct mtk_eth * eth,size_t size,dma_addr_t * dma_handle,bool use_sram) mtk_dma_ring_alloc() argument
1313 mtk_dma_ring_free(struct mtk_eth * eth,size_t size,void * dma_ring,dma_addr_t dma_handle,bool in_sram) mtk_dma_ring_free() argument
1323 mtk_init_fq_dma(struct mtk_eth * eth) mtk_init_fq_dma() argument
1408 mtk_tx_unmap(struct mtk_eth * eth,struct mtk_tx_buf * tx_buf,struct xdp_frame_bulk * bq,bool napi) mtk_tx_unmap() argument
1462 setup_tx_buf(struct mtk_eth * eth,struct mtk_tx_buf * tx_buf,struct mtk_tx_dma * txd,dma_addr_t mapped_addr,size_t size,int idx) setup_tx_buf() argument
1489 struct mtk_eth *eth = mac->hw; mtk_tx_set_dma_desc_v1() local
1520 struct mtk_eth *eth = mac->hw; mtk_tx_set_dma_desc_v2() local
1575 struct mtk_eth *eth = mac->hw; mtk_tx_set_dma_desc() local
1598 struct mtk_eth *eth = mac->hw; mtk_tx_map() local
1735 mtk_cal_txd_req(struct mtk_eth * eth,struct sk_buff * skb) mtk_cal_txd_req() argument
1753 mtk_queue_stopped(struct mtk_eth * eth) mtk_queue_stopped() argument
1767 mtk_wake_queue(struct mtk_eth * eth) mtk_wake_queue() argument
1781 struct mtk_eth *eth = mac->hw; mtk_start_xmit() local
1845 mtk_get_rx_ring(struct mtk_eth * eth) mtk_get_rx_ring() argument
1869 mtk_update_rx_cpu_idx(struct mtk_eth * eth) mtk_update_rx_cpu_idx() argument
1888 mtk_page_pool_enabled(struct mtk_eth * eth) mtk_page_pool_enabled() argument
1893 mtk_create_page_pool(struct mtk_eth * eth,struct xdp_rxq_info * xdp_q,int id,int size) mtk_create_page_pool() argument
1956 mtk_xdp_frame_map(struct mtk_eth * eth,struct net_device * dev,struct mtk_tx_dma_desc_info * txd_info,struct mtk_tx_dma * txd,struct mtk_tx_buf * tx_buf,void * data,u16 headroom,int index,bool dma_map) mtk_xdp_frame_map() argument
1993 mtk_xdp_submit_frame(struct mtk_eth * eth,struct xdp_frame * xdpf,struct net_device * dev,bool dma_map) mtk_xdp_submit_frame() argument
2118 struct mtk_eth *eth = mac->hw; mtk_xdp_xmit() local
2138 mtk_xdp_run(struct mtk_eth * eth,struct mtk_rx_ring * ring,struct xdp_buff * xdp,struct net_device * dev) mtk_xdp_run() argument
2202 mtk_poll_rx(struct napi_struct * napi,int budget,struct mtk_eth * eth) mtk_poll_rx() argument
2440 mtk_poll_tx_done(struct mtk_eth * eth,struct mtk_poll_state * state,u8 mac,struct sk_buff * skb) mtk_poll_tx_done() argument
2470 mtk_poll_tx_qdma(struct mtk_eth * eth,int budget,struct mtk_poll_state * state) mtk_poll_tx_qdma() argument
2520 mtk_poll_tx_pdma(struct mtk_eth * eth,int budget,struct mtk_poll_state * state) mtk_poll_tx_pdma() argument
2558 mtk_poll_tx(struct mtk_eth * eth,int budget) mtk_poll_tx() argument
2583 mtk_handle_status_irq(struct mtk_eth * eth) mtk_handle_status_irq() argument
2596 struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi); mtk_napi_tx() local
2626 struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi); mtk_napi_rx() local
2659 mtk_tx_alloc(struct mtk_eth * eth) mtk_tx_alloc() argument
2764 mtk_tx_clean(struct mtk_eth * eth) mtk_tx_clean() argument
2791 mtk_rx_alloc(struct mtk_eth * eth,int ring_no,int rx_flag) mtk_rx_alloc() argument
2924 mtk_rx_clean(struct mtk_eth * eth,struct mtk_rx_ring * ring,bool in_sram) mtk_rx_clean() argument
2965 mtk_hwlro_rx_init(struct mtk_eth * eth) mtk_hwlro_rx_init() argument
3025 mtk_hwlro_rx_uninit(struct mtk_eth * eth) mtk_hwlro_rx_uninit() argument
3051 mtk_hwlro_val_ipaddr(struct mtk_eth * eth,int idx,__be32 ip) mtk_hwlro_val_ipaddr() argument
3066 mtk_hwlro_inval_ipaddr(struct mtk_eth * eth,int idx) mtk_hwlro_inval_ipaddr() argument
3097 struct mtk_eth *eth = mac->hw; mtk_hwlro_add_ipaddr() local
3121 struct mtk_eth *eth = mac->hw; mtk_hwlro_del_ipaddr() local
3140 struct mtk_eth *eth = mac->hw; mtk_hwlro_netdev_disable() local
3231 mtk_dma_busy_wait(struct mtk_eth * eth) mtk_dma_busy_wait() argument
3251 mtk_dma_init(struct mtk_eth * eth) mtk_dma_init() argument
3305 mtk_dma_free(struct mtk_eth * eth) mtk_dma_free() argument
3345 mtk_hw_reset_check(struct mtk_eth * eth) mtk_hw_reset_check() argument
3357 struct mtk_eth *eth = mac->hw; mtk_tx_timeout() local
3371 mtk_get_irqs(struct platform_device * pdev,struct mtk_eth * eth) mtk_get_irqs() argument
3420 struct mtk_eth *eth = _eth; mtk_handle_irq_rx() local
3433 struct mtk_eth *eth = _eth; mtk_handle_irq_tx() local
3446 struct mtk_eth *eth = _eth; mtk_handle_irq() local
3467 struct mtk_eth *eth = mac->hw; mtk_poll_controller() local
3477 mtk_start_dma(struct mtk_eth * eth) mtk_start_dma() argument
3516 mtk_gdm_config(struct mtk_eth * eth,u32 id,u32 config) mtk_gdm_config() argument
3553 struct mtk_eth *eth = mac->hw; mtk_device_event() local
3592 mtk_max_gmac_mtu(struct mtk_eth * eth) mtk_max_gmac_mtu() argument
3606 struct mtk_eth *eth = mac->hw; mtk_open() local
3704 mtk_stop_dma(struct mtk_eth * eth,u32 glo_cfg) mtk_stop_dma() argument
3730 struct mtk_eth *eth = mac->hw; mtk_stop() local
3770 struct mtk_eth *eth = mac->hw; mtk_xdp_setup() local
3817 ethsys_reset(struct mtk_eth * eth,u32 reset_bits) ethsys_reset() argument
3830 mtk_clk_disable(struct mtk_eth * eth) mtk_clk_disable() argument
3838 mtk_clk_enable(struct mtk_eth * eth) mtk_clk_enable() argument
3860 struct mtk_eth *eth = container_of(dim, struct mtk_eth, rx_dim); mtk_dim_rx() local
3891 struct mtk_eth *eth = container_of(dim, struct mtk_eth, tx_dim); mtk_dim_tx() local
3921 struct mtk_eth *eth = mac->hw; mtk_set_mcr_max_rx() local
3943 mtk_hw_reset(struct mtk_eth * eth) mtk_hw_reset() argument
3979 mtk_hw_reset_read(struct mtk_eth * eth) mtk_hw_reset_read() argument
3987 mtk_hw_warm_reset(struct mtk_eth * eth) mtk_hw_warm_reset() argument
4034 mtk_hw_check_dma_hang(struct mtk_eth * eth) mtk_hw_check_dma_hang() argument
4115 struct mtk_eth *eth = container_of(del_work, struct mtk_eth, mtk_hw_reset_monitor_work() local
4130 mtk_hw_init(struct mtk_eth * eth,bool reset) mtk_hw_init() argument
4324 mtk_hw_deinit(struct mtk_eth * eth) mtk_hw_deinit() argument
4340 struct mtk_eth *eth = mac->hw; mtk_uninit() local
4351 struct mtk_eth *eth = mac->hw; mtk_change_mtu() local
4386 mtk_prepare_for_reset(struct mtk_eth * eth) mtk_prepare_for_reset() argument
4419 struct mtk_eth *eth = container_of(work, struct mtk_eth, pending_work); mtk_pending_work() local
4482 mtk_free_dev(struct mtk_eth * eth) mtk_free_dev() argument
4501 mtk_unreg_dev(struct mtk_eth * eth) mtk_unreg_dev() argument
4522 mtk_sgmii_destroy(struct mtk_eth * eth) mtk_sgmii_destroy() argument
4530 mtk_cleanup(struct mtk_eth * eth) mtk_cleanup() argument
4635 mtk_ethtool_pp_stats(struct mtk_eth * eth,u64 * data) mtk_ethtool_pp_stats() argument
4828 mtk_add_mac(struct mtk_eth * eth,struct device_node * np) mtk_add_mac() argument
5035 mtk_eth_set_dma_device(struct mtk_eth * eth,struct device * dma_dev) mtk_eth_set_dma_device() argument
5068 mtk_sgmii_init(struct mtk_eth * eth) mtk_sgmii_init() argument
5095 mtk_setup_legacy_sram(struct mtk_eth * eth,struct resource * res) mtk_setup_legacy_sram() argument
5120 struct mtk_eth *eth; mtk_probe() local
5395 struct mtk_eth *eth = platform_get_drvdata(pdev); mtk_remove() local
[all...]
H A Dmtk_ppe_offload.c17 struct ethhdr eth; member
57 mtk_flow_set_ipv4_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv4_addr() argument
60 return mtk_foe_entry_set_ipv4_tuple(eth, foe, egress, in mtk_flow_set_ipv4_addr()
66 mtk_flow_set_ipv6_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv6_addr() argument
69 return mtk_foe_entry_set_ipv6_tuple(eth, foe, in mtk_flow_set_ipv6_addr()
75 mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth) in mtk_flow_offload_mangle_eth() argument
77 void *dest = eth + act->mangle.offset; in mtk_flow_offload_mangle_eth()
200 mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_output_device() argument
208 mtk_foe_entry_set_wdma(eth, foe, info.wdma_idx, info.queue, in mtk_flow_set_output_device()
210 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_flow_set_output_device()
[all …]
H A Dmtk_ppe.c61 static u32 mtk_eth_timestamp(struct mtk_eth *eth) in mtk_eth_timestamp() argument
63 return mtk_r32(eth, 0x0010) & mtk_get_ib1_ts_mask(eth); in mtk_eth_timestamp()
112 if (mtk_is_netsys_v3_or_greater(ppe->eth)) { in mtk_mib_entry_read()
144 static u32 mtk_ppe_hash_entry(struct mtk_eth *eth, struct mtk_foe_entry *e) in mtk_ppe_hash_entry() argument
149 switch (mtk_get_ib1_pkt_type(eth, e->ib1)) { in mtk_ppe_hash_entry()
178 hash <<= (ffs(eth->soc->hash_offset) - 1); in mtk_ppe_hash_entry()
185 mtk_foe_entry_l2(struct mtk_eth *eth, struct mtk_foe_entry *entry) in mtk_foe_entry_l2() argument
187 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_l2()
199 mtk_foe_entry_ib2(struct mtk_eth *eth, struct mtk_foe_entry *entry) in mtk_foe_entry_ib2() argument
201 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_ib2()
[all …]
H A Dmtk_eth_soc.h342 #define TX_DMA_PLEN0(x) (((x) & eth->soc->tx.dma_max_len) << eth->soc->tx.dma_len_offset)
343 #define TX_DMA_PLEN1(x) ((x) & eth->soc->tx.dma_max_len)
363 #define RX_DMA_PREP_PLEN0(x) (((x) & eth->soc->rx.dma_max_len) << eth->soc->rx.dma_len_offset)
364 #define RX_DMA_GET_PLEN0(x) (((x) >> eth->soc->rx.dma_len_offset) & eth->soc->rx.dma_max_len)
1388 static inline bool mtk_is_netsys_v1(struct mtk_eth *eth) in mtk_is_netsys_v1() argument
1390 return eth->soc->version == 1; in mtk_is_netsys_v1()
1393 static inline bool mtk_is_netsys_v2_or_greater(struct mtk_eth *eth) in mtk_is_netsys_v2_or_greater() argument
1395 return eth->soc->version > 1; in mtk_is_netsys_v2_or_greater()
1398 static inline bool mtk_is_netsys_v3_or_greater(struct mtk_eth *eth) in mtk_is_netsys_v3_or_greater() argument
1400 return eth->soc->version > 2; in mtk_is_netsys_v3_or_greater()
[all …]
/linux/drivers/net/ethernet/airoha/
H A Dairoha_eth.c77 struct airoha_eth *eth = dev->eth; in airoha_set_macaddr() local
85 for (i = 0; i < ARRAY_SIZE(eth->ports); i++) { in airoha_set_macaddr()
86 struct airoha_gdm_port *port = eth->ports[i]; in airoha_set_macaddr()
125 dev_warn(eth->dev, in airoha_set_macaddr()
129 dev_warn(eth->dev, "FE hw forwarding won't work properly\n"); in airoha_set_macaddr()
136 airoha_fe_wr(eth, reg, val); in airoha_set_macaddr()
138 airoha_fe_wr(eth, REG_FE_MAC_LMIN(reg), lmin); in airoha_set_macaddr()
139 airoha_fe_wr(eth, REG_FE_MAC_LMAX(reg), lmax); in airoha_set_macaddr()
146 static void airoha_set_gdm_port_fwd_cfg(struct airoha_eth *eth, u32 addr, in airoha_set_gdm_port_fwd_cfg() argument
149 airoha_fe_rmw(eth, addr, GDM_OCFQ_MASK, in airoha_set_gdm_port_fwd_cfg()
[all …]
H A Dairoha_ppe.c43 if (airoha_is_7583(ppe->eth)) in airoha_ppe_get_num_stats_entries()
54 struct airoha_eth *eth = ppe->eth; in airoha_ppe_get_total_num_stats_entries() local
56 num_stats = num_stats * eth->soc->num_ppe; in airoha_ppe_get_total_num_stats_entries()
64 struct airoha_eth *eth = ppe->eth; in airoha_ppe_get_total_sram_num_entries() local
66 return PPE_SRAM_NUM_ENTRIES * eth->soc->num_ppe; in airoha_ppe_get_total_sram_num_entries()
76 bool airoha_ppe_is_enabled(struct airoha_eth *eth, int index) in airoha_ppe_is_enabled() argument
78 if (index >= eth->soc->num_ppe) in airoha_ppe_is_enabled()
81 return airoha_fe_rr(eth, REG_PPE_GLO_CFG(index)) & PPE_GLO_CFG_EN_MASK; in airoha_ppe_is_enabled()
86 return airoha_fe_get(ppe->eth, REG_FE_FOE_TS, in airoha_ppe_get_timestamp()
93 struct airoha_eth *eth = dev->eth; in airoha_ppe_set_cpu_port() local
[all …]
H A Dairoha_eth.h474 struct ethhdr eth; member
560 struct airoha_eth *eth; member
581 struct airoha_eth *eth; member
616 struct airoha_eth *eth; member
671 #define airoha_fe_rr(eth, offset) \ argument
672 airoha_rr((eth)->fe_regs, (offset))
673 #define airoha_fe_wr(eth, offset, val) \ argument
674 airoha_wr((eth)->fe_regs, (offset), (val))
675 #define airoha_fe_rmw(eth, offset, mask, val) \ argument
676 airoha_rmw((eth)->fe_regs, (offset), (mask), (val))
[all …]
/linux/tools/testing/selftests/bpf/progs/
H A Dxdp_hw_metadata.c35 struct ethhdr *eth; in rx() local
40 eth = data; in rx()
42 if (eth + 1 < data_end && (eth->h_proto == bpf_htons(ETH_P_8021AD) || in rx()
43 eth->h_proto == bpf_htons(ETH_P_8021Q))) in rx()
44 eth = (void *)eth + sizeof(struct vlan_hdr); in rx()
46 if (eth + 1 < data_end && eth->h_proto == bpf_htons(ETH_P_8021Q)) in rx()
47 eth = (void *)eth + sizeof(struct vlan_hdr); in rx()
49 if (eth + 1 < data_end) { in rx()
50 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in rx()
51 iph = (void *)(eth + 1); in rx()
[all …]
H A Dtest_tc_change_tail_pmtu.c41 struct ethhdr *eth; in change_tail_icmp() local
53 eth = data; in change_tail_icmp()
54 if ((void *)(eth + 1) > data_end) in change_tail_icmp()
56 if (eth->h_proto != bpf_htons(ETH_P_IP)) in change_tail_icmp()
59 ip = (void *)(eth + 1); in change_tail_icmp()
73 __builtin_memcpy(smac, eth->h_source, ETH_ALEN); in change_tail_icmp()
74 __builtin_memcpy(dmac, eth->h_dest, ETH_ALEN); in change_tail_icmp()
95 eth = data; in change_tail_icmp()
96 ip = (void *)(eth + 1); in change_tail_icmp()
103 __builtin_memcpy(eth->h_dest, smac, ETH_ALEN); in change_tail_icmp()
[all …]
H A Dxdping_kern.c
H A Dxdp_metadata.c42 struct ethhdr *eth = NULL; in rx()
51 eth = data; in rx()
52 if (eth + 1 < data_end) { in rx()
53 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in rx()
54 iph = (void *)(eth + 1); in rx()
58 if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in rx()
59 ip6h = (void *)(eth + 1); in rx()
35 struct ethhdr *eth = NULL; rx() local
H A Dxdp_redirect_multi_kern.c51 struct ethhdr *eth = data; in xdp_redirect_map_multi_prog()
57 nh_off = sizeof(*eth); in xdp_redirect_map_multi_prog()
61 h_proto = bpf_htons(eth->h_proto); in xdp_redirect_map_multi_prog()
96 struct ethhdr *eth = data;
100 nh_off = sizeof(*eth);
106 __builtin_memcpy(eth->h_source, mac, ETH_ALEN);
43 struct ethhdr *eth = data; xdp_redirect_map_multi_prog() local
79 struct ethhdr *eth = data; xdp_devmap_prog() local
H A Dtest_pkt_access.c107 struct ethhdr *eth = (struct ethhdr *)(data); in test_pkt_access() local
112 if (eth + 1 > data_end) in test_pkt_access()
115 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in test_pkt_access()
116 struct iphdr *iph = (struct iphdr *)(eth + 1); in test_pkt_access()
123 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in test_pkt_access()
124 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in test_pkt_access()
/linux/tools/testing/selftests/net/lib/
H A Dxdp_native.bpf.c75 struct ethhdr *eth; in filter_udphdr() local
78 err = bpf_xdp_pull_data(ctx, sizeof(*eth)); in filter_udphdr()
83 data = eth = (void *)(long)ctx->data; in filter_udphdr()
85 if (data + sizeof(*eth) > data_end) in filter_udphdr()
88 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in filter_udphdr()
91 err = bpf_xdp_pull_data(ctx, sizeof(*eth) + sizeof(*iph) + in filter_udphdr()
99 iph = data + sizeof(*eth); in filter_udphdr()
105 udph = data + sizeof(*iph) + sizeof(*eth); in filter_udphdr()
106 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in filter_udphdr()
109 err = bpf_xdp_pull_data(ctx, sizeof(*eth) + sizeof(*ipv6h) + in filter_udphdr()
[all …]
/linux/net/ethernet/
H A Deth.c83 struct ethhdr *eth = skb_push(skb, ETH_HLEN); in eth_header() local
86 eth->h_proto = htons(type); in eth_header()
88 eth->h_proto = htons(len); in eth_header()
96 memcpy(eth->h_source, saddr, ETH_ALEN); in eth_header()
99 memcpy(eth->h_dest, daddr, ETH_ALEN); in eth_header()
108 eth_zero_addr(eth->h_dest); in eth_header()
128 const struct ethhdr *eth = (const struct ethhdr *)data; in eth_get_headlen() local
132 if (unlikely(len < sizeof(*eth))) in eth_get_headlen()
137 eth->h_proto, sizeof(*eth), in eth_get_headlen()
139 return max_t(u32, keys.control.thoff, sizeof(*eth)); in eth_get_headlen()
[all …]
/linux/drivers/infiniband/hw/mlx4/
H A Dah.c93 memcpy(ah->av.eth.mac, ah_attr->roce.dmac, ETH_ALEN); in create_iboe_ah()
94 eth_zero_addr(ah->av.eth.s_mac); in create_iboe_ah()
103 &ah->av.eth.s_mac[0]); in create_iboe_ah()
110 ah->av.eth.gid_index = ret; in create_iboe_ah()
113 ah->av.eth.gid_index = ah_attr->grh.sgid_index; in create_iboe_ah()
118 ah->av.eth.port_pd = cpu_to_be32(to_mpd(ib_ah->pd)->pdn | in create_iboe_ah()
120 ah->av.eth.vlan = cpu_to_be16(vlan_tag); in create_iboe_ah()
121 ah->av.eth.hop_limit = grh->hop_limit; in create_iboe_ah()
123 ah->av.eth.stat_rate = rdma_ah_get_static_rate(ah_attr) + in create_iboe_ah()
125 while (ah->av.eth.stat_rate > IB_RATE_2_5_GBPS + MLX4_STAT_RATE_OFFSET && in create_iboe_ah()
[all …]
/linux/tools/testing/selftests/drivers/net/
H A Dring_reconfig.py36 chans = cfg.eth.channels_get(ehdr)
50 defer(cfg.eth.channels_set, ehdr | restore)
54 cfg.eth.channels_set(ehdr | config)
55 get = cfg.eth.channels_get(ehdr)
91 chans = cfg.eth.channels_get(ehdr)
110 cfg.eth.channels_set(ehdr | config)
111 defer(cfg.eth.channels_set, ehdr | restore)
120 rings = cfg.eth.rings_get(ehdr)
132 defer(cfg.eth.rings_set, ehdr | restore)
142 cfg.eth.rings_set({'header':{'dev-index': cfg.ifindex},
[all …]
/linux/samples/bpf/
H A Dparse_simple.c30 struct eth_hdr *eth = data; in handle_ingress() local
31 struct iphdr *iph = data + sizeof(*eth); in handle_ingress()
32 struct udphdr *udp = data + sizeof(*eth) + sizeof(*iph); in handle_ingress()
36 if (data + sizeof(*eth) + sizeof(*iph) + sizeof(*udp) > data_end) in handle_ingress()
39 if (eth->h_proto != htons(ETH_P_IP)) in handle_ingress()
/linux/drivers/net/wireless/nxp/nxpwifi/
H A Dsta_rx.c26 struct ethhdr *eth; in nxpwifi_discard_gratuitous_arp() local
30 eth = (struct ethhdr *)skb->data; in nxpwifi_discard_gratuitous_arp()
31 switch (ntohs(eth->h_proto)) { in nxpwifi_discard_gratuitous_arp()
70 struct ethhdr *eth; in nxpwifi_process_rx_packet() local
102 eth = (struct ethhdr *) in nxpwifi_process_rx_packet()
110 memcpy(eth->h_source, rx_pkt_hdr->eth803_hdr.h_source, in nxpwifi_process_rx_packet()
111 sizeof(eth->h_source)); in nxpwifi_process_rx_packet()
112 memcpy(eth->h_dest, rx_pkt_hdr->eth803_hdr.h_dest, in nxpwifi_process_rx_packet()
113 sizeof(eth->h_dest)); in nxpwifi_process_rx_packet()
119 hdr_chop = (u8 *)eth - (u8 *)local_rx_pd; in nxpwifi_process_rx_packet()
/linux/arch/mips/cavium-octeon/
H A Docteon-platform.c483 static void __init octeon_fdt_set_phy(int eth, int phy_addr) in octeon_fdt_set_phy() argument
495 phy_handle = fdt_getprop(initial_boot_params, eth, "phy-handle", NULL); in octeon_fdt_set_phy()
502 alt_phy_handle = fdt_getprop(initial_boot_params, eth, "cavium,alt-phy-handle", NULL); in octeon_fdt_set_phy()
513 fdt_nop_property(initial_boot_params, eth, "phy-handle"); in octeon_fdt_set_phy()
515 fdt_nop_property(initial_boot_params, eth, "cavium,alt-phy-handle"); in octeon_fdt_set_phy()
529 phy_prop = fdt_get_property(initial_boot_params, eth, "phy-handle", NULL); in octeon_fdt_set_phy()
532 fdt_nop_property(initial_boot_params, eth, "phy-handle"); in octeon_fdt_set_phy()
533 alt_prop = fdt_get_property_w(initial_boot_params, eth, "cavium,alt-phy-handle", NULL); in octeon_fdt_set_phy()
610 static void __init _octeon_rx_tx_delay(int eth, int rx_delay, int tx_delay) in _octeon_rx_tx_delay() argument
612 fdt_setprop_inplace_cell(initial_boot_params, eth, "rx-delay", in _octeon_rx_tx_delay()
[all …]
/linux/drivers/net/wireless/marvell/mwifiex/
H A Dsta_rx.c27 struct ethhdr *eth; in mwifiex_discard_gratuitous_arp() local
31 eth = (struct ethhdr *)skb->data; in mwifiex_discard_gratuitous_arp()
32 switch (ntohs(eth->h_proto)) { in mwifiex_discard_gratuitous_arp()
78 struct ethhdr *eth; in mwifiex_process_rx_packet() local
115 eth = (struct ethhdr *) in mwifiex_process_rx_packet()
123 memcpy(eth->h_source, rx_pkt_hdr->eth803_hdr.h_source, in mwifiex_process_rx_packet()
124 sizeof(eth->h_source)); in mwifiex_process_rx_packet()
125 memcpy(eth->h_dest, rx_pkt_hdr->eth803_hdr.h_dest, in mwifiex_process_rx_packet()
126 sizeof(eth->h_dest)); in mwifiex_process_rx_packet()
130 hdr_chop = (u8 *) eth - (u8 *) local_rx_pd; in mwifiex_process_rx_packet()
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dflow_dissector.c19 struct ethhdr eth; member
25 struct ethhdr eth; member
32 struct ethhdr eth; member
40 struct ethhdr eth; member
46 struct ethhdr eth; member
58 struct ethhdr eth; member
73 struct ethhdr eth; member
102 .eth.h_proto = __bpf_constant_htons(ETH_P_IP),
124 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6),
145 .eth.h_proto = __bpf_constant_htons(ETH_P_8021Q),
[all …]
/linux/drivers/infiniband/hw/ocrdma/
H A Docrdma_ah.c78 struct ocrdma_eth_vlan eth; in set_av_attr() local
90 memset(&eth, 0, sizeof(eth)); in set_av_attr()
108 eth.eth_type = cpu_to_be16(0x8100); in set_av_attr()
109 eth.roce_eth_type = cpu_to_be16(proto_num); in set_av_attr()
111 eth.vlan_tag = cpu_to_be16(vlan_tag); in set_av_attr()
115 eth.eth_type = cpu_to_be16(proto_num); in set_av_attr()
119 memcpy(&eth.smac[0], &dev->nic_info.mac_addr[0], ETH_ALEN); in set_av_attr()
120 status = ocrdma_resolve_dmac(dev, attr, &eth.dmac[0]); in set_av_attr()
126 memcpy(&ah->av->eth_hdr, &eth, eth_sz); in set_av_attr()
/linux/net/openvswitch/
H A Dflow.c484 key->eth.vlan.tci = 0; in clear_vlan()
485 key->eth.vlan.tpid = 0; in clear_vlan()
486 key->eth.cvlan.tci = 0; in clear_vlan()
487 key->eth.cvlan.tpid = 0; in clear_vlan()
495 key->eth.vlan.tci = htons(skb->vlan_tci) | htons(VLAN_CFI_MASK); in parse_vlan()
496 key->eth.vlan.tpid = skb->vlan_proto; in parse_vlan()
499 res = parse_vlan_tag(skb, &key->eth.vlan, true); in parse_vlan()
505 res = parse_vlan_tag(skb, &key->eth.cvlan, false); in parse_vlan()
684 if (key->eth.type == htons(ETH_P_IP)) { in key_extract_l3l4()
759 } else if (key->eth.type == htons(ETH_P_ARP) || in key_extract_l3l4()
[all …]
/linux/tools/testing/selftests/net/
H A Dnat6to4.bpf.c54 const struct ethhdr * const eth = data; // used iff is_ethernet in sched_cls_ingress6_nat_6_prog() local
55 const struct ipv6hdr * const ip6 = (void *)(eth + 1); in sched_cls_ingress6_nat_6_prog()
70 if (eth->h_proto != bpf_htons(ETH_P_IPV6)) in sched_cls_ingress6_nat_6_prog()
91 eth2 = *eth; // Copy over the ethernet header (src/dst mac) in sched_cls_ingress6_nat_6_prog()
155 const struct ethhdr *const eth = data; // used iff is_ethernet in sched_cls_egress4_snat4_prog() local
156 const struct iphdr *const ip4 = (void *)(eth + 1); in sched_cls_egress4_snat4_prog()
167 if (eth->h_proto != bpf_htons(ETH_P_IP)) in sched_cls_egress4_snat4_prog()
226 eth2 = *eth; // Copy over the ethernet header (src/dst mac) in sched_cls_egress4_snat4_prog()

12345678910>>...14