28 Nov, 2013

3 commits

  • Endianness issues are now consistent as per the documentation in
    host/mic_virtio.h. Sparse warnings related to endianness are also fixed.
    Note that the MIC driver implementation assumes that the host can be
    both BE or LE whereas the card is always LE.

    Reported-by: Fengguang Wu
    Reviewed-by: Sudeep Dutt
    Reviewed-by: Nikhil Rao
    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Greg Kroah-Hartman

    Ashutosh Dixit
     
  • Avoid declaring ALIGN() and __aligned() in
    include/uapi/linux/mic_common.h since they pollute user space
    namespace. Also, mic_aligned_size() can be simply replaced simply by
    sizeof() since all structures where mic_aligned_size() is used are
    declared using __attribute__ ((aligned(8)));

    --
    >From mail from H Peter Anvin about this:

    On Fri, Nov 08, 2013 H Peter Anvin wrote:
    Subject: Namespace pollution in mic_common.h

    This puts two macros, ALIGN() and __aligned(), into arbitrary user space
    namespace. This really isn't safe or acceptable, especially since those
    symbols are highly generic.
    ...
    When these structures are forced-aligned, they will in fact have padding
    automatically added by the compiler to an 8-byte boundary anyway, so
    mic_aligned_size() does nothing.
    ...

    Reported-by: H Peter Anvin
    Reviewed-by: Sudeep Dutt
    Signed-off-by: Nikhil Rao
    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Greg Kroah-Hartman

    Ashutosh Dixit
     
  • MIC user space daemon poll's on sysfs changes. The documentation for
    sysfs_poll(...) in fs/sysfs/file.c states that "Once poll/select
    indicates that the value has changed, you need to close and re-open the
    file, or seek to 0 and read again". This step was missed out earlier and
    resulted in the daemon spinning continuously rather than getting blocked
    in 'poll'. This bug was exposed by commit aea585ef8fa65163 introduced as
    part of sysfs changes in 3.13-rc1. A seek to 0 has been introduced to
    fix it.

    Reviewed-by: Sudeep Dutt
    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Greg Kroah-Hartman

    Ashutosh Dixit
     

06 Oct, 2013

1 commit

  • This patch enables support for OSPM suspend and resume in the MIC
    driver. During a host suspend event, the driver performs an
    orderly shutdown of the cards if they are online. Upon resume, any
    cards that were previously online before suspend are rebooted.
    The driver performs an orderly shutdown of the card primarily to
    ensure that applications in the card are terminated and mounted
    devices are safely un-mounted before the card is powered down in
    the event of an OSPM suspend.

    The driver makes use of the MIC daemon to accomplish OSPM suspend
    and resume. The driver registers a PM notifier per MIC device.
    The devices get notified synchronously during PM_SUSPEND_PREPARE and
    PM_POST_SUSPEND phases.

    During the PM_SUSPEND_PREPARE phase, the driver performs one of the
    following three tasks.
    1) If the card is 'offline', the driver sets the card to a
    'suspended' state and returns.
    2) If the card is 'online', the driver initiates card shutdown by
    setting the card state to suspending. This notifies the MIC
    daemon which invokes shutdown and sets card state to 'suspended'.
    The driver returns after the shutdown is complete.
    3) If the card is already being shutdown, possibly by a host user
    space application, the driver sets the card state to 'suspended'
    and returns after the shutdown is complete.

    During the PM_POST_SUSPEND phase, the driver simply notifies the
    daemon and returns. The daemon boots those cards that were previously
    online during the suspend phase.

    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Nikhil Rao
    Signed-off-by: Harshavardhan R Kharche
    Signed-off-by: Sudeep Dutt
    Signed-off-by: Dasaratharaman Chandramouli
    Signed-off-by: Greg Kroah-Hartman

    Dasaratharaman Chandramouli
     

04 Oct, 2013

1 commit

  • Specifying gcc format function attribute for mpsslog(..) and
    building on 32 bit systems exposed a few build issues in the
    sample MIC daemon which are fixed by this patch. Some of these
    changes were authored by Joe Perches @
    https://lkml.org/lkml/2013/9/27/419

    Reported-by: Joe Perches
    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Caz Yokoyama
    Signed-off-by: Sudeep Dutt
    Signed-off-by: Greg Kroah-Hartman

    Sudeep Dutt
     

28 Sep, 2013

1 commit

  • These changes were mostly authored by Joe Perches
    @ https://lkml.org/lkml/2013/9/5/602

    Reported-by: Joe Perches
    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Dasaratharaman Chandramouli
    Signed-off-by: Nikhil Rao
    Signed-off-by: Harshavardhan R Kharche
    Signed-off-by: Sudeep Dutt
    Signed-off-by: Greg Kroah-Hartman

    Ashutosh Dixit
     

27 Sep, 2013

1 commit

  • This patch introduces a sample user space daemon which
    implements the virtio device backends on the host. The daemon
    creates/removes/configures virtio device backends by communicating with
    the Intel MIC Host Driver. The virtio devices currently supported are
    virtio net, virtio console and virtio block. Virtio net supports TSO/GSO.
    The daemon also monitors card shutdown status and takes appropriate actions
    like killing the virtio backends and resetting the card upon card shutdown
    and crashes.

    Co-author: Ashutosh Dixit
    Co-author: Sudeep Dutt
    Signed-off-by: Ashutosh Dixit
    Signed-off-by: Caz Yokoyama
    Signed-off-by: Dasaratharaman Chandramouli
    Signed-off-by: Nikhil Rao
    Signed-off-by: Harshavardhan R Kharche
    Signed-off-by: Sudeep Dutt
    Acked-by: Yaozu (Eddie) Dong
    Signed-off-by: Greg Kroah-Hartman

    Caz Yokoyama