Netdev List
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jakub Ramaseuski <jramaseu@redhat.com>,
	<anthony.l.nguyen@intel.com>, <intel-wired-lan@lists.osuosl.org>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@kernel.org>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH iwl-next 2/3] ice: share default RSS hash profiles between PFs
Date: Fri, 27 Nov 2026 14:39:16 +0100	[thread overview]
Message-ID: <e8a1046e-c129-414f-9e90-d165c863c856@intel.com> (raw)
In-Reply-To: <20261126123114.893916-3-jramaseu@redhat.com>

On 11/26/26 1:31 PM, Jakub Ramaseuski wrote:
> RSS hash profile IDs are a firmware resource of the whole device: the DDP
> package defines 128 of them, of which IDs 2-127 can be used by the PFs.
> Each PF allocates its own IDs, and since
> commit a6d63bbf2c52 ("ice: Implement RSS settings for GTP using ethtool")
> its default RSS configuration takes 19 of them. On devices with 8 PFs,
> like the E830-XXVDA8F, that is 152 IDs: the PFs probed last lose part
> or all of their default RSS configuration, and RSS configurations requested
> later, e.g. by VFs, fail:
> 
>    ice 0000:6c:00.0: ice_add_rss_cfg failed for VF 0, VSI 2, error:-5
> 
> The default configuration is the same on all PFs, and so are the profiles
> it needs. The package, for E810 and E830 alike, defines the RSS profile
> IDs as shared resources: firmware lets a PF allocate an ID another PF
> holds, by allocating that index without ICE_AQC_RES_TYPE_FLAG_IGNORE_INDEX,
> keeps the ID until its last user frees it, and a PF reset releases the IDs
> of that PF. What firmware does not provide is a lookup of the ID
> programmed with an extraction sequence.
> 
> Keep a list of the profile IDs shared by the PFs in struct ice_adapter,
> keyed by extraction sequence. When a PF needs an ID for a default profile,
> it joins the ID another PF uses for the same extraction sequence, or
> allocates a new one and adds it to the list. Each PF takes and releases
> its own firmware reference, through its own admin queue, when its
> reference count of the profile goes from 0 to 1 and from 1 to 0; the PFs
> never access the tables of each other.
> 
> Only profiles using neither field masks nor symmetric hashing are shared:
> the GLQF_HMASK registers are split between the PFs, and GLQF_HSYMM is
> programmed by every user of a profile. Such profiles, including the two
> GTP-U ones hashing on the QFI field, keep one ID per PF. Raw (parser)
> profiles program GLQF_HSYMM on their own and never use a shared ID.
> 
> A PF leaves the list on reset, devlink reload and remove, as firmware
> releases its IDs then. CORER, GLOBR and EMPR empty the list: each PF
> empties it while preparing for the reset, before it can allocate IDs
> again, so no PF joins an ID the reset freed. A PF that prepares late
> may drop entries a faster PF made after its rebuild; their IDs stay
> valid and are freed as usual, only not shared. An ID firmware hands out
> as a new one drops a stale entry for it. Sharing is off when an
> ice_adapter can cover more than one device (E825C, devices without a
> serial number).
> 
> While at it, replace the fd_swap parameter of ice_add_prof() with flags.
> 
> Measured on an E810-CQDA2 split to 8 PFs (NVM 4.30), with all PFs bound,
> then one VF created on each PF and "rx-flow-hash {tcp,udp}{4,6} fn" set on
> it, reading the IDs the PFs hold from firmware:
> 
>                 IDs in use     IDs in use after   failed profile ID
>                 after probe    VFs and ethtool    allocations
>    before       126            126                70 (30 at probe)
>    after        33             65                 0
> 
> Also checked on an E830-XXVDA8F (8 PFs) with a RHEL 9.6 backport: one VF
> per PF and "rx-flow-hash {tcp,udp}{4,6} fn" on each, all 32 input set
> changes succeed with no ice errors.
> 
> Fixes: a6d63bbf2c52 ("ice: Implement RSS settings for GTP using ethtool")
> Signed-off-by: Jakub Ramaseuski <jramaseu@redhat.com>
> ---
>   .../net/ethernet/intel/ice/devlink/devlink.c  |   2 +
>   drivers/net/ethernet/intel/ice/ice_adapter.c  |  13 +
>   drivers/net/ethernet/intel/ice/ice_adapter.h  |   7 +
>   drivers/net/ethernet/intel/ice/ice_ethtool.c  |   2 +-
>   .../net/ethernet/intel/ice/ice_flex_pipe.c    | 351 +++++++++++++++++-
>   .../net/ethernet/intel/ice/ice_flex_pipe.h    |   9 +-
>   .../net/ethernet/intel/ice/ice_flex_type.h    |   1 +
>   drivers/net/ethernet/intel/ice/ice_flow.c     |  51 ++-
>   drivers/net/ethernet/intel/ice/ice_flow.h     |   2 +
>   drivers/net/ethernet/intel/ice/ice_lib.c      |  10 +-
>   drivers/net/ethernet/intel/ice/ice_main.c     |   5 +
>   drivers/net/ethernet/intel/ice/virt/rss.c     |   2 +-
>   12 files changed, 427 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> index 9851e6140a944..aba28e33eac58 100644
> --- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
> +++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
> @@ -460,6 +460,7 @@ static void ice_devlink_reinit_down(struct ice_pf *pf)
>   	ice_vsi_decfg(ice_get_main_vsi(pf));
>   	rtnl_unlock();
>   	ice_deinit_pf(pf);
> +	ice_put_shared_profs(&pf->hw);
>   	ice_deinit_hw(&pf->hw);
>   	ice_deinit_dev(pf);
>   }
> @@ -1326,6 +1327,7 @@ static int ice_devlink_reinit_up(struct ice_pf *pf)
>   unroll_dev_init:
>   	need_dev_deinit = true;
>   unroll_hw_init:
> +	ice_put_shared_profs(&pf->hw);
>   	ice_deinit_hw(&pf->hw);
>   	if (need_dev_deinit)
>   		ice_deinit_dev(pf);
> diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.c b/drivers/net/ethernet/intel/ice/ice_adapter.c
> index eecad97c084d9..ea21c83155d81 100644
> --- a/drivers/net/ethernet/intel/ice/ice_adapter.c
> +++ b/drivers/net/ethernet/intel/ice/ice_adapter.c
> @@ -53,7 +53,9 @@ static int ice_adapter_init(void *priv, void *init_param)
>   {
>   	const struct ice_hw *hw = init_param;
>   	struct ice_adapter *adapter = priv;
> +	struct ice_pf *pf = hw->back;
>   	struct devlink *devlink;
> +	u64 index;
>   
>   	devlink = shd_priv_to_devlink(adapter);
>   	adapter->devlink = devlink;
> @@ -84,6 +86,15 @@ static int ice_adapter_init(void *priv, void *init_param)
>   
>   	adapter->phc.use_timecounter = ice_adapter_use_timecounter(hw);
>   
> +	mutex_init(&adapter->rss_prof_lock);
> +	INIT_LIST_HEAD(&adapter->rss_profs);
> +	/* RSS hash profile IDs come from the firmware of a single device.
> +	 * The NACs of E825C, and devices without a serial number,

I would not care about devices w/o DNS - those are strictly "pre-prod",
and if someone at intel (those should not leave our lab) would have such
cards, it will be sufficient to just use only one per machine, or to
program DNS number to some other value.

--
For the 2 NAC mode, it bothers me after working with the code around,
that it was melted with the "whole device" thing, except its shared
or not depending on the topic. Would be great to add one more level of
common abstraction. Of course its not easy given there are multiple
series in flight that touch the code.
(this is not an action item for you, just saying that improvement here
would be much welcomed by me personally)

> +	 * may share one ice_adapter, but not the profile IDs.
> +	 */
> +	index = ice_adapter_index(pf->pdev);
> +	adapter->rss_prof_share = index && !(index & ICE_ADAPTER_FIXED_INDEX);
> +
>   	return init_srcu_struct(&adapter->ports.srcu);
>   }
>   
> @@ -92,10 +103,12 @@ static void ice_adapter_fini(void *priv)
>   	struct ice_adapter *adapter = priv;
>   
>   	WARN_ON(!list_empty(&adapter->ports.list));
> +	WARN_ON(!list_empty(&adapter->rss_profs));
>   	for (int i = 0; i < ARRAY_SIZE(adapter->cpi_phy_lock); i++)
>   		mutex_destroy(&adapter->cpi_phy_lock[i]);
>   	mutex_destroy(&adapter->cgu_synce_lock);
>   	mutex_destroy(&adapter->rebuild_lock);
> +	mutex_destroy(&adapter->rss_prof_lock);
>   
>   	cleanup_srcu_struct(&adapter->ports.srcu);
>   	mutex_destroy(&adapter->ps_lock);
> diff --git a/drivers/net/ethernet/intel/ice/ice_adapter.h b/drivers/net/ethernet/intel/ice/ice_adapter.h
> index 3778948730ef7..6e2d8b33ce71e 100644
> --- a/drivers/net/ethernet/intel/ice/ice_adapter.h
> +++ b/drivers/net/ethernet/intel/ice/ice_adapter.h
> @@ -101,6 +101,9 @@ struct ice_phc {
>    * @ctrl_pf: Control PF of the adapter
>    * @rebuild_lock: serialize PFR recovery across PFs of the same adapter
>    * @ports: Ports list
> + * @rss_prof_lock: Mutex protecting @rss_profs
> + * @rss_profs: RSS hash profile IDs shared by the PFs, see ice_flex_pipe.c
> + * @rss_prof_share: The PFs may share RSS hash profile IDs
>    */
>   struct ice_adapter {
>   	struct devlink *devlink;
> @@ -124,6 +127,10 @@ struct ice_adapter {
>   	struct rw_semaphore ctrl_pf_lock;
>   	struct ice_pf __rcu *ctrl_pf;
>   	struct ice_port_list ports;
> +	/* For access to the list of shared RSS hash profiles */
> +	struct mutex rss_prof_lock;
> +	struct list_head rss_profs;
> +	bool rss_prof_share;
>   };
>   
>   struct ice_adapter *ice_adapter_get(struct pci_dev *pdev);
> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> index 4a5e2043447f1..ceba419233a70 100644
> --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
> @@ -2966,7 +2966,7 @@ ice_set_rxfh_fields(struct net_device *netdev,
>   	struct ice_netdev_priv *np = netdev_priv(netdev);
>   	struct ice_vsi *vsi = np->vsi;
>   	struct ice_pf *pf = vsi->back;
> -	struct ice_rss_hash_cfg cfg;
> +	struct ice_rss_hash_cfg cfg = {};

rct

>   	struct device *dev;
>   	u64 hashed_flds;
>   	int status;
> diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
> index 6d619eeaf0190..427ea89aa091a 100644
> --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
> +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c
> @@ -1215,12 +1215,13 @@ ice_prof_has_mask(struct ice_hw *hw, enum ice_block blk, u8 prof, u16 *masks)
>    * @fv: field vector to search for
>    * @masks: masks for FV
>    * @symm: symmetric setting for RSS flows
> + * @skip_shared: do not return a profile ID shared with other PFs
>    * @prof_id: receives the profile ID
>    */
>   static int
>   ice_find_prof_id_with_mask(struct ice_hw *hw, enum ice_block blk,
>   			   struct ice_fv_word *fv, u16 *masks, bool symm,
> -			   u8 *prof_id)
> +			   bool skip_shared, u8 *prof_id)
>   {
>   	struct ice_es *es = &hw->blk[blk].es;
>   	u8 i;
> @@ -1237,6 +1238,9 @@ ice_find_prof_id_with_mask(struct ice_hw *hw, enum ice_block blk,
>   		if (blk == ICE_BLK_RSS && es->symm[i] != symm)
>   			continue;
>   
> +		if (skip_shared && es->shared[i])
> +			continue;
> +
>   		if (memcmp(&es->t[off], fv, es->fvw * sizeof(*fv)))
>   			continue;
>   
> @@ -1376,6 +1380,324 @@ static int ice_free_prof_id(struct ice_hw *hw, enum ice_block blk, u8 prof_id)
>   	return ice_free_hw_res(hw, res_type, 1, &tmp_prof_id);
>   }
>   
> +/**
> + * struct ice_shared_prof - RSS hash profile ID shared by the PFs of an adapter
> + * @list: entry in the list of shared profiles of the adapter
> + * @es: extraction sequence the profile ID is programmed with
> + * @pfs: bitmap of the PFs (by hw->pf_id) holding a reference to the ID
> + * @prof_id: the profile ID
> + *
> + * The DDP package defines the RSS profile IDs as shared resources: firmware
> + * lets every PF allocate an ID that another PF already holds, keeps the ID
> + * until its last user frees it, and a PF reset drops the references of that
> + * PF. Firmware cannot look up the ID programmed with an extraction sequence,
> + * the adapter keeps a list of these entries for that.
> + *
> + * Only profiles without field masks and symmetric hashing are shared, their
> + * only hardware state is the extraction sequence, which all PFs write the
> + * same. The GLQF_HMASK registers are split between the PFs, and GLQF_HSYMM is
> + * programmed by every user of a profile.
> + */
> +struct ice_shared_prof {
> +	struct list_head list;
> +	struct ice_fv_word es[ICE_MAX_FV_WORDS];
> +	unsigned long pfs;
> +	u8 prof_id;
> +};
> +
> +/**
> + * ice_shared_profs_adapter - get the adapter whose PFs share profile IDs
> + * @hw: pointer to the HW struct
> + * @blk: hardware block
> + *
> + * Return: the adapter of the PF, if its PFs may share profile IDs of @blk,
> + * NULL otherwise.
> + */
> +static struct ice_adapter *
> +ice_shared_profs_adapter(struct ice_hw *hw, enum ice_block blk)
> +{
> +	struct ice_pf *pf = hw->back;
> +
> +	if (blk != ICE_BLK_RSS || !pf->adapter || !pf->adapter->rss_prof_share)

I guess pf->adapter cannot be null

> +		return NULL;
> +
> +	return pf->adapter;
> +}
> +
> +/**
> + * ice_prof_can_share - check if a profile ID may be shared with other PFs
> + * @hw: pointer to the HW struct
> + * @blk: hardware block
> + * @masks: masks for the extraction sequence
> + * @symm: symmetric setting for RSS profiles
> + *
> + * Return: true if the profile uses neither field masks nor symmetric hashing.
> + */
> +static bool
> +ice_prof_can_share(struct ice_hw *hw, enum ice_block blk, u16 *masks,
> +		   bool symm)
> +{
> +	u16 i;

the default type for variable is "int", and loop counters should be
declared in the loop header

> +
> +	if (symm)
> +		return false;
> +
> +	if (!masks)
> +		return true;
> +
> +	for (i = 0; i < hw->blk[blk].es.fvw; i++)
> +		if (masks[i] && masks[i] != 0xFFFF)
> +			return false;
> +
> +	return true;
> +}
> +
> +/**
> + * ice_find_shared_prof - find the shared profile ID for an extraction sequence
> + * @adapter: adapter of the PFs sharing the profile IDs
> + * @es: extraction sequence
> + * @fvw: number of words in @es
> + *
> + * Return: the shared profile, NULL if there is none.
> + */
> +static struct ice_shared_prof *
> +ice_find_shared_prof(struct ice_adapter *adapter, struct ice_fv_word *es,
> +		     u16 fvw)
> +{
> +	struct ice_shared_prof *sp;
> +
> +	list_for_each_entry(sp, &adapter->rss_profs, list)
> +		if (!memcmp(sp->es, es, fvw * sizeof(*es)))
> +			return sp;
> +
> +	return NULL;
> +}
> +
> +/**
> + * ice_find_shared_prof_id - find a shared profile by its ID
> + * @adapter: adapter of the PFs sharing the profile IDs
> + * @prof_id: the profile ID
> + *
> + * Return: the shared profile, NULL if there is none.
> + */
> +static struct ice_shared_prof *
> +ice_find_shared_prof_id(struct ice_adapter *adapter, u8 prof_id)
> +{
> +	struct ice_shared_prof *sp;
> +
> +	list_for_each_entry(sp, &adapter->rss_profs, list)
> +		if (sp->prof_id == prof_id)
> +			return sp;
> +
> +	return NULL;
> +}
> +
> +/**
> + * ice_drop_shared_prof - remove a PF from the users of a shared profile ID
> + * @sp: the shared profile
> + * @pf_id: the PF
> + *
> + * Free the entry when it has no users left.
> + */
> +static void ice_drop_shared_prof(struct ice_shared_prof *sp, u8 pf_id)
> +{
> +	sp->pfs &= ~BIT(pf_id);
> +	if (sp->pfs)
> +		return;
> +
> +	list_del(&sp->list);
> +	kfree(sp);
> +}
> +
> +/**
> + * ice_join_prof_id - take a reference to a profile ID another PF allocated
> + * @hw: pointer to the HW struct
> + * @blk: the block of the profile ID
> + * @prof_id: the profile ID
> + *
> + * Allocate the given profile ID, without ICE_AQC_RES_TYPE_FLAG_IGNORE_INDEX:
> + * firmware adds the PF to the users of the ID.
> + *
> + * Return: 0 on success, negative error code otherwise.
> + */
> +static int ice_join_prof_id(struct ice_hw *hw, enum ice_block blk, u8 prof_id)
> +{
> +	DEFINE_RAW_FLEX(struct ice_aqc_alloc_free_res_elem, buf, elem, 1);
> +	u16 res_type, idx;
> +	int status;

in new code please name the variable "err", not "status"

> +
> +	if (!ice_prof_id_rsrc_type(blk, &res_type))
> +		return -EINVAL;
> +
> +	buf->num_elems = cpu_to_le16(1);
> +	buf->res_type = cpu_to_le16(res_type | ICE_AQC_RES_TYPE_FLAG_DEDICATED);
> +	buf->elem[0].e.sw_resp = cpu_to_le16(prof_id);
> +
> +	status = ice_aq_alloc_free_res(hw, buf, __struct_size(buf),
> +				       ice_aqc_opc_alloc_res);
> +	if (status)
> +		return status;
> +
> +	idx = le16_to_cpu(buf->elem[0].e.sw_resp);
> +	if (idx != prof_id) {
> +		ice_free_hw_res(hw, res_type, 1, &idx);
> +		return -EIO;
> +	}
> +
> +	return 0;
> +}
> +
> +/**
> + * ice_get_prof_id - get a profile ID for an extraction sequence
> + * @hw: pointer to the HW struct
> + * @blk: hardware block
> + * @es: extraction sequence of the profile
> + * @masks: masks for @es
> + * @symm: symmetric setting for RSS profiles
> + * @flags: ICE_PROF_* flags of the profile
> + * @prof_id: receives the profile ID
> + *
> + * Get a profile ID for @es, which the PF does not have yet. With
> + * ICE_PROF_SHARED, join the ID another PF of the adapter has for @es, or
> + * allocate a new one and make it available to the other PFs.
> + *
> + * Return: 0 on success, negative error code otherwise.
> + */
> +static int
> +ice_get_prof_id(struct ice_hw *hw, enum ice_block blk, struct ice_fv_word *es,
> +		u16 *masks, bool symm, u32 flags, u8 *prof_id)
> +{
> +	struct ice_adapter *adapter = ice_shared_profs_adapter(hw, blk);
> +	u16 fvw = hw->blk[blk].es.fvw;
> +	struct ice_shared_prof *sp;
> +	bool share;
> +	int status;
> +
> +	if (!adapter)
> +		return ice_alloc_prof_id(hw, blk, prof_id);
> +
> +	share = (flags & ICE_PROF_SHARED) &&
> +		ice_prof_can_share(hw, blk, masks, symm);
> +
> +	guard(mutex)(&adapter->rss_prof_lock);

we ban guard()() in netdev, scoped_guard() is fine

> +
> +	sp = share ? ice_find_shared_prof(adapter, es, fvw) : NULL;
> +	if (sp) {
> +		status = ice_join_prof_id(hw, blk, sp->prof_id);
> +		if (!status) {
> +			sp->pfs |= BIT(hw->pf_id);
> +			hw->blk[blk].es.shared[sp->prof_id] = 1;
> +			*prof_id = sp->prof_id;
> +			return 0;
> +		}
> +
> +		ice_debug(hw, ICE_DBG_PKG, "Failed to join profile ID %u, allocating a new one: %d\n",
> +			  sp->prof_id, status);
> +		share = false;
> +	}
> +
> +	status = ice_alloc_prof_id(hw, blk, prof_id);
> +	if (status)
> +		return status;
> +
> +	/* Firmware hands out unused IDs only, an entry for the ID is a stale
> +	 * one, left from before a reset that cleared the IDs of all PFs.
> +	 */

should we clear those at reset?

> +	sp = ice_find_shared_prof_id(adapter, *prof_id);
> +	if (sp) {
> +		list_del(&sp->list);
> +		kfree(sp);
> +	}
> +
> +	if (!share)
> +		return 0;
> +
> +	/* without an entry the ID just stays private to the PF */

too many comments - general rule is to avoid (esp. in the AI era),
it's fine to comment about something that is not inferrable from the
code, like FW/HW behavior

> +	sp = kzalloc_obj(*sp);
> +	if (!sp)
> +		return 0;
> +
> +	memcpy(sp->es, es, fvw * sizeof(*es));
> +	sp->pfs = BIT(hw->pf_id);
> +	sp->prof_id = *prof_id;
> +	list_add(&sp->list, &adapter->rss_profs);
> +	hw->blk[blk].es.shared[*prof_id] = 1;
> +
> +	return 0;
> +}


  reply	other threads:[~2026-11-27 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 12:31 [PATCH iwl-next 0/3] ice: share RSS hash profile IDs between PFs Jakub Ramaseuski
2026-11-26 12:31 ` [PATCH iwl-next 1/3] ice: release the profile ID on ice_add_prof() error paths Jakub Ramaseuski
2026-11-26 12:31 ` [PATCH iwl-next 2/3] ice: share default RSS hash profiles between PFs Jakub Ramaseuski
2026-11-27 13:39   ` Przemek Kitszel [this message]
2026-11-26 12:31 ` [PATCH iwl-next 3/3] ice: share all " Jakub Ramaseuski
2026-11-27 13:45   ` Przemek Kitszel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8a1046e-c129-414f-9e90-d165c863c856@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jramaseu@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox