18 Jan, 2015

19 commits

  • Contrary to common expectations for an "int" return, these functions
    return only a positive value -- if used correctly they cannot even
    return 0 because the message header will necessarily be in the skb.

    This makes the very common pattern of

    if (genlmsg_end(...) < 0) { ... }

    be a whole bunch of dead code. Many places also simply do

    return nlmsg_end(...);

    and the caller is expected to deal with it.

    This also commonly (at least for me) causes errors, because it is very
    common to write

    if (my_function(...))
    /* error condition */

    and if my_function() does "return nlmsg_end()" this is of course wrong.

    Additionally, there's not a single place in the kernel that actually
    needs the message length returned, and if anyone needs it later then
    it'll be very easy to just use skb->len there.

    Remove this, and make the functions void. This removes a bunch of dead
    code as described above. The patch adds lines because I did

    - return nlmsg_end(...);
    + nlmsg_end(...);
    + return 0;

    I could have preserved all the function's return values by returning
    skb->len, but instead I've audited all the places calling the affected
    functions and found that none cared. A few places actually compared
    the return value with < 0 with no change in behaviour, so I opted for the more
    efficient version.

    One instance of the error I've made numerous times now is also present
    in net/phonet/pn_netlink.c in the route_dumpit() function - it didn't
    check for
    Signed-off-by: David S. Miller

    Johannes Berg
     
  • Signed-off-by: Chas Williams - CONTRACTOR
    Signed-off-by: David S. Miller

    chas williams - CONTRACTOR
     
  • Fix some spelling mistakes, coding style and don't assign value to static var.

    Signed-off-by: Akash Shende
    Signed-off-by: David S. Miller

    Akash Shende
     
  • Commit 07f6c4bc (tipc: convert tipc reference table to use generic
    rhashtable) introduced a problem with port listing in the new netlink
    API. It broke the resume functionality resulting in a never ending
    loop. This was caused by starting with the first hash table every time
    subsequently never returning an empty skb (terminating).

    This patch fixes the resume mechanism by keeping a logical reference
    to the last hash table along with a logical reference to the socket
    (port) that didn't fit in the previous message.

    Signed-off-by: Richard Alpe
    Reviewed-by: Erik Hugne
    Reviewed-by: Ying Xue
    Signed-off-by: David S. Miller

    Richard Alpe
     
  • …etooth/bluetooth-next

    Johan Hedberg says:

    ====================
    pull request: bluetooth-next 2015-01-16

    Here are some more bluetooth & ieee802154 patches intended for 3.20:

    - Refactoring & cleanups of ieee802154 & 6lowpan code
    - Various fixes to the btmrvl driver
    - Fixes for Bluetooth Low Energy Privacy feature handling
    - Added build-time sanity checks for sockaddr sizes
    - Fixes for Security Manager registration on LE-only controllers
    - Refactoring of broken inquiry mode handling to a generic quirk

    Please let me know if there are any issues pulling. Thanks.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     
  • This patch benefits from newly introduced switchdev notifier and uses it
    to propagate fdb learn events from rocker driver to bridge. That avoids
    direct function calls and possible use by other listeners (ovs).

    Suggested-by: Thomas Graf
    Signed-off-by: Jiri Pirko
    Signed-off-by: Scott Feldman
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • This patch introduces new notifier for purposes of exposing events which happen
    on switch driver side. The consumers of the event messages are mainly involved
    masters, namely bridge and ovs.

    Suggested-by: Thomas Graf
    Signed-off-by: Jiri Pirko
    Signed-off-by: Scott Feldman
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • After a "page = alloc_page(mask);", we do not need to use
    compound_head() : page already points to the right place.

    This would be true even if using alloc_pages().

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This field already contains the length of the iovec, no need to calculate it
    again.

    Suggested-by: Al Viro
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     
  • Ursula Braun says:

    ====================
    s390: network patches for net-next

    here are some s390 related patches for net-next
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • The member irq_tasklet in the qeth_channel structure
    is not referenced anymore and is removed from the
    structure.

    Signed-off-by: Thomas Richter
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Thomas Richter
     
  • Replace combination of strsep() and a temporary char *
    followed by a series of "if (!strcmp(...))" with a series
    of "if (sysfs_streq(...))".

    Signed-off-by: Eugene Crosser
    Signed-off-by: Ursula Braun
    Reviewed-by: Thomas-Mich Richter
    Signed-off-by: David S. Miller

    Eugene Crosser
     
  • qeth_card_hw_is_reachable() was introduced as part of a new
    functionality, but it is a useful abstraction that can replace
    verbose checks througout the rest of the `qeth` driver.

    Signed-off-by: Eugene Crosser
    Signed-off-by: Ursula Braun
    Reviewed-by: Thomas-Mich Richter
    Signed-off-by: David S. Miller

    Eugene Crosser
     
  • The function debug_unregister() tests whether its argument is
    NULL and then returns immediately. Thus the test around the call
    is not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Markus Elfring
     
  • This patch is concerned with migrating the time variables for the s390
    network drivers. The changes handle the y2038 problem where timespec will
    overflow in the year 2038. timespec was replaced by unsigned long and
    all time variables get their values from the jiffies global variable.
    This was done for the sake of speed and efficiency.

    Signed-off-by: Aya Mahfouz
    Signed-off-by: Ursula Braun
    Signed-off-by: David S. Miller

    Aya Mahfouz
     
  • It was suggested by DaveM to change the name as "len" might indicate
    unit bytes.

    Suggested-by: David Miller
    Signed-off-by: Jiri Pirko
    Acked-by: Daniel Borkmann
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • This action provides a possibility to exec custom BPF code.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     
  • problems with bridge getlink/setlink notifications today:
    - bridge setlink generates two notifications to userspace
    - one from the bridge driver
    - one from rtnetlink.c (rtnl_bridge_notify)
    - dellink generates one notification from rtnetlink.c. Which
    means bridge setlink and dellink notifications are not
    consistent

    - Looking at the code it appears,
    If both BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF were set,
    the size calculation in rtnl_bridge_notify can be wrong.
    Example: if you set both BRIDGE_FLAGS_MASTER and BRIDGE_FLAGS_SELF
    in a setlink request to rocker dev, rtnl_bridge_notify will
    allocate skb for one set of bridge attributes, but,
    both the bridge driver and rocker dev will try to add
    attributes resulting in twice the number of attributes
    being added to the skb. (rocker dev calls ndo_dflt_bridge_getlink)

    There are multiple options:
    1) Generate one notification including all attributes from master and self:
    But, I don't think it will work, because both master and self may use
    the same attributes/policy. Cannot pack the same set of attributes in a
    single notification from both master and slave (duplicate attributes).

    2) Generate one notification from master and the other notification from
    self (This seems to be ideal):
    For master: the master driver will send notification (bridge in this
    example)
    For self: the self driver will send notification (rocker in the above
    example. It can use helpers from rtnetlink.c to do so. Like the
    ndo_dflt_bridge_getlink api).

    This patch implements 2) (leaving the 'rtnl_bridge_notify' around to be used
    with 'self').

    v1->v2 :
    - rtnl_bridge_notify is now called only for self,
    so, remove 'BRIDGE_FLAGS_SELF' check and cleanup a few things
    - rtnl_bridge_dellink used to always send a RTM_NEWLINK msg
    earlier. So, I have changed the notification from br_dellink to
    go as RTM_NEWLINK

    Signed-off-by: Roopa Prabhu
    Signed-off-by: David S. Miller

    Roopa Prabhu
     
  • Jeff Kirsher says:

    ====================
    Intel Wired LAN Driver Updates 2015-01-16

    This series contains updates to i40e and i40evf.

    This series is a little bit larger than normal because two of the patches are
    version bumps.

    Shannon provides tweaks to i40e and i40evf to keep the firmware, software
    and silicon validation in line together by removing unused and
    deprecated code, adding define for iSCSI and fix queue mask size. Fix
    i40e so we do not give up in the reset/rebuild process if DCB setup
    fails, just handle it the same as in the probe setup. Cleans up PTP
    log messages by removing the use of __func__ as we are not using that
    any longer and removes the netdev name, since that can change and can
    be misleading. Adds struct size checks to indirect and command
    structs that were left out previously. Added admin queue API updates
    (LLDP control, OEM OCSD and OCBB commands).

    Kevin increases ASQ timeout for scenarios with multi-function devices.

    Carolyn fixes a problem where the interrupts descriptions from the MSIx
    configuration were truncating the needed bus info, which makes it hard
    to distinguish configurations from port to port. Increased the string
    buffer size in order to allow the full data to be displayed.

    Sravanthi cleans up the dump stats string from debugfs.

    Jacob updates i40e to only enable the PTP interrupt in PFs which have PTP
    enabled, instead of blindly enabling the PTP interrupt flags for all PFs.
    Also updated i40e so that we do not do Tx or Rx timestamps if we do not
    have PTP enabled. Added the same check against pf->ptp_rx as we have
    in Rx timestamp code path because it is possible that the user can
    configure only Tx hardware timestamping so we do not want to check for
    Rx timestamp hang since the software won't be handling them.

    Neerav updates the driver to disable firmware LLDP agent for NICs with
    a firmware version lower than v4.3 and added a message when this happens.
    Adds parsing and reporting of iSCSI capability for a given device or
    function, as well as adding support for iSCSI partition type with DCB
    in NPAR mode.

    v2:
    - Dropped patch 10 "i40e: clean up PTP log messages" based on feedback
    from David Laight and David Miller
    - Split up the original patch 13 "i40e: AQ API updates for new commands"
    into 2 patches (now #12 & #13) based on feedback from Or Gerlitz
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

17 Jan, 2015

13 commits

  • Tom Lendacky says:

    ====================
    amd-xgbe: AMD XGBE driver updates 2015-01-16

    The following series of patches includes functional updates to the
    driver as well as some trivial changes.

    - Fix checks/warnings from checkpatch in the amd-xgbe driver
    - Fix checks/warnings from checkpatch in the amd-xgbe-phy driver
    - Add a check to be sure that the amd-xgbe driver is using the
    amd-xgbe-phy driver
    - Use a saved control register value when bringing the PCS out of
    suspend
    - Clear all device state during a device restart
    - Simplify the Rx descriptor ring tracking
    - Remove the need for Tx path spinlocks
    - Update the auto-negotiation logic to make use of the auto-negotiation
    interrupt
    - Properly support/advertise the FEC capability of the device
    - Use the proper page registers during auto-negotiation extended next
    page exchange
    - Add ACPI support to the amd-xgbe and amd-xgbe-phy drivers
    - Allow platform specific phy settings to be supplied by UEFI

    This patch series is based on net-next.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • Certain PHY settings need to be configurable by UEFI depending on the
    platform being used. Add new device tree / ACPI properties that, if
    present, will override the pre-determined values currently used.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • Add support for ACPI to the amd-xgbe and amd-xgbe-phy drivers. This
    support converts many of the device tree APIs to the new device_property
    APIs.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • When receiving and processing extended next pages the base registers
    were used instead of the XNP registers. Update the code to use the
    device XNP and link partner XNP registers.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • Advertise and apply the Forward Error Correction capabilities of the
    device based on the FEC ability of the device. Also, remove the use
    of some hard coded values related to KR and FEC in preference of some
    #defines.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • The auto negotiation logic was geared to being the initiator of the
    auto negotiation. This presented problems when auto negotiation was
    initiated by the remote end. Change the auto negotiation logic to
    make use of the auto negotiation event interrupt thus allowing the
    auto negotiation state machine to function properly in either scenario.
    This also removes the polling during auto-negotiation.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • Since the Tx ring cleanup can run at the same time that data is being
    transmitted, a spin lock was used to protect the ring. This patch
    eliminates the need for Tx spinlocks by updating the current ring
    position only after all ownership bits for data being transmitted have
    been set. This will insure that ring operations in the Tx cleanup path
    do not interfere with the ring operations in the Tx transmit path.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • Make the Rx descriptor ring processing similar to the Tx descriptor
    ring processing. Remove the realloc_index and realloc_threshold
    variables and base everything on the current index counter and the
    dirty index counter.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • When performing a device restart, like during an MTU change, sometimes
    the device queues still have data and get hung up trying to flush
    resulting in the device becoming unresponsive until brought down and
    back up. To prevent this, always perform a device reset during a
    restart.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • Reads to registers are undefined when the PCS is powered down. To be
    safe, save the CTRL1 register used for power down during suspend and
    restore that value during resume.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • The amd-xgbe driver relies on the amd-xgbe-phy phylib driver. Add a
    check to be sure that if any errors occur during probing of the
    amd-xgbe-phy driver then the amd-xgbe driver returns an error.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • This set of patches resolves some checks reported by the checkpatch
    tool.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     
  • This set of patches resolves some checks reported by the checkpatch
    tool.

    Signed-off-by: Tom Lendacky
    Signed-off-by: David S. Miller

    Lendacky, Thomas
     

16 Jan, 2015

8 commits

  • Bump i40e to 1.2.6 and i40evf to 1.2.0 version.

    Change-ID: Ice127eee3a5a5d1b8765d83cff8c30f9f3b1bc32
    Signed-off-by: Sravanthi Tangeda
    Tested-by: Jim Young
    Signed-off-by: Jeff Kirsher

    Sravanthi Tangeda
     
  • Add parsing and reporting of iSCSI capability for a given device or
    function.

    Also add support for iSCSI partition type with DCB in NPAR mode.
    In this mode it is expected that software would configure both the LAN
    and iSCSI traffic classes for the iSCSI partition; whereas all the NIC
    type partitions will use LAN TC (TC0) only.
    Hence, the patch enables querying of DCB configuration in MFP mode and
    configures TCs for iSCSI partition type.

    Though NIC type partitions may not have more than 1 TC enabled for them
    the port may have multiple TCs enabled and hence I40E_FLAG_DCB_ENABLED
    will be set/reset on all the partitions based on number of TCs on the
    port. This is required as in DCB environment it is expected that all
    traffic will be priority tagged.

    Change-ID: I8c6e1cfd46c46d8a39c57d9020d9ff8d42ed8a7d
    Signed-off-by: Neerav Parikh
    Signed-off-by: Jeff Kirsher

    Neerav Parikh
     
  • Instead of leaving the Rx timestamps in the same mode as before if we
    disable the Rx logic, we can set it into a mode that has the fewest
    possible timestamps generated. To do this, select only V1 mode, but do
    not enable UDP packet recognition. This should eliminate all (or at
    least almost all) Rx timestamps, since V1 packets are always over UDP.

    Change-ID: If847288e0030a716e059c4c33ab114f2cf038f05
    Signed-off-by: Jacob Keller
    Acked-by: Shannon Nelson
    Signed-off-by: Jeff Kirsher

    Jacob Keller
     
  • It's possible that the user configured only Tx hardware timestamping,
    and thus we might be receiving PTP traffic which we timestamp but which
    software never reads. In this case we don't want to check for Rx
    timestamp hang, because we already know that software won't be handling
    them. Thus, we add the same check against pf->ptp_rx as we have in the
    Rx timestamp code path.

    Change-ID: I66486c8dba307facbff8eace4e52e2f083789d1b
    Signed-off-by: Jacob Keller
    Acked-by: Shannon Nelson
    Signed-off-by: Jeff Kirsher

    Jacob Keller
     
  • Add lldp control commands, add oem ocsd and ocbb commands.

    Change-ID: I89eba2bd02013d0a44e1ce900559c54bb15f4a66
    Signed-off-by: Shannon Nelson
    Signed-off-by: Kamil Krawczyk
    Signed-off-by: Jeff Kirsher

    Shannon Nelson
     
  • Fix up NVM config read and write data structs.

    Signed-off-by: Shannon Nelson
    Signed-off-by: Kamil Krawczyk
    Signed-off-by: Jeff Kirsher

    Jeff Kirsher
     
  • Add struct size checks to many of the indirect structs and a few
    command structs that were left out previously.

    Change-ID: I7810b9af0f04e3ced670639f8671daf7df9b3f4d
    Signed-off-by: Shannon Nelson
    Acked-by: Greg Rose
    Signed-off-by: Jeff Kirsher

    Shannon Nelson
     
  • Disable firmware LLDP agent for NICs with firmware version lower than
    v4.3. Added a message when driver disables the firmware LLDP agent on
    such NICs.

    Change-ID: Ia8abf89439c70cb50e23db82753d7d282265506b
    Signed-off-by: Neerav Parikh
    Signed-off-by: Jeff Kirsher

    Neerav Parikh