Skip to content
Permalink
Arkadiusz-Kuba…
Switch branches/tags

Commits on Aug 16, 2021

  1. ice: add sysfs interface to configure PHY recovered reference signal

    Allow user to enable or disable propagation of PHY recovered clock
    signal onto requested output pin with new human friendly device private
    sysfs interface.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021
  2. ice: add SIOC{S|G}SYNCE interface usage to recover reference signal

    Add new Admin Queue Command definitions for getting and setting
    configuration of PHY recovered clock signal from Firmware.
    
    Allow user to enable or disable propagation of PHY recovered clock
    signal onto requested output pin with new IOCTLs: SIOCGSYNCE,
    SIOCSSYNCE.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021
  3. selftests/net: Add test app for SIOC{S|G}SYNCE

    Test usage of new netdev IOCTLs: SIOCSSYNCE and SIOCGSYNCE.
    
    Allow set or get the netdev driver configuration
    of PHY reference clock on output pins.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021
  4. net: add ioctl interface for recover reference clock on netdev

    Previously there was no similar interface. It is required for
    configuration of Synchronous Ethernet (SyncE).
    
    User must be able to enable or disable propagation of its
    PHY recovered clock signal onto available output pin.
    This allows the signal to be used as frequency reference signal
    for different hardware chips.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021
  5. ice: add get_dpll_state ptp interface usage

    Add new Admin Queue Command definitions for
    getting status of Digital Phase Locked Loop.
    
    Implement new part of ptp interface for getting
    state of Digital Phase Locked Loop.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021
  6. selftests/ptp: Add usage of PTP_DPLL_GETSTATE ioctl in testptp

    Allow get Digital Phase Locked Loop state of ptp enabled device
    through ptp related ioctl PTP_DPLL_GETSTATE.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021
  7. ptp: Add interface for acquiring DPLL state

    Previously there was no common interface for monitoring
    synchronization state of Digital Phase Locked Loop.
    
    Add interface through PTP ioctl subsystem for tools,
    as well as sysfs human-friendly part of the interface.
    
    enum dpll_state moved to uapi definition, it is required to
    have common definition of DPLL states in uapi.
    
    Add new callback function, must be implemented by ptp
    enabled driver in order to get the state of dpll.
    
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and intel-lab-lkp committed Aug 16, 2021

