1. 28 Oct, 2018 1 commit
    • Philippe Gerum's avatar
      net/stack: export services to switch interface up/down · 05cc9c99
      Philippe Gerum authored
      We may want to force a rtnet interface up, and more likely down before
      unloading a driver module.
      Export the ioctl() code which handles the IOC_RT_IFUP/IFDOWN core
      ioctl requests as standalone routines. The locking model remains
      unchanged, with ioctl() requests and direct service calls serializing
      on the per-device lock.
      Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
  2. 25 Aug, 2018 1 commit
  3. 03 Jul, 2018 1 commit
    • Philippe Gerum's avatar
      net: create sysfs nodes for net devices · 20818d45
      Philippe Gerum authored
      Each rtnet device registered with the stack is represented by a node
      into /sys/devices/virtual/rtnet/.
      Setting the address of the real device probed by the kernel into the
      rtnet_device.sysbind field before calling rt_register_rtnetdev(),
      causes the "adapter" symlink to be installed in the newly created
      attribute directory, pointing at that device.
      static int probe_handler(struct pci_dev *pdev, const struct pci_device_id *ent)
      	rtdev->sysbind = &pdev->dev;
      	ret = rt_register_rtnetdev(rtdev);
      $ ls -l /sys/devices/virtual/rtnet/
      total 0
      drwxr-xr-x    2 root     root             0 Mar 30 12:50 enp1s0
      drwxr-xr-x    2 root     root             0 Mar 30 12:50 rtlo
      $ ls -l /sys/devices/virtual/rtnet/enp1s0/
      total 0
      lrwxrwxrwx    1 root     root             0 Mar 30 12:51 adapter -> ../../../pci0000:00/0000:00:13.0/0000:01:00.0
      lrwxrwxrwx    1 root     root             0 Mar 30 12:51 subsystem -> ../../../../class/rtnet
      -rw-r--r--    1 root     root          4096 Mar 30 12:50 uevent
  4. 08 Mar, 2018 4 commits
  5. 04 Nov, 2015 1 commit
  6. 21 Oct, 2015 1 commit
    • Gilles Chanteperdrix's avatar
      rtnet: transfer skb ownership when sending · 91b33022
      Gilles Chanteperdrix authored
      to the device pool, to avoid crashes when a socket is destroyed while it
      has buffers queued in the device transmit ring. This is a consequence of
      commit 45474093, buffers from the socket
      pool no longer prevent the socket from being destroyed.
      At this chance, rename the device pool "rx_pool" to "dev_pool", as it is
      now also used for transmission.
  7. 15 Oct, 2015 1 commit
  8. 01 Oct, 2015 3 commits
    • Gilles Chanteperdrix's avatar
      rtnet: adapt to RTDM task management changes · bd971c3a
      Gilles Chanteperdrix authored
      Replace rtcfg timer tasks with timers, polled in the rtcfg rx task.
      Remove useless calls to rtdm_task_join_nrt.
    • Gilles Chanteperdrix's avatar
      rtnet/stack_mgr: rework packet type locking · 32f810a9
      Gilles Chanteperdrix authored
      Use module count to lock packet types rather than a reference count with
      a loop blocking module unload.
    • Gilles Chanteperdrix's avatar
      rtnet/socket: rework reference counting · 45474093
      Gilles Chanteperdrix authored
      With socket pools allocations locking sockets, when a received packet
      switches from the device pool to the socket pool and is queued in a
      socket incoming queue, the socket is locked preventing its destruction
      until all packets have been received. This is probably the reason for
      this bug report:
      Furthermore, when looking at the code in af_packet.c when a packet has
      been acquired by the socket pool, but is not yet queued, the socket is
      locked, so, the socket can not disappear and the packet leak, so the
      locking is redundant. The case of ip_input.c is a bit different as there
      is a small window where a packet is in flight and a socket can be
      closed, but this can been fixed.
      What can happen however, is that a module can be removed in the middle
      of the packet reception, causing all sorts of trouble.
      So, this commit:
      - suppresses the locking of sockets by the socket pool allocation;
      - gets sockets creation to lock the module in which they are created;
      - fixes packet delivery in ip_input.c to lock the destination socket as
      long as the packet has not been delivered.
  9. 16 Nov, 2014 11 commits