* [Intel-wired-lan] [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r, t}xq in XSK
@ 2024-01-23 11:58 ` Maciej Fijalkowski
0 siblings, 0 replies; 16+ messages in thread
From: Maciej Fijalkowski @ 2024-01-23 11:58 UTC (permalink / raw)
To: intel-wired-lan
Cc: netdev, Maciej Fijalkowski, anthony.l.nguyen, magnus.karlsson
Ice driver has routines dedicated for configuring single queues. Let us
use them from ZC control path. This move will allow us to make
ice_vsi_cfg_{r,t}xq() static.
Thanks,
Maciej
Maciej Fijalkowski (2):
ice: make ice_vsi_cfg_rxq() static
ice: make ice_vsi_cfg_txq() static
drivers/net/ethernet/intel/ice/ice_base.c | 134 +++++++++++++++++++++-
drivers/net/ethernet/intel/ice/ice_base.h | 10 +-
drivers/net/ethernet/intel/ice/ice_lib.c | 129 ---------------------
drivers/net/ethernet/intel/ice/ice_lib.h | 10 --
drivers/net/ethernet/intel/ice/ice_xsk.c | 22 +---
5 files changed, 142 insertions(+), 163 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread* [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq in XSK @ 2024-01-23 11:58 ` Maciej Fijalkowski 0 siblings, 0 replies; 16+ messages in thread From: Maciej Fijalkowski @ 2024-01-23 11:58 UTC (permalink / raw) To: intel-wired-lan Cc: netdev, anthony.l.nguyen, magnus.karlsson, Maciej Fijalkowski Ice driver has routines dedicated for configuring single queues. Let us use them from ZC control path. This move will allow us to make ice_vsi_cfg_{r,t}xq() static. Thanks, Maciej Maciej Fijalkowski (2): ice: make ice_vsi_cfg_rxq() static ice: make ice_vsi_cfg_txq() static drivers/net/ethernet/intel/ice/ice_base.c | 134 +++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_base.h | 10 +- drivers/net/ethernet/intel/ice/ice_lib.c | 129 --------------------- drivers/net/ethernet/intel/ice/ice_lib.h | 10 -- drivers/net/ethernet/intel/ice/ice_xsk.c | 22 +--- 5 files changed, 142 insertions(+), 163 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static 2024-01-23 11:58 ` [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq " Maciej Fijalkowski @ 2024-01-23 11:58 ` Maciej Fijalkowski -1 siblings, 0 replies; 16+ messages in thread From: Maciej Fijalkowski @ 2024-01-23 11:58 UTC (permalink / raw) To: intel-wired-lan Cc: netdev, Maciej Fijalkowski, anthony.l.nguyen, magnus.karlsson Currently, XSK control path in ice driver calls directly ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that purpose. Use the latter from XSK side and make ice_vsi_cfg_rxq() static. ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce the code churn let us move two callers of it from ice_lib.c to ice_base.c. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> --- drivers/net/ethernet/intel/ice/ice_base.c | 58 ++++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_base.h | 3 +- drivers/net/ethernet/intel/ice/ice_lib.c | 56 ---------------------- drivers/net/ethernet/intel/ice/ice_lib.h | 4 -- drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- 5 files changed, 60 insertions(+), 63 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index b25b7f415965..2d8898d5e317 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -546,7 +546,7 @@ static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring) * * Return 0 on success and a negative value on error. */ -int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) +static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) { struct device *dev = ice_pf_to_dev(ring->vsi->back); u32 num_bufs = ICE_RX_DESC_UNUSED(ring); @@ -632,6 +632,62 @@ int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) return 0; } +int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx) +{ + if (q_idx >= vsi->num_rxq) + return -EINVAL; + + return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]); +} + +/** + * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length + * @vsi: VSI + */ +static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) +{ + if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) { + vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX; + vsi->rx_buf_len = ICE_RXBUF_1664; +#if (PAGE_SIZE < 8192) + } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && + (vsi->netdev->mtu <= ETH_DATA_LEN)) { + vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN; + vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN; +#endif + } else { + vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX; + vsi->rx_buf_len = ICE_RXBUF_3072; + } +} + +/** + * ice_vsi_cfg_rxqs - Configure the VSI for Rx + * @vsi: the VSI being configured + * + * Return 0 on success and a negative value on error + * Configure the Rx VSI for operation. + */ +int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) +{ + u16 i; + + if (vsi->type == ICE_VSI_VF) + goto setup_rings; + + ice_vsi_cfg_frame_size(vsi); +setup_rings: + /* set up individual rings */ + ice_for_each_rxq(vsi, i) { + int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]); + + if (err) + return err; + } + + return 0; +} + /** * __ice_vsi_get_qs - helper function for assigning queues from PF to VSI * @qs_cfg: gathered variables needed for pf->vsi queues assignment diff --git a/drivers/net/ethernet/intel/ice/ice_base.h b/drivers/net/ethernet/intel/ice/ice_base.h index b67dca417acb..4c1f8d33b976 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.h +++ b/drivers/net/ethernet/intel/ice/ice_base.h @@ -6,7 +6,8 @@ #include "ice.h" -int ice_vsi_cfg_rxq(struct ice_rx_ring *ring); +int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); +int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg); int ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait); diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 711e4fb62cb7..844356beb58c 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1681,27 +1681,6 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi) } } -/** - * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length - * @vsi: VSI - */ -static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) -{ - if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) { - vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX; - vsi->rx_buf_len = ICE_RXBUF_1664; -#if (PAGE_SIZE < 8192) - } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && - (vsi->netdev->mtu <= ETH_DATA_LEN)) { - vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN; - vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN; -#endif - } else { - vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX; - vsi->rx_buf_len = ICE_RXBUF_3072; - } -} - /** * ice_pf_state_is_nominal - checks the PF for nominal state * @pf: pointer to PF to check @@ -1808,14 +1787,6 @@ ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio, wr32(hw, QRXFLXP_CNTXT(pf_q), regval); } -int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx) -{ - if (q_idx >= vsi->num_rxq) - return -EINVAL; - - return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]); -} - int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx) { DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); @@ -1828,33 +1799,6 @@ int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); } -/** - * ice_vsi_cfg_rxqs - Configure the VSI for Rx - * @vsi: the VSI being configured - * - * Return 0 on success and a negative value on error - * Configure the Rx VSI for operation. - */ -int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) -{ - u16 i; - - if (vsi->type == ICE_VSI_VF) - goto setup_rings; - - ice_vsi_cfg_frame_size(vsi); -setup_rings: - /* set up individual rings */ - ice_for_each_rxq(vsi, i) { - int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]); - - if (err) - return err; - } - - return 0; -} - /** * ice_vsi_cfg_txqs - Configure the VSI for Tx * @vsi: the VSI being configured diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h index 71bd27244941..6ffe4b0603bd 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_lib.h @@ -54,12 +54,8 @@ bool ice_pf_state_is_nominal(struct ice_pf *pf); void ice_update_eth_stats(struct ice_vsi *vsi); -int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); - int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx); -int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); - int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); void ice_vsi_cfg_msix(struct ice_vsi *vsi); diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 5d1ae8e4058a..4eae83d94fb4 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -249,7 +249,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) ice_tx_xsk_pool(vsi, q_idx); } - err = ice_vsi_cfg_rxq(rx_ring); + err = ice_vsi_cfg_single_rxq(vsi, q_idx); if (err) return err; -- 2.34.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static @ 2024-01-23 11:58 ` Maciej Fijalkowski 0 siblings, 0 replies; 16+ messages in thread From: Maciej Fijalkowski @ 2024-01-23 11:58 UTC (permalink / raw) To: intel-wired-lan Cc: netdev, anthony.l.nguyen, magnus.karlsson, Maciej Fijalkowski Currently, XSK control path in ice driver calls directly ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that purpose. Use the latter from XSK side and make ice_vsi_cfg_rxq() static. ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce the code churn let us move two callers of it from ice_lib.c to ice_base.c. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> --- drivers/net/ethernet/intel/ice/ice_base.c | 58 ++++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_base.h | 3 +- drivers/net/ethernet/intel/ice/ice_lib.c | 56 ---------------------- drivers/net/ethernet/intel/ice/ice_lib.h | 4 -- drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- 5 files changed, 60 insertions(+), 63 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index b25b7f415965..2d8898d5e317 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -546,7 +546,7 @@ static void ice_xsk_pool_fill_cb(struct ice_rx_ring *ring) * * Return 0 on success and a negative value on error. */ -int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) +static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) { struct device *dev = ice_pf_to_dev(ring->vsi->back); u32 num_bufs = ICE_RX_DESC_UNUSED(ring); @@ -632,6 +632,62 @@ int ice_vsi_cfg_rxq(struct ice_rx_ring *ring) return 0; } +int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx) +{ + if (q_idx >= vsi->num_rxq) + return -EINVAL; + + return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]); +} + +/** + * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length + * @vsi: VSI + */ +static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) +{ + if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) { + vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX; + vsi->rx_buf_len = ICE_RXBUF_1664; +#if (PAGE_SIZE < 8192) + } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && + (vsi->netdev->mtu <= ETH_DATA_LEN)) { + vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN; + vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN; +#endif + } else { + vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX; + vsi->rx_buf_len = ICE_RXBUF_3072; + } +} + +/** + * ice_vsi_cfg_rxqs - Configure the VSI for Rx + * @vsi: the VSI being configured + * + * Return 0 on success and a negative value on error + * Configure the Rx VSI for operation. + */ +int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) +{ + u16 i; + + if (vsi->type == ICE_VSI_VF) + goto setup_rings; + + ice_vsi_cfg_frame_size(vsi); +setup_rings: + /* set up individual rings */ + ice_for_each_rxq(vsi, i) { + int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]); + + if (err) + return err; + } + + return 0; +} + /** * __ice_vsi_get_qs - helper function for assigning queues from PF to VSI * @qs_cfg: gathered variables needed for pf->vsi queues assignment diff --git a/drivers/net/ethernet/intel/ice/ice_base.h b/drivers/net/ethernet/intel/ice/ice_base.h index b67dca417acb..4c1f8d33b976 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.h +++ b/drivers/net/ethernet/intel/ice/ice_base.h @@ -6,7 +6,8 @@ #include "ice.h" -int ice_vsi_cfg_rxq(struct ice_rx_ring *ring); +int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); +int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); int __ice_vsi_get_qs(struct ice_qs_cfg *qs_cfg); int ice_vsi_ctrl_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx, bool wait); diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 711e4fb62cb7..844356beb58c 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1681,27 +1681,6 @@ static void ice_vsi_set_rss_flow_fld(struct ice_vsi *vsi) } } -/** - * ice_vsi_cfg_frame_size - setup max frame size and Rx buffer length - * @vsi: VSI - */ -static void ice_vsi_cfg_frame_size(struct ice_vsi *vsi) -{ - if (!vsi->netdev || test_bit(ICE_FLAG_LEGACY_RX, vsi->back->flags)) { - vsi->max_frame = ICE_MAX_FRAME_LEGACY_RX; - vsi->rx_buf_len = ICE_RXBUF_1664; -#if (PAGE_SIZE < 8192) - } else if (!ICE_2K_TOO_SMALL_WITH_PADDING && - (vsi->netdev->mtu <= ETH_DATA_LEN)) { - vsi->max_frame = ICE_RXBUF_1536 - NET_IP_ALIGN; - vsi->rx_buf_len = ICE_RXBUF_1536 - NET_IP_ALIGN; -#endif - } else { - vsi->max_frame = ICE_AQ_SET_MAC_FRAME_SIZE_MAX; - vsi->rx_buf_len = ICE_RXBUF_3072; - } -} - /** * ice_pf_state_is_nominal - checks the PF for nominal state * @pf: pointer to PF to check @@ -1808,14 +1787,6 @@ ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio, wr32(hw, QRXFLXP_CNTXT(pf_q), regval); } -int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx) -{ - if (q_idx >= vsi->num_rxq) - return -EINVAL; - - return ice_vsi_cfg_rxq(vsi->rx_rings[q_idx]); -} - int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx) { DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); @@ -1828,33 +1799,6 @@ int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); } -/** - * ice_vsi_cfg_rxqs - Configure the VSI for Rx - * @vsi: the VSI being configured - * - * Return 0 on success and a negative value on error - * Configure the Rx VSI for operation. - */ -int ice_vsi_cfg_rxqs(struct ice_vsi *vsi) -{ - u16 i; - - if (vsi->type == ICE_VSI_VF) - goto setup_rings; - - ice_vsi_cfg_frame_size(vsi); -setup_rings: - /* set up individual rings */ - ice_for_each_rxq(vsi, i) { - int err = ice_vsi_cfg_rxq(vsi->rx_rings[i]); - - if (err) - return err; - } - - return 0; -} - /** * ice_vsi_cfg_txqs - Configure the VSI for Tx * @vsi: the VSI being configured diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h index 71bd27244941..6ffe4b0603bd 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_lib.h @@ -54,12 +54,8 @@ bool ice_pf_state_is_nominal(struct ice_pf *pf); void ice_update_eth_stats(struct ice_vsi *vsi); -int ice_vsi_cfg_single_rxq(struct ice_vsi *vsi, u16 q_idx); - int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx); -int ice_vsi_cfg_rxqs(struct ice_vsi *vsi); - int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); void ice_vsi_cfg_msix(struct ice_vsi *vsi); diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 5d1ae8e4058a..4eae83d94fb4 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -249,7 +249,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) ice_tx_xsk_pool(vsi, q_idx); } - err = ice_vsi_cfg_rxq(rx_ring); + err = ice_vsi_cfg_single_rxq(vsi, q_idx); if (err) return err; -- 2.34.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static 2024-01-23 11:58 ` Maciej Fijalkowski @ 2024-01-24 10:09 ` Simon Horman -1 siblings, 0 replies; 16+ messages in thread From: Simon Horman @ 2024-01-24 10:09 UTC (permalink / raw) To: Maciej Fijalkowski Cc: netdev, anthony.l.nguyen, intel-wired-lan, magnus.karlsson On Tue, Jan 23, 2024 at 12:58:45PM +0100, Maciej Fijalkowski wrote: > Currently, XSK control path in ice driver calls directly > ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that > purpose. Use the latter from XSK side and make ice_vsi_cfg_rxq() static. > > ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce > the code churn let us move two callers of it from ice_lib.c to > ice_base.c. > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static @ 2024-01-24 10:09 ` Simon Horman 0 siblings, 0 replies; 16+ messages in thread From: Simon Horman @ 2024-01-24 10:09 UTC (permalink / raw) To: Maciej Fijalkowski Cc: intel-wired-lan, netdev, anthony.l.nguyen, magnus.karlsson On Tue, Jan 23, 2024 at 12:58:45PM +0100, Maciej Fijalkowski wrote: > Currently, XSK control path in ice driver calls directly > ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that > purpose. Use the latter from XSK side and make ice_vsi_cfg_rxq() static. > > ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce > the code churn let us move two callers of it from ice_lib.c to > ice_base.c. > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static 2024-01-23 11:58 ` Maciej Fijalkowski @ 2024-01-31 3:19 ` Rout, ChandanX -1 siblings, 0 replies; 16+ messages in thread From: Rout, ChandanX @ 2024-01-31 3:19 UTC (permalink / raw) To: Fijalkowski, Maciej, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Pandey, Atul, Nguyen, Anthony L, Nagraj, Shravan, Kuruvinakunnel, George, Karlsson, Magnus >-----Original Message----- >From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of >Fijalkowski, Maciej >Sent: Tuesday, January 23, 2024 5:29 PM >To: intel-wired-lan@lists.osuosl.org >Cc: netdev@vger.kernel.org; Fijalkowski, Maciej ><maciej.fijalkowski@intel.com>; Nguyen, Anthony L ><anthony.l.nguyen@intel.com>; Karlsson, Magnus ><magnus.karlsson@intel.com> >Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static > >Currently, XSK control path in ice driver calls directly >ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that purpose. >Use the latter from XSK side and make ice_vsi_cfg_rxq() static. > >ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce the code >churn let us move two callers of it from ice_lib.c to ice_base.c. > >Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> >--- > drivers/net/ethernet/intel/ice/ice_base.c | 58 ++++++++++++++++++++++- >drivers/net/ethernet/intel/ice/ice_base.h | 3 +- >drivers/net/ethernet/intel/ice/ice_lib.c | 56 ---------------------- >drivers/net/ethernet/intel/ice/ice_lib.h | 4 -- >drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- > 5 files changed, 60 insertions(+), 63 deletions(-) > Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel) ^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static @ 2024-01-31 3:19 ` Rout, ChandanX 0 siblings, 0 replies; 16+ messages in thread From: Rout, ChandanX @ 2024-01-31 3:19 UTC (permalink / raw) To: Fijalkowski, Maciej, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Nguyen, Anthony L, Karlsson, Magnus, Kuruvinakunnel, George, Pandey, Atul, Nagraj, Shravan >-----Original Message----- >From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of >Fijalkowski, Maciej >Sent: Tuesday, January 23, 2024 5:29 PM >To: intel-wired-lan@lists.osuosl.org >Cc: netdev@vger.kernel.org; Fijalkowski, Maciej ><maciej.fijalkowski@intel.com>; Nguyen, Anthony L ><anthony.l.nguyen@intel.com>; Karlsson, Magnus ><magnus.karlsson@intel.com> >Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static > >Currently, XSK control path in ice driver calls directly >ice_vsi_cfg_rxq() whereas we have ice_vsi_cfg_single_rxq() for that purpose. >Use the latter from XSK side and make ice_vsi_cfg_rxq() static. > >ice_vsi_cfg_rxq() resides in ice_base.c and is rather big, so to reduce the code >churn let us move two callers of it from ice_lib.c to ice_base.c. > >Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> >--- > drivers/net/ethernet/intel/ice/ice_base.c | 58 ++++++++++++++++++++++- >drivers/net/ethernet/intel/ice/ice_base.h | 3 +- >drivers/net/ethernet/intel/ice/ice_lib.c | 56 ---------------------- >drivers/net/ethernet/intel/ice/ice_lib.h | 4 -- >drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- > 5 files changed, 60 insertions(+), 63 deletions(-) > Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel) ^ permalink raw reply [flat|nested] 16+ messages in thread
* [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static 2024-01-23 11:58 ` [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq " Maciej Fijalkowski @ 2024-01-23 11:58 ` Maciej Fijalkowski -1 siblings, 0 replies; 16+ messages in thread From: Maciej Fijalkowski @ 2024-01-23 11:58 UTC (permalink / raw) To: intel-wired-lan Cc: netdev, Maciej Fijalkowski, anthony.l.nguyen, magnus.karlsson Currently, XSK control path in ice driver calls directly ice_vsi_cfg_txq() whereas we have ice_vsi_cfg_single_txq() for that purpose. Use the latter from XSK side and make ice_vsi_cfg_txq() static. ice_vsi_cfg_txq() resides in ice_base.c and is rather big, so to reduce the code churn let us move the callers of it from ice_lib.c to ice_base.c. This change puts ice_qp_ena() on nice diet due to the checks and operations that ice_vsi_cfg_single_{r,t}xq() do internally. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-182 (-182) Function old new delta ice_xsk_pool_setup 2165 1983 -182 Total: Before=472597, After=472415, chg -0.04% Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> --- drivers/net/ethernet/intel/ice/ice_base.c | 76 ++++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_base.h | 7 ++- drivers/net/ethernet/intel/ice/ice_lib.c | 73 ---------------------- drivers/net/ethernet/intel/ice/ice_lib.h | 6 -- drivers/net/ethernet/intel/ice/ice_xsk.c | 20 +----- 5 files changed, 82 insertions(+), 100 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index 2d8898d5e317..073da2e7085c 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -883,7 +883,7 @@ void ice_vsi_free_q_vectors(struct ice_vsi *vsi) * @ring: Tx ring to be configured * @qg_buf: queue group buffer */ -int +static int ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, struct ice_aqc_add_tx_qgrp *qg_buf) { @@ -954,6 +954,80 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, return 0; } +int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, + u16 q_idx) +{ + DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); + + if (q_idx >= vsi->alloc_txq || !tx_rings || !tx_rings[q_idx]) + return -EINVAL; + + qg_buf->num_txqs = 1; + + return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); +} + +/** + * ice_vsi_cfg_txqs - Configure the VSI for Tx + * @vsi: the VSI being configured + * @rings: Tx ring array to be configured + * @count: number of Tx ring array elements + * + * Return 0 on success and a negative value on error + * Configure the Tx VSI for operation. + */ +static int +ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_tx_ring **rings, u16 count) +{ + DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); + int err = 0; + u16 q_idx; + + qg_buf->num_txqs = 1; + + for (q_idx = 0; q_idx < count; q_idx++) { + err = ice_vsi_cfg_txq(vsi, rings[q_idx], qg_buf); + if (err) + break; + } + + return err; +} + +/** + * ice_vsi_cfg_lan_txqs - Configure the VSI for Tx + * @vsi: the VSI being configured + * + * Return 0 on success and a negative value on error + * Configure the Tx VSI for operation. + */ +int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi) +{ + return ice_vsi_cfg_txqs(vsi, vsi->tx_rings, vsi->num_txq); +} + +/** + * ice_vsi_cfg_xdp_txqs - Configure Tx queues dedicated for XDP in given VSI + * @vsi: the VSI being configured + * + * Return 0 on success and a negative value on error + * Configure the Tx queues dedicated for XDP in given VSI for operation. + */ +int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi) +{ + int ret; + int i; + + ret = ice_vsi_cfg_txqs(vsi, vsi->xdp_rings, vsi->num_xdp_txq); + if (ret) + return ret; + + ice_for_each_rxq(vsi, i) + ice_tx_xsk_pool(vsi, i); + + return 0; +} + /** * ice_cfg_itr - configure the initial interrupt throttle values * @hw: pointer to the HW structure diff --git a/drivers/net/ethernet/intel/ice/ice_base.h b/drivers/net/ethernet/intel/ice/ice_base.h index 4c1f8d33b976..789b1b2319f0 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.h +++ b/drivers/net/ethernet/intel/ice/ice_base.h @@ -15,9 +15,10 @@ int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx); int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi); void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi); void ice_vsi_free_q_vectors(struct ice_vsi *vsi); -int -ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, - struct ice_aqc_add_tx_qgrp *qg_buf); +int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, + u16 q_idx); +int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); +int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); void ice_cfg_itr(struct ice_hw *hw, struct ice_q_vector *q_vector); void ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx); diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 844356beb58c..a1336b2a9f00 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1787,79 +1787,6 @@ ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio, wr32(hw, QRXFLXP_CNTXT(pf_q), regval); } -int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx) -{ - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); - - if (q_idx >= vsi->alloc_txq || !tx_rings || !tx_rings[q_idx]) - return -EINVAL; - - qg_buf->num_txqs = 1; - - return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); -} - -/** - * ice_vsi_cfg_txqs - Configure the VSI for Tx - * @vsi: the VSI being configured - * @rings: Tx ring array to be configured - * @count: number of Tx ring array elements - * - * Return 0 on success and a negative value on error - * Configure the Tx VSI for operation. - */ -static int -ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_tx_ring **rings, u16 count) -{ - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); - int err = 0; - u16 q_idx; - - qg_buf->num_txqs = 1; - - for (q_idx = 0; q_idx < count; q_idx++) { - err = ice_vsi_cfg_txq(vsi, rings[q_idx], qg_buf); - if (err) - break; - } - - return err; -} - -/** - * ice_vsi_cfg_lan_txqs - Configure the VSI for Tx - * @vsi: the VSI being configured - * - * Return 0 on success and a negative value on error - * Configure the Tx VSI for operation. - */ -int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi) -{ - return ice_vsi_cfg_txqs(vsi, vsi->tx_rings, vsi->num_txq); -} - -/** - * ice_vsi_cfg_xdp_txqs - Configure Tx queues dedicated for XDP in given VSI - * @vsi: the VSI being configured - * - * Return 0 on success and a negative value on error - * Configure the Tx queues dedicated for XDP in given VSI for operation. - */ -int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi) -{ - int ret; - int i; - - ret = ice_vsi_cfg_txqs(vsi, vsi->xdp_rings, vsi->num_xdp_txq); - if (ret) - return ret; - - ice_for_each_rxq(vsi, i) - ice_tx_xsk_pool(vsi, i); - - return 0; -} - /** * ice_intrl_usec_to_reg - convert interrupt rate limit to register value * @intrl: interrupt rate limit in usecs diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h index 6ffe4b0603bd..0c77d581416a 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_lib.h @@ -54,10 +54,6 @@ bool ice_pf_state_is_nominal(struct ice_pf *pf); void ice_update_eth_stats(struct ice_vsi *vsi); -int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx); - -int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); - void ice_vsi_cfg_msix(struct ice_vsi *vsi); int ice_vsi_start_all_rx_rings(struct ice_vsi *vsi); @@ -68,8 +64,6 @@ int ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, u16 rel_vmvf_num); -int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); - int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi); void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create); diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 4eae83d94fb4..446f5b1d2897 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -217,32 +217,17 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) */ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) { - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); - u16 size = __struct_size(qg_buf); struct ice_q_vector *q_vector; - struct ice_tx_ring *tx_ring; - struct ice_rx_ring *rx_ring; int err; - if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq) - return -EINVAL; - - qg_buf->num_txqs = 1; - - tx_ring = vsi->tx_rings[q_idx]; - rx_ring = vsi->rx_rings[q_idx]; - q_vector = rx_ring->q_vector; - - err = ice_vsi_cfg_txq(vsi, tx_ring, qg_buf); + err = ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx); if (err) return err; if (ice_is_xdp_ena_vsi(vsi)) { struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx]; - memset(qg_buf, 0, size); - qg_buf->num_txqs = 1; - err = ice_vsi_cfg_txq(vsi, xdp_ring, qg_buf); + err = ice_vsi_cfg_single_txq(vsi, vsi->xdp_rings, q_idx); if (err) return err; ice_set_ring_xdp(xdp_ring); @@ -253,6 +238,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) if (err) return err; + q_vector = vsi->rx_rings[q_idx]->q_vector; ice_qvec_cfg_msix(vsi, q_vector); err = ice_vsi_ctrl_one_rx_ring(vsi, true, q_idx, true); -- 2.34.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static @ 2024-01-23 11:58 ` Maciej Fijalkowski 0 siblings, 0 replies; 16+ messages in thread From: Maciej Fijalkowski @ 2024-01-23 11:58 UTC (permalink / raw) To: intel-wired-lan Cc: netdev, anthony.l.nguyen, magnus.karlsson, Maciej Fijalkowski Currently, XSK control path in ice driver calls directly ice_vsi_cfg_txq() whereas we have ice_vsi_cfg_single_txq() for that purpose. Use the latter from XSK side and make ice_vsi_cfg_txq() static. ice_vsi_cfg_txq() resides in ice_base.c and is rather big, so to reduce the code churn let us move the callers of it from ice_lib.c to ice_base.c. This change puts ice_qp_ena() on nice diet due to the checks and operations that ice_vsi_cfg_single_{r,t}xq() do internally. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-182 (-182) Function old new delta ice_xsk_pool_setup 2165 1983 -182 Total: Before=472597, After=472415, chg -0.04% Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> --- drivers/net/ethernet/intel/ice/ice_base.c | 76 ++++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_base.h | 7 ++- drivers/net/ethernet/intel/ice/ice_lib.c | 73 ---------------------- drivers/net/ethernet/intel/ice/ice_lib.h | 6 -- drivers/net/ethernet/intel/ice/ice_xsk.c | 20 +----- 5 files changed, 82 insertions(+), 100 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c index 2d8898d5e317..073da2e7085c 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.c +++ b/drivers/net/ethernet/intel/ice/ice_base.c @@ -883,7 +883,7 @@ void ice_vsi_free_q_vectors(struct ice_vsi *vsi) * @ring: Tx ring to be configured * @qg_buf: queue group buffer */ -int +static int ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, struct ice_aqc_add_tx_qgrp *qg_buf) { @@ -954,6 +954,80 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, return 0; } +int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, + u16 q_idx) +{ + DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); + + if (q_idx >= vsi->alloc_txq || !tx_rings || !tx_rings[q_idx]) + return -EINVAL; + + qg_buf->num_txqs = 1; + + return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); +} + +/** + * ice_vsi_cfg_txqs - Configure the VSI for Tx + * @vsi: the VSI being configured + * @rings: Tx ring array to be configured + * @count: number of Tx ring array elements + * + * Return 0 on success and a negative value on error + * Configure the Tx VSI for operation. + */ +static int +ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_tx_ring **rings, u16 count) +{ + DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); + int err = 0; + u16 q_idx; + + qg_buf->num_txqs = 1; + + for (q_idx = 0; q_idx < count; q_idx++) { + err = ice_vsi_cfg_txq(vsi, rings[q_idx], qg_buf); + if (err) + break; + } + + return err; +} + +/** + * ice_vsi_cfg_lan_txqs - Configure the VSI for Tx + * @vsi: the VSI being configured + * + * Return 0 on success and a negative value on error + * Configure the Tx VSI for operation. + */ +int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi) +{ + return ice_vsi_cfg_txqs(vsi, vsi->tx_rings, vsi->num_txq); +} + +/** + * ice_vsi_cfg_xdp_txqs - Configure Tx queues dedicated for XDP in given VSI + * @vsi: the VSI being configured + * + * Return 0 on success and a negative value on error + * Configure the Tx queues dedicated for XDP in given VSI for operation. + */ +int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi) +{ + int ret; + int i; + + ret = ice_vsi_cfg_txqs(vsi, vsi->xdp_rings, vsi->num_xdp_txq); + if (ret) + return ret; + + ice_for_each_rxq(vsi, i) + ice_tx_xsk_pool(vsi, i); + + return 0; +} + /** * ice_cfg_itr - configure the initial interrupt throttle values * @hw: pointer to the HW structure diff --git a/drivers/net/ethernet/intel/ice/ice_base.h b/drivers/net/ethernet/intel/ice/ice_base.h index 4c1f8d33b976..789b1b2319f0 100644 --- a/drivers/net/ethernet/intel/ice/ice_base.h +++ b/drivers/net/ethernet/intel/ice/ice_base.h @@ -15,9 +15,10 @@ int ice_vsi_wait_one_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx); int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi); void ice_vsi_map_rings_to_vectors(struct ice_vsi *vsi); void ice_vsi_free_q_vectors(struct ice_vsi *vsi); -int -ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_tx_ring *ring, - struct ice_aqc_add_tx_qgrp *qg_buf); +int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, + u16 q_idx); +int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); +int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); void ice_cfg_itr(struct ice_hw *hw, struct ice_q_vector *q_vector); void ice_cfg_txq_interrupt(struct ice_vsi *vsi, u16 txq, u16 msix_idx, u16 itr_idx); diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 844356beb58c..a1336b2a9f00 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -1787,79 +1787,6 @@ ice_write_qrxflxp_cntxt(struct ice_hw *hw, u16 pf_q, u32 rxdid, u32 prio, wr32(hw, QRXFLXP_CNTXT(pf_q), regval); } -int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx) -{ - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); - - if (q_idx >= vsi->alloc_txq || !tx_rings || !tx_rings[q_idx]) - return -EINVAL; - - qg_buf->num_txqs = 1; - - return ice_vsi_cfg_txq(vsi, tx_rings[q_idx], qg_buf); -} - -/** - * ice_vsi_cfg_txqs - Configure the VSI for Tx - * @vsi: the VSI being configured - * @rings: Tx ring array to be configured - * @count: number of Tx ring array elements - * - * Return 0 on success and a negative value on error - * Configure the Tx VSI for operation. - */ -static int -ice_vsi_cfg_txqs(struct ice_vsi *vsi, struct ice_tx_ring **rings, u16 count) -{ - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); - int err = 0; - u16 q_idx; - - qg_buf->num_txqs = 1; - - for (q_idx = 0; q_idx < count; q_idx++) { - err = ice_vsi_cfg_txq(vsi, rings[q_idx], qg_buf); - if (err) - break; - } - - return err; -} - -/** - * ice_vsi_cfg_lan_txqs - Configure the VSI for Tx - * @vsi: the VSI being configured - * - * Return 0 on success and a negative value on error - * Configure the Tx VSI for operation. - */ -int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi) -{ - return ice_vsi_cfg_txqs(vsi, vsi->tx_rings, vsi->num_txq); -} - -/** - * ice_vsi_cfg_xdp_txqs - Configure Tx queues dedicated for XDP in given VSI - * @vsi: the VSI being configured - * - * Return 0 on success and a negative value on error - * Configure the Tx queues dedicated for XDP in given VSI for operation. - */ -int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi) -{ - int ret; - int i; - - ret = ice_vsi_cfg_txqs(vsi, vsi->xdp_rings, vsi->num_xdp_txq); - if (ret) - return ret; - - ice_for_each_rxq(vsi, i) - ice_tx_xsk_pool(vsi, i); - - return 0; -} - /** * ice_intrl_usec_to_reg - convert interrupt rate limit to register value * @intrl: interrupt rate limit in usecs diff --git a/drivers/net/ethernet/intel/ice/ice_lib.h b/drivers/net/ethernet/intel/ice/ice_lib.h index 6ffe4b0603bd..0c77d581416a 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_lib.h @@ -54,10 +54,6 @@ bool ice_pf_state_is_nominal(struct ice_pf *pf); void ice_update_eth_stats(struct ice_vsi *vsi); -int ice_vsi_cfg_single_txq(struct ice_vsi *vsi, struct ice_tx_ring **tx_rings, u16 q_idx); - -int ice_vsi_cfg_lan_txqs(struct ice_vsi *vsi); - void ice_vsi_cfg_msix(struct ice_vsi *vsi); int ice_vsi_start_all_rx_rings(struct ice_vsi *vsi); @@ -68,8 +64,6 @@ int ice_vsi_stop_lan_tx_rings(struct ice_vsi *vsi, enum ice_disq_rst_src rst_src, u16 rel_vmvf_num); -int ice_vsi_cfg_xdp_txqs(struct ice_vsi *vsi); - int ice_vsi_stop_xdp_tx_rings(struct ice_vsi *vsi); void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create); diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 4eae83d94fb4..446f5b1d2897 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -217,32 +217,17 @@ static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx) */ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) { - DEFINE_FLEX(struct ice_aqc_add_tx_qgrp, qg_buf, txqs, 1); - u16 size = __struct_size(qg_buf); struct ice_q_vector *q_vector; - struct ice_tx_ring *tx_ring; - struct ice_rx_ring *rx_ring; int err; - if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq) - return -EINVAL; - - qg_buf->num_txqs = 1; - - tx_ring = vsi->tx_rings[q_idx]; - rx_ring = vsi->rx_rings[q_idx]; - q_vector = rx_ring->q_vector; - - err = ice_vsi_cfg_txq(vsi, tx_ring, qg_buf); + err = ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx); if (err) return err; if (ice_is_xdp_ena_vsi(vsi)) { struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx]; - memset(qg_buf, 0, size); - qg_buf->num_txqs = 1; - err = ice_vsi_cfg_txq(vsi, xdp_ring, qg_buf); + err = ice_vsi_cfg_single_txq(vsi, vsi->xdp_rings, q_idx); if (err) return err; ice_set_ring_xdp(xdp_ring); @@ -253,6 +238,7 @@ static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx) if (err) return err; + q_vector = vsi->rx_rings[q_idx]->q_vector; ice_qvec_cfg_msix(vsi, q_vector); err = ice_vsi_ctrl_one_rx_ring(vsi, true, q_idx, true); -- 2.34.1 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static 2024-01-23 11:58 ` Maciej Fijalkowski @ 2024-01-24 10:09 ` Simon Horman -1 siblings, 0 replies; 16+ messages in thread From: Simon Horman @ 2024-01-24 10:09 UTC (permalink / raw) To: Maciej Fijalkowski Cc: netdev, anthony.l.nguyen, intel-wired-lan, magnus.karlsson On Tue, Jan 23, 2024 at 12:58:46PM +0100, Maciej Fijalkowski wrote: > Currently, XSK control path in ice driver calls directly > ice_vsi_cfg_txq() whereas we have ice_vsi_cfg_single_txq() for that > purpose. Use the latter from XSK side and make ice_vsi_cfg_txq() static. > > ice_vsi_cfg_txq() resides in ice_base.c and is rather big, so to reduce > the code churn let us move the callers of it from ice_lib.c to > ice_base.c. > > This change puts ice_qp_ena() on nice diet due to the checks and > operations that ice_vsi_cfg_single_{r,t}xq() do internally. > > add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-182 (-182) > Function old new delta > ice_xsk_pool_setup 2165 1983 -182 > Total: Before=472597, After=472415, chg -0.04% > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static @ 2024-01-24 10:09 ` Simon Horman 0 siblings, 0 replies; 16+ messages in thread From: Simon Horman @ 2024-01-24 10:09 UTC (permalink / raw) To: Maciej Fijalkowski Cc: intel-wired-lan, netdev, anthony.l.nguyen, magnus.karlsson On Tue, Jan 23, 2024 at 12:58:46PM +0100, Maciej Fijalkowski wrote: > Currently, XSK control path in ice driver calls directly > ice_vsi_cfg_txq() whereas we have ice_vsi_cfg_single_txq() for that > purpose. Use the latter from XSK side and make ice_vsi_cfg_txq() static. > > ice_vsi_cfg_txq() resides in ice_base.c and is rather big, so to reduce > the code churn let us move the callers of it from ice_lib.c to > ice_base.c. > > This change puts ice_qp_ena() on nice diet due to the checks and > operations that ice_vsi_cfg_single_{r,t}xq() do internally. > > add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-182 (-182) > Function old new delta > ice_xsk_pool_setup 2165 1983 -182 > Total: Before=472597, After=472415, chg -0.04% > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Simon Horman <horms@kernel.org> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static 2024-01-23 11:58 ` Maciej Fijalkowski @ 2024-01-31 3:16 ` Rout, ChandanX -1 siblings, 0 replies; 16+ messages in thread From: Rout, ChandanX @ 2024-01-31 3:16 UTC (permalink / raw) To: Fijalkowski, Maciej, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Pandey, Atul, Nguyen, Anthony L, Nagraj, Shravan, Kuruvinakunnel, George, Karlsson, Magnus >-----Original Message----- >From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of >Fijalkowski, Maciej >Sent: Tuesday, January 23, 2024 5:29 PM >To: intel-wired-lan@lists.osuosl.org >Cc: netdev@vger.kernel.org; Fijalkowski, Maciej ><maciej.fijalkowski@intel.com>; Nguyen, Anthony L ><anthony.l.nguyen@intel.com>; Karlsson, Magnus ><magnus.karlsson@intel.com> >Subject: [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static > >Currently, XSK control path in ice driver calls directly >ice_vsi_cfg_txq() whereas we have ice_vsi_cfg_single_txq() for that purpose. >Use the latter from XSK side and make ice_vsi_cfg_txq() static. > >ice_vsi_cfg_txq() resides in ice_base.c and is rather big, so to reduce the code >churn let us move the callers of it from ice_lib.c to ice_base.c. > >This change puts ice_qp_ena() on nice diet due to the checks and operations >that ice_vsi_cfg_single_{r,t}xq() do internally. > >add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-182 (-182) >Function old new delta >ice_xsk_pool_setup 2165 1983 -182 >Total: Before=472597, After=472415, chg -0.04% > >Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> >--- > drivers/net/ethernet/intel/ice/ice_base.c | 76 ++++++++++++++++++++++- >drivers/net/ethernet/intel/ice/ice_base.h | 7 ++- >drivers/net/ethernet/intel/ice/ice_lib.c | 73 ---------------------- >drivers/net/ethernet/intel/ice/ice_lib.h | 6 -- >drivers/net/ethernet/intel/ice/ice_xsk.c | 20 +----- > 5 files changed, 82 insertions(+), 100 deletions(-) > Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel) ^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static @ 2024-01-31 3:16 ` Rout, ChandanX 0 siblings, 0 replies; 16+ messages in thread From: Rout, ChandanX @ 2024-01-31 3:16 UTC (permalink / raw) To: Fijalkowski, Maciej, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, Nguyen, Anthony L, Karlsson, Magnus, Kuruvinakunnel, George, Nagraj, Shravan, Pandey, Atul >-----Original Message----- >From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of >Fijalkowski, Maciej >Sent: Tuesday, January 23, 2024 5:29 PM >To: intel-wired-lan@lists.osuosl.org >Cc: netdev@vger.kernel.org; Fijalkowski, Maciej ><maciej.fijalkowski@intel.com>; Nguyen, Anthony L ><anthony.l.nguyen@intel.com>; Karlsson, Magnus ><magnus.karlsson@intel.com> >Subject: [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static > >Currently, XSK control path in ice driver calls directly >ice_vsi_cfg_txq() whereas we have ice_vsi_cfg_single_txq() for that purpose. >Use the latter from XSK side and make ice_vsi_cfg_txq() static. > >ice_vsi_cfg_txq() resides in ice_base.c and is rather big, so to reduce the code >churn let us move the callers of it from ice_lib.c to ice_base.c. > >This change puts ice_qp_ena() on nice diet due to the checks and operations >that ice_vsi_cfg_single_{r,t}xq() do internally. > >add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-182 (-182) >Function old new delta >ice_xsk_pool_setup 2165 1983 -182 >Total: Before=472597, After=472415, chg -0.04% > >Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> >--- > drivers/net/ethernet/intel/ice/ice_base.c | 76 ++++++++++++++++++++++- >drivers/net/ethernet/intel/ice/ice_base.h | 7 ++- >drivers/net/ethernet/intel/ice/ice_lib.c | 73 ---------------------- >drivers/net/ethernet/intel/ice/ice_lib.h | 6 -- >drivers/net/ethernet/intel/ice/ice_xsk.c | 20 +----- > 5 files changed, 82 insertions(+), 100 deletions(-) > Tested-by: Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel) ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r, t}xq in XSK 2024-01-23 11:58 ` [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq " Maciej Fijalkowski @ 2024-01-24 7:59 ` Magnus Karlsson -1 siblings, 0 replies; 16+ messages in thread From: Magnus Karlsson @ 2024-01-24 7:59 UTC (permalink / raw) To: Maciej Fijalkowski Cc: netdev, anthony.l.nguyen, intel-wired-lan, magnus.karlsson On Tue, 23 Jan 2024 at 12:59, Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote: > > Ice driver has routines dedicated for configuring single queues. Let us > use them from ZC control path. This move will allow us to make > ice_vsi_cfg_{r,t}xq() static. > > Thanks, > Maciej Thanks for the clean up Maciej. For the series: Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> > Maciej Fijalkowski (2): > ice: make ice_vsi_cfg_rxq() static > ice: make ice_vsi_cfg_txq() static > > drivers/net/ethernet/intel/ice/ice_base.c | 134 +++++++++++++++++++++- > drivers/net/ethernet/intel/ice/ice_base.h | 10 +- > drivers/net/ethernet/intel/ice/ice_lib.c | 129 --------------------- > drivers/net/ethernet/intel/ice/ice_lib.h | 10 -- > drivers/net/ethernet/intel/ice/ice_xsk.c | 22 +--- > 5 files changed, 142 insertions(+), 163 deletions(-) > > -- > 2.34.1 > > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq in XSK @ 2024-01-24 7:59 ` Magnus Karlsson 0 siblings, 0 replies; 16+ messages in thread From: Magnus Karlsson @ 2024-01-24 7:59 UTC (permalink / raw) To: Maciej Fijalkowski Cc: intel-wired-lan, netdev, anthony.l.nguyen, magnus.karlsson On Tue, 23 Jan 2024 at 12:59, Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote: > > Ice driver has routines dedicated for configuring single queues. Let us > use them from ZC control path. This move will allow us to make > ice_vsi_cfg_{r,t}xq() static. > > Thanks, > Maciej Thanks for the clean up Maciej. For the series: Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> > Maciej Fijalkowski (2): > ice: make ice_vsi_cfg_rxq() static > ice: make ice_vsi_cfg_txq() static > > drivers/net/ethernet/intel/ice/ice_base.c | 134 +++++++++++++++++++++- > drivers/net/ethernet/intel/ice/ice_base.h | 10 +- > drivers/net/ethernet/intel/ice/ice_lib.c | 129 --------------------- > drivers/net/ethernet/intel/ice/ice_lib.h | 10 -- > drivers/net/ethernet/intel/ice/ice_xsk.c | 22 +--- > 5 files changed, 142 insertions(+), 163 deletions(-) > > -- > 2.34.1 > > ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2024-01-31 3:20 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 11:58 [Intel-wired-lan] [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r, t}xq in XSK Maciej Fijalkowski
2024-01-23 11:58 ` [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq " Maciej Fijalkowski
2024-01-23 11:58 ` [Intel-wired-lan] [PATCH iwl-next 1/2] ice: make ice_vsi_cfg_rxq() static Maciej Fijalkowski
2024-01-23 11:58 ` Maciej Fijalkowski
2024-01-24 10:09 ` [Intel-wired-lan] " Simon Horman
2024-01-24 10:09 ` Simon Horman
2024-01-31 3:19 ` [Intel-wired-lan] " Rout, ChandanX
2024-01-31 3:19 ` Rout, ChandanX
2024-01-23 11:58 ` [Intel-wired-lan] [PATCH iwl-next 2/2] ice: make ice_vsi_cfg_txq() static Maciej Fijalkowski
2024-01-23 11:58 ` Maciej Fijalkowski
2024-01-24 10:09 ` [Intel-wired-lan] " Simon Horman
2024-01-24 10:09 ` Simon Horman
2024-01-31 3:16 ` [Intel-wired-lan] " Rout, ChandanX
2024-01-31 3:16 ` Rout, ChandanX
2024-01-24 7:59 ` [Intel-wired-lan] [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r, t}xq in XSK Magnus Karlsson
2024-01-24 7:59 ` [PATCH iwl-next 0/2] ice: use ice_vsi_cfg_single_{r,t}xq " Magnus Karlsson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.