cxgb4 updates
Subsystems (2)
cover cxgb4 updates
Following is a series of 5 cxgb4 patches, all for net-next. Mainly they implement the get_rxnfc, get_rxfh_indir, and set_rxfh_indir ethtool ops, plus a couple of fixes.
PATCH 1/5 cxgb4: move the choice of interrupt type before net_device registration
We need to settle on the kind of interrupts we'll be using, a choice that also impacts the number of queues, before registering and making visible the net_devices. Move the relevant code up a bit.
--- drivers/net/cxgb4/cxgb4_main.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
drivers/net/cxgb4/cxgb4_main.c +7 -6
@@ -3507,6 +3507,12 @@ static int __devinit init_one(struct pci_dev *pdev, adapter->params.offload =0 ; } +/* See what interrupts we'll be using */ +if (msi >1 &&enable_msix (adapter) ==0 ) + adapter->flags |=USING_MSIX ; +else if (msi >0 &&pci_enable_msi (pdev) ==0 ) + adapter->flags |=USING_MSI ; +/* * The card is now ready to go. If any errors occur during device * registration we do not fail the whole card but rather proceed only
@@ -3542,12 +3548,6 @@ static int __devinit init_one(struct pci_dev *pdev,setup_debugfs (adapter); } -/* See what interrupts we'll be using */ -if (msi >1 &&enable_msix (adapter) ==0 ) - adapter->flags |=USING_MSIX ; -else if (msi >0 &&pci_enable_msi (pdev) ==0 ) - adapter->flags |=USING_MSI ; -if (is_offload (adapter))attach_ulds (adapter);
@@ -3571,6 +3571,7 @@ sriov:free_netdev (adapter->port[i]);if (adapter->flags &FW_OK )t4_fw_bye (adapter,0 ); +disable_msi (adapter); out_unmap_bar:iounmap (adapter->regs); out_free_adapter:
Signature · 1 line
1.5.4
PATCH 2/5 cxgb4: avoid duplicating some resource freeing code
Currently there are two copies of some resource freeing code, turn it into a function and call it.
--- drivers/net/cxgb4/cxgb4_main.c | 42 +++++++++++++++++++++++---------------- 1 files changed, 25 insertions(+), 17 deletions(-)
drivers/net/cxgb4/cxgb4_main.c +25 -17
@@ -3364,6 +3364,29 @@ static void __devinit print_port_info(struct adapter *adap) } } +/* +* Free the following resources: +* - memory used for tables +* - MSI/MSI-X +* - net devices +* - resources FW is holding for us +*/ +static void free_some_resources (struct adapter *adapter) +{ +unsigned int i; + +t4_free_mem (adapter->l2t); +t4_free_mem (adapter->tids.tid_tab); +disable_msi (adapter); + +for_each_port (adapter, i) +if (adapter->port[i]) +free_netdev (adapter->port[i]); + +if (adapter->flags &FW_OK ) +t4_fw_bye (adapter,0 ); +} +#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | NETIF_F_TSO6 |\ NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
@@ -3564,14 +3587,7 @@ sriov:return 0 ; out_free_dev: -t4_free_mem (adapter->tids.tid_tab); -t4_free_mem (adapter->l2t); -for_each_port (adapter, i) -if (adapter->port[i]) -free_netdev (adapter->port[i]); -if (adapter->flags &FW_OK ) -t4_fw_bye (adapter,0 ); -disable_msi (adapter); +free_some_resources (adapter); out_unmap_bar:iounmap (adapter->regs); out_free_adapter:
@@ -3606,16 +3622,8 @@ static void __devexit remove_one(struct pci_dev *pdev)if (adapter->flags &FULL_INIT_DONE )cxgb_down (adapter); -t4_free_mem (adapter->l2t); -t4_free_mem (adapter->tids.tid_tab); -disable_msi (adapter); - -for_each_port (adapter, i) -if (adapter->port[i]) -free_netdev (adapter->port[i]); -if (adapter->flags &FW_OK ) -t4_fw_bye (adapter,0 ); +free_some_resources (adapter);iounmap (adapter->regs);kfree (adapter);pci_disable_pcie_error_reporting (pdev);
Signature · 1 line
1.5.4
PATCH 3/5 cxgb4: add user manipulation of the RSS table
Implement the get_rxnfc, get_rxfh_indir, and set_rxfh_indir ethtool methods for user manipulation of the RSS table. Besides the methods themselves the rest of the changes here store, initialize, and write the table contents.
--- drivers/net/cxgb4/cxgb4.h | 1 + drivers/net/cxgb4/cxgb4_main.c | 113 ++++++++++++++++++++++++++++++++++------ 2 files changed, 98 insertions(+), 16 deletions(-)
drivers/net/cxgb4/cxgb4.h +1 -0
@@ -295,6 +295,7 @@ struct port_info {u8 nqsets;/* # of qsets */ u8 first_qset;/* index of first qset */ struct link_config link_cfg; +u16 *rss; };/* port_info.rx_offload flags */
drivers/net/cxgb4/cxgb4_main.c +97 -16
160 lines not on this page · raw message
Signature · 1 line
1.5.4
PATCH 4/5 cxgb4: implement the ETHTOOL_GRXFH command
--- drivers/net/cxgb4/cxgb4.h | 1 + drivers/net/cxgb4/cxgb4_main.c | 54 +++++++++++++++++++++++++++++++++++++++- drivers/net/cxgb4/t4_hw.c | 11 ++++++++ 3 files changed, 65 insertions(+), 1 deletions(-)
drivers/net/cxgb4/cxgb4.h +1 -0
@@ -294,6 +294,7 @@ struct port_info {u8 rx_offload;/* CSO, etc */ u8 nqsets;/* # of qsets */ u8 first_qset;/* index of first qset */ +u8 rss_mode;struct link_config link_cfg;u16 *rss; };
drivers/net/cxgb4/cxgb4_main.c +53 -1
62 lines not on this page · raw message
drivers/net/cxgb4/t4_hw.c +11 -0
@@ -3133,8 +3133,10 @@ int __devinit t4_port_init(struct adapter *adap, int mbox, int pf, int vf)u8 addr[6 ];int ret, i, j =0 ;struct fw_port_cmd c; +struct fw_rss_vi_config_cmd rvc;memset (&c,0 ,sizeof (c)); +memset (&rvc,0 ,sizeof (rvc));for_each_port (adap, i) {unsigned int rss_size;
@@ -3171,6 +3173,15 @@ int __devinit t4_port_init(struct adapter *adap, int mbox, int pf, int vf) p->port_type =FW_PORT_CMD_PTYPE_GET (ret); p->mod_type =FW_PORT_MOD_TYPE_NA ; + rvc.op_to_viid =htonl (FW_CMD_OP (FW_RSS_VI_CONFIG_CMD ) | +FW_CMD_REQUEST |FW_CMD_READ | +FW_RSS_VI_CONFIG_CMD_VIID (p->viid)); + rvc.retval_len16 =htonl (FW_LEN16 (rvc)); + ret =t4_wr_mbox (adap, mbox, &rvc,sizeof (rvc), &rvc); +if (ret) +return ret; + p->rss_mode =ntohl (rvc.u.basicvirtual.defaultq_to_udpen); +init_link_config (&p->link_cfg,ntohs (c.u.info.pcap)); j++; }
Signature · 1 line
1.5.4
PATCH 5/5 cxgb4: exclude registers with read side effects from register dumps
A few registers have side effects on reads, eg FIFO pointers that auto advance or mailboxes which change ownership when read. They are unsafe to read so exclude them from ethtool register dumps.
--- drivers/net/cxgb4/cxgb4_main.c | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/cxgb4/cxgb4_main.c +11 -9
@@ -1128,7 +1128,9 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,0xdfc0 ,0xdfe0 ,0xe000 ,0xea7c ,0xf000 ,0x11190 , -0x19040 ,0x19124 , +0x19040 ,0x1906c , +0x19078 ,0x19080 , +0x1908c ,0x19124 ,0x19150 ,0x191b0 ,0x191d0 ,0x191e8 , 0x19238, 0x1924c,
@@ -1141,49 +1143,49 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,0x1a190 ,0x1a1c4 ,0x1a1fc ,0x1a1fc ,0x1e040 ,0x1e04c , -0x1e240 ,0x1e28c , +0x1e284 ,0x1e28c ,0x1e2c0 ,0x1e2c0 ,0x1e2e0 ,0x1e2e0 ,0x1e300 ,0x1e384 ,0x1e3c0 ,0x1e3c8 ,0x1e440 ,0x1e44c , -0x1e640 ,0x1e68c , +0x1e684 ,0x1e68c ,0x1e6c0 ,0x1e6c0 ,0x1e6e0 ,0x1e6e0 ,0x1e700 ,0x1e784 ,0x1e7c0 ,0x1e7c8 ,0x1e840 ,0x1e84c , -0x1ea40 ,0x1ea8c , +0x1ea84 ,0x1ea8c ,0x1eac0 ,0x1eac0 ,0x1eae0 ,0x1eae0 ,0x1eb00 ,0x1eb84 ,0x1ebc0 ,0x1ebc8 ,0x1ec40 ,0x1ec4c , -0x1ee40 ,0x1ee8c , +0x1ee84 ,0x1ee8c ,0x1eec0 ,0x1eec0 ,0x1eee0 ,0x1eee0 ,0x1ef00 ,0x1ef84 ,0x1efc0 ,0x1efc8 ,0x1f040 ,0x1f04c , -0x1f240 ,0x1f28c , +0x1f284 ,0x1f28c ,0x1f2c0 ,0x1f2c0 ,0x1f2e0 ,0x1f2e0 ,0x1f300 ,0x1f384 ,0x1f3c0 ,0x1f3c8 ,0x1f440 ,0x1f44c , -0x1f640 ,0x1f68c , +0x1f684 ,0x1f68c ,0x1f6c0 ,0x1f6c0 ,0x1f6e0 ,0x1f6e0 ,0x1f700 ,0x1f784 ,0x1f7c0 ,0x1f7c8 ,0x1f840 ,0x1f84c , -0x1fa40 ,0x1fa8c , +0x1fa84 ,0x1fa8c ,0x1fac0 ,0x1fac0 ,0x1fae0 ,0x1fae0 ,0x1fb00 ,0x1fb84 ,0x1fbc0 ,0x1fbc8 ,0x1fc40 ,0x1fc4c , -0x1fe40 ,0x1fe8c , +0x1fe84 ,0x1fe8c ,0x1fec0 ,0x1fec0 ,0x1fee0 ,0x1fee0 , 0x1ff00, 0x1ff84,
Signature · 1 line
1.5.4
Re: [PATCH net-next 5/5] cxgb4: exclude registers with read side effects from register dumps
Quoted 3 lines · Dimitris Michailidis
A few registers have side effects on reads, eg FIFO pointers that auto advance or mailboxes which change ownership when read. They are unsafe to read so exclude them from ethtool register dumps.
[...]
If you change the set of registers in the dump, you need to increment the version number.
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerRe: [PATCH net-next 5/5] cxgb4: exclude registers with read side effects from register dumps
From: Ben Hutchings <[email protected]>
Date: Sun, 11 Jul 2010 23:17:06 +0100
Quoted 8 lines · Dimitris Michailidis
Quoted 3 lines
A few registers have side effects on reads, eg FIFO pointers that auto advance or mailboxes which change ownership when read. They are unsafe to read so exclude them from ethtool register dumps.
[...]
If you change the set of registers in the dump, you need to increment the version number.
Agreed.
From: Dimitris Michailidis <[email protected]>
Date: Sun, 11 Jul 2010 15:01:14 -0700
Quoted 4 lines
Following is a series of 5 cxgb4 patches, all for net-next. Mainly they implement the
get_rxnfc,get_rxfh_indir, andset_rxfh_indirethtool ops, plus a couple of fixes.
Applied patches 1-4, please fixup patch 5 to bump the register dump version number.
Thanks.