当前位置:首页>Linux>Linux网络设备详解

Linux网络设备详解

  • 2026-07-02 16:33:15
Linux网络设备详解

一、前言

1.1 业务场景

网络设备驱动是 Linux 系统中最核心的驱动之一,负责管理网卡等网络硬件设备,是实现网络通信的基础。无论是服务器、嵌入式设备还是物联网网关,网络驱动都是不可或缺的组件。

1.2 应用价值

  • 网络通信:实现设备间的数据传输
  • 协议支持:支持 TCP/IP、UDP、ICMP 等协议
  • 性能优化:通过 NAPI、TSO、GRO 等技术提升吞吐量
  • 虚拟化支持:支持 VLAN、桥接、隧道等功能

1.3 驱动定位

网络设备驱动在系统中的位置:

二、网络设备驱动架构

2.1 四层架构模型

根据架构图,网络设备驱动分为四个层次:

2.2 各层职责详解

层次
名称
职责
核心函数/结构
第4层
网络协议接口层
协议栈与设备的接口
dev_queue_xmit()
netif_receive_skb()
第3层
网络设备接口层
设备抽象与管理
struct net_device
第2层
设备驱动功能层
驱动实现与调度
ndo_start_xmit
, NAPI
第1层
网络设备与媒介层
硬件交互
DMA、IRQ、PHY

2.3 数据包发送流程(TX Path)

2.4 数据包接收流程(RX Path)


三、核心结构体详解

3.1 struct net_device - 网络设备核心抽象

struct net_device 是网络设备驱动的核心数据结构,代表一个网络接口:

structnet_device {char                name[IFNAMSIZ];      // 设备名称(如 eth0)unsignedint        flags;               // 设备标志(IFF_UP等)unsignedint        priv_flags;          // 私有标志unsigned short      type;                // 设备类型(ARPHRD_ETHER)unsigned short      hard_header_len;     // 硬件头部长度unsignedint        mtu;                 // 最大传输单元unsignedchar       addr_len;            // MAC地址长度unsignedchar       perm_addr[MAX_ADDR_LEN]; // 永久MAC地址unsignedchar       dev_addr[MAX_ADDR_LEN];   // 当前MAC地址/* 接收队列 */structnetdev_queue __rcu *rx_queue;/* 发送队列 */structnetdev_queue *tx_queue;unsignedint        num_tx_queues;unsignedint        real_num_tx_queues;/* 操作函数集 */conststructnet_device_ops *netdev_ops;conststructethtool_ops *ethtool_ops;conststructheader_ops *header_ops;/* 统计信息 */structrtnl_link_stats64 __percpu *stats64;/* NAPI相关 */structnapi_structnapi;unsignedint        gro_flush_timeout;/* 队列状态 */enumnetdev_queue_state_t state;/* 私有数据 */void                *priv;/* 设备引用计数 */refcount_t          refcnt;/* 设备链表 */structlist_headdev_list;/* 网络命名空间 */structnet          *nd_net;/* 队列控制 */structQdisc        *qdisc;structQdisc        *qdisc_sleeping;/* 硬件特性 */netdev_features_t   features;netdev_features_t   hw_features;netdev_features_t   wanted_features;/* 定时器 */structtimer_listwatchdog_timer;/* MTU变更回调 */int                 (*change_mtu)(struct net_device *, int);/* 设备状态变更回调 */void                (*destructor)(struct net_device *);/* DMA掩码 */    u64                 dma_mask;/* 中断号 */unsignedint        irq;/* 总线私有数据 */structdevicedev;/* 设备索引 */int                 ifindex;/* 网络设备类型 */enum net_device_type dev_type;/* 最大帧长度 */unsignedint        max_mtu;unsignedint        min_mtu;/* VLAN相关 */structnet_device  *master;structlist_headvlans;/* 时间戳 */structhwtstamp_config *tstamp_config;/* 设备统计 */structpcpu_lstats __percpu *lstats;/* 接收缓冲区配置 */unsignedint        rx_queue_len;/* 网络设备组 */unsignedint        group;/* 设备状态 */unsignedlong       state;/* 设备唤醒标志 */bool                needs_free_netdev;/* 设备注册标志 */bool                registered;/* 设备关闭标志 */bool                shutdown;};

关键字段解析:

字段
作用
说明
name
设备名称
eth0、wlan0 等
flags
设备标志
IFF_UP(启动)、IFF_BROADCAST(广播)等
mtu
最大传输单元
以太网默认 1500 字节
dev_addr
MAC地址
6字节硬件地址
netdev_ops
操作函数集
设备的核心操作接口
napi
NAPI结构体
用于中断合并和轮询
features
设备特性
TSO、GRO、VLAN等功能支持
priv
私有数据
驱动私有结构体指针

3.2 struct net_device_ops - 设备操作函数集

structnet_device_ops {int     (*ndo_init)(struct net_device *dev);void    (*ndo_uninit)(struct net_device *dev);netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev);int     (*ndo_open)(struct net_device *dev);int     (*ndo_stop)(struct net_device *dev);int     (*ndo_change_mtu)(struct net_device *dev, int new_mtu);int     (*ndo_set_mac_address)(struct net_device *dev, void *addr);int     (*ndo_validate_addr)(struct net_device *dev);int     (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);netdev_features_t (*ndo_features_check)(struct sk_buff *skb,                                           struct net_device *dev,netdev_features_t features);void    (*ndo_tx_timeout)(struct net_device *dev, unsignedint txqueue);void    (*ndo_get_stats64)(struct net_device *dev,                               struct rtnl_link_stats64 *stats);int     (*ndo_set_features)(struct net_device *dev, netdev_features_t features);int     (*ndo_fix_features)(struct net_device *dev);int     (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8 *mac);int     (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan,                               u8 qos, __be16 vlan_proto);int     (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool enable);int     (*ndo_get_vf_config)(struct net_device *dev, int vf,                                 struct ifla_vf_info *info);int     (*ndo_set_vf_rate)(struct net_device *dev, int vf, int min_tx_rate,int max_tx_rate);int     (*ndo_bpf)(struct net_device *dev, struct netdev_bpf *bpf);int     (*ndo_change_carrier)(struct net_device *dev, bool new_carrier);int     (*ndo_neigh_setup)(struct net_device *dev, struct neigh_parms *);void    (*ndo_netpoll_setup)(struct net_device *dev, struct netpoll_info *ni);void    (*ndo_netpoll_cleanup)(struct net_device *dev);int     (*ndo_direct_xmit)(struct net_device *dev, struct sk_buff *skb);};

核心函数说明:

函数
作用
调用时机
ndo_init
设备初始化
设备注册时
ndo_open
打开设备
ifup 时
ndo_stop
关闭设备
ifdown 时
ndo_start_xmit
发送数据包
协议栈发送数据时
ndo_tx_timeout
发送超时处理
发送队列超时时
ndo_get_stats64
获取统计信息
读取 /proc/net/dev 时
ndo_change_mtu
修改 MTU
ifconfig eth0 mtu xxx
ndo_set_mac_address
设置 MAC 地址
ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

3.3 struct napi_struct - NAPI轮询结构

NAPI(New API)是 Linux 2.6 引入的网络中断处理机制,用于减少中断频率,提高网络吞吐量:

structnapi_struct {/* 轮询函数 */int     (*poll)(struct napi_struct *, int);/* 设备上下文 */structnet_device *dev;/* 软中断处理 */structlist_headdev_list;structlist_headpoll_list;/* 权重 */unsignedint        weight;/* 预算 */unsignedint        budget;/* 状态标志 */unsignedint        napi_state;/* 唤醒标志 */unsignedint        wakeup_pending;/* 队列状态 */structsk_buff_headrx_queue;/* 工作队列 */structwork_structwork;/* 定时器 */structtimer_listtimer;/* 统计信息 */unsignedlong       rx_packets;unsignedlong       rx_bytes;/* 延迟处理 */unsignedint        gro_count;/* 时间戳 */unsignedlong       poll_start;};

