Skip to content
  • Vincenzo Maffione's avatar
    4875bf14
    net: netmap: improve netmap_receive_iov() · 4875bf14
    Vincenzo Maffione authored
    
    
    Changes:
      - Save CPU cycles by computing the return value while scanning the
        input iovec, rather than calling iov_size() at the end.
      - Remove check for s->tx != NULL, because it cannot happen.
      - Cache ring->tail in a local variable and use it to check for
        space in the TX ring. The use of nm_ring_empty() was invalid,
        because nobody is updating ring->cur and ring->head at that point.
      - In case we run out of netmap slots in the middle of a packet,
        move the wake-up point by advancing ring->cur, but do not
        expose the incomplete packet (i.e., by updating also ring->head).
    
    Signed-off-by: default avatarVincenzo Maffione <v.maffione@gmail.com>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
    4875bf14
    net: netmap: improve netmap_receive_iov()
    Vincenzo Maffione authored
    
    
    Changes:
      - Save CPU cycles by computing the return value while scanning the
        input iovec, rather than calling iov_size() at the end.
      - Remove check for s->tx != NULL, because it cannot happen.
      - Cache ring->tail in a local variable and use it to check for
        space in the TX ring. The use of nm_ring_empty() was invalid,
        because nobody is updating ring->cur and ring->head at that point.
      - In case we run out of netmap slots in the middle of a packet,
        move the wake-up point by advancing ring->cur, but do not
        expose the incomplete packet (i.e., by updating also ring->head).
    
    Signed-off-by: default avatarVincenzo Maffione <v.maffione@gmail.com>
    Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Loading