Commits on Aug 10, 2021

  1. igc: Add support for CBS offloading

    Implemented support for Credit-based shaper(CBS) Qdisc hardware
    offload mode in the driver. There are two sets of IEEE802.1Qav
    (CBS) HW logic in i225 controller and this patch supports
    enabling them in the top two priority TX queues.
    
    Driver implemented as recommended by Foxville External
    Architecture Specification v0.993. Idleslope and Hi-credit are
    the CBS tunable parameters for i225 NIC, programmed in TQAVCC
    and TQAVHC registers respectively.
    
    In-order for IEEE802.1Qav (CBS) algorithm to work as intended
    and provide BW reservation CBS should be enabled in highest
    priority queue first. If we enable CBS on any of low priority
    queues, the traffic in high priority queue does not allow low
    priority queue to be selected for transmission and bandwidth
    reservation is not guaranteed.
    
    Signed-off-by: Aravindhan Gunasekaran <aravindhan.gunasekaran@intel.com>
    Signed-off-by: Mallikarjuna Chilakala <mallikarjuna.chilakala@intel.com>
    agunasek authored and anguy11 committed Aug 10, 2021
  2. igc: Simplify TSN flags handling

    Separates the procedure done during reset from applying a
    configuration, knowing when the code is executing allow us to
    separate the better what changes the hardware state from what
    changes only the driver state.
    
    Introduces a flag for bookkeeping the driver state of TSN
    features. When Qav and frame-preemption is also implemented
    this flag makes it easier to keep track on whether a TSN feature
    driver state is enabled or not though controller state changes,
    say,during a reset.
    
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    Signed-off-by: Aravindhan Gunasekaran <aravindhan.gunasekaran@intel.com>
    Signed-off-by: Mallikarjuna Chilakala <mallikarjuna.chilakala@intel.com>
    vcgomes authored and anguy11 committed Aug 10, 2021
  3. igc: Use default cycle 'start' and 'end' values for queues

    Sets default values for each queue cycle start and cycle end.
    This allows some simplification in the handling of these
    configurations as most TSN features in i225 require a cycle
    to be configured.
    
    In i225, cycle start and end time is required to be programmed
    for CBS to work properly.
    
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    Signed-off-by: Aravindhan Gunasekaran <aravindhan.gunasekaran@intel.com>
    Signed-off-by: Mallikarjuna Chilakala <mallikarjuna.chilakala@intel.com>
    vcgomes authored and anguy11 committed Aug 10, 2021
  4. ixgbe: Add locking to prevent panic when setting sriov_numvfs to zero.

    It is possible to disable VFs while the PF driver is processing requests
    from the VF driver.  This can result in a panic.
    
    BUG: unable to handle kernel paging request at 000000000000106c
    PGD 0 P4D 0
    Oops: 0000 [#1] SMP NOPTI
    CPU: 8 PID: 0 Comm: swapper/8 Kdump: loaded Tainted: G          I      --------- -  -
    Hardware name: Dell Inc. PowerEdge R740/06WXJT, BIOS 2.8.2 08/27/2020
    RIP: 0010:ixgbe_msg_task+0x4c8/0x1690 [ixgbe]
    Code: 00 00 48 8d 04 40 48 c1 e0 05 89 7c 24 24 89 fd 48 89 44 24 10 83 ff 01 0f 84 b8 04 00 00 4c 8b 64 24 10 4d 03 a5 48 22 00 00 <41> 80 7c 24 4c 00 0f 84 8a 03 00 00 0f b7 c7 83 f8 08 0f 84 8f 0a
    RSP: 0018:ffffb337869f8df8 EFLAGS: 00010002
    RAX: 0000000000001020 RBX: 0000000000000000 RCX: 000000000000002b
    RDX: 0000000000000002 RSI: 0000000000000008 RDI: 0000000000000006
    RBP: 0000000000000006 R08: 0000000000000002 R09: 0000000000029780
    R10: 00006957d8f42832 R11: 0000000000000000 R12: 0000000000001020
    R13: ffff8a00e8978ac0 R14: 000000000000002b R15: ffff8a00e8979c80
    FS:  0000000000000000(0000) GS:ffff8a07dfd00000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000000000106c CR3: 0000000063e10004 CR4: 00000000007726e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    PKRU: 55555554
    Call Trace:
     <IRQ>
     ? ttwu_do_wakeup+0x19/0x140
     ? try_to_wake_up+0x1cd/0x550
     ? ixgbevf_update_xcast_mode+0x71/0xc0 [ixgbevf]
     ixgbe_msix_other+0x17e/0x310 [ixgbe]
     __handle_irq_event_percpu+0x40/0x180
     handle_irq_event_percpu+0x30/0x80
     handle_irq_event+0x36/0x53
     handle_edge_irq+0x82/0x190
     handle_irq+0x1c/0x30
     do_IRQ+0x49/0xd0
     common_interrupt+0xf/0xf
    
    This can be eventually be reproduced with the following script:
    
    while :
    do
    	echo 63 > /sys/class/net/ens3f0/device/sriov_numvfs
    	sleep 1
    	echo 0 > /sys/class/net/ens3f0/device/sriov_numvfs
            sleep 1
    done
    
    Signed-off-by: Ken Cox <jkc@redhat.com>
    Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
    Ken Cox authored and anguy11 committed Aug 10, 2021
  5. ice: Add support for VF rate limiting

    Implement ndo_set_vf_rate to support setting of min_tx_rate and
    max_tx_rate; set the appropriate bandwidth in the scheduler for the
    node representing the specified VF VSI.
    
    Co-developed-by: Tarun Singh <tarun.k.singh@intel.com>
    Signed-off-by: Tarun Singh <tarun.k.singh@intel.com>
    Signed-off-by: Brett Creeley <brett.creeley@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    bcreeley13 authored and anguy11 committed Aug 10, 2021
  6. ice: ndo_setup_tc implementation for PR

    Add tc-flower support for VF port representor devices.
    
    Implement ndo_setup_tc callback for TC HW offload on VF port representors
    devices. Implemented both methods: add and delete tc-flower flows.
    
    Mark NETIF_F_HW_TC bit in net device's feature set to enable offload TC
    infrastructure for port representor.
    
    Implement TC filters replay function required to restore filters settings
    while switchdev configuration is rebuilt.
    
    Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    mswiatko authored and anguy11 committed Aug 10, 2021
  7. ice: ndo_setup_tc implementation for PF

    Implement ndo_setup_tc net device callback for TC HW offload on PF device.
    
    ndo_setup_tc provides support for HW offloading various TC filters.
    Add support for configuring the following filter with tc-flower:
    - default L2 filters (src/dst mac addresses, ethertype, VLAN)
    - variations of L3, L3+L4, L2+L3+L4 filters using advanced filters
    (including ipv4 and ipv6 addresses).
    
    Allow for adding/removing TC flows when PF device is configured in
    eswitch switchdev mode. Two types of actions are supported at the
    moment: FLOW_ACTION_DROP and FLOW_ACTION_REDIRECT.
    
    Co-developed-by: Priyalee Kushwaha <priyalee.kushwaha@intel.com>
    Signed-off-by: Priyalee Kushwaha <priyalee.kushwaha@intel.com>
    Signed-off-by: Kiran Patil <kiran.patil@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    kapatil authored and anguy11 committed Aug 10, 2021
  8. ice: Allow changing lan_en and lb_en on all kinds of filters

    There is no way to change default lan_en and lb_en flags while
    adding new rule. Add function that allows changing these flags
    on rule determined by rule id and recipe id.
    
    Function checks if the rule is presented on regular rules list or
    advance rules list and call the appropriate function to update
    rule entry.
    
    As rules with ICE_SW_LKUP_DFLT recipe aren't tracked in a list,
    implement function which updates flags without searching for rules
    based only on rule id.
    
    Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    mswiatko authored and anguy11 committed Aug 10, 2021
  9. ice: cleanup rules info

    Change ICE_SW_LKUP_LAST to ICE_MAX_NUM_RECIPES as for now there also can
    be recipes other than the default.
    
    Free all structures created for advanced recipes in cleanup function.
    Write a function to clean allocated structures on advanced rule info.
    
    Signed-off-by: Victor Raj <victor.raj@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    vraj-amr authored and anguy11 committed Aug 10, 2021
  10. ice: allow deleting advanced rules

    To remove advanced rule the same protocols list like in adding should be
    send to function. Based on this information list of advanced rules is
    searched to find the correct rule id.
    
    Remove advanced rule if it forwards to only one VSI. If it forwards
    to list of VSI remove only input VSI from this list.
    
    Introduce function to remove rule by id. It is used in case rule needs to
    be removed even if it forwards to the list of VSI.
    
    Allow removing all advanced rules from a particular VSI. It is useful in
    rebuilding VSI path.
    
    Co-developed-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Shivanshu Shukla <shivanshu.shukla@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    shivanshushukla authored and anguy11 committed Aug 10, 2021
  11. ice: allow adding advanced rules

    Define dummy packet headers to allow adding advanced rules in HW. This
    header is used as admin queue command parameter for adding a rule.
    The firmware will extract correct fields and will use them in look ups.
    
    Define each supported packets header and offsets to words used in recipe.
    Supported headers:
    - MAC + IPv4 + UDP
    - MAC + VLAN + IPv4 + UDP
    - MAC + IPv4 + TCP
    - MAC + VLAN + IPv4 + TCP
    - MAC + IPv6 + UDP
    - MAC + VLAN + IPv6 + UDP
    - MAC + IPv6 + TCP
    - MAC + VLAN + IPv6 + TCP
    
    Add code for creating an advanced rule. Rule needs to match defined
    dummy packet, if not return error, which means that this type of rule
    isn't currently supported.
    
    The first step in adding advanced rule is searching for an advanced
    recipe matching this kind of rule. If it doesn't exist new recipe is
    created. Dummy packet has to be filled with the correct header field
    value from the rule definition. It will be used to do look up in HW.
    
    Support searching for existing advance rule entry. It is used in case
    of adding the same rule on different VSI. In this case, instead of
    creating new rule, the existing one should be updated with refreshed VSI
    list.
    
    Add initialization for prof_res_bm_init flag to zero so that
    the possible resource for fv in the files can be initialized.
    
    Co-developed-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Grishma Kotecha <grishma.kotecha@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    Grishma Kotecha authored and anguy11 committed Aug 10, 2021
  12. ice: create advanced switch recipe

    These changes introduce code for creating advanced recipes for the
    switch in hardware.
    
    There are a couple of recipes already defined in the HW. They apply to
    matching on basic protocol headers, like MAC, VLAN, MACVLAN,
    ethertype or direction (promiscuous), etc.. If the user wants to match on
    other protocol headers (eg. ip address, src/dst port etc.) or different
    variation of already supported protocols, there is a need to create
    new, more complex recipe. That new recipe is referred as
    'advanced recipe', and the filtering rule created on top of that recipe
    is called 'advanced rule'.
    
    One recipe can have up to 5 words, but the first word is always reserved
    for match on switch id, so the driver can define up to 4 words for one
    recipe. To support recipes with more words up to 5 recipes can be
    chained, so 20 words can be programmed for look up.
    
    Input for adding recipe function is a list of protocols to support. Based
    on this list correct profile is being chosen. Correct profile means
    that it contains all protocol types from a list. Each profile have up to
    48 field vector words and each of this word have protocol id and offset.
    These two fields need to match with input data for adding recipe
    function. If the correct profile can't be found the function returns an
    error.
    
    The next step after finding the correct profile is grouping words into
    groups. One group can have up to 4 words. This is done to simplify
    sending recipes to HW (because recipe also can have up to 4 words).
    
    In case of chaining (so when look up consists of more than 4 words) last
    recipe will always have results from the previous recipes used as words.
    
    A recipe to profile map is used to store information about which profile
    is associate with this recipe. This map is an array of 64 elements (max
    number of recipes) and each element is a 256 bits bitmap (max number of
    profiles)
    
    Profile to recipe map is used to store information about which recipe is
    associate with this profile. This map is an array of 256 elements (max
    number of profiles) and each element is a 64 bits bitmap (max number of
    recipes)
    
    Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    DanNowlin authored and anguy11 committed Aug 10, 2021
  13. ice: manage profiles and field vectors

    Implement functions to manage profiles and field vectors in hardware.
    
    In hardware, there are up to 256 profiles and each of these profiles can
    have 48 field vector words. Each field vector word is described by
    protocol id and offset in the packet. To add a new recipe all used
    profiles need to be searched. If the profile contains all required
    protocol ids and offsets from the recipe it can be used. The driver has
    to add this profile to recipe association to tell hardware that newly
    added recipe is going to be associated with this profile.
    
    The amount of used profiles depend on the package. To avoid searching
    across not used profile, max profile id value is calculated at init flow.
    The profile is considered as unused when all field vector words in the
    profile are invalid (protocol id 0xff and offset 0x1ff).
    
    Profiles are read from the package section ICE_SID_FLD_VEC_SW. Empty
    field vector words can be used for recipe results. Store all unused field
    vector words in prof_res_bm. It is a 256 elements array (max number of
    profiles) each element is a 48 bit bitmap (max number of field vector
    words).
    
    For now, support only non-tunnel profiles type.
    
    Co-developed-by: Grishma Kotecha <grishma.kotecha@intel.com>
    Signed-off-by: Grishma Kotecha <grishma.kotecha@intel.com>
    Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    DanNowlin authored and anguy11 committed Aug 10, 2021
  14. ice: implement low level recipes functions

    Add code to manage recipes and profiles on admin queue layer.
    
    Allow the driver to add a new recipe and update an existing one. Get a
    recipe and get a recipe to profile association is mostly used in update
    existing recipes code.
    
    Only default recipes can be updated. An update is done by reading recipes
    from HW, changing their params and calling add recipe command.
    
    Support following admin queue commands:
    - ice_aqc_opc_add_recipe (0x0290) - create a recipe with protocol
    header information and other details that determine how this recipe
    filter works
    - ice_aqc_opc_recipe_to_profile (0x0291) - associate a switch recipe
    to a profile
    - ice_aqc_opc_get_recipe (0x0292) - get details of an exsisting recipe
    - ice_aqc_opc_get_recipe_to_profile (0x0293) - get a recipe associated
    with profile ID
    
    Define ICE_AQC_RES_TYPE_RECIPE resource type to hold a switch
    recipe. It is needed when a new switch recipe needs to be created.
    
    Co-developed-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
    Signed-off-by: Grishma Kotecha  <grishma.kotecha@intel.com>
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    Grishma Kotecha authored and anguy11 committed Aug 10, 2021
  15. ice: Use ether_addr_copy() instead of memcpy

    To save the netdev->dev_addr the driver is using memcpy with the length
    of a MAC address. ether_addr_copy() is meant specifically for this, so
    use it.
    
    Signed-off-by: Brett Creeley <brett.creeley@intel.com>
    bcreeley13 authored and anguy11 committed Aug 10, 2021
  16. ice: don't remove netdev->dev_addr from uc sync list

    In some circumstances, such as with bridging, it's possible that the
    stack will add the device's own MAC address to its unicast address list.
    
    If, later, the stack deletes this address, the driver will receive a
    request to remove this address.
    
    The driver stores its current MAC address as part of the VSI MAC filter
    list instead of separately. So, this causes a problem when the device's
    MAC address is deleted unexpectedly, which results in traffic failure in
    some cases.
    
    The following configuration steps will reproduce the previously
    mentioned problem:
    
    > ip link set eth0 up
    > ip link add dev br0 type bridge
    > ip link set br0 up
    > ip addr flush dev eth0
    > ip link set eth0 master br0
    > echo 1 > /sys/class/net/br0/bridge/vlan_filtering
    > modprobe -r veth
    > modprobe -r bridge
    > ip addr add 192.168.1.100/24 dev eth0
    
    The following ping command fails due to the netdev->dev_addr being
    deleted when removing the bridge module.
    > ping <link partner>
    
    Fix this by making sure to not delete the netdev->dev_addr during MAC
    address sync. After fixing this issue it was noticed that the
    netdev_warn() in .set_mac was overly verbose, so make it at
    netdev_dbg().
    
    Also, there is a possibility of a race condition between .set_mac and
    .set_rx_mode. Fix this by calling netif_addr_lock_bh() and
    netif_addr_unlock_bh() on the device's netdev when the netdev->dev_addr
    is going to be updated in .set_mac.
    
    Fixes: e94d447 ("ice: Implement filter sync, NDO operations and bump version")
    Signed-off-by: Brett Creeley <brett.creeley@intel.com>
    bcreeley13 authored and anguy11 committed Aug 10, 2021
  17. ice: Stop processing VF messages during teardown

    When VFs are setup and torn down in quick succession, it is possible
    that a VF is torn down by the PF while the VF's virtchnl requests are
    still in the PF's mailbox ring. Processing the VF's virtchnl request
    when the VF itself doesn't exist results in undefined behavior. Fix
    this by adding a check to stop processing virtchnl requests when VF
    teardown is in progress.
    
    Fixes: ddf30f7 ("ice: Add handler to configure SR-IOV")
    Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
    refactorman authored and anguy11 committed Aug 10, 2021
  18. igc: Add support for PTP getcrosststamp()

    i225 supports PCIe Precision Time Measurement (PTM), allowing us to
    support the PTP_SYS_OFFSET_PRECISE ioctl() in the driver via the
    getcrosststamp() function.
    
    The easiest way to expose the PTM registers would be to configure the PTM
    dialogs to run periodically, but the PTP_SYS_OFFSET_PRECISE ioctl()
    semantics are more aligned to using a kind of "one-shot" way of retrieving
    the PTM timestamps. But this causes a bit more code to be written: the
    trigger registers for the PTM dialogs are not cleared automatically.
    
    i225 can be configured to send "fake" packets with the PTM
    information, adding support for handling these types of packets is
    left for the future.
    
    PTM improves the accuracy of time synchronization, for example, using
    phc2sys, while a simple application is sending packets as fast as
    possible. First, without .getcrosststamp():
    
    phc2sys[191.382]: enp4s0 sys offset      -959 s2 freq    -454 delay   4492
    phc2sys[191.482]: enp4s0 sys offset       798 s2 freq   +1015 delay   4069
    phc2sys[191.583]: enp4s0 sys offset       962 s2 freq   +1418 delay   3849
    phc2sys[191.683]: enp4s0 sys offset       924 s2 freq   +1669 delay   3753
    phc2sys[191.783]: enp4s0 sys offset       664 s2 freq   +1686 delay   3349
    phc2sys[191.883]: enp4s0 sys offset       218 s2 freq   +1439 delay   2585
    phc2sys[191.983]: enp4s0 sys offset       761 s2 freq   +2048 delay   3750
    phc2sys[192.083]: enp4s0 sys offset       756 s2 freq   +2271 delay   4061
    phc2sys[192.183]: enp4s0 sys offset       809 s2 freq   +2551 delay   4384
    phc2sys[192.283]: enp4s0 sys offset      -108 s2 freq   +1877 delay   2480
    phc2sys[192.383]: enp4s0 sys offset     -1145 s2 freq    +807 delay   4438
    phc2sys[192.484]: enp4s0 sys offset       571 s2 freq   +2180 delay   3849
    phc2sys[192.584]: enp4s0 sys offset       241 s2 freq   +2021 delay   3389
    phc2sys[192.684]: enp4s0 sys offset       405 s2 freq   +2257 delay   3829
    phc2sys[192.784]: enp4s0 sys offset        17 s2 freq   +1991 delay   3273
    phc2sys[192.884]: enp4s0 sys offset       152 s2 freq   +2131 delay   3948
    phc2sys[192.984]: enp4s0 sys offset      -187 s2 freq   +1837 delay   3162
    phc2sys[193.084]: enp4s0 sys offset     -1595 s2 freq    +373 delay   4557
    phc2sys[193.184]: enp4s0 sys offset       107 s2 freq   +1597 delay   3740
    phc2sys[193.284]: enp4s0 sys offset       199 s2 freq   +1721 delay   4010
    phc2sys[193.385]: enp4s0 sys offset      -169 s2 freq   +1413 delay   3701
    phc2sys[193.485]: enp4s0 sys offset       -47 s2 freq   +1484 delay   3581
    phc2sys[193.585]: enp4s0 sys offset       -65 s2 freq   +1452 delay   3778
    phc2sys[193.685]: enp4s0 sys offset        95 s2 freq   +1592 delay   3888
    phc2sys[193.785]: enp4s0 sys offset       206 s2 freq   +1732 delay   4445
    phc2sys[193.885]: enp4s0 sys offset      -652 s2 freq    +936 delay   2521
    phc2sys[193.985]: enp4s0 sys offset      -203 s2 freq   +1189 delay   3391
    phc2sys[194.085]: enp4s0 sys offset      -376 s2 freq    +955 delay   2951
    phc2sys[194.185]: enp4s0 sys offset      -134 s2 freq   +1084 delay   3330
    phc2sys[194.285]: enp4s0 sys offset       -22 s2 freq   +1156 delay   3479
    phc2sys[194.386]: enp4s0 sys offset        32 s2 freq   +1204 delay   3602
    phc2sys[194.486]: enp4s0 sys offset       122 s2 freq   +1303 delay   3731
    
    Statistics for this run (total of 2179 lines), in nanoseconds:
      average: -1.12
      stdev: 634.80
      max: 1551
      min: -2215
    
    With .getcrosststamp() via PCIe PTM:
    
    phc2sys[367.859]: enp4s0 sys offset         6 s2 freq   +1727 delay      0
    phc2sys[367.959]: enp4s0 sys offset        -2 s2 freq   +1721 delay      0
    phc2sys[368.059]: enp4s0 sys offset         5 s2 freq   +1727 delay      0
    phc2sys[368.160]: enp4s0 sys offset        -1 s2 freq   +1723 delay      0
    phc2sys[368.260]: enp4s0 sys offset        -4 s2 freq   +1719 delay      0
    phc2sys[368.360]: enp4s0 sys offset        -5 s2 freq   +1717 delay      0
    phc2sys[368.460]: enp4s0 sys offset         1 s2 freq   +1722 delay      0
    phc2sys[368.560]: enp4s0 sys offset        -3 s2 freq   +1718 delay      0
    phc2sys[368.660]: enp4s0 sys offset         5 s2 freq   +1725 delay      0
    phc2sys[368.760]: enp4s0 sys offset        -1 s2 freq   +1721 delay      0
    phc2sys[368.860]: enp4s0 sys offset         0 s2 freq   +1721 delay      0
    phc2sys[368.960]: enp4s0 sys offset         0 s2 freq   +1721 delay      0
    phc2sys[369.061]: enp4s0 sys offset         4 s2 freq   +1725 delay      0
    phc2sys[369.161]: enp4s0 sys offset         1 s2 freq   +1724 delay      0
    phc2sys[369.261]: enp4s0 sys offset         4 s2 freq   +1727 delay      0
    phc2sys[369.361]: enp4s0 sys offset         8 s2 freq   +1732 delay      0
    phc2sys[369.461]: enp4s0 sys offset         7 s2 freq   +1733 delay      0
    phc2sys[369.561]: enp4s0 sys offset         4 s2 freq   +1733 delay      0
    phc2sys[369.661]: enp4s0 sys offset         1 s2 freq   +1731 delay      0
    phc2sys[369.761]: enp4s0 sys offset         1 s2 freq   +1731 delay      0
    phc2sys[369.861]: enp4s0 sys offset        -5 s2 freq   +1725 delay      0
    phc2sys[369.961]: enp4s0 sys offset        -4 s2 freq   +1725 delay      0
    phc2sys[370.062]: enp4s0 sys offset         2 s2 freq   +1730 delay      0
    phc2sys[370.162]: enp4s0 sys offset        -7 s2 freq   +1721 delay      0
    phc2sys[370.262]: enp4s0 sys offset        -3 s2 freq   +1723 delay      0
    phc2sys[370.362]: enp4s0 sys offset         1 s2 freq   +1726 delay      0
    phc2sys[370.462]: enp4s0 sys offset        -3 s2 freq   +1723 delay      0
    phc2sys[370.562]: enp4s0 sys offset        -1 s2 freq   +1724 delay      0
    phc2sys[370.662]: enp4s0 sys offset        -4 s2 freq   +1720 delay      0
    phc2sys[370.762]: enp4s0 sys offset        -7 s2 freq   +1716 delay      0
    phc2sys[370.862]: enp4s0 sys offset        -2 s2 freq   +1719 delay      0
    
    Statistics for this run (total of 2179 lines), in nanoseconds:
      average: 0.14
      stdev: 5.03
      max: 48
      min: -27
    
    For reference, the statistics for runs without PCIe congestion show
    that the improvements from enabling PTM are less dramatic. For two
    runs of 16466 entries:
      without PTM: avg -0.04 stdev 10.57 max 39 min -42
      with PTM: avg 0.01 stdev 4.20 max 19 min -16
    
    One possible explanation is that when PTM is not enabled, and there's a lot
    of traffic in the PCIe fabric, some register reads will take more time
    than the others because of congestion on the PCIe fabric.
    
    When PTM is enabled, even if the PTM dialogs take more time to
    complete under heavy traffic, the time measurements do not depend on
    the time to read the registers.
    
    This was implemented following the i225 EAS version 0.993.
    
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    vcgomes authored and anguy11 committed Aug 10, 2021
  19. igc: Enable PCIe PTM

    Enables PCIe PTM (Precision Time Measurement) support in the igc
    driver. Notifies the PCI devices that PCIe PTM should be enabled.
    
    PCIe PTM is similar protocol to PTP (Precision Time Protocol) running
    in the PCIe fabric, it allows devices to report time measurements from
    their internal clocks and the correlation with the PCIe root clock.
    
    The i225 NIC exposes some registers that expose those time
    measurements, those registers will be used, in later patches, to
    implement the PTP_SYS_OFFSET_PRECISE ioctl().
    
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    vcgomes authored and anguy11 committed Aug 10, 2021
  20. PCI: Add pcie_ptm_enabled()

    Add a predicate that returns if PCIe PTM (Precision Time Measurement)
    is enabled.
    
    It will only return true if it's enabled in all the ports in the path
    from the device to the root.
    
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    Acked-by: Bjorn Helgaas <bhelgaas@google.com>
    vcgomes authored and anguy11 committed Aug 10, 2021
  21. Revert "PCI: Make pci_enable_ptm() private"

    Make pci_enable_ptm() accessible from the drivers.
    
    Exposing this to the driver enables the driver to use the
    'ptm_enabled' field of 'pci_dev' to check if PTM is enabled or not.
    
    This reverts commit ac6c26d ("PCI: Make pci_enable_ptm() private").
    
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    Acked-by: Bjorn Helgaas <bhelgaas@google.com>
    vcgomes authored and anguy11 committed Aug 10, 2021
  22. ice: Add support to print error on PHY FW load failure

    Some devices have support for loading the PHY FW and in some cases this
    can fail. When this fails, the FW will set the corresponding bit in the
    link info structure. Also, the FW will send a link event if the correct
    link event mask bit is set. Add support for printing an error message
    when the PHY FW load fails during any link configuration flow and the
    link event flow.
    
    Since ice_check_module_power() is already doing something very similar
    add a new function ice_check_link_cfg_err() so any failures reported in
    the link info's link_cfg_err member can be printed in this one function.
    
    Also, add the new ICE_FLAG_PHY_FW_LOAD_FAILED bit to the PF's flags so
    we don't constantly print this error message during link polling if the
    value never changed.
    
    Signed-off-by: Brett Creeley <brett.creeley@intel.com>
    bcreeley13 authored and anguy11 committed Aug 10, 2021
  23. i40e: Fix spelling mistake "dissable" -> "disable"

    There is a spelling mistake in a dev_info message. Fix it.
    
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Colin Ian King authored and anguy11 committed Aug 10, 2021
  24. ice: Prevent probing virtual functions

    The userspace utility "driverctl" can be used to change/override the
    system's default driver choices. This is useful in some situations
    (buggy driver, old driver missing a device ID, trying a workaround,
    etc.) where the user needs to load a different driver.
    
    However, this is also prone to user error, where a driver is mapped
    to a device it's not designed to drive. For example, if the ice driver
    is mapped to driver iavf devices, the ice driver crashes.
    
    Add a check to return an error if the ice driver is being used to
    probe a virtual function.
    
    Fixes: 837f08f ("ice: Add basic driver framework for Intel(R) E800 Series")
    Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
    refactorman authored and anguy11 committed Aug 10, 2021
  25. i40e: Fix ATR queue selection

    Without this patch, ATR does not work. Receive/transmit uses queue
    selection based on SW DCB hashing method.
    
    If traffic classes are not configured for PF, then use
    netdev_pick_tx function for selecting queue for packet transmission.
    Instead of calling i40e_swdcb_skb_tx_hash, call netdev_pick_tx,
    which ensures that packet is transmitted/received from CPU that is
    running the application.
    
    Reproduction steps:
    1. Load i40e driver
    2. Map each MSI interrupt of i40e port for each CPU
    3. Disable ntuple, enable ATR i.e.:
    ethtool -K $interface ntuple off
    ethtool --set-priv-flags $interface flow-director-atr
    4. Run application that is generating traffic and is bound to a
    single CPU, i.e.:
    taskset -c 9 netperf -H 1.1.1.1 -t TCP_RR -l 10
    5. Observe behavior:
    Application's traffic should be restricted to the CPU provided in
    taskset.
    
    Fixes: 821bd0c990ba ("i40e: Fix queue-to-TC mapping on Tx")
    Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
    Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
    kubalewski authored and anguy11 committed Aug 10, 2021
  26. igc: Use num_tx_queues when iterating over tx_ring queue

    Use num_tx_queues rather than the IGC_MAX_TX_QUEUES fixed number 4 when
    iterating over tx_ring queue since instantiated queue count could be
    less than 4 where on-line cpu count is less than 4.
    
    Fixes: ec50a9d ("igc: Add support for taprio offloading")
    Signed-off-by: Toshiki Nishioka <toshiki.nishioka@intel.com>
    Tested-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
    Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
    Acked-by: Sasha Neftin <sasha.neftin@intel.com>
    tnishiok authored and anguy11 committed Aug 10, 2021
  27. ice: Fix crash in switchdev mode during VFR

    During VF reset VF VSI is released, because of that there was
    a risk of calling ice_repr_get_stats64 or ice_get_drvinfo when
    VF VSI was NULL. The solution is to use ice_check_vf_ready_for_cfg
    function.
    
    Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
    WojDrew authored and anguy11 committed Aug 10, 2021
  28. igc: Remove media type checking on the PHY initialization

    i225 devices have only copper phy media type. There is no point in checking
    phy media type during the phy initialization.
    This patch comes to clean up these pointless checkings.
    
    Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
    aneftin authored and anguy11 committed Aug 10, 2021
Older