1. 22 Sep, 2018 10 commits
    • Vakul Garg's avatar
      net/tls: Add support for async encryption of records for performance · a42055e8
      Vakul Garg authored
      In current implementation, tls records are encrypted & transmitted
      serially. Till the time the previously submitted user data is encrypted,
      the implementation waits and on finish starts transmitting the record.
      This approach of encrypt-one record at a time is inefficient when
      asynchronous crypto accelerators are used. For each record, there are
      overheads of interrupts, driver softIRQ scheduling etc. Also the crypto
      accelerator sits idle most of time while an encrypted record's pages are
      handed over to tcp stack for transmission.
      
      This patch enables encryption of multiple records in parallel when an
      async capable crypto accelerator is present in system. This is achieved
      by allowing the user space application to send more data using sendmsg()
      even while previously issued data is being processed by crypto
      accelerator. This requires returning the control back to user space
      application after submitting encryption request to accelerator. This
      also means that zero-copy mode of encryption cannot be used with async
      accelerator as we must be done with user space application buffer before
      returning from sendmsg().
      
      There can be multiple records in flight to/from the accelerator. Each of
      the record is represented by 'struct tls_rec'. This is used to store the
      memory pages for the record.
      
      After the records are encrypted, they are added in a linked list called
      tx_ready_list which contains encrypted tls records sorted as per tls
      sequence number. The records from tx_ready_list are transmitted using a
      newly introduced function called tls_tx_records(). The tx_ready_list is
      polled for any record ready to be transmitted in sendmsg(), sendpage()
      after initiating encryption of new tls records. This achieves parallel
      encryption and transmission of records when async accelerator is
      present.
      
      There could be situation when crypto accelerator completes encryption
      later than polling of tx_ready_list by sendmsg()/sendpage(). Therefore
      we need a deferred work context to be able to transmit records from
      tx_ready_list. The deferred work context gets scheduled if applications
      are not sending much data through the socket. If the applications issue
      sendmsg()/sendpage() in quick succession, then the scheduling of
      tx_work_handler gets cancelled as the tx_ready_list would be polled from
      application's context itself. This saves scheduling overhead of deferred
      work.
      
      The patch also brings some side benefit. We are able to get rid of the
      concept of CLOSED record. This is because the records once closed are
      either encrypted and then placed into tx_ready_list or if encryption
      fails, the socket error is set. This simplifies the kernel tls
      sendpath. However since tls_device.c is still using macros, accessory
      functions for CLOSED records have been retained.
      Signed-off-by: default avatarVakul Garg <vakul.garg@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a42055e8
    • YueHaibing's avatar
      net: freescale: fix return type of ndo_start_xmit function · 06983aa5
      YueHaibing authored
      The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
      which is a typedef for an enum type, so make sure the implementation in
      this driver has returns 'netdev_tx_t' value, and change the function
      return type to netdev_tx_t.
      
      Found by coccinelle.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06983aa5
    • YueHaibing's avatar
      net: micrel: fix return type of ndo_start_xmit function · 2b49117a
      YueHaibing authored
      The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
      which is a typedef for an enum type, so make sure the implementation in
      this driver has returns 'netdev_tx_t' value, and change the function
      return type to netdev_tx_t.
      
      Found by coccinelle.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b49117a
    • Florian Fainelli's avatar
      net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider · b78ac6ec
      Florian Fainelli authored
      Allow the configuration of the MDIO clock divider when the Device Tree
      contains 'clock-frequency' property (similar to I2C and SPI buses).
      Because the hardware may have lost its state during suspend/resume,
      re-apply the MDIO clock divider upon resumption.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b78ac6ec
    • Nathan Chancellor's avatar
      net: lan78xx: Avoid unnecessary self assignment · 94e7c844
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/net/usb/lan78xx.c:940:11: warning: explicitly assigning value of
      variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign]
                              offset = offset;
                              ~~~~~~ ^ ~~~~~~
      1 warning generated.
      
      Reorder the if statement to acheive the same result and avoid a self
      assignment warning.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/129Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94e7c844
    • Nathan Chancellor's avatar
      net: fddi: skfp: Remove unused function · 6b8e327c
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/net/fddi/skfp/pcmplc.c:1257:6: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              phy = phy ; on_off = on_off ;
              ~~~ ^ ~~~
      drivers/net/fddi/skfp/pcmplc.c:1257:21: warning: explicitly assigning
      value of variable of type 'int' to itself [-Wself-assign]
              phy = phy ; on_off = on_off ;
                          ~~~~~~ ^ ~~~~~~
      2 warnings generated.
      
      Turns out this entire function doesn't actually do anything since
      SK_UNUSED is just casting the pointer to void. Remove it to silence
      this Clang warning.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/128Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b8e327c
    • Nathan Chancellor's avatar
      bna: Remove unnecessary self assignment · 83b4768e
      Nathan Chancellor authored
      Clang warns when a variable is assigned to itself.
      
      drivers/net/ethernet/brocade/bna/bna_enet.c:1800:9: warning: explicitly
      assigning value of variable of type 'int' to itself [-Wself-assign]
              for (i = i; i < (bna->ioceth.attr.num_ucmac * 2); i++)
                   ~ ^ ~
      drivers/net/ethernet/brocade/bna/bna_enet.c:1835:9: warning: explicitly
      assigning value of variable of type 'int' to itself [-Wself-assign]
              for (i = i; i < (bna->ioceth.attr.num_mcmac * 2); i++)
                   ~ ^ ~
      2 warnings generated.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/110Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83b4768e
    • Nathan Chancellor's avatar
      net: neterion: vxge: Remove unnecessary parentheses · b1e51eab
      Nathan Chancellor authored
      Clang warns when multiple pairs of parentheses are used for a single
      conditional statement.
      
      drivers/net/ethernet/neterion/vxge/vxge-traffic.c:2265:31: warning:
      equality comparison with extraneous parentheses [-Wparentheses-equality]
              if ((hldev->config.intr_mode ==
      VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
                   ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/ethernet/neterion/vxge/vxge-traffic.c:2265:31: note: remove
      extraneous parentheses around the comparison to silence this warning
              if ((hldev->config.intr_mode ==
      VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
                  ~                        ^                                 ~
      drivers/net/ethernet/neterion/vxge/vxge-traffic.c:2265:31: note: use '='
      to turn this equality comparison into an assignment
              if ((hldev->config.intr_mode ==
      VXGE_HW_INTR_MODE_MSIX_ONE_SHOT))
                                           ^~
                                           =
      1 warning generated.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/124Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b1e51eab
    • Heiner Kallweit's avatar
      net: phy: don't reschedule state machine when PHY is halted · 075ddebc
      Heiner Kallweit authored
      When being in state PHY_HALTED we don't have to reschedule the
      state machine, phy_start() will start it again.
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      075ddebc
    • Romain Aviolat's avatar
      DRIVERS: net: macsec: Fix multiple coding style issues · 7979472b
      Romain Aviolat authored
      This patch fixes a couple of issues highlighted by checkpatch.pl:
      
          * Missing a blank line after declarations
          * Alignment should match open parenthesis
      Signed-off-by: default avatarRomain Aviolat <r.aviolat@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7979472b
  2. 21 Sep, 2018 20 commits
  3. 20 Sep, 2018 10 commits