From: Andrew Rybchenko Date: Thu, 7 Feb 2019 12:17:50 +0000 (+0000) Subject: net/sfc: move isolated flag in adapter shared X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e0d5ba7eaaff8c53b1550e0803110b39e1c3ec82;p=dpdk.git net/sfc: move isolated flag in adapter shared The flag is required in default RSS RETA get which does not make sense in isolated mode. Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index 72992d68b1..e8569bbbc1 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -131,7 +131,6 @@ struct sfc_port { * Flow API isolated mode overrides promisc and allmulti settings; * they won't be applied if isolated mode is active */ - boolean_t isolated; boolean_t promisc; boolean_t allmulti; @@ -184,6 +183,8 @@ struct sfc_adapter_shared { struct sfc_rss rss; + boolean_t isolated; + struct rte_pci_addr pci_addr; uint16_t port_id; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 034229f373..c6bee09ee4 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -357,7 +357,7 @@ sfc_dev_filter_set(struct rte_eth_dev *dev, enum sfc_dev_filter_mode mode, if (*toggle != enabled) { *toggle = enabled; - if (port->isolated) { + if (sfc_sa2shared(sa)->isolated) { sfc_warn(sa, "isolated mode is active on the port"); sfc_warn(sa, "the change is to be applied on the next " "start provided that isolated mode is " @@ -957,7 +957,7 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) * on the next port start if the user prevents * isolated mode from being enabled. */ - if (port->isolated) { + if (sfc_sa2shared(sa)->isolated) { sfc_warn(sa, "isolated mode is active on the port"); sfc_warn(sa, "will not set MAC address"); goto unlock; @@ -1027,7 +1027,7 @@ sfc_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set, int rc; unsigned int i; - if (port->isolated) { + if (sfc_sa2shared(sa)->isolated) { sfc_err(sa, "isolated mode is active on the port"); sfc_err(sa, "will not set multicast address list"); return -ENOTSUP; @@ -1451,11 +1451,10 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev, { struct sfc_adapter *sa = dev->data->dev_private; struct sfc_rss *rss = &sfc_sa2shared(sa)->rss; - struct sfc_port *port = &sa->port; unsigned int efx_hash_types; int rc = 0; - if (port->isolated) + if (sfc_sa2shared(sa)->isolated) return -ENOTSUP; if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE) { @@ -1529,10 +1528,9 @@ sfc_dev_rss_reta_query(struct rte_eth_dev *dev, struct sfc_adapter_shared *sas = sfc_adapter_shared_by_eth_dev(dev); struct sfc_adapter *sa = dev->data->dev_private; struct sfc_rss *rss = &sas->rss; - struct sfc_port *port = &sa->port; int entry; - if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE || port->isolated) + if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE || sas->isolated) return -ENOTSUP; if (rss->channels == 0) @@ -1563,13 +1561,12 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev, { struct sfc_adapter *sa = dev->data->dev_private; struct sfc_rss *rss = &sfc_sa2shared(sa)->rss; - struct sfc_port *port = &sa->port; unsigned int *rss_tbl_new; uint16_t entry; int rc = 0; - if (port->isolated) + if (sfc_sa2shared(sa)->isolated) return -ENOTSUP; if (rss->context_type != EFX_RX_SCALE_EXCLUSIVE) { diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index 201c6cd060..01a81eab83 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -2425,7 +2425,6 @@ sfc_flow_isolate(struct rte_eth_dev *dev, int enable, struct rte_flow_error *error) { struct sfc_adapter *sa = dev->data->dev_private; - struct sfc_port *port = &sa->port; int ret = 0; sfc_adapter_lock(sa); @@ -2435,7 +2434,7 @@ sfc_flow_isolate(struct rte_eth_dev *dev, int enable, NULL, "please close the port first"); ret = -rte_errno; } else { - port->isolated = (enable) ? B_TRUE : B_FALSE; + sfc_sa2shared(sa)->isolated = (enable) ? B_TRUE : B_FALSE; } sfc_adapter_unlock(sa); diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c index 5eb4b3acaf..1709dba4e6 100644 --- a/drivers/net/sfc/sfc_port.c +++ b/drivers/net/sfc/sfc_port.c @@ -226,7 +226,7 @@ sfc_port_start(struct sfc_adapter *sa) if (rc != 0) goto fail_mac_pdu_set; - if (!port->isolated) { + if (!sfc_sa2shared(sa)->isolated) { struct ether_addr *addr = &port->default_mac_addr; sfc_log_init(sa, "set MAC address"); diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 3b4b65f6e6..cd8abc8ea0 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -669,7 +669,6 @@ retry: int sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index) { - struct sfc_port *port = &sa->port; struct sfc_rxq_info *rxq_info; struct sfc_rxq *rxq; struct sfc_evq *evq; @@ -731,7 +730,7 @@ sfc_rx_qstart(struct sfc_adapter *sa, unsigned int sw_index) rxq_info->state |= SFC_RXQ_STARTED; - if ((sw_index == 0) && !port->isolated) { + if (sw_index == 0 && !sfc_sa2shared(sa)->isolated) { rc = sfc_rx_default_rxq_set_filter(sa, rxq); if (rc != 0) goto fail_mac_filter_default_rxq_set;