Skip to content

Commit

Permalink
Merge branch 'nfp-crc32-rss-hash-port-name-reporting-and-misc-fastpat…
Browse files Browse the repository at this point in the history
…h-cleanups'

Jakub Kicinski says:

====================
nfp: CRC32 RSS hash, port name reporting and misc fastpath cleanups

This series adds support for CRC32 RSS hash function to kernel API
of which NFP driver immediately makes use.  There is also a
.ndo_get_phys_port_name() implementation conforming to switchdev
name format.  Small patch takes advantage of napi_complete_done()'s
return code.  Simon provides a fix for potentially trusting values
returned from FW too much.

A handful of unassuming fast path adjustments is also thrown in to make
the upcoming xdp_adjust_head() series easier to review.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 10, 2017
2 parents 581319c + 5692dbb commit 96d7552
Show file tree
Hide file tree
Showing 11 changed files with 216 additions and 87 deletions.
15 changes: 13 additions & 2 deletions drivers/net/ethernet/netronome/nfp/nfp_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@

/* Forward declarations */
struct nfp_cpp;
struct nfp_eth_table_port;
struct nfp_net;
struct nfp_net_r_vector;

Expand Down Expand Up @@ -434,18 +435,20 @@ struct nfp_stat_pair {

/**
* struct nfp_net - NFP network device structure
* @pdev: Backpointer to PCI device
* @dev: Backpointer to struct device
* @netdev: Backpointer to net_device structure
* @is_vf: Is the driver attached to a VF?
* @bpf_offload_skip_sw: Offloaded BPF program will not be rerun by cls_bpf
* @bpf_offload_xdp: Offloaded BPF program is XDP
* @chained_metadata_format: Firemware will use new metadata format
* @ctrl: Local copy of the control register/word.
* @fl_bufsz: Currently configured size of the freelist buffers
* @rx_offset: Offset in the RX buffers where packet data starts
* @xdp_prog: Installed XDP program
* @fw_ver: Firmware version
* @cap: Capabilities advertised by the Firmware
* @max_mtu: Maximum support MTU advertised by the Firmware
* @rss_hfunc: RSS selected hash function
* @rss_cfg: RSS configuration
* @rss_key: RSS secret key
* @rss_itbl: RSS indirection table
Expand Down Expand Up @@ -494,15 +497,18 @@ struct nfp_stat_pair {
* @debugfs_dir: Device directory in debugfs
* @ethtool_dump_flag: Ethtool dump flag
* @port_list: Entry on device port list
* @pdev: Backpointer to PCI device
* @cpp: CPP device handle if available
* @eth_port: Translated ETH Table port entry
*/
struct nfp_net {
struct pci_dev *pdev;
struct device *dev;
struct net_device *netdev;

unsigned is_vf:1;
unsigned bpf_offload_skip_sw:1;
unsigned bpf_offload_xdp:1;
unsigned chained_metadata_format:1;

u32 ctrl;
u32 fl_bufsz;
Expand All @@ -518,6 +524,7 @@ struct nfp_net {
u32 cap;
u32 max_mtu;

u8 rss_hfunc;
u32 rss_cfg;
u8 rss_key[NFP_NET_CFG_RSS_KEY_SZ];
u8 rss_itbl[NFP_NET_CFG_RSS_ITBL_SZ];
Expand Down Expand Up @@ -584,7 +591,10 @@ struct nfp_net {

struct list_head port_list;

struct pci_dev *pdev;
struct nfp_cpp *cpp;

struct nfp_eth_table_port *eth_port;
};

struct nfp_net_ring_set {
Expand Down Expand Up @@ -776,6 +786,7 @@ void nfp_net_netdev_clean(struct net_device *netdev);
void nfp_net_set_ethtool_ops(struct net_device *netdev);
void nfp_net_info(struct nfp_net *nn);
int nfp_net_reconfig(struct nfp_net *nn, u32 update);
unsigned int nfp_net_rss_key_sz(struct nfp_net *nn);
void nfp_net_rss_write_itbl(struct nfp_net *nn);
void nfp_net_rss_write_key(struct nfp_net *nn);
void nfp_net_coalesce_write_cfg(struct nfp_net *nn);
Expand Down
Loading

0 comments on commit 96d7552

Please sign in to comment.