NAPI 工作原理:

3.4 struct sk_buff - 套接字缓冲区

struct sk_buff 是网络数据包在内核中的表示形式:

structsk_buff {/* 缓冲区头部指针 */union {structsk_buff *next;structrcu_headrcu;    };/* 数据指针 */unsignedchar       *head;          // 缓冲区起始unsignedchar       *data;          // 当前数据起始unsignedchar       *tail;          // 当前数据末尾unsignedchar       *end;           // 缓冲区末尾/* 长度信息 */unsignedint        len;            // 数据长度unsignedint        data_len;       // 数据部分长度    __u16               mac_len;        // MAC头部长度    __u16               hdr_len;        // 协议头部长度/* 协议信息 */    __be16              protocol;       // 协议类型/* 设备信息 */structnet_device   *dev;// 所属设备/* 网络命名空间 */structnet          *sk_net;/* 时间戳 */skb_mstamp_t        tstamp;/* 校验和 */    __wsum              csum;    __u32               csum_start;    __u32               csum_offset;/* 标志位 */unsignedint        flags;/* 队列信息 */structlist_headlist;structsk_buff_head *list_head;/* 引用计数 */refcount_t          users;/* 内存分配器 */structkmem_cache   *destructor_cache;/* 私有数据 */void                (*destructor)(struct sk_buff *skb);/* 网络层头部 */structiphdr        *ip_hdr;structtcphdr       *tcp_hdr;/* 传输特性 */netdev_features_t   features;netdev_features_t   skb_features;/* GRO相关 */structsk_buff      *next_frag;structsk_buff      *frag_list;/* 分片信息 */structskb_shared_info *shinfo;/* 优先级 */    __u32               priority;/* 流量控制 */structQdisc        *qdisc;/* 路由信息 */structdst_entry    *dst;/* 安全信息 */structsec_path     *sp;/* 加密信息 */structcrypto_skb_info *crypto;};

四、网络设备驱动核心API

4.1 设备注册与注销

// 分配网络设备struct net_device *alloc_netdev(int sizeof_priv, constchar *name,void (*setup)(struct net_device *));// 注册网络设备intregister_netdev(struct net_device *dev);// 注销网络设备voidunregister_netdev(struct net_device *dev);// 释放网络设备voidfree_netdev(struct net_device *dev);

使用示例:

staticvoidmynet_setup(struct net_device *dev){    ether_setup(dev);  // 初始化以太网设备    dev->netdev_ops = &mynet_ops;    dev->ethtool_ops = &mynet_ethtool_ops;    dev->flags |= IFF_NOARP;}staticint __init mynet_init(void){structnet_device *dev;    dev = alloc_netdev(sizeof(struct mynet_priv), "mynet%d", mynet_setup);if (!dev)return -ENOMEM;return register_netdev(dev);}staticvoid __exit mynet_exit(void){    unregister_netdev(dev);    free_netdev(dev);}

4.2 NAPI 相关函数

// 初始化NAPIvoidnapi_init(struct napi_struct *napi, int (*poll)(struct napi_struct *, int));// 调度NAPIvoidnapi_schedule(struct napi_struct *napi);// 启用NAPIvoidnapi_enable(struct napi_struct *napi);// 禁用NAPIvoidnapi_disable(struct napi_struct *napi);// 完成NAPI轮询voidnapi_complete(struct napi_struct *napi);// 完成NAPI轮询(扩展版)voidnapi_complete_done(struct napi_struct *napi, int work_done);

4.3 数据包发送与接收

// 发送数据包到网络层intdev_queue_xmit(struct sk_buff *skb);// 接收数据包intnetif_receive_skb(struct sk_buff *skb);// 批量接收数据包intnetif_receive_skb_list(struct list_head *head);// 通知发送完成voiddev_kfree_skb(struct sk_buff *skb);// 分配skbstruct sk_buff *dev_alloc_skb(unsignedint length);// 克隆skbstruct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask);

4.4 设备状态控制

// 设置设备标志voidset_bit(int nr, volatileunsignedlong *addr);voidclear_bit(int nr, volatileunsignedlong *addr);// 检查设备是否启动staticinlineboolnetif_running(const struct net_device *dev);// 检查设备是否可发送staticinlineboolnetif_xmit_stopped(const struct net_device *dev);// 唤醒发送队列voidnetif_wake_queue(struct net_device *dev);// 停止发送队列voidnetif_stop_queue(struct net_device *dev);// 更新链路状态voidnetif_carrier_on(struct net_device *dev);voidnetif_carrier_off(struct net_device *dev);// 更新设备统计voiddev_lstats_add(struct net_device *dev, unsignedint len);

五、网络设备驱动开发实战

5.1 驱动框架搭建

#include<linux/netdevice.h>#include<linux/etherdevice.h>#include<linux/module.h>#include<linux/platform_device.h>/* 驱动私有数据 */structmynet_priv {structnet_device *dev;structnapi_structnapi;structsk_buff_headrx_queue;spinlock_t lock;/* 硬件相关 */void __iomem *regs;int irq;};/* NAPI轮询函数 */staticintmynet_poll(struct napi_struct *napi, int budget){structmynet_priv *priv = container_of(napistructmynet_privnapi);structsk_buff *skb;int work_done = 0;while (work_done < budget) {/* 检查是否有接收的数据 */if (skb_queue_empty(&priv->rx_queue))break;        skb = skb_dequeue(&priv->rx_queue);if (!skb)break;/* 传递给协议栈 */        netif_receive_skb(skb);        work_done++;    }/* 如果没有更多数据,重新启用中断 */if (work_done < budget) {        napi_complete(napi);/* 启用硬件中断 */    }return work_done;}/* 发送函数 */staticnetdev_tx_tmynet_start_xmit(struct sk_buff *skb, struct net_device *dev){structmynet_priv *priv = netdev_priv(dev);/* 获取数据 */unsignedchar *data = skb->data;unsignedint len = skb->len;/* 发送数据到硬件 */// ... 硬件操作 .../* 释放skb */    dev_kfree_skb(skb);return NETDEV_TX_OK;}/* 打开设备 */staticintmynet_open(struct net_device *dev){structmynet_priv *priv = netdev_priv(dev);/* 启用NAPI */    napi_enable(&priv->napi);/* 注册中断 */// request_irq(priv->irq, mynet_interrupt, ...);/* 启动硬件 */// ...return0;}/* 关闭设备 */staticintmynet_stop(struct net_device *dev){structmynet_priv *priv = netdev_priv(dev);/* 禁用NAPI */    napi_disable(&priv->napi);/* 释放中断 */// free_irq(priv->irq, priv);/* 停止硬件 */// ...return0;}/* 设备操作函数集 */staticconststructnet_device_opsmynet_netdev_ops = {    .ndo_open               = mynet_open,    .ndo_stop               = mynet_stop,    .ndo_start_xmit         = mynet_start_xmit,    .ndo_validate_addr      = eth_validate_addr,    .ndo_set_mac_address    = eth_mac_addr,};/* 设备初始化 */staticvoidmynet_setup(struct net_device *dev){structmynet_priv *priv = netdev_priv(dev);/* 初始化以太网设备 */    ether_setup(dev);/* 设置操作函数 */    dev->netdev_ops = &mynet_netdev_ops;/* 设置设备特性 */    dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO;/* 初始化NAPI */    napi_init(&priv->napi, mynet_poll);    priv->napi.dev = dev;/* 初始化接收队列 */    skb_queue_head_init(&priv->rx_queue);/* 初始化锁 */    spin_lock_init(&priv->lock);}/* Probe函数 */staticintmynet_probe(struct platform_device *pdev){structmynet_priv *priv;structnet_device *dev;structresource *res;int err;/* 分配网络设备 */    dev = alloc_netdev(sizeof(*priv), "mynet%d", NET_NAME_UNKNOWN, mynet_setup);if (!dev)return -ENOMEM;    priv = netdev_priv(dev);    priv->dev = dev;/* 获取寄存器资源 */    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);    priv->regs = devm_ioremap_resource(&pdev->dev, res);if (IS_ERR(priv->regs)) {        err = PTR_ERR(priv->regs);goto out_free_dev;    }/* 获取中断 */    priv->irq = platform_get_irq(pdev, 0);if (priv->irq < 0) {        err = priv->irq;goto out_free_dev;    }/* 设置私有数据 */    platform_set_drvdata(pdev, priv);/* 注册网络设备 */    err = register_netdev(dev);if (err)goto out_free_dev;return0;out_free_dev:    free_netdev(dev);return err;}/* Remove函数 */staticintmynet_remove(struct platform_device *pdev){structmynet_priv *priv = platform_get_drvdata(pdev);    unregister_netdev(priv->dev);    free_netdev(priv->dev);return0;}/* 设备树匹配 */staticconststructof_device_idmynet_match[] = {    { .compatible = "vendor,mynet" },    { /* Sentinel */ }};MODULE_DEVICE_TABLE(of, mynet_match);/* 平台驱动 */staticstructplatform_drivermynet_driver = {    .probe      = mynet_probe,    .remove     = mynet_remove,    .driver     = {        .name   = "mynet",        .of_match_table = mynet_match,    },};module_platform_driver(mynet_driver);MODULE_LICENSE("GPL");MODULE_DESCRIPTION("My Network Driver");MODULE_AUTHOR("WindRunner1");

5.2 中断处理与NAPI集成

/* 中断处理函数 */staticirqreturn_tmynet_interrupt(int irq, void *dev_id){structmynet_priv *priv = dev_id;    u32 status;/* 读取中断状态 */    status = readl(priv->regs + INTERRUPT_STATUS);/* 清除中断 */    writel(status, priv->regs + INTERRUPT_STATUS);/* 处理接收中断 */if (status & RX_INTERRUPT) {/* 读取数据包到skb */structsk_buff *skb = dev_alloc_skb(MAX_PACKET_SIZE);if (skb) {/* 从硬件读取数据 */// memcpy(skb_put(skb, len), rx_buffer, len);/* 设置协议类型 */            skb->protocol = eth_type_trans(skb, priv->dev);/* 加入接收队列 */            spin_lock(&priv->lock);            skb_queue_tail(&priv->rx_queue, skb);            spin_unlock(&priv->lock);/* 调度NAPI */            napi_schedule(&priv->napi);        }    }/* 处理发送完成中断 */if (status & TX_INTERRUPT) {/* 释放发送缓冲区 */// ...    }return IRQ_HANDLED;}

5.3 统计信息收集

staticvoidmynet_get_stats64(struct net_device *dev,                              struct rtnl_link_stats64 *stats){structmynet_priv *priv = netdev_priv(dev);/* 读取硬件统计寄存器 */// stats->rx_packets = readl(priv->regs + RX_PACKETS);// stats->tx_packets = readl(priv->regs + TX_PACKETS);// stats->rx_bytes = readl(priv->regs + RX_BYTES);// stats->tx_bytes = readl(priv->regs + TX_BYTES);}

六、实战排坑指南

6.1 常见编译错误

错误信息
原因
解决方案
netdev_priv undeclared
缺少头文件
#include <linux/netdevice.h>
struct sk_buff_head undefined
缺少头文件
#include <linux/skbuff.h>
napi_schedule undefined
内核版本差异
使用 napi_schedule_irqoff
NETDEV_TX_OK undeclared
缺少头文件
#include <linux/netdevice.h>

6.2 运行时问题分析

问题一:设备无法注册

# 现象dmesg | grep "mynet"# 显示: mynet: probe failed# 排查步骤1. 检查设备树节点2. 检查资源是否正确获取3. 检查 register_netdev 返回值

问题二:数据包发送失败

# 现象ping 192.168.1.1# 显示: Destination Host Unreachable# 排查步骤1. 检查设备是否启动: ifconfig mynet02. 检查发送队列是否停止: cat /sys/class/net/mynet0/queues/tx-0/state3. 检查硬件是否正常

问题三:接收性能差

# 现象网络吞吐量远低于预期# 优化建议1. 确保启用NAPI2. 调整NAPI预算: echo 64 > /proc/sys/net/core/netdev_budget3. 启用TSO/GRO: ethtool -K mynet0 tso on gro on

6.3 调试技巧

# 查看设备信息ip link show# 查看设备统计cat /proc/net/dev# 查看中断统计cat /proc/interrupts | grep mynet# 查看NAPI状态cat /sys/class/net/mynet0/napi_defer_hard_irqs# 使用ethtool查看设备信息ethtool mynet0# 使用tcpdump抓包tcpdump -i mynet0

七、总结与拓展

7.1 知识点回顾

  1. 四层架构:协议接口层、设备接口层、驱动功能层、硬件层
  2. 核心结构体net_devicenet_device_opsnapi_structsk_buff
  3. 核心流程:发送路径(dev_queue_xmit → ndo_start_xmit)、接收路径(中断 → NAPI → netif_receive_skb
  4. NAPI机制:减少中断频率,提高吞吐量

7.2 拓展学习方向

📚 进阶内容

  1. 高级特性

    • TSO(TCP Segmentation Offload)
    • GRO(Generic Receive Offload)
    • VLAN 处理
    • 流量控制(QoS)
  2. 虚拟化网络

    • VLAN 桥接
    • Open vSwitch
    • SR-IOV
  3. 性能优化

    • 多队列支持
    • RSS(Receive Side Scaling)
    • XDP(eXpress Data Path)

🔧 相关项目

  1. 实现一个简单的虚拟网络驱动
  2. 添加对 TSO/GRO 的支持
  3. 实现 XDP 程序
  4. 开发一个完整的以太网驱动

参考资料

  • Linux 内核源码:drivers/net/
  • Linux 网络子系统文档:Documentation/networking/
  • Linux Device Drivers, 3rd Edition

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 12:23:52 HTTP/2.0 GET : https://f.mffb.com.cn/a/495610.html
  2. 运行时间 : 0.214052s [ 吞吐率:4.67req/s ] 内存消耗:4,760.82kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=97033878db87b2171dafe9c075849bff
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000455s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000577s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.008170s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000321s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000553s ]
  6. SELECT * FROM `set` [ RunTime:0.000263s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000587s ]
  8. SELECT * FROM `article` WHERE `id` = 495610 LIMIT 1 [ RunTime:0.031710s ]
  9. UPDATE `article` SET `lasttime` = 1783052632 WHERE `id` = 495610 [ RunTime:0.008265s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.002615s ]
  11. SELECT * FROM `article` WHERE `id` < 495610 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.017002s ]
  12. SELECT * FROM `article` WHERE `id` > 495610 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000546s ]
  13. SELECT * FROM `article` WHERE `id` < 495610 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002021s ]
  14. SELECT * FROM `article` WHERE `id` < 495610 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002923s ]
  15. SELECT * FROM `article` WHERE `id` < 495610 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.043056s ]
0.215620s