1. 11 Apr, 2017 5 commits
  2. 10 Apr, 2017 17 commits
  3. 09 Apr, 2017 2 commits
    • David S. Miller's avatar
      Revert "rtnl: Add support for netdev event to link messages" · bf74b20d
      David S. Miller authored
      This reverts commit def12888.
      
      As per discussion between Roopa Prabhu and David Ahern, it is
      advisable that we instead have the code collect the setlink triggered
      events into a bitmask emitted in the IFLA_EVENT netlink attribute.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bf74b20d
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 0492b71c
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2017-04-08
      
      This series contains updates to i40e and i40evf only.
      
      Mitch fixes an issue where the client driver (i40iw) was attempting to
      load on x710 devices (which do not support iWARP), so only register with
      the client if iWARP is supported.
      
      Jake fixes up error messages to better clarify to the user when adding a
      invalid flow type.  Updates the driver to look up the MAC address from
      eth_get_platform_mac_address() first before checking what the firmware
      provides.  Cleans up code so we are not repeating a duplicate loop, by
      checking both transmit and receive queues in a single loop.  Also cleans
      up flags never used, so remove the definitions.
      
      Alex does cleanup so that we are always updating pf->flags when a change
      is made to the private flags.  Adds support for 3K buffers to the receive
      path so that we can provide the additional padding needed in the event
      of NET_IP_ALIGN being non-zero or a cache line being greater than 64.
      Adds support for build_skb() to i40e/i40evf.
      
      Maciej adjusts the scope of the rtnl lock held during reset because it
      was stopping other PFs from running their reset procedures.
      
      Alan reduces code complexity in i40e_detect_recover_hung_queue().
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0492b71c
  4. 08 Apr, 2017 16 commits
    • David S. Miller's avatar
      Merge branch 'dsa-receive-path-simplifications' · 417d978f
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      net: dsa: Receive path simplifications
      
      This patch series does factor the common code found in all tag implementations
      into dsa_switch_rcv(). The original motivation was to add GRO support, but this
      may be a lot of work with unclear benefits at this point.
      
      Changes in v2:
      - take care of tag_mtk.c in the process
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      417d978f
    • Florian Fainelli's avatar
      net: dsa: Factor bottom tag receive functions · a86d8bec
      Florian Fainelli authored
      All DSA tag receive functions do strictly the same thing after they have located
      the originating source port from their tag specific protocol:
      
      - push ETH_HLEN bytes
      - set pkt_type to PACKET_HOST
      - call eth_type_trans()
      - bump up counters
      - call netif_receive_skb()
      
      Factor all of that into dsa_switch_rcv(). This also makes us return a pointer to
      a sk_buff, which makes us symetric with the xmit function.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a86d8bec
    • Florian Fainelli's avatar
      net: dsa: Move skb_unshare() to dsa_switch_rcv() · 16c5dcb1
      Florian Fainelli authored
      All DSA tag receive functions need to unshare the skb before mangling it, move
      this to the generic dsa_switch_rcv() function which will allow us to make the
      tag receive function return their mangled skb without caring about freeing a
      NULL skb.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16c5dcb1
    • Florian Fainelli's avatar
      net: dsa: Do not check for NULL dst in tag parsers · 9d7f9c4f
      Florian Fainelli authored
      dsa_switch_rcv() already tests for dst == NULL, so there is no need to duplicate
      the same check within the tag receive functions.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d7f9c4f
    • Steffen Klassert's avatar
      skbuff: Extend gso_type to unsigned int. · 7f564528
      Steffen Klassert authored
      All available gso_type flags are currently in use, so
      extend gso_type from 'unsigned short' to 'unsigned int'
      to be able to add further flags.
      
      We reorder the struct skb_shared_info to use
      two bytes of the four byte hole before dataref.
      All fields before dataref are cleared, i.e.
      four bytes more than before the change.
      
      The remaining two byte hole is moved to the
      beginning of the structure, this protects us
      from immediate overwites on out of bound writes
      to the sk_buff head.
      
      Structure layout on x86-64 before the change:
      
      struct skb_shared_info {
      	unsigned char              nr_frags;             /*     0     1 */
      	__u8                       tx_flags;             /*     1     1 */
      	short unsigned int         gso_size;             /*     2     2 */
      	short unsigned int         gso_segs;             /*     4     2 */
      	short unsigned int         gso_type;             /*     6     2 */
      	struct sk_buff *           frag_list;            /*     8     8 */
      	struct skb_shared_hwtstamps hwtstamps;           /*    16     8 */
      	u32                        tskey;                /*    24     4 */
      	__be32                     ip6_frag_id;          /*    28     4 */
      	atomic_t                   dataref;              /*    32     4 */
      
      	/* XXX 4 bytes hole, try to pack */
      
      	void *                     destructor_arg;       /*    40     8 */
      	skb_frag_t                 frags[17];            /*    48   272 */
      	/* --- cacheline 5 boundary (320 bytes) --- */
      
      	/* size: 320, cachelines: 5, members: 12 */
      	/* sum members: 316, holes: 1, sum holes: 4 */
      };
      
      Structure layout on x86-64 after the change:
      
      struct skb_shared_info {
      	short unsigned int         _unused;              /*     0     2 */
      	unsigned char              nr_frags;             /*     2     1 */
      	__u8                       tx_flags;             /*     3     1 */
      	short unsigned int         gso_size;             /*     4     2 */
      	short unsigned int         gso_segs;             /*     6     2 */
      	struct sk_buff *           frag_list;            /*     8     8 */
      	struct skb_shared_hwtstamps hwtstamps;           /*    16     8 */
      	unsigned int               gso_type;             /*    24     4 */
      	u32                        tskey;                /*    28     4 */
      	__be32                     ip6_frag_id;          /*    32     4 */
      	atomic_t                   dataref;              /*    36     4 */
      	void *                     destructor_arg;       /*    40     8 */
      	skb_frag_t                 frags[17];            /*    48   272 */
      	/* --- cacheline 5 boundary (320 bytes) --- */
      
      	/* size: 320, cachelines: 5, members: 13 */
      };
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7f564528
    • Felix Manlunas's avatar
      liquidio: fix VF incorrectly indicating that it successfully set its VLAN · 0c264588
      Felix Manlunas authored
      For security reasons, NIC firmware does not allow VF to set its VLAN if PF
      set it already.  Firmware allows VF to set its VLAN if PF did not set it.
      After the VF instructs the firmware to set the VLAN, VF always indicates
      (via return 0) that the operation is successful--even for the times when it
      isn't.
      
      Put in a mechanism for the VF's set VLAN function to receive the firmware
      response code, then make that function return -EPERM if the firmware
      forbids the operation.
      
      Make that mechanism available for other functions that may, in the future,
      be interested in receiving the response code from the firmware.  That
      mechanism involves adding new fields to struct octnic_ctrl_pkt, so make all
      users of struct octnic_ctrl_pkt initialize the struct to zero before using
      it; otherwise, the mechanism might act on uninitialized garbage.
      Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
      Signed-off-by: default avatarDerek Chickles <derek.chickles@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c264588
    • K. Y. Srinivasan's avatar
      netvsc: Initialize all channel related state prior to opening the channel · bffb1842
      K. Y. Srinivasan authored
      Prior to opening the channel we should have all the state setup to handle
      interrupts. The current code does not do that; fix the bug. This bug
      can result in faults in the interrupt path.
      Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bffb1842
    • Florian Fainelli's avatar
      net: dsa: mv88e6xxx: Make SMI c22/c45 read/write functions static · 54a88e4c
      Florian Fainelli authored
      The SMI clause 22 & 45 read/write operations are local to the global2.c file,
      so make them static. This eliminates the following warning:
      
      drivers/net/dsa/mv88e6xxx/global2.c:571:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_read_c45' [-Wmissing-prototypes]
       int mv88e6xxx_g2_smi_phy_read_c45(struct mv88e6xxx_chip *chip, int addr,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/dsa/mv88e6xxx/global2.c:602:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_read_c22' [-Wmissing-prototypes]
       int mv88e6xxx_g2_smi_phy_read_c22(struct mv88e6xxx_chip *chip, int addr,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/dsa/mv88e6xxx/global2.c:635:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_write_c45' [-Wmissing-prototypes]
       int mv88e6xxx_g2_smi_phy_write_c45(struct mv88e6xxx_chip *chip, int addr,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/net/dsa/mv88e6xxx/global2.c:664:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_write_c22' [-Wmissing-prototypes]
       int mv88e6xxx_g2_smi_phy_write_c22(struct mv88e6xxx_chip *chip, int addr,
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Suggested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54a88e4c
    • Johannes Berg's avatar
      netlink: uapi: use hex numbers for NLM_F_* flags · 261a0a54
      Johannes Berg authored
      It's rather confusing that the netlink message flags are
      numbered 1, 2, 4, 8, 16, 32, <unused>, 0x100. Make that
      more understandable by numbering the lower ones with hex
      constants as well.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      261a0a54
    • Colin Ian King's avatar
      nfp: don't dereference a null nn->eth_port to print a warning · 1f1120a5
      Colin Ian King authored
      On the case where nn->eth_port is null the warning message
      is printing the port by dereferencing this null pointer.
      Remove the deference to avoid a crash when printing the
      warning message.
      
      Detected by CoverityScan, CID#1426198 ("Dereference after null check")
      
      Fixes: ce22f5a2 ("nfp: separate high level and low level NSP headers")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f1120a5
    • David S. Miller's avatar
      Merge branch 'net-SO_COOKIE' · 7cb164ef
      David S. Miller authored
      Chenbo Feng says:
      
      ====================
      New getsockopt option to retrieve socket cookie
      
      In the current kernel socket cookie implementation, there is no simple
      and direct way to retrieve the socket cookie based on file descriptor. A
      process mat need to get it from sock fd if it want to correlate with
      sock_diag output or use a bpf map with new socket cookie function.
      
      If userspace wants to receive the socket cookie for a given socket fd,
      it must send a SOCK_DIAG_BY_FAMILY dump request and look for the 5-tuple.
      This is slow and can be ambiguous in the case of sockets that have the
      same 5-tuple (e.g., tproxy / transparent sockets, SO_REUSEPORT sockets,
      etc.).
      
      As shown in the example program. The xt_eBPF program is using socket cookie
      to record the network traffics statistics and with the socket cookie
      retrieved by getsockopt. The program can directly access to a specific
      socket data without scanning the whole bpf map.
      ====================
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7cb164ef
    • Chenbo Feng's avatar
      Sample program using SO_COOKIE · 00f660ea
      Chenbo Feng authored
      Added a per socket traffic monitoring option to illustrate the usage
      of new getsockopt SO_COOKIE. The program is based on the socket traffic
      monitoring program using xt_eBPF and in the new option the data entry
      can be directly accessed using socket cookie. The cookie retrieved
      allow us to lookup an element in the eBPF for a specific socket.
      Signed-off-by: default avatarChenbo Feng <fengc@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00f660ea
    • Chenbo Feng's avatar
      New getsockopt option to get socket cookie · 5daab9db
      Chenbo Feng authored
      Introduce a new getsockopt operation to retrieve the socket cookie
      for a specific socket based on the socket fd.  It returns a unique
      non-decreasing cookie for each socket.
      Tested: https://android-review.googlesource.com/#/c/358163/Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarChenbo Feng <fengc@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5daab9db
    • David S. Miller's avatar
      Merge tag 'mlx5-updates-2017-04-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · c42cb98c
      David S. Miller authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2017-04-16
      
      This patchset provides some updates for the mlx5 drivers.
      
      From Majd,
      1st patch, Adds ConnectX-6 and ConnectX-6 VF PCI IDs support.
      
      From Guy,
      2nd patch, Adds RXFCS scatter support.
      3rd patch, Small cleanup to make a function static.
      
      From Eran,
      4th patch, Adds 4 zeros padding to ethtool FW version.
      6th patch, Trevial code reuse cleanup
      
      From Inbar,
      5th patch, Show board id in ethtool driver information
      
      From Saeed,
      7th patch, Set default RX moderation parameters on driver load
      as a small fix for the latest fail-safe config feature.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c42cb98c
    • Alexander Duyck's avatar
      i40e/i40evf: Use build_skb to build frames · f8b45b74
      Alexander Duyck authored
      This patch is meant to improve the performance of the Rx path.
      Specifically by using build_skb we have several distinct advantages.
      
      In the case of small frames we were previously using a copy-break approach.
      This means that we were allocating a page fragment to use for skb->head,
      and were having to copy the packet into that region.  Both of those calls
      are now avoided since we just build the skb around the data.
      
      In the case of large frames the gains are much more significant.
      Specifically we were having to allocate skb->head, and copy the headers as
      before.  However in addition we were having to parse the header using
      eth_get_headlen which could be quite expensive.  All of this is avoided by
      building the frame around the data.  I have seen gains as high as 30% when
      using VXLAN for instance due to just header pulling overhead.
      
      Finally with all this in place it also sets us up to start looking at
      enabling XDP.  Specifically we now have a path in which the data is in the
      page and the frame is built around it.  So if we parse it with XDP before
      we call build_skb we can take care of any necessary processing there.
      
      Change-ID: Id4bdd618e94473d41f892417e5d8019639e421e3
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f8b45b74
    • Alexander Duyck's avatar
      i40e/i40evf: Add support for padding start of frames · ca9ec088
      Alexander Duyck authored
      This patch adds padding to the start of frames to make room for headroom
      for us to eventually start using build_skb.  Right now we guarantee at
      least NET_SKB_PAD + NET_IP_ALIGN, however we allocate more space if more is
      available.  For example on x86 the headroom should be 192 bytes.
      
      On systems that have too large of a cache line size to support storing 1.5K
      padding and shared info we default to using 3K buffers and reserve
      everything that isn't used for skb_shared_info or the data buffer for
      headroom.
      
      Change-ID: I33c641c9a1ea10cf7cc484c2d20985368d2d709a
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      ca9ec088