1. 04 Oct, 2020 27 commits
  2. 03 Oct, 2020 13 commits
    • Yuchung Cheng's avatar
      tcp: account total lost packets properly · 9cd8b6c9
      Yuchung Cheng authored
      The retransmission refactoring patch
      68698970 ("tcp: simplify tcp_mark_skb_lost")
      does not properly update the total lost packet counter which may
      break the policer mode in BBR. This patch fixes it.
      
      Fixes: 68698970 ("tcp: simplify tcp_mark_skb_lost")
      Reported-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9cd8b6c9
    • David S. Miller's avatar
      Merge branch 'net-iucv-next' · 223b32db
      David S. Miller authored
      Julian Wiedmann says:
      
      ====================
      net/iucv: updates 2020-10-01
      
      Just two (rare) patches, and both deal with smatch warnings.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      223b32db
    • Julian Wiedmann's avatar
      net/iucv: fix indentation in __iucv_message_receive() · a29f245e
      Julian Wiedmann authored
      smatch complains about
      net/iucv/iucv.c:1119 __iucv_message_receive() warn: inconsistent indenting
      
      While touching this line, also make the return logic consistent and thus
      get rid of a goto label.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a29f245e
    • Julian Wiedmann's avatar
      net/af_iucv: right-size the uid variable in iucv_sock_bind() · 398999ba
      Julian Wiedmann authored
      smatch complains about
      net/iucv/af_iucv.c:624 iucv_sock_bind() error: memcpy() 'sa->siucv_user_id' too small (8 vs 9)
      
      Which is absolutely correct - the memcpy() takes 9 bytes (sizeof(uid))
      from an 8-byte field (sa->siucv_user_id).
      Luckily the sockaddr_iucv struct contains more data after the
      .siucv_user_id field, and we checked the size of the passed data earlier
      on. So the memcpy() won't accidentally read from an invalid location.
      
      Fix the warning by reducing the size of the uid variable to what's
      actually needed, and thus reducing the amount of copied data.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      398999ba
    • Taehee Yoo's avatar
      net: remove NETDEV_HW_ADDR_T_SLAVE · 8e1b3884
      Taehee Yoo authored
      NETDEV_HW_ADDR_T_SLAVE is not used anymore, remove it.
      Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e1b3884
    • David S. Miller's avatar
      Merge branch 'genetlink-per-op-policy-export' · 186e26eb
      David S. Miller authored
      Johannes Berg says:
      
      ====================
      genetlink per-op policy export
      
      Here's a respin, now including Jakub's patch last so that it will
      do the right thing from the start.
      
      The first patch remains the same, of course; the others have mostly
      some rebasing going on, except for the actual export patch (patch 4)
      which is adjusted per Jakub's review comments about exporting the
      policy only if it's actually used for do/dump.
      
      To see that, the dump for "nlctrl" (i.e. the generic netlink control)
      is instructive, because the ops are this:
      
              {
                      .cmd            = CTRL_CMD_GETFAMILY,
                      .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
                      .policy         = ctrl_policy_family,
                      .maxattr        = ARRAY_SIZE(ctrl_policy_family) - 1,
                      .doit           = ctrl_getfamily,
                      .dumpit         = ctrl_dumpfamily,
              },
              {
                      .cmd            = CTRL_CMD_GETPOLICY,
                      .policy         = ctrl_policy_policy,
                      .maxattr        = ARRAY_SIZE(ctrl_policy_policy) - 1,
                      .start          = ctrl_dumppolicy_start,
                      .dumpit         = ctrl_dumppolicy,
                      .done           = ctrl_dumppolicy_done,
              },
      
      So we exercise both "don't have doit" and "GENL_DONT_VALIDATE_DUMP"
      parts, and get (with the current genl patch):
      
      $ genl ctrl policy name nlctrl
      	ID: 0x10  op 3 policies: do=0
      	ID: 0x10  op 10 policies: dump=1
      	ID: 0x10  policy[0]:attr[1]: type=U16 range:[0,65535]
      	ID: 0x10  policy[0]:attr[2]: type=NUL_STRING max len:15
      	ID: 0x10  policy[1]:attr[1]: type=U16 range:[0,65535]
      	ID: 0x10  policy[1]:attr[2]: type=NUL_STRING max len:15
      	ID: 0x10  policy[1]:attr[10]: type=U32 range:[0,4294967295]
      ====================
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      186e26eb
    • Jakub Kicinski's avatar
      genetlink: allow dumping command-specific policy · e992a6ed
      Jakub Kicinski authored
      Right now CTRL_CMD_GETPOLICY can only dump the family-wide
      policy. Support dumping policy of a specific op.
      
      v3:
       - rebase after per-op policy export and handle that
      v2:
       - make cmd U32, just in case.
      v1:
       - don't echo op in the output in a naive way, this should
         make it cleaner to extend the output format for dumping
         policies for all the commands at once in the future.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/r/20201001225933.1373426-11-kuba@kernel.orgSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e992a6ed
    • Johannes Berg's avatar
      genetlink: properly support per-op policy dumping · 50a896cf
      Johannes Berg authored
      Add support for per-op policy dumping. The data is pretty much
      as before, except that now the assumption that the policy with
      index 0 is "the" policy no longer holds - you now need to look
      at the new CTRL_ATTR_OP_POLICY attribute which is a nested attr
      (indexed by op) containing attributes for do and dump policies.
      
      When a single op is requested, the CTRL_ATTR_OP_POLICY will be
      added in the same way, since do and dump policies may differ.
      
      v2:
       - conditionally advertise per-command policies only if there
         actually is a policy being used for the do/dump and it's
         present at all
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50a896cf
    • Johannes Berg's avatar
      genetlink: factor skb preparation out of ctrl_dumppolicy() · aa85ee5f
      Johannes Berg authored
      We'll need this later for the per-op policy index dump.
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      aa85ee5f
    • Johannes Berg's avatar
      netlink: rework policy dump to support multiple policies · 04a351a6
      Johannes Berg authored
      Rework the policy dump code a bit to support adding multiple
      policies to a single dump, in order to e.g. support per-op
      policies in generic netlink.
      
      v2:
       - move kernel-doc to implementation [Jakub]
       - squash the first patch to not flip-flop on the prototype
         [Jakub]
       - merge netlink_policy_dump_get_policy_idx() with the old
         get_policy_idx() we already had
       - rebase without Jakub's patch to have per-op dump
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      04a351a6
    • Johannes Berg's avatar
      netlink: compare policy more accurately · 899b07c5
      Johannes Berg authored
      The maxtype is really an integral part of the policy, and while we
      haven't gotten into a situation yet where this happens, it seems
      that some developer might eventually have two places pointing to
      identical policies, with different maxattr to exclude some attrs
      in one of the places.
      
      Even if not, it's really the right thing to compare both since the
      two data items fundamentally belong together.
      
      v2:
       - also do the proper comparison in get_policy_idx()
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      899b07c5
    • David S. Miller's avatar
      Merge branch 'genetlink-support-per-command-policy-dump' · 678cdd49
      David S. Miller authored
      Jakub Kicinski says:
      
      ====================
      genetlink: support per-command policy dump
      
      The objective of this series is to dump ethtool policies
      to be able to tell which flags are supported by the kernel.
      Current release adds ETHTOOL_FLAG_STATS for dumping extra
      stats, but because of strict checking we need to make sure
      that the flag is actually supported before setting it in
      a request.
      
      Ethtool policies are per command, and so far only dumping
      family policies was supported.
      
      The series adds new set of "light" ops to genl families which
      don't have all the callbacks, and won't have the policy.
      Most of families are then moved to these ops. This gives
      us 4096B in savings on an allyesconfig build (not counting
      the growth that would have happened when policy is added):
      
           text       data       bss        dec       hex
      244415581  227958581  78372980  550747142  20d3bc06
      244415581  227962677  78372980  550751238  20d3cc06
      
      Next 5 patches deal the dumping per-op policy.
      
      v3:
      
      The actually patch to dump per-op policy was taken out and
      will come in a series from Johannes, to make sure uAPI is
      consistent from the start.
      
      For dump-specific policies I think it should be fine to add
      a new pair of members to the "full" ops, and not overthink it.
      
      v2:
       - remove the stale comment in taskstats
       - split patch 8 -> 8, 9
       - now the getfamily policy is also in the op
       - make cmd u32
      v1:
       - replace remaining uses of "light" with "small"
       - fix dump (ops can't be on the stack there)
       - coding changes in patch 4
       - new patch 7
       - don't echo op in responses - to make dump all easier
      
      Dave - this series will cause a very trivial conflict with
      the patch I sent to net. Both sides add some kdoc to struct
      genl_ops so we'll need to keep it all.  I'm sending this
      already because I also need to restructure ethool policies
      in time for 5.10 if we want to use it for the stats flag.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      678cdd49
    • Jakub Kicinski's avatar
      genetlink: switch control commands to per-op policies · a4bb4f5f
      Jakub Kicinski authored
      In preparation for adding a new attribute to CTRL_CMD_GETPOLICY
      split the policies for getpolicy and getfamily apart.
      
      This will cause a slight user-visible change in that dumping
      the policies will switch from per family to per op, but
      supposedly sniffer-type applications (which are the main use
      case for policy dumping thus far) should support both, anyway.
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4bb4f5f