search for: mlx5_vdpa_net

Displaying 20 results from an estimated 39 matches for "mlx5_vdpa_net".

2020 Jul 16
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
...onfig > index 48a1a776dd86..809cb4c2eecf 100644 > --- a/drivers/vdpa/Kconfig > +++ b/drivers/vdpa/Kconfig > @@ -36,4 +36,14 @@ config MLX5_VDPA > Support library for Mellanox VDPA drivers. Provides code that is > common for all types of VDPA drivers. > > +config MLX5_VDPA_NET > + tristate "vDPA driver for ConnectX devices" > + depends on MLX5_VDPA > + default n > + help > + VDPA network driver for ConnectX6 and newer. Provides offloading > + of virtio net datapath such that descriptors put on the ring will > + be executed by the hard...
2020 Aug 06
1
[PATCH][next] vdpa/mlx5: fix memory allocation failure checks
...ile changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 3ec44a4f0e45..55bc58e1dae9 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl *outlen = MLX5_ST_SZ_BYTES(qp_2rst_out); *in = kzalloc(*inlen, GFP_KERNEL); *out = kzalloc(*outlen, GFP_KERNEL); - if (!in || !out) + if (!*in || !*out) goto outerr; MLX5_SET(qp_2rst_in, *in, opcode, cmd); @@ -879,7 +879,7 @@ static void alloc...
2023 Apr 03
0
[Patch v3] vdpa/mlx5: Avoid losing link state updates
...>> + > >> + return false; > >> +} > >> + > >> +static void update_carrier(struct work_struct *work) > >> +{ > >> + struct mlx5_vdpa_wq_ent *wqent; > >> + struct mlx5_vdpa_dev *mvdev; > >> + struct mlx5_vdpa_net *ndev; > >> + > >> + wqent = container_of(work, struct mlx5_vdpa_wq_ent, work); > >> + mvdev = wqent->mvdev; > >> + ndev = to_mlx5_vdpa_ndev(mvdev); > >> + if (get_link_state(mvdev)) > >> + ndev->confi...
2020 Jul 17
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
On 2020/7/16 ??7:54, Eli Cohen wrote: > On Thu, Jul 16, 2020 at 05:14:32PM +0800, Jason Wang wrote: >>> +static void suspend_vqs(struct mlx5_vdpa_net *ndev) >>> +{ >>> + int i; >>> + >>> + for (i = 0; i < MLX5_MAX_SUPPORTED_VQS; i++) >>> + suspend_vq(ndev, &ndev->vqs[i]); >> >> In teardown_virtqueues() it has a check of mvq->num_ent, any reason >> not doing it here? &gt...
2020 Aug 07
1
[PATCH] vdpa/mlx5: Fix erroneous null pointer checks
...4 deletions(-) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index 3ec44a4f0e45..bcb6600c2839 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -867,7 +867,7 @@ static void alloc_inout(struct mlx5_vdpa_net *ndev, int cmd, void **in, int *inl > *outlen = MLX5_ST_SZ_BYTES(qp_2rst_out); > *in = kzalloc(*inlen, GFP_KERNEL); > *out = kzalloc(*outlen, GFP_KERNEL); > - if (!in || !out) > + if (!*in || !*out) > goto outerr; > > MLX5_SET(qp_2rst_in, *in, opcod...
2023 Aug 31
2
[PATCH v2] vdpa/mlx5: Fix firmware error on creation of 1k VQs
...s changed, 63 insertions(+), 9 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 40a03b08d7cf..ef5907b1d513 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -625,30 +625,70 @@ static void cq_destroy(struct mlx5_vdpa_net *ndev, u16 idx) mlx5_db_free(ndev->mvdev.mdev, &vcq->db); } +static int read_umem_params(struct mlx5_vdpa_net *ndev) +{ + u32 in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {}; + u16 opmod = (MLX5_CAP_VDPA_EMULATION << 1) | (HCA_CAP_OPMOD_GET_CUR & 0x01); + struct mlx5_core_dev *mde...
2023 Mar 27
0
[PATCH] vdpa/mlx5: Avoid losing link state updates
...ruct mlx5_vdpa_dev *mvdev) > +{ > + if (query_vport_state(mvdev->mdev, MLX5_VPORT_STATE_OP_MOD_VNIC_VPORT, 0) == > + VPORT_STATE_UP) > + return true; > + > + return false; > +} > + > +static void update_link_state(struct mlx5_vdpa_dev *mvdev) > +{ > + struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); > + bool up; > + > + up = get_link_state(mvdev); > + spin_lock(&ndev->status_lock); > + if (up) > + ndev->config.status |= cpu_to_mlx5vdpa16(mvdev, VIRTIO_NET_S_LINK_UP); > + else > + ndev->config.status &= cpu_to_mlx5vdpa...
2020 Aug 10
0
[PATCH] vdpa/mlx5: fix up endian-ness for mtu
...c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index c6b9ec47e51d..9df69d5efe8c 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -137,6 +137,7 @@ struct mlx5_vdpa_net { struct mlx5_fc *rx_counter; struct mlx5_flow_handle *rx_rule; bool setup; + u16 mtu; }; static void free_resources(struct mlx5_vdpa_net *ndev); @@ -1506,6 +1507,13 @@ static void teardown_virtqueues(struct mlx5_vdpa_net *ndev) } } +/* TODO: cross-endian support */ +static inline bo...
2023 Mar 21
0
[PATCH v3 1/2] vdpa/mlx5: Extend driver support for new features
...O6)) << MLX5_VIRTIO_NET_F_HOST_TSO6) | > + (!!(features & BIT_ULL(VIRTIO_NET_F_HOST_TSO4)) << MLX5_VIRTIO_NET_F_HOST_TSO4); > } > > static bool counters_supported(const struct mlx5_vdpa_dev *mvdev) > @@ -797,6 +813,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtque > int inlen = MLX5_ST_SZ_BYTES(create_virtio_net_q_in); > u32 out[MLX5_ST_SZ_DW(create_virtio_net_q_out)] = {}; > void *obj_context; > + u16 mlx_features; > void *cmd_hdr; > void *vq_ctx; > void *in; > @@ -812,6 +829,7 @@ sta...
2023 Mar 17
0
[PATCH v2 1/2] vdpa/mlx5: Extend driver support for new features
...6)) << MLX5_VIRTIO_NET_F_HOST_TSO6) | > + (!!(features & BIT_ULL(VIRTIO_NET_F_HOST_TSO4)) << MLX5_VIRTIO_NET_F_HOST_TSO4); > } > > static bool counters_supported(const struct mlx5_vdpa_dev *mvdev) > @@ -797,6 +817,7 @@ static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtque > int inlen = MLX5_ST_SZ_BYTES(create_virtio_net_q_in); > u32 out[MLX5_ST_SZ_DW(create_virtio_net_q_out)] = {}; > void *obj_context; > + u16 mlx_features; > void *cmd_hdr; > void *vq_ctx; > vo...
2020 Sep 28
0
[PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module
...for ConnectX devices" > depends on MLX5_CORE > - default n > help > Support library for Mellanox VDPA drivers. Provides code that is > common for all types of VDPA drivers. The following drivers are planned: > @@ -40,8 +39,7 @@ config MLX5_VDPA > > config MLX5_VDPA_NET > tristate "vDPA driver for ConnectX devices" > - depends on MLX5_VDPA > - default n > + depends on MLX5_VDPA_CORE > help > VDPA network driver for ConnectX6 and newer. Provides offloading > of virtio net datapath such that descriptors put on the ring will...
2020 Sep 29
0
[PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module
...- default n > > > help > > > Support library for Mellanox VDPA drivers. Provides code that is > > > common for all types of VDPA drivers. The following drivers are planned: > > > @@ -40,8 +39,7 @@ config MLX5_VDPA > > > > > > config MLX5_VDPA_NET > > > tristate "vDPA driver for ConnectX devices" > > > - depends on MLX5_VDPA > > > - default n > > > + depends on MLX5_VDPA_CORE > > > help > > > VDPA network driver for ConnectX6 and newer. Provides offloading > > >...
2020 Oct 01
0
[PATCH] vdpa/mlx5: should keep avail_index despite device status
...1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 70676a6..74264e59 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1133,15 +1133,17 @@ static void suspend_vq(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *m if (!mvq->initialized) return; - if (query_virtqueue(ndev, mvq, &attr)) { - mlx5_vdpa_warn(&ndev->mvdev, "failed to query virtqueue\n"); - return; - } if (mvq->fw_state != MLX5_VIRTIO_NET_Q_OBJECT_STATE_RDY) return; i...
2020 Sep 29
0
[PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module
...gt; > Support library for Mellanox VDPA drivers. Provides code that is > > > > > common for all types of VDPA drivers. The following drivers are planned: > > > > > @@ -40,8 +39,7 @@ config MLX5_VDPA > > > > > > > > > > config MLX5_VDPA_NET > > > > > tristate "vDPA driver for ConnectX devices" > > > > > - depends on MLX5_VDPA > > > > > - default n > > > > > + depends on MLX5_VDPA_CORE > > > > > help > > > > > VDPA network driver...
2023 Jul 04
1
[PATCH] mlx5_vdpa: offer VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK
...e <uapi/linux/vdpa.h> >> +#include <uapi/linux/vhost_types.h> >> #include <linux/virtio_config.h> >> #include <linux/auxiliary_bus.h> >> #include <linux/mlx5/cq.h> >> @@ -2499,6 +2500,11 @@ static void unregister_link_notifier(struct mlx5_vdpa_net *ndev) >> flush_workqueue(ndev->mvdev.wq); >> } >> >> +static u64 mlx5_vdpa_get_backend_features(const struct vdpa_device *vdpa) >> +{ >> + return BIT_ULL(VHOST_BACKEND_F_ENABLE_AFTER_DRIVER_OK); >> +} >> + >> static int mlx5_vdpa_...
2020 Sep 29
0
[PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module
...x VDPA drivers. Provides code that is > > > > > > > common for all types of VDPA drivers. The following drivers are planned: > > > > > > > @@ -40,8 +39,7 @@ config MLX5_VDPA > > > > > > > > > > > > > > config MLX5_VDPA_NET > > > > > > > tristate "vDPA driver for ConnectX devices" > > > > > > > - depends on MLX5_VDPA > > > > > > > - default n > > > > > > > + depends on MLX5_VDPA_CORE > > > > > > > hel...
2020 Aug 21
3
[PATCH] vdpa/mlx5: Avoid warnings about shifts on 32-bit platforms
...VIRTIO_NET_F_HOST_TSO4)) << 9) | + (!!(features & BIT_ULL(VIRTIO_NET_F_HOST_TSO6)) << 8) | + (!!(features & BIT_ULL(VIRTIO_NET_F_CSUM)) << 7) | + (!!(features & BIT_ULL(VIRTIO_NET_F_GUEST_CSUM)) << 6); } static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq) @@ -1439,13 +1439,13 @@ static u64 mlx_to_vritio_features(u16 dev_features) u64 result = 0; if (dev_features & MLX5_VIRTIO_NET_F_GUEST_CSUM) - result |= BIT(VIRTIO_NET_F_GUEST_CSUM); + result |= BIT_ULL(VIRTIO_NET_F_GUEST_CSUM); if (dev_features...
2020 Aug 21
3
[PATCH] vdpa/mlx5: Avoid warnings about shifts on 32-bit platforms
...VIRTIO_NET_F_HOST_TSO4)) << 9) | + (!!(features & BIT_ULL(VIRTIO_NET_F_HOST_TSO6)) << 8) | + (!!(features & BIT_ULL(VIRTIO_NET_F_CSUM)) << 7) | + (!!(features & BIT_ULL(VIRTIO_NET_F_GUEST_CSUM)) << 6); } static int create_virtqueue(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue *mvq) @@ -1439,13 +1439,13 @@ static u64 mlx_to_vritio_features(u16 dev_features) u64 result = 0; if (dev_features & MLX5_VIRTIO_NET_F_GUEST_CSUM) - result |= BIT(VIRTIO_NET_F_GUEST_CSUM); + result |= BIT_ULL(VIRTIO_NET_F_GUEST_CSUM); if (dev_features...
2020 Jul 20
0
[PATCH vhost next 10/10] vdpa/mlx5: Add VDPA driver for supported mlx5 devices
...ike checking intialized is enough. Will fix this. >>>>> + >>>>> +static void mlx5_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready) >>>>> +{ >>>>> + struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev); >>>>> + struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); >>>>> + struct mlx5_vdpa_virtqueue *mvq = &ndev->vqs[idx]; >>>>> + int err; >>>>> + >>>>> + if (!mvq->ready && ready && mvq->fw_state != MLX5_VIRTIO_NET_Q_OBJECT_STATE_RDY) { &...
2020 Aug 08
0
[PATCH] vdpa/mlx5: Fix pointer math in mlx5_vdpa_get_config()
...rivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 3ec44a4f0e45..9d1637cf772e 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c @@ -1758,7 +1758,7 @@ static void mlx5_vdpa_get_config(struct vdpa_device *vdev, unsigned int offset, struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); if (offset + len < sizeof(struct virtio_net_config)) - memcpy(buf, &ndev->config + offset, len); + memcpy(buf, (u8 *)&ndev->config + offset, len); } static void mlx5_vdpa_set_config(struct vdpa_device *vdev, unsigned int offset, const voi...