* [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
@ 2023-04-11 12:04 Ivan Vecera
[not found] ` <CACKFLimBqwsX3tsnUp9svqSJHx57XEAu3kQ8Hj1Pq0+QS1uGsg@mail.gmail.com>
2023-04-13 9:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 6+ messages in thread
From: Ivan Vecera @ 2023-04-11 12:04 UTC (permalink / raw)
To: netdev
Cc: mschmidt, Michael Chan, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, open list
Remove an inability of bnxt_en driver to set eswitch to switchdev
mode without existing VFs by:
1. Allow to set switchdev mode in bnxt_dl_eswitch_mode_set() so
representors are created only when num_vfs > 0 otherwise just
set bp->eswitch_mode
2. Do not automatically change bp->eswitch_mode during
bnxt_vf_reps_create() and bnxt_vf_reps_destroy() calls so
the eswitch mode is managed only by an user by devlink.
Just set temporarily bp->eswitch_mode to legacy to avoid
re-opening of representors during destroy.
3. Create representors in bnxt_sriov_enable() if current eswitch
mode is switchdev one
Tested by this sequence:
1. Set PF interface up
2. Set PF's eswitch mode to switchdev
3. Created N VFs
4. Checked that N representors were created
5. Set eswitch mode to legacy
6. Checked that representors were deleted
7. Set eswitch mode back to switchdev
8. Checked that representors exist again for VFs
9. Deleted all VFs
10. Checked that all representors were deleted as well
11. Checked that current eswitch mode is still switchdev
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
.../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 16 ++++++++++
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 29 ++++++++++++-------
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h | 6 ++++
3 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
index 3ed3a2b3b3a9..dde327f2c57e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
@@ -825,8 +825,24 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
if (rc)
goto err_out2;
+ if (bp->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV)
+ return 0;
+
+ /* Create representors for VFs in switchdev mode */
+ devl_lock(bp->dl);
+ rc = bnxt_vf_reps_create(bp);
+ devl_unlock(bp->dl);
+ if (rc) {
+ netdev_info(bp->dev, "Cannot enable VFS as representors cannot be created\n");
+ goto err_out3;
+ }
+
return 0;
+err_out3:
+ /* Disable SR-IOV */
+ pci_disable_sriov(bp->pdev);
+
err_out2:
/* Free the resources reserved for various VF's */
bnxt_hwrm_func_vf_resource_free(bp, *num_vfs);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
index fcc65890820a..2f1a1f2d2157 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
@@ -356,10 +356,15 @@ void bnxt_vf_reps_destroy(struct bnxt *bp)
/* un-publish cfa_code_map so that RX path can't see it anymore */
kfree(bp->cfa_code_map);
bp->cfa_code_map = NULL;
- bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
- if (closed)
+ if (closed) {
+ /* Temporarily set legacy mode to avoid re-opening
+ * representors and restore switchdev mode after that.
+ */
+ bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
bnxt_open_nic(bp, false, false);
+ bp->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV;
+ }
rtnl_unlock();
/* Need to call vf_reps_destroy() outside of rntl_lock
@@ -482,7 +487,7 @@ static void bnxt_vf_rep_netdev_init(struct bnxt *bp, struct bnxt_vf_rep *vf_rep,
dev->min_mtu = ETH_ZLEN;
}
-static int bnxt_vf_reps_create(struct bnxt *bp)
+int bnxt_vf_reps_create(struct bnxt *bp)
{
u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev);
struct bnxt_vf_rep *vf_rep;
@@ -535,7 +540,6 @@ static int bnxt_vf_reps_create(struct bnxt *bp)
/* publish cfa_code_map only after all VF-reps have been initialized */
bp->cfa_code_map = cfa_code_map;
- bp->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV;
netif_keep_dst(bp->dev);
return 0;
@@ -559,6 +563,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
struct netlink_ext_ack *extack)
{
struct bnxt *bp = bnxt_get_bp_from_dl(devlink);
+ int ret = 0;
if (bp->eswitch_mode == mode) {
netdev_info(bp->dev, "already in %s eswitch mode\n",
@@ -570,7 +575,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
switch (mode) {
case DEVLINK_ESWITCH_MODE_LEGACY:
bnxt_vf_reps_destroy(bp);
- return 0;
+ break;
case DEVLINK_ESWITCH_MODE_SWITCHDEV:
if (bp->hwrm_spec_code < 0x10803) {
@@ -578,15 +583,19 @@ int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
return -ENOTSUPP;
}
- if (pci_num_vf(bp->pdev) == 0) {
- netdev_info(bp->dev, "Enable VFs before setting switchdev mode\n");
- return -EPERM;
- }
- return bnxt_vf_reps_create(bp);
+ /* Create representors for existing VFs */
+ if (pci_num_vf(bp->pdev) > 0)
+ ret = bnxt_vf_reps_create(bp);
+ break;
default:
return -EINVAL;
}
+
+ if (!ret)
+ bp->eswitch_mode = mode;
+
+ return ret;
}
#endif
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
index 5637a84884d7..33a965631d0b 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
@@ -14,6 +14,7 @@
#define MAX_CFA_CODE 65536
+int bnxt_vf_reps_create(struct bnxt *bp);
void bnxt_vf_reps_destroy(struct bnxt *bp);
void bnxt_vf_reps_close(struct bnxt *bp);
void bnxt_vf_reps_open(struct bnxt *bp);
@@ -37,6 +38,11 @@ int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
#else
+static inline int bnxt_vf_reps_create(struct bnxt *bp)
+{
+ return 0;
+}
+
static inline void bnxt_vf_reps_close(struct bnxt *bp)
{
}
--
2.39.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
[not found] ` <CACKFLimBqwsX3tsnUp9svqSJHx57XEAu3kQ8Hj1Pq0+QS1uGsg@mail.gmail.com>
@ 2023-04-11 17:39 ` Venkat Duvvuru
2023-04-11 17:47 ` Venkat Duvvuru
1 sibling, 0 replies; 6+ messages in thread
From: Venkat Duvvuru @ 2023-04-11 17:39 UTC (permalink / raw)
To: ivecera, netdev
Cc: mschmidt, Michael Chan, David S. Miller, edumazet, kuba, pabeni,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 7275 bytes --]
> Remove an inability of bnxt_en driver to set eswitch to switchdev
> mode without existing VFs by:
>
> 1. Allow to set switchdev mode in bnxt_dl_eswitch_mode_set() so
> representors are created only when num_vfs > 0 otherwise just
> set bp->eswitch_mode
> 2. Do not automatically change bp->eswitch_mode during
> bnxt_vf_reps_create() and bnxt_vf_reps_destroy() calls so
> the eswitch mode is managed only by an user by devlink.
> Just set temporarily bp->eswitch_mode to legacy to avoid
> re-opening of representors during destroy.
> 3. Create representors in bnxt_sriov_enable() if current eswitch
> mode is switchdev one
>
> Tested by this sequence:
> 1. Set PF interface up
> 2. Set PF's eswitch mode to switchdev
> 3. Created N VFs
> 4. Checked that N representors were created
> 5. Set eswitch mode to legacy
> 6. Checked that representors were deleted
> 7. Set eswitch mode back to switchdev
> 8. Checked that representors exist again for VFs
> 9. Deleted all VFs
> 10. Checked that all representors were deleted as well
> 11. Checked that current eswitch mode is still switchdev
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
> ---
> .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 16 ++++++++++
> drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 29 ++++++++++++-------
> drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h | 6 ++++
> 3 files changed, 41 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> index 3ed3a2b3b3a9..dde327f2c57e 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> @@ -825,8 +825,24 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
> if (rc)
> goto err_out2;
>
> + if (bp->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV)
> + return 0;
> +
> + /* Create representors for VFs in switchdev mode */
> + devl_lock(bp->dl);
> + rc = bnxt_vf_reps_create(bp);
> + devl_unlock(bp->dl);
> + if (rc) {
> + netdev_info(bp->dev, "Cannot enable VFS as
> representors cannot be created\n");
> + goto err_out3;
> + }
> +
> return 0;
>
> +err_out3:
> + /* Disable SR-IOV */
> + pci_disable_sriov(bp->pdev);
> +
> err_out2:
> /* Free the resources reserved for various VF's */
> bnxt_hwrm_func_vf_resource_free(bp, *num_vfs);
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> index fcc65890820a..2f1a1f2d2157 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> @@ -356,10 +356,15 @@ void bnxt_vf_reps_destroy(struct bnxt *bp)
> /* un-publish cfa_code_map so that RX path can't see it anymore */
> kfree(bp->cfa_code_map);
> bp->cfa_code_map = NULL;
> - bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
>
> - if (closed)
> + if (closed) {
> + /* Temporarily set legacy mode to avoid re-opening
> + * representors and restore switchdev mode after that.
> + */
> + bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
> bnxt_open_nic(bp, false, false);
> + bp->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV;
> + }
> rtnl_unlock();
>
> /* Need to call vf_reps_destroy() outside of rntl_lock
> @@ -482,7 +487,7 @@ static void bnxt_vf_rep_netdev_init(struct bnxt
> *bp, struct bnxt_vf_rep *vf_rep,
> dev->min_mtu = ETH_ZLEN;
> }
>
> -static int bnxt_vf_reps_create(struct bnxt *bp)
> +int bnxt_vf_reps_create(struct bnxt *bp)
> {
> u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev);
> struct bnxt_vf_rep *vf_rep;
> @@ -535,7 +540,6 @@ static int bnxt_vf_reps_create(struct bnxt *bp)
>
> /* publish cfa_code_map only after all VF-reps have been initialized */
> bp->cfa_code_map = cfa_code_map;
> - bp->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV;
> netif_keep_dst(bp->dev);
> return 0;
>
> @@ -559,6 +563,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
> struct netlink_ext_ack *extack)
> {
> struct bnxt *bp = bnxt_get_bp_from_dl(devlink);
> + int ret = 0;
>
> if (bp->eswitch_mode == mode) {
> netdev_info(bp->dev, "already in %s eswitch mode\n",
> @@ -570,7 +575,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
> switch (mode) {
> case DEVLINK_ESWITCH_MODE_LEGACY:
> bnxt_vf_reps_destroy(bp);
> - return 0;
> + break;
>
> case DEVLINK_ESWITCH_MODE_SWITCHDEV:
> if (bp->hwrm_spec_code < 0x10803) {
> @@ -578,15 +583,19 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
> return -ENOTSUPP;
> }
>
> - if (pci_num_vf(bp->pdev) == 0) {
> - netdev_info(bp->dev, "Enable VFs before
> setting switchdev mode\n");
> - return -EPERM;
> - }
> - return bnxt_vf_reps_create(bp);
> + /* Create representors for existing VFs */
> + if (pci_num_vf(bp->pdev) > 0)
> + ret = bnxt_vf_reps_create(bp);
> + break;
>
> default:
> return -EINVAL;
> }
> +
> + if (!ret)
> + bp->eswitch_mode = mode;
> +
> + return ret;
> }
>
> #endif
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> index 5637a84884d7..33a965631d0b 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> @@ -14,6 +14,7 @@
>
> #define MAX_CFA_CODE 65536
>
> +int bnxt_vf_reps_create(struct bnxt *bp);
> void bnxt_vf_reps_destroy(struct bnxt *bp);
> void bnxt_vf_reps_close(struct bnxt *bp);
> void bnxt_vf_reps_open(struct bnxt *bp);
> @@ -37,6 +38,11 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
>
> #else
>
> +static inline int bnxt_vf_reps_create(struct bnxt *bp)
> +{
> + return 0;
> +}
> +
> static inline void bnxt_vf_reps_close(struct bnxt *bp)
> {
> }
> --
> 2.39.2
ACK
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4225 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
[not found] ` <CACKFLimBqwsX3tsnUp9svqSJHx57XEAu3kQ8Hj1Pq0+QS1uGsg@mail.gmail.com>
2023-04-11 17:39 ` Venkat Duvvuru
@ 2023-04-11 17:47 ` Venkat Duvvuru
2023-04-12 14:34 ` Jakub Kicinski
1 sibling, 1 reply; 6+ messages in thread
From: Venkat Duvvuru @ 2023-04-11 17:47 UTC (permalink / raw)
To: ivecera, netdev
Cc: mschmidt, Michael Chan, David S. Miller, edumazet, Jakub Kicinski,
pabeni, open list
[-- Attachment #1: Type: text/plain, Size: 7331 bytes --]
> Remove an inability of bnxt_en driver to set eswitch to switchdev
> mode without existing VFs by:
>
> 1. Allow to set switchdev mode in bnxt_dl_eswitch_mode_set() so
> representors are created only when num_vfs > 0 otherwise just
> set bp->eswitch_mode
> 2. Do not automatically change bp->eswitch_mode during
> bnxt_vf_reps_create() and bnxt_vf_reps_destroy() calls so
> the eswitch mode is managed only by an user by devlink.
> Just set temporarily bp->eswitch_mode to legacy to avoid
> re-opening of representors during destroy.
> 3. Create representors in bnxt_sriov_enable() if current eswitch
> mode is switchdev one
>
> Tested by this sequence:
> 1. Set PF interface up
> 2. Set PF's eswitch mode to switchdev
> 3. Created N VFs
> 4. Checked that N representors were created
> 5. Set eswitch mode to legacy
> 6. Checked that representors were deleted
> 7. Set eswitch mode back to switchdev
> 8. Checked that representors exist again for VFs
> 9. Deleted all VFs
> 10. Checked that all representors were deleted as well
> 11. Checked that current eswitch mode is still switchdev
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
> ---
> .../net/ethernet/broadcom/bnxt/bnxt_sriov.c | 16 ++++++++++
> drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 29 ++++++++++++-------
> drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h | 6 ++++
> 3 files changed, 41 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> index 3ed3a2b3b3a9..dde327f2c57e 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c
> @@ -825,8 +825,24 @@ static int bnxt_sriov_enable(struct bnxt *bp, int *num_vfs)
> if (rc)
> goto err_out2;
>
> + if (bp->eswitch_mode != DEVLINK_ESWITCH_MODE_SWITCHDEV)
> + return 0;
> +
> + /* Create representors for VFs in switchdev mode */
> + devl_lock(bp->dl);
> + rc = bnxt_vf_reps_create(bp);
> + devl_unlock(bp->dl);
> + if (rc) {
> + netdev_info(bp->dev, "Cannot enable VFS as
> representors cannot be created\n");
> + goto err_out3;
> + }
> +
> return 0;
>
> +err_out3:
> + /* Disable SR-IOV */
> + pci_disable_sriov(bp->pdev);
> +
> err_out2:
> /* Free the resources reserved for various VF's */
> bnxt_hwrm_func_vf_resource_free(bp, *num_vfs);
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> index fcc65890820a..2f1a1f2d2157 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> @@ -356,10 +356,15 @@ void bnxt_vf_reps_destroy(struct bnxt *bp)
> /* un-publish cfa_code_map so that RX path can't see it anymore */
> kfree(bp->cfa_code_map);
> bp->cfa_code_map = NULL;
> - bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
>
> - if (closed)
> + if (closed) {
> + /* Temporarily set legacy mode to avoid re-opening
> + * representors and restore switchdev mode after that.
> + */
> + bp->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY;
> bnxt_open_nic(bp, false, false);
> + bp->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV;
> + }
> rtnl_unlock();
>
> /* Need to call vf_reps_destroy() outside of rntl_lock
> @@ -482,7 +487,7 @@ static void bnxt_vf_rep_netdev_init(struct bnxt
> *bp, struct bnxt_vf_rep *vf_rep,
> dev->min_mtu = ETH_ZLEN;
> }
>
> -static int bnxt_vf_reps_create(struct bnxt *bp)
> +int bnxt_vf_reps_create(struct bnxt *bp)
> {
> u16 *cfa_code_map = NULL, num_vfs = pci_num_vf(bp->pdev);
> struct bnxt_vf_rep *vf_rep;
> @@ -535,7 +540,6 @@ static int bnxt_vf_reps_create(struct bnxt *bp)
>
> /* publish cfa_code_map only after all VF-reps have been initialized */
> bp->cfa_code_map = cfa_code_map;
> - bp->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV;
> netif_keep_dst(bp->dev);
> return 0;
>
> @@ -559,6 +563,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
> struct netlink_ext_ack *extack)
> {
> struct bnxt *bp = bnxt_get_bp_from_dl(devlink);
> + int ret = 0;
>
> if (bp->eswitch_mode == mode) {
> netdev_info(bp->dev, "already in %s eswitch mode\n",
> @@ -570,7 +575,7 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
> switch (mode) {
> case DEVLINK_ESWITCH_MODE_LEGACY:
> bnxt_vf_reps_destroy(bp);
> - return 0;
> + break;
>
> case DEVLINK_ESWITCH_MODE_SWITCHDEV:
> if (bp->hwrm_spec_code < 0x10803) {
> @@ -578,15 +583,19 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
> return -ENOTSUPP;
> }
>
> - if (pci_num_vf(bp->pdev) == 0) {
> - netdev_info(bp->dev, "Enable VFs before
> setting switchdev mode\n");
> - return -EPERM;
> - }
> - return bnxt_vf_reps_create(bp);
> + /* Create representors for existing VFs */
> + if (pci_num_vf(bp->pdev) > 0)
> + ret = bnxt_vf_reps_create(bp);
> + break;
>
> default:
> return -EINVAL;
> }
> +
> + if (!ret)
> + bp->eswitch_mode = mode;
> +
> + return ret;
> }
>
> #endif
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> index 5637a84884d7..33a965631d0b 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
> @@ -14,6 +14,7 @@
>
> #define MAX_CFA_CODE 65536
>
> +int bnxt_vf_reps_create(struct bnxt *bp);
> void bnxt_vf_reps_destroy(struct bnxt *bp);
> void bnxt_vf_reps_close(struct bnxt *bp);
> void bnxt_vf_reps_open(struct bnxt *bp);
> @@ -37,6 +38,11 @@ int bnxt_dl_eswitch_mode_set(struct devlink
> *devlink, u16 mode,
>
> #else
>
> +static inline int bnxt_vf_reps_create(struct bnxt *bp)
> +{
> + return 0;
> +}
> +
> static inline void bnxt_vf_reps_close(struct bnxt *bp)
> {
> }
> --
> 2.39.2
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4225 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
2023-04-11 17:47 ` Venkat Duvvuru
@ 2023-04-12 14:34 ` Jakub Kicinski
2023-04-12 17:14 ` Michael Chan
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2023-04-12 14:34 UTC (permalink / raw)
To: Venkat Duvvuru, Michael Chan
Cc: ivecera, netdev, mschmidt, David S. Miller, edumazet, pabeni,
open list
On Tue, 11 Apr 2023 23:17:55 +0530 Venkat Duvvuru wrote:
> Acked-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Michael, does this mean Broadcom is okay with the patch?
> This electronic communication and the information and any files transmitted
> with it, or attached to it, are confidential and are intended solely for
> the use of the individual or entity to whom it is addressed and may contain
> information that is confidential, legally privileged, protected by privacy
> laws, or otherwise restricted from disclosure to anyone else. If you are
> not the intended recipient or the person responsible for delivering the
> e-mail to the intended recipient, you are hereby notified that any use,
> copying, distributing, dissemination, forwarding, printing, or copying of
> this e-mail is strictly prohibited. If you received this e-mail in error,
> please return the e-mail to the sender, delete it from your computer, and
> destroy any printed copy of it.
You must remove this footer.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
2023-04-12 14:34 ` Jakub Kicinski
@ 2023-04-12 17:14 ` Michael Chan
0 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2023-04-12 17:14 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Venkat Duvvuru, ivecera, netdev, mschmidt, David S. Miller,
edumazet, pabeni, open list
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
On Wed, Apr 12, 2023 at 7:34 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Tue, 11 Apr 2023 23:17:55 +0530 Venkat Duvvuru wrote:
> > Acked-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
>
> Michael, does this mean Broadcom is okay with the patch?
>
Yes, I've asked Venkat to review this and he has given his okay. Thanks.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs
2023-04-11 12:04 [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs Ivan Vecera
[not found] ` <CACKFLimBqwsX3tsnUp9svqSJHx57XEAu3kQ8Hj1Pq0+QS1uGsg@mail.gmail.com>
@ 2023-04-13 9:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-13 9:20 UTC (permalink / raw)
To: Ivan Vecera
Cc: netdev, mschmidt, michael.chan, davem, edumazet, kuba, pabeni,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Tue, 11 Apr 2023 14:04:42 +0200 you wrote:
> Remove an inability of bnxt_en driver to set eswitch to switchdev
> mode without existing VFs by:
>
> 1. Allow to set switchdev mode in bnxt_dl_eswitch_mode_set() so
> representors are created only when num_vfs > 0 otherwise just
> set bp->eswitch_mode
> 2. Do not automatically change bp->eswitch_mode during
> bnxt_vf_reps_create() and bnxt_vf_reps_destroy() calls so
> the eswitch mode is managed only by an user by devlink.
> Just set temporarily bp->eswitch_mode to legacy to avoid
> re-opening of representors during destroy.
> 3. Create representors in bnxt_sriov_enable() if current eswitch
> mode is switchdev one
>
> [...]
Here is the summary with links:
- [net-next,v2] bnxt_en: Allow to set switchdev mode without existing VFs
https://git.kernel.org/netdev/net-next/c/f032d8a9c8b3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-04-13 9:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11 12:04 [PATCH net-next v2] bnxt_en: Allow to set switchdev mode without existing VFs Ivan Vecera
[not found] ` <CACKFLimBqwsX3tsnUp9svqSJHx57XEAu3kQ8Hj1Pq0+QS1uGsg@mail.gmail.com>
2023-04-11 17:39 ` Venkat Duvvuru
2023-04-11 17:47 ` Venkat Duvvuru
2023-04-12 14:34 ` Jakub Kicinski
2023-04-12 17:14 ` Michael Chan
2023-04-13 9:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).