Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp778252pxv; Thu, 22 Jul 2021 11:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw3HTWXsMPW4FwQElY4bHLWVbnGEaWjPRD6f5PyX0vHEXStIvKlQTiEZQIxm/RgqopFhzH X-Received: by 2002:a17:906:4e15:: with SMTP id z21mr1171025eju.333.1626980029374; Thu, 22 Jul 2021 11:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626980029; cv=none; d=google.com; s=arc-20160816; b=hK2Ol1fa5Ge6AwIPLbuhA6qklZZ7fd2agcUEmuJ01F+BzXOCHgS64AK5TuyWRckY9h 9ouIAiUqg1LPlraLPudRTegat7PamZSZx/LMNC6XysAT009VMKHcXKa4WDE7miv+5ZQG ECH9brtt+Iv7wzikC1PrGfFr9OpNdf/y8DRWkMS/d0AtDnZKKsjb0x4pvCnYItoGUoce sU37znZzGlMmxwIeuX6ZbrJOP6Y3pTYmY8nkhEK3BJJjjPe6sNfljsWnc3DK+gFISn3N H24w1JswYSsr52cheCjscdH/v55u4aS+6bJj+89zamzKWCl9+KsWP5UYScIT2KLQ6YMk Eqyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=SS/avponfdTcVbCYBYVWP8iYT4d+tuO9lAk0bD3jIws=; b=0mkXSKbIVI+u+FzRbgSEGrpu/AbLdP+qpNRqz8o/i+Z1c62LiX+RSos1x7T/vrKys1 Mf8hb+aQraI+R5BSA6+fOix9Ra6DoPWg8NwWxxUuZwXJxAGO0utLkNzgWk042kJVjsQV 9Avv7dVudOwU7sefuMjNlz2INNZzLQWvPH8Y3+GA0SrVzjf7CR/iOIHAxXRNp3rE8G73 B2hMi7tKcE7bEiMuzBv0uXeWjPHpMYDVOpNcJ/RmeV+ydlFeppFpqXypemAwi3xba5s5 cZpWaMofL1pAhCJ+sccQGLc6ojAxR3vwiQpgBS/Q2cpPIVM9wzLksWdkhktz6aMd0Wun 7/hQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m17si27110938edc.467.2021.07.22.11.52.51; Thu, 22 Jul 2021 11:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbhGVSKV convert rfc822-to-8bit (ORCPT + 99 others); Thu, 22 Jul 2021 14:10:21 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:56720 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230172AbhGVSKU (ORCPT ); Thu, 22 Jul 2021 14:10:20 -0400 Received: from smtpclient.apple (p5b3d2eb8.dip0.t-ipconnect.de [91.61.46.184]) by mail.holtmann.org (Postfix) with ESMTPSA id 8E743CECE6; Thu, 22 Jul 2021 20:50:54 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [PATCH v10 10/10] Bluetooth: Add offload feature under experimental flag From: Marcel Holtmann In-Reply-To: Date: Thu, 22 Jul 2021 20:50:54 +0200 Cc: Kiran K , "linux-bluetooth@vger.kernel.org" Content-Transfer-Encoding: 8BIT Message-Id: <72541BF8-3226-410C-962B-7128FB2B192C@holtmann.org> References: <20210630080807.12600-1-kiran.k@intel.com> <20210630080807.12600-10-kiran.k@intel.com> <87EBBD58-71B1-4712-A5BC-8B53E739DAFE@holtmann.org> To: Luiz Augusto von Dentz X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz, >>>>>> Allow user level process to enable / disable codec offload >>>>>> feature through mgmt interface. By default offload codec feature >>>>>> is disabled. >>>>>> >>>>>> Signed-off-by: Kiran K >>>>>> Reviewed-by: Chethan T N >>>>>> Reviewed-by: Srivatsa Ravishankar >>>>>> --- >>>>>> * changes in v10: >>>>>> - new patch added to place offload codec feature under experimental flag >>>>>> >>>>>> include/net/bluetooth/hci.h | 4 ++ >>>>>> net/bluetooth/mgmt.c | 106 +++++++++++++++++++++++++++++++++++- >>>>>> net/bluetooth/sco.c | 10 ++++ >>>>>> 3 files changed, 119 insertions(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h >>>>>> index e20318854900..5ca98d9f64dd 100644 >>>>>> --- a/include/net/bluetooth/hci.h >>>>>> +++ b/include/net/bluetooth/hci.h >>>>>> @@ -331,6 +331,10 @@ enum { >>>>>> HCI_CMD_PENDING, >>>>>> HCI_FORCE_NO_MITM, >>>>>> >>>>>> +#if IS_ENABLED(CONFIG_BT_OFFLOAD_CODECS) >>>>>> + HCI_OFFLOAD_CODECS_ENABLED, >>>>>> +#endif >>>>> >>>>> That is probably a bad idea as it could lead the enum to assume >>>>> different values based on what is enabled, besides we don't gain >>>>> anything by not having the symbol defined all the time. >>>> >>>> While this would work with dev_flags which are internal and not API, I still don’t like it. >>>> >>>> There is really no benefit to make this a compile time option. And as far as I remember I never said this needs to be compile time. Actually I rather have this as an experimental setting so that it can be switched on at runtime. Nobody is going to recompile their kernels to test codec offload. >>> >>> Initially I was with the same opinion, but the problem is the codecs >>> are read at init sequence and the experimental flags are set at a >>> later stage thus why I suggested a KConfig option until the feature is >>> more mature and we can remove the option altogether. >> >> I am fine with the codec options being read all the time. I mean having an experimental option to control the use of offload. > > Alright, then we don't need the Kconfig after all, the experimental > flag will only control the use of the codecs e.g. socketopts would not > work if the flag is not enabled I assume? exactly. It would then return EOPNOTSUPP error. It would be similar to an old kernel where this socket option is not available either. Regards Marcel