Commit b9aad5d6 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'stefanha/net-next' into staging



# By Vincenzo Maffione (2) and others
# Via Stefan Hajnoczi
* stefanha/net-next:
  net: Update netdev peer on link change
  virtio-net: don't update mac_table in error state
  MAINTAINERS: Add netmap maintainers
  net: Adding netmap network backend

Message-id: 1386594692-21278-1-git-send-email-stefanha@redhat.com
Signed-off-by: default avatarAnthony Liguori <aliguori@amazon.com>
parents 1ead3ed5 02d38fcb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -710,6 +710,14 @@ S: Maintained
F: net/
T: git git://github.com/stefanha/qemu.git net

Netmap network backend
M: Luigi Rizzo <rizzo@iet.unipi.it>
M: Giuseppe Lettieri <g.lettieri@iet.unipi.it>
M: Vincenzo Maffione <v.maffione@gmail.com>
W: http://info.iet.unipi.it/~luigi/netmap/
S: Maintained
F: net/netmap.c

Network Block Device (NBD)
M: Paolo Bonzini <pbonzini@redhat.com>
S: Odd Fixes
+32 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ curl=""
curses=""
docs=""
fdt=""
netmap="no"
pixman=""
sdl=""
virtfs=""
@@ -488,6 +489,7 @@ FreeBSD)
  audio_possible_drivers="oss sdl esd pa"
  # needed for kinfo_getvmmap(3) in libutil.h
  LIBS="-lutil $LIBS"
  netmap=""  # enable netmap autodetect
;;
DragonFly)
  bsd="yes"
@@ -797,6 +799,10 @@ for opt do
  ;;
  --enable-vde) vde="yes"
  ;;
  --disable-netmap) netmap="no"
  ;;
  --enable-netmap) netmap="yes"
  ;;
  --disable-xen) xen="no"
  ;;
  --enable-xen) xen="yes"
@@ -1182,6 +1188,8 @@ echo " --disable-uuid disable uuid support"
echo "  --enable-uuid            enable uuid support"
echo "  --disable-vde            disable support for vde network"
echo "  --enable-vde             enable support for vde network"
echo "  --disable-netmap         disable support for netmap network"
echo "  --enable-netmap          enable support for netmap network"
echo "  --disable-linux-aio      disable Linux AIO support"
echo "  --enable-linux-aio       enable Linux AIO support"
echo "  --disable-cap-ng         disable libcap-ng support"
@@ -2094,6 +2102,26 @@ EOF
  fi
fi

##########################################
# netmap headers probe
if test "$netmap" != "no" ; then
  cat > $TMPC << EOF
#include <inttypes.h>
#include <net/if.h>
#include <net/netmap.h>
#include <net/netmap_user.h>
int main(void) { return 0; }
EOF
  if compile_prog "" "" ; then
    netmap=yes
  else
    if test "$netmap" = "yes" ; then
      feature_not_found "netmap"
    fi
    netmap=no
  fi
fi

##########################################
# libcap-ng library probe
if test "$cap_ng" != "no" ; then
@@ -3751,6 +3779,7 @@ echo "uname -r $uname_release"
echo "GUEST_BASE        $guest_base"
echo "PIE               $pie"
echo "vde support       $vde"
echo "netmap support    $netmap"
echo "Linux AIO support $linux_aio"
echo "ATTR/XATTR support $attr"
echo "Install blobs     $blobs"
@@ -3888,6 +3917,9 @@ fi
if test "$vde" = "yes" ; then
  echo "CONFIG_VDE=y" >> $config_host_mak
fi
if test "$netmap" = "yes" ; then
  echo "CONFIG_NETMAP=y" >> $config_host_mak
fi
if test "$cap_ng" = "yes" ; then
  echo "CONFIG_LIBCAP=y" >> $config_host_mak
