1. 03 Apr, 2024 2 commits
    • Gustavo A. R. Silva's avatar
      nfp: Avoid -Wflex-array-member-not-at-end warnings · d88cabfd
      Gustavo A. R. Silva authored
      -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
      ready to enable it globally.
      
      There is currently an object (`tl`), at the beginning of multiple
      structures, that contains a flexible structure (`struct nfp_dump_tl`),
      for example:
      
      struct nfp_dumpspec_csr {
              struct nfp_dump_tl tl;
      
              ...
      
              __be32 register_width;  /* in bits */
      };
      
      So, in order to avoid ending up with flexible-array members in the
      middle of multiple other structs, we use the `struct_group_tagged()`
      helper to separate the flexible array from the rest of the members
      in the flexible structure:
      
      struct nfp_dump_tl {
      	struct_group_tagged(nfp_dump_tl_hdr, hdr,
      
      	... the rest of members
      
      	);
              char data[];
      };
      
      With the change described above, we now declare objects of the type of
      the tagged struct, in this case `struct nfp_dump_tl_hdr`, without
      embedding flexible arrays in the middle of another struct:
      
      struct nfp_dumpspec_csr {
              struct nfp_dump_tl_hdr tl;
      
      	...
      
              __be32 register_width;  /* in bits */
      };
      
      Also, use `container_of()` whenever we need to retrieve a pointer to
      the flexible structure, through which we can access the flexible
      array if needed.
      
      So, with these changes, fix 33 of the following warnings:
      drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c:58:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c:64:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c:70:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c:78:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c:87:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      drivers/net/ethernet/netronome/nfp/nfp_net_debugdump.c:92:28: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      
      Link: https://github.com/KSPP/linux/issues/202Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/ZgYWlkxdrrieDYIu@neatSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d88cabfd
    • Paweł Owoc's avatar
      net: phy: aquantia: add support for AQR114C PHY ID · c278ec64
      Paweł Owoc authored
      Add support for AQR114C PHY ID. This PHY advertise 10G speed:
      SPEED(0x04): 0x6031
        capabilities: -400g +5g +2.5g -200g -25g -10g-xr -100g -40g -10g/1g -10
                      +100 +1000 -10-ts -2-tl +10g
      EXTABLE(0x0B): 0x40fc
        capabilities: -10g-cx4 -10g-lrm +10g-t +10g-kx4 +10g-kr +1000-t +1000-kx
                      +100-tx -10-t -p2mp -40g/100g -1000/100-t1 -25g -200g/400g
                      +2.5g/5g -1000-h
      
      but supports only up to 5G speed (as with AQR111/111B0).
      AQR111 init config is used to set max speed 5G.
      Signed-off-by: default avatarPaweł Owoc <frut3k7@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20240401145114.1699451-1-frut3k7@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c278ec64
  2. 02 Apr, 2024 12 commits
  3. 01 Apr, 2024 26 commits