1. 25 1月, 2018 7 次提交
    • C
      igb: Allow to remove administratively set MAC on VFs · 177132df
      Corinna Vinschen 提交于
      Before libvirt modifies the MAC address and vlan tag for an SRIOV VF
      for use by a virtual machine (either using vfio device assignment or
      macvtap passthru mode), it saves the current MAC address and vlan tag
      so that it can reset them to their original value when the guest is
      done.  Libvirt can't leave the VF MAC set to the value used by the
      now-defunct guest since it may be started again later using a
      different VF, but it certainly shouldn't just pick any random value,
      either. So it saves the state of everything prior to using the VF, and
      resets it to that.
      
      The igb driver initializes the MAC addresses of all VFs to
      00:00:00:00:00:00, and reports that when asked (via an RTM_GETLINK
      netlink message, also visible in the list of VFs in the output of "ip
      link show"). But when libvirt attempts to restore the MAC address back
      to 00:00:00:00:00:00 (using an RTM_SETLINK netlink message) the kernel
      responds with "Invalid argument".
      
      Forbidding a reset back to the original value leaves the VF MAC at the
      value set for the now-defunct virtual machine. Especially on a system
      with NetworkManager enabled, this has very bad consequences, since
      NetworkManager forces all interfacess to be IFF_UP all the time - if
      the same virtual machine is restarted using a different VF (or even on
      a different host), there will be multiple interfaces watching for
      traffic with the same MAC address.
      
      To allow libvirt to revert to the original state, we need a way to
      remove the administrative set MAC on a VF, to allow normal host
      operation again, and to reset/overwrite the VF MAC via VF netdev.
      
      This patch implements the outlined scenario by allowing to set the
      VF MAC to 00:00:00:00:00:00 via RTM_SETLINK on the PF.
      igb_ndo_set_vf_mac resets the IGB_VF_FLAG_PF_SET_MAC flag to 0,
      so it's possible to reset the VF MAC back to the original value via
      the VF netdev.
      
      Note: Recent patches to libvirt allow for a workaround if the NIC
      isn't capable of resetting the administrative MAC back to all 0, but
      in theory the NIC should allow resetting the MAC in the first place.
      Signed-off-by: NCorinna Vinschen <vinschen@redhat.com>
      Tested-by: NAaron Brown <arron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      177132df
    • D
      Merge branch 'pktgen-Behavior-flags-fixes' · 46410c2e
      David S. Miller 提交于
      Dmitry Safonov says:
      
      ====================
      pktgen: Behavior flags fixes
      
      v2:
        o fixed a nitpick from David Miller
      
      There are a bunch of fixes/cleanups/Documentations.
      Diffstat says for itself, regardless added docs and missed flag
      parameters.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      46410c2e
    • D
      pktgen: Clean read user supplied flag mess · 52e12d5d
      Dmitry Safonov 提交于
      Don't use error-prone-brute-force way.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      52e12d5d
    • D
      pktgen: Remove brute-force printing of flags · 99c6d3d2
      Dmitry Safonov 提交于
      Add macro generated pkt_flag_names array, with a little help of which
      the flags can be printed by using an index.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99c6d3d2
    • D
      pktgen: Add behaviour flags macro to generate flags/names · 6f107c74
      Dmitry Safonov 提交于
      PKT_FALGS macro will be used to add package behavior names definitions
      to simplify the code that prints/reads pkg flags.
      Sorted the array in order of printing the flags in pktgen_if_show()
      Note: Renamed IPSEC_ON => IPSEC for simplicity.
      
      No visible behavior change expected.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f107c74
    • D
      pktgen: Add missing !flag parameters · 57a5749b
      Dmitry Safonov 提交于
      o FLOW_SEQ now can be disabled with pgset "flag !FLOW_SEQ"
      o FLOW_SEQ and FLOW_RND are antonyms, as it's shown by pktgen_if_show()
      o IPSEC now may be disabled
      
      Note, that IPV6 is enabled with dst6/src6 parameters, not with
      a flag parameter.
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57a5749b
    • D
      Documentation/pktgen: Clearify how-to use pktgen samples · d2ee7973
      Dmitry Safonov 提交于
      o Change process name in ps output: looks like, these days the process
        is named kpktgend_<cpu>, rather than pktgen/<cpu>.
      o Use pg_ctrl for start/stop as it can work well with pgset without
        changes to $(PGDEV) variable.
      o Clarify a bit needed $(PGDEV) definition for sample scripts and that
        one needs to `source functions.sh`.
      o Document how-to unset a behaviour flag, note about history expansion.
      o Fix pgset spi parameter value.
      
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: linux-doc@vger.kernel.org
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2ee7973
  2. 24 1月, 2018 33 次提交