def METHOD_NAME(profile, priority, cipher_suite, primary_cak, primary_ckn, policy, enable_replay_protect, replay_window, send_sci, rekey_period):
    """
    Add MACsec profile
    """
    ctx = click.get_current_context()
    config_db = ctx.obj
    profile_entry = config_db.get_entry('MACSEC_PROFILE', profile)
    if not len(profile_entry) == 0:
        ctx.fail("{} already exists".format(profile))
    profile_table = {}
    profile_table["priority"] = priority
    profile_table["cipher_suite"] = cipher_suite
    if "128" in cipher_suite:
        if len(primary_cak) != 66:
            ctx.fail("Expect the length of CAK is 66, but got {}".format(len(primary_cak)))
    elif "256" in cipher_suite:
        if len(primary_cak) != 130:
            ctx.fail("Expect the length of CAK is 130, but got {}".format(len(primary_cak)))
    if not is_hexstring(primary_cak):
        ctx.fail("Expect the primary_cak is valid hex string")
    if not is_hexstring(primary_ckn):
        ctx.fail("Expect the primary_ckn is valid hex string")
    profile_table["primary_cak"] = primary_cak
    profile_table["primary_ckn"] = primary_ckn
    profile_table["policy"] = policy
    if enable_replay_protect and replay_window > 0:
        profile_table["enable_replay_protect"] = enable_replay_protect
        profile_table["replay_window"] = replay_window
    profile_table["send_sci"] = send_sci
    if rekey_period > 0:
        profile_table["rekey_period"] = rekey_period
    for k, v in profile_table.items():
        if isinstance(v, bool):
            if v:
                profile_table[k] = "true"
            else:
                profile_table[k] = "false"
        else:
            profile_table[k] = str(v)
    config_db.set_entry("MACSEC_PROFILE", profile, profile_table)