From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Xueming Li <xuemingl@mellanox.com>,
Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v5 2/5] net/mlx5: install a socket to exchange a file descriptor
Date: Fri, 6 Oct 2017 19:21:00 +0100 [thread overview]
Message-ID: <9bd9343c-1bf1-33cf-fe6c-d3970bfa6a07@intel.com> (raw)
In-Reply-To: <20171006154552.161159-3-xuemingl@mellanox.com>
On 10/6/2017 4:45 PM, Xueming Li wrote:
> Use a unix socket to get back the communication channel with the Kernel
> driver from the primary process, this is necessary to remap those pages
> in the secondary process memory space and thus use the same Tx queues.
>
> This is only supported from rdma-core (v15).
>
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
<...>
> +int
> +priv_tx_uar_remap(struct priv *priv, int fd)
> +{
> + unsigned int i, j;
> + uintptr_t pages[priv->txqs_n];
> + unsigned int pages_n = 0;
> + uintptr_t uar_va;
> + void *addr;
> + struct txq *txq;
> + struct txq_ctrl *txq_ctrl;
> + int already_mapped;
> + size_t page_size = sysconf(_SC_PAGESIZE);
> +
> + /*
> + * As rdma-core, UARs are mapped in size of OS page size.
> + * Use aligned address to avoid duplicate mmap.
> + * Ref to libmlx5 function: mlx5_init_context()
> + */
> + for (i = 0; i != priv->txqs_n; ++i) {
> + txq = (*priv->txqs)[i];
> + txq_ctrl = container_of(txq, struct txq_ctrl, txq);
> + uar_va = (uintptr_t)txq_ctrl->txq.bf_reg;
> + uar_va = RTE_ALIGN_FLOOR(uar_va, page_size);
> + already_mapped = 0;
> + for (j = 0; j != pages_n; ++j) {
> + if (pages[j] == uar_va) {
ICC generates following warning [1], but it looks like false positive, I
will disable this warning for this file for ICC while applying, please
double check final commit.
[1]
.../drivers/net/mlx5/mlx5_txq.c(608): error #3656: variable "pages" may
be used before its value is set
if (pages[j] == uar_va) {
^
> + already_mapped = 1;
> + break;
> + }
> + }
> + if (already_mapped)
> + continue;
> + pages[pages_n++] = uar_va;
> + addr = mmap((void *)uar_va, page_size,
> + PROT_WRITE, MAP_FIXED | MAP_SHARED, fd,
> + txq_ctrl->uar_mmap_offset);
> + if (addr != (void *)uar_va) {
> + ERROR("call to mmap failed on UAR for txq %d\n", i);
> + return -1;
> + }
> + }
> + return 0;
> +}
>
next prev parent reply other threads:[~2017-10-06 18:21 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 14:03 [dpdk-dev] [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process Xueming Li
2017-08-24 14:03 ` [dpdk-dev] [PATCH v1 2/2] net/mlx5: add multiple process support Xueming Li
2017-08-25 7:27 ` Nélio Laranjeiro
2017-08-25 6:52 ` [dpdk-dev] [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process Nélio Laranjeiro
2017-08-25 7:15 ` Xueming(Steven) Li
2017-08-25 7:32 ` Nélio Laranjeiro
2017-09-15 15:59 ` [dpdk-dev] [PATCH v2 1/6] " Xueming Li
2017-09-15 15:59 ` [dpdk-dev] [PATCH v2 2/6] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-09-15 15:59 ` [dpdk-dev] [PATCH v2 3/6] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-09-15 15:59 ` [dpdk-dev] [PATCH v2 4/6] net/mlx5: remove verbs fork check Xueming Li
2017-09-15 15:59 ` [dpdk-dev] [PATCH v2 5/6] net/mlx5: add operations for secondary process Xueming Li
2017-09-15 16:00 ` [dpdk-dev] [PATCH v2 6/6] net/mlx5: multi-process document update Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 0/6] net/mlx5 multi-process support Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 1/6] net/mlx5: change eth device reference for secondary process Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 2/6] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 3/6] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 4/6] net/mlx5: remove verbs fork check Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 5/6] net/mlx5: add operations for secondary process Xueming Li
2017-09-18 14:36 ` [dpdk-dev] [PATCH v3 6/6] net/mlx5: multi-process document update Xueming Li
2017-09-18 18:47 ` Mcnamara, John
2017-09-19 14:31 ` [dpdk-dev] [PATCH v4 0/5] net/mlx5 multi-process support Xueming Li
2017-09-19 14:41 ` Nélio Laranjeiro
2017-09-19 14:48 ` Ferruh Yigit
2017-09-19 15:02 ` Xueming(Steven) Li
2017-09-20 8:07 ` Nélio Laranjeiro
2017-10-05 0:17 ` Ferruh Yigit
2017-10-06 15:52 ` Xueming(Steven) Li
2017-09-19 14:31 ` [dpdk-dev] [PATCH v4 1/5] net/mlx5: change eth device reference for secondary process Xueming Li
2017-09-19 14:31 ` [dpdk-dev] [PATCH v4 2/5] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-09-19 14:31 ` [dpdk-dev] [PATCH v4 3/5] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-09-19 14:31 ` [dpdk-dev] [PATCH v4 4/5] net/mlx5: add operations for secondary process Xueming Li
2017-09-19 14:31 ` [dpdk-dev] [PATCH v4 5/5] net/mlx5: multi-process document update Xueming Li
2017-09-19 16:16 ` Mcnamara, John
2017-10-06 15:45 ` [dpdk-dev] [PATCH v5 0/5] net/mlx5 multi-process support Xueming Li
2017-10-06 18:21 ` Ferruh Yigit
2017-10-06 15:45 ` [dpdk-dev] [PATCH v5 1/5] net/mlx5: change eth device reference for secondary process Xueming Li
2017-10-06 15:45 ` [dpdk-dev] [PATCH v5 2/5] net/mlx5: install a socket to exchange a file descriptor Xueming Li
2017-10-06 18:21 ` Ferruh Yigit [this message]
2017-10-06 15:45 ` [dpdk-dev] [PATCH v5 3/5] net/mlx5: allocate verbs object into shared memory Xueming Li
2017-10-06 15:45 ` [dpdk-dev] [PATCH v5 4/5] net/mlx5: add operations for secondary process Xueming Li
2017-10-06 15:45 ` [dpdk-dev] [PATCH v5 5/5] net/mlx5: multi-process document update Xueming Li
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=9bd9343c-1bf1-33cf-fe6c-d3970bfa6a07@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=nelio.laranjeiro@6wind.com \
--cc=xuemingl@mellanox.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;
as well as URLs for NNTP newsgroup(s).