1. 02 Aug, 2014 5 commits
    • Alexei Starovoitov's avatar
      net: filter: split 'struct sk_filter' into socket and bpf parts · 7ae457c1
      Alexei Starovoitov authored
      clean up names related to socket filtering and bpf in the following way:
      - everything that deals with sockets keeps 'sk_*' prefix
      - everything that is pure BPF is changed to 'bpf_*' prefix
      
      split 'struct sk_filter' into
      struct sk_filter {
      	atomic_t        refcnt;
      	struct rcu_head rcu;
      	struct bpf_prog *prog;
      };
      and
      struct bpf_prog {
              u32                     jited:1,
                                      len:31;
              struct sock_fprog_kern  *orig_prog;
              unsigned int            (*bpf_func)(const struct sk_buff *skb,
                                                  const struct bpf_insn *filter);
              union {
                      struct sock_filter      insns[0];
                      struct bpf_insn         insnsi[0];
                      struct work_struct      work;
              };
      };
      so that 'struct bpf_prog' can be used independent of sockets and cleans up
      'unattached' bpf use cases
      
      split SK_RUN_FILTER macro into:
          SK_RUN_FILTER to be used with 'struct sk_filter *' and
          BPF_PROG_RUN to be used with 'struct bpf_prog *'
      
      __sk_filter_release(struct sk_filter *) gains
      __bpf_prog_release(struct bpf_prog *) helper function
      
      also perform related renames for the functions that work
      with 'struct bpf_prog *', since they're on the same lines:
      
      sk_filter_size -> bpf_prog_size
      sk_filter_select_runtime -> bpf_prog_select_runtime
      sk_filter_free -> bpf_prog_free
      sk_unattached_filter_create -> bpf_prog_create
      sk_unattached_filter_destroy -> bpf_prog_destroy
      sk_store_orig_filter -> bpf_prog_store_orig_filter
      sk_release_orig_filter -> bpf_release_orig_filter
      __sk_migrate_filter -> bpf_migrate_filter
      __sk_prepare_filter -> bpf_prepare_filter
      
      API for attaching classic BPF to a socket stays the same:
      sk_attach_filter(prog, struct sock *)/sk_detach_filter(struct sock *)
      and SK_RUN_FILTER(struct sk_filter *, ctx) to execute a program
      which is used by sockets, tun, af_packet
      
      API for 'unattached' BPF programs becomes:
      bpf_prog_create(struct bpf_prog **)/bpf_prog_destroy(struct bpf_prog *)
      and BPF_PROG_RUN(struct bpf_prog *, ctx) to execute a program
      which is used by isdn, ppp, team, seccomp, ptp, xt_bpf, cls_bpf, test_bpf
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7ae457c1
    • Alexei Starovoitov's avatar
      net: filter: rename sk_convert_filter() -> bpf_convert_filter() · 8fb575ca
      Alexei Starovoitov authored
      to indicate that this function is converting classic BPF into eBPF
      and not related to sockets
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8fb575ca
    • Alexei Starovoitov's avatar
      net: filter: rename sk_chk_filter() -> bpf_check_classic() · 4df95ff4
      Alexei Starovoitov authored
      trivial rename to indicate that this functions performs classic BPF checking
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4df95ff4
    • Alexei Starovoitov's avatar
      net: filter: rename sk_filter_proglen -> bpf_classic_proglen · 009937e7
      Alexei Starovoitov authored
      trivial rename to better match semantics of macro
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      009937e7
    • Alexei Starovoitov's avatar
      net: filter: simplify socket charging · 278571ba
      Alexei Starovoitov authored
      attaching bpf program to a socket involves multiple socket memory arithmetic,
      since size of 'sk_filter' is changing when classic BPF is converted to eBPF.
      Also common path of program creation has to deal with two ways of freeing
      the memory.
      
      Simplify the code by delaying socket charging until program is ready and
      its size is known
      Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      278571ba
  2. 01 Aug, 2014 7 commits
  3. 31 Jul, 2014 28 commits
    • David S. Miller's avatar
      Merge branch 'stmmac-next' · 8e97b85a
      David S. Miller authored
      Vince Bridgers says:
      
      ====================
      net: stmmac: Improve mcast/ucast filter for snps
      
      This patch series adds Synopsys specific bindings for the Synopsys EMAC
      filter characteristics since those are implementation dependent. The
      multicast and unicast filtering code was improved to handle different
      configuration variations based on device tree settings.
      
      I verified the operation of the multicast and unicast filters through
      Synopsys support as requested during the V1 review, and tested the GMAC
      configuration on an Altera Cyclone 5 SOC (which supports 256 multicast
      bins and 128 Unicast addresses). The 10/100 variant of this driver
      modification was not tested, although it was compile tested. I shared
      the email thread results of the investigation through Synopsys with the
      stmmac maintainer.
      
      V4: Remove patch from series that addressed a sparse issue from a
          down rev'd version of sparse that does not show up in the
          latest version of sparse.
      V3: Break up the patch into interface and functional change patches
          per review comments
      V2: Confirm with Synopsys methods to determine number of Multicast bins
          and Unicast address filter entries per first round review comments.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e97b85a
    • Vince Bridgers's avatar
      net: stmmac: Support devicetree configs for mcast and ucast filter entries · 3b57de95
      Vince Bridgers authored
      This patch adds and modifies code to support multiple Multicast and Unicast
      Synopsys MAC filter configurations. The default configuration is defined to
      support legacy driver behavior, which is 64 Multicast bins. The Unicast
      filter code previously assumed all controllers support 32 or 16 Unicast
      addresses based on controller version number, but this has been corrected
      to support a default of 1 Unicast address. The filter configuration may
      be specified through the devicetree using a Synopsys specific device tree
      entry. This information was verified with Synopsys through
      Synopsys Support Case #8000684337 and shared with the maintainer.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b57de95
    • Vince Bridgers's avatar
      ARM: socfpga: Add socfpga Ethernet filter attributes entries · ea6856e3
      Vince Bridgers authored
      This patch adds socfpga Ethernet filter attributes for multicast
      and unicast filters per Synopsys Ethernet IP configuration chosen
      by Altera for the Cyclone 5 and Arria SOC FPGAs.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ea6856e3
    • Vince Bridgers's avatar
      dts: Add bindings for multicast hash bins and perfect filter entries · 94ceaa26
      Vince Bridgers authored
      This change adds bindings for the number of multicast hash bins and perfect
      filter entries supported by the Synopsys EMAC. The Synopsys EMAC core is
      configurable at device creation time, and can be configured for a different
      number of multicast hash bins and a different number of perfect filter
      entries. The device does not provide a way to query these parameters,
      therefore parameters are required. The Altera Cyclone V SOC has support for
      256 multicast hash bins and 128 perfect filter entries, and is different
      than what's currently provided in the stmmac driver.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      94ceaa26
    • Vince Bridgers's avatar
      net: stmmac: Correct set_filter for multicast and unicast cases · aefef4c1
      Vince Bridgers authored
      This patch removes the check for the number of mulitcast addresses
      when using hash based filtering since it's not necessary. If the number
      of multicast addresses in the list exceeds the number of multicast hash
      bins, the bins will "fold" over into one of the bins configured and
      enabled for the particular component instance.
      
      The default number of maximum unicast addresses was changed from 32 to 1
      since this number is not dependent on the component revision. The maximum
      number of multicast and unicast addresses is dependent on the configuration
      of the Synopsys EMAC configured by the SOC architect at the time the
      features were selected and configured for a particular component. Sadly,
      Synopsys does not provide a way to query the precise number supported
      by a particular component, so we must fall back on a devicetree entry.
      This configuration could vary from vendor to vendor (such as STMicro,
      Altera, etc).
      
      The multicast bins are set for every possible filtering case (including
      no entries) - previously the bits were set only if multicast filter entries
      were present.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aefef4c1
    • Vince Bridgers's avatar
      net: stmmac: Change MAC interface to support multiple filter configurations · 7ed24bbe
      Vince Bridgers authored
      The synopsys EMAC can be configured for different numbers of multicast hash
      bins and perfect filter entries at device creation time and there's no way
      to query this configuration information at runtime. As a result, a devicetree
      parameter is required in order for the driver to program these filters
      correctly for a particular device instance. This patch modifies the
      10/100/1000 MAC software interface such that these configuration parameters
      can be set at initialization time.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7ed24bbe
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next · a173e550
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter updates for net-next
      
      The following patchset contains netfilter updates for net-next, they are:
      
      1) Add the reject expression for the nf_tables bridge family, this
         allows us to send explicit reject (TCP RST / ICMP dest unrech) to
         the packets matching a rule.
      
      2) Simplify and consolidate the nf_tables set dumping logic. This uses
         netlink control->data to filter out depending on the request.
      
      3) Perform garbage collection in xt_hashlimit using a workqueue instead
         of a timer, which is problematic when many entries are in place in
         the tables, from Eric Dumazet.
      
      4) Remove leftover code from the removed ulog target support, from
         Paul Bolle.
      
      5) Dump unmodified flags in the netfilter packet accounting when resetting
         counters, so userspace knows that a counter was in overquota situation,
         from Alexey Perevalov.
      
      6) Fix wrong usage of the bitwise functions in nfnetlink_acct, also from
         Alexey.
      
      7) Fix a crash when adding new set element with an empty NFTA_SET_ELEM_LIST
         attribute.
      
      This patchset also includes a couple of cleanups for xt_LED from
      Duan Jiong and for nf_conntrack_ipv4 (using coccinelle) from
      Himangi Saraogi.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a173e550
    • Banerjee, Debabrata's avatar
      tcp: don't require root to read tcp_metrics · 388070fa
      Banerjee, Debabrata authored
      commit d23ff701 (tcp: add generic netlink support for tcp_metrics) introduced
      netlink support for the new tcp_metrics, however it restricted getting of
      tcp_metrics to root user only. This is a change from how these values could
      have been fetched when in the old route cache. Unless there's a legitimate
      reason to restrict the reading of these values it would be better if normal
      users could fetch them.
      
      Cc: Julian Anastasov <ja@ssi.bg>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarDebabrata Banerjee <dbanerje@akamai.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      388070fa
    • Daniel Borkmann's avatar
      team: fix releasing uninitialized pointer to BPF prog · 2b391ee2
      Daniel Borkmann authored
      Commit 34c5bd66 introduced the possibility that an
      uninitialized pointer on the stack (orig_fp) can call into
      sk_unattached_filter_destroy() when its value is non NULL.
      
      Before that commit orig_fp was only destroyed in the same
      block where it was assigned a valid BPF prog before. Fix it
      up by initializing it to NULL.
      
      Fixes: 34c5bd66 ("net: filter: don't release unattached filter through call_rcu()")
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Cc: Pablo Neira <pablo@netfilter.org>
      Cc: Alexei Starovoitov <ast@plumgrid.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b391ee2
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: check for unset NFTA_SET_ELEM_LIST_ELEMENTS attribute · 7d5570ca
      Pablo Neira Ayuso authored
      Otherwise, the kernel oopses in nla_for_each_nested when iterating over
      the unset attribute NFTA_SET_ELEM_LIST_ELEMENTS in the
      nf_tables_{new,del}setelem() path.
      
      netlink: 65524 bytes leftover after parsing attributes in process `nft'.
      [...]
      Oops: 0000 [#1] SMP
      [...]
      CPU: 2 PID: 6287 Comm: nft Not tainted 3.16.0-rc2+ #169
      RIP: 0010:[<ffffffffa0526e61>]  [<ffffffffa0526e61>] nf_tables_newsetelem+0x82/0xec [nf_tables]
      [...]
      Call Trace:
       [<ffffffffa05178c4>] nfnetlink_rcv+0x2e7/0x3d7 [nfnetlink]
       [<ffffffffa0517939>] ? nfnetlink_rcv+0x35c/0x3d7 [nfnetlink]
       [<ffffffff8137d300>] netlink_unicast+0xf8/0x17a
       [<ffffffff8137d6a5>] netlink_sendmsg+0x323/0x351
      [...]
      
      Fix this by returning -EINVAL if this attribute is not set, which
      doesn't make sense at all since those commands are there to add and to
      delete elements from the set.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      7d5570ca
    • Alexey Perevalov's avatar
      netfilter: nfnetlink_acct: avoid using NFACCT_F_OVERQUOTA with bit helper functions · b6d04688
      Alexey Perevalov authored
      Bit helper functions were used for manipulation with NFACCT_F_OVERQUOTA,
      but they are accepting pit position, but not a bit mask. As a result
      not a third bit for NFACCT_F_OVERQUOTA was set, but forth. Such
      behaviour was dangarous and could lead to unexpected overquota report
      result.
      Signed-off-by: default avatarAlexey Perevalov <a.perevalov@samsung.com>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      b6d04688
    • David S. Miller's avatar
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next · ccda4a77
      David S. Miller authored
      Steffen Klassert says:
      
      ====================
      pull request (net-next): ipsec-next 2014-07-30
      
      This is the last pull request for ipsec-next before I'll be
      off for two weeks starting on friday. David, can you please
      take urgent ipsec patches directly into net/net-next during
      this time?
      
      1) Error handling simplifications for vti and vti6.
         From Mathias Krause.
      
      2) Remove a duplicate semicolon after a return statement.
         From Christoph Paasch.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ccda4a77
    • Brian Norris's avatar
      net: bcmgenet: correct spelling · 7fc527f9
      Brian Norris authored
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7fc527f9
    • David S. Miller's avatar
      Merge branch 'libphy_mmd' · 989e9ad0
      David S. Miller authored
      Vince Bridgers says:
      
      ====================
      net: libphy: Add phy specific functions to access mmd regs
      
      This set of patches addresses a problem found with the Micrel ksz9021 phy and
      libphy, where the ksz9021 phy does not support mmd extended register access
      per the IEEE specification as assumed by libphy. The first patch adds a
      framework for phy specific support to specify their own function to access
      extended phy registers, return a failure code if not supported, or to default
      to libphy's IEEE defined method for accessing the mmd extended phy registers.
      
      This issue was found by using the Synopsys EMAC and a Micrel ksz9021 phy on the
      Altera Cyclone 5 SOC development kit. This patch was tested on the same system
      in both positive and negative test cases.
      
      V5: Revert name of mmd register access functions, check for phy specific
          driver override functions in mmd register access functions per
          Florian's comments to minimize source code changes
      V4: Correct error when formatting V3 patch - erroneous text cut from code
      V3: Correct formatting of function arguments, remove return statement from
          NULL functions, and add patch for PHY driver documentation per review
          comments.
      V2: Split the original patch submission into seperate patches for the libphy
          framework required for the modification and for the Micrel Phy.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      989e9ad0
    • Vince Bridgers's avatar
      Documentation: networking: phy.txt: Update text for indirect MMD access · 49193a66
      Vince Bridgers authored
      Update the PHY library documentation to describe how a specific PHY
      driver can use the PAL MMD register access routines or override those
      routines with it's own in the event the PHY does not support the IEEE
      standard for reading and writing MMD phy registers.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49193a66
    • Vince Bridgers's avatar
      net: libphy: Add stubs to hook IEEE MMD Register reads and writes · 19936942
      Vince Bridgers authored
      The Micrel ksz9021 PHY does not support standard IEEE standard MMD
      extended register access, therefore requires stubs to fail the read
      register method and do nothing for the write register method when
      libphy attempts to read and/or configure Energy Efficient Ethernet
      features in PHYS that do support those features. This problem
      was observed on an Altera Cyclone V SOC development kit that
      uses the Synopsys EMAC and the Micrel ksz9021 PHY. This patch
      was tested on the same board, and Energy Efficient Ethernet is
      now disabled as expected since the Micrel PHY does not support that
      feature.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      19936942
    • Vince Bridgers's avatar
      net: libphy: Add phy specific function to access mmd phy registers · 0c1d77df
      Vince Bridgers authored
      libphy was originally written assuming all phy devices support clause 45
      access extensions to the mmd registers through the indirection registers
      located within the first 16 phy registers. This assumption is not true
      in all cases, and one specific example is the Micrel ksz9021 10/100/1000
      Mbps phy. Using the stmmac driver, accessing the mmd registers to query
      and configure energy efficient Ethernet (EEE) features yielded unexpected
      behavior.
      
      This patch adds mmd access functions to the phy driver that can be
      overriden by the phy specific driver if the phy does not support this
      mechanism or uses it's own non-standard access mechanism. By default,
      the IEEE Compatible clause 45 access mechanism described in clause 22
      is used. With this patch, EEE query/configure functions as expected
      using the stmmac and the Micrel ksz9021 phy.
      Signed-off-by: default avatarVince Bridgers <vbridgers2013@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0c1d77df
    • Shruti Kanetkar's avatar
    • Madalin Bucur's avatar
      net/fsl: fix misspelled word · c1543d37
      Madalin Bucur authored
      Fix one misspelled word reported by codespell.
      Signed-off-by: default avatarMadalin Bucur <madalin.bucur@freescale.com>
      Signed-off-by: default avatarShruti Kanetkar <Shruti@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1543d37
    • Pablo Neira's avatar
      net: filter: don't release unattached filter through call_rcu() · 34c5bd66
      Pablo Neira authored
      sk_unattached_filter_destroy() does not always need to release the
      filter object via rcu. Since this filter is never attached to the
      socket, the caller should be responsible for releasing the filter
      in a safe way, which may not necessarily imply rcu.
      
      This is a short summary of clients of this function:
      
      1) xt_bpf.c and cls_bpf.c use the bpf matchers from rules, these rules
         are removed from the packet path before the filter is released. Thus,
         the framework makes sure the filter is safely removed.
      
      2) In the ppp driver, the ppp_lock ensures serialization between the
         xmit and filter attachment/detachment path. This doesn't use rcu
         so deferred release via rcu makes no sense.
      
      3) In the isdn/ppp driver, it is called from isdn_ppp_release()
         the isdn_ppp_ioctl(). This driver uses mutex and spinlocks, no rcu.
         Thus, deferred rcu makes no sense to me either, the deferred releases
         may be just masking the effects of wrong locking strategy, which
         should be fixed in the driver itself.
      
      4) In the team driver, this is the only place where the rcu
         synchronization with unattached filter is used. Therefore, this
         patch introduces synchronize_rcu() which is called from the
         genetlink path to make sure the filter doesn't go away while packets
         are still walking over it. I think we can revisit this once struct
         bpf_prog (that only wraps specific bpf code bits) is in place, then
         add some specific struct rcu_head in the scope of the team driver if
         Jiri thinks this is needed.
      
      Deferred rcu release for unattached filters was originally introduced
      in 302d6637 ("filter: Allow to create sk-unattached filters").
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      34c5bd66
    • Pablo Neira's avatar
      netfilter: xt_bpf: add mising opaque struct sk_filter definition · e10038a8
      Pablo Neira authored
      This structure is not exposed to userspace, so fix this by defining
      struct sk_filter; so we skip the casting in kernelspace. This is safe
      since userspace has no way to lurk with that internal pointer.
      
      Fixes: e6f30c73 ("netfilter: x_tables: add xt_bpf match")
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: default avatarWillem de Bruijn <willemb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e10038a8
    • Julia Lawall's avatar
      CAPI: use correct structure type name in sizeof · 5160ee93
      Julia Lawall authored
      Correct typo in the name of the type given to sizeof.  Because it is the
      size of a pointer that is wanted, the typo has no impact on compilation or
      execution.
      
      This problem was found using Coccinelle (http://coccinelle.lip6.fr/).  The
      semantic patch used can be found in message 0 of this patch series.
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5160ee93
    • David S. Miller's avatar
      Merge branch 'amd-xgbe-next' · 6b1bed79
      David S. Miller authored
      Tom Lendacky says:
      
      ====================
      amd-xgbe: AMD XGBE driver update 2014-07-25
      
      This patch series is dependent on the following patch that was
      applied to the net tree and needs to be applied to the net-next
      tree:
        332cfc82 - amd-xgbe: Fix error return code in xgbe_probe()
      
      The following series of patches includes fixes and new support in the
      driver.
      
      - Device bindings documentation update
      - Hardware timestamp support
      - 2.5GbE support changes
      - Fifo sizes based on active queues/rings
      - Phylib driver updates for:
        - Rate change completion check
        - KR training initiation
        - Auto-negotiation results
      - Traffic class support, including DCB support
      
      This patch series is based on net-next.
      
      Changes in V2:
        - Remove DBGPR(...., __func__) calls
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b1bed79
    • Lendacky, Thomas's avatar
      amd-xgbe: Add traffic class support · fca2d994
      Lendacky, Thomas authored
      This patch adds support for traffic classes as well as support
      for Data Center Bridging interfaces related to traffic classes
      and priority flow control.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fca2d994
    • Lendacky, Thomas's avatar
      amd-xgbe-phy: Print out the auto-negotiation method used · b668a3ae
      Lendacky, Thomas authored
      Add a netdev_info statement detailing whether auto-negotiation was
      completed through parallel detection or through the auto-negotiation
      protocol.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b668a3ae
    • Lendacky, Thomas's avatar
      amd-xgbe-phy: Updates to KR training initiation · 5c10e5cb
      Lendacky, Thomas authored
      As part of changing rates to KR mode, KR training is initiated. If
      the KR training is restarted it is possible to enter an invalid logic
      state. This can be avoided by asserting a training reset bit before
      initiating the KR training and then clearing the training reset bit.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c10e5cb
    • Lendacky, Thomas's avatar
      amd-xgbe-phy: Updates to rate change complete check · 169a6303
      Lendacky, Thomas authored
      Currently, the logic will loop endlessly waiting for a rate change
      to complete.  Add a counter so that if the rate change signals
      never indicate complete the loop will eventually exit.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      169a6303
    • Lendacky, Thomas's avatar
      amd-xgbe: Base queue fifo size and enablement on ring count · 853eb16b
      Lendacky, Thomas authored
      When setting the fifo sizes for the queues and enabling the queues
      use the number of active Tx and Rx queues that have been enabled
      not the maximum number available.
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      853eb16b