fi
+2 −2
Original line number Diff line number Diff line
@@ -1190,7 +1190,7 @@ ETEXI
    {
        .name       = "host_net_add",
        .args_type  = "device:s,opts:s?",
        .params     = "tap|user|socket|vde|dump [options]",
        .params     = "tap|user|socket|vde|netmap|dump [options]",
        .help       = "add host VLAN client",
        .mhandler.cmd = net_host_device_add,
    },
@@ -1218,7 +1218,7 @@ ETEXI
    {
        .name       = "netdev_add",
        .args_type  = "netdev:O",
        .params     = "[user|tap|socket|hubport],id=str[,prop=value][,...]",
        .params     = "[user|tap|socket|hubport|netmap],id=str[,prop=value][,...]",
        .help       = "add host network device",
        .mhandler.cmd = hmp_netdev_add,
    },
+20 −15
Original line number Diff line number Diff line
@@ -610,11 +610,11 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
        return VIRTIO_NET_ERR;
    }

    n->mac_table.in_use = 0;
    n->mac_table.first_multi = 0;
    n->mac_table.uni_overflow = 0;
    n->mac_table.multi_overflow = 0;
    memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN);
    int in_use = 0;
    int first_multi = 0;
    uint8_t uni_overflow = 0;
    uint8_t multi_overflow = 0;
    uint8_t *macs = g_malloc0(MAC_TABLE_ENTRIES * ETH_ALEN);

    s = iov_to_buf(iov, iov_cnt, 0, &mac_data.entries,
                   sizeof(mac_data.entries));
@@ -629,19 +629,19 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
    }

    if (mac_data.entries <= MAC_TABLE_ENTRIES) {
        s = iov_to_buf(iov, iov_cnt, 0, n->mac_table.macs,
        s = iov_to_buf(iov, iov_cnt, 0, macs,
                       mac_data.entries * ETH_ALEN);
        if (s != mac_data.entries * ETH_ALEN) {
            goto error;
        }
        n->mac_table.in_use += mac_data.entries;
        in_use += mac_data.entries;
    } else {
        n->mac_table.uni_overflow = 1;
        uni_overflow = 1;
    }

    iov_discard_front(&iov, &iov_cnt, mac_data.entries * ETH_ALEN);

    n->mac_table.first_multi = n->mac_table.in_use;
    first_multi = in_use;

    s = iov_to_buf(iov, iov_cnt, 0, &mac_data.entries,
                   sizeof(mac_data.entries));
@@ -656,24 +656,29 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
        goto error;
    }

    if (n->mac_table.in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
        s = iov_to_buf(iov, iov_cnt, 0,
                       &n->mac_table.macs[n->mac_table.in_use * ETH_ALEN],
    if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
        s = iov_to_buf(iov, iov_cnt, 0, &macs[in_use * ETH_ALEN],
                       mac_data.entries * ETH_ALEN);
        if (s != mac_data.entries * ETH_ALEN) {
            goto error;
        }
        n->mac_table.in_use += mac_data.entries;
        in_use += mac_data.entries;
    } else {
        n->mac_table.multi_overflow = 1;
        multi_overflow = 1;
    }

    n->mac_table.in_use = in_use;
    n->mac_table.first_multi = first_multi;
    n->mac_table.uni_overflow = uni_overflow;
    n->mac_table.multi_overflow = multi_overflow;
    memcpy(n->mac_table.macs, macs, MAC_TABLE_ENTRIES * ETH_ALEN);
    g_free(macs);
    rxfilter_notify(nc);

    return VIRTIO_NET_OK;

error:
    rxfilter_notify(nc);
    g_free(macs);
    return VIRTIO_NET_ERR;
}

+1 −0
Original line number Diff line number Diff line
@@ -11,3 +11,4 @@ common-obj-$(CONFIG_AIX) += tap-aix.o
common-obj-$(CONFIG_HAIKU) += tap-haiku.o
common-obj-$(CONFIG_SLIRP) += slirp.o
common-obj-$(CONFIG_VDE) += vde.o
common-obj-$(CONFIG_NETMAP) += netmap.o
Loading