From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8C57CA034F; Fri, 8 Oct 2021 12:59:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A504C41204; Fri, 8 Oct 2021 12:56:37 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 9FEF1411E0 for ; Thu, 7 Oct 2021 20:45:52 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id u7so6050892pfg.13 for ; Thu, 07 Oct 2021 11:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oneconvergence.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aeS0CGV/+hSPYiR4P5TjZrxsClU7NUb8c4wVetnfxd8=; b=f6+Og/JYl3dJUuJPg/FaS29tm4paZwpYRee9mDiSWFJKd7TDWKYegOHa0ZWQ3p6JaT evjCUfkfE0mHVkFDHrXTwBYcMWOdEhLiXkEfN5xuxcWJB9lAEW6R33cpHyfru2R0A/Rm RFRoa1Agn+CPaCI/LQmNo0AxS4eWdCGBlTRKE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aeS0CGV/+hSPYiR4P5TjZrxsClU7NUb8c4wVetnfxd8=; b=uh5gYoWrWaOIjcqq9fd6gWrscJhDh53IkU3DpBEEexVUYNwOVs+v8ob6JU1UdS/eK7 KdsRfDf/mjI5SgifLRO4Ory3CPRBj1OwGh1hSxzv2q3KDFwgPNaN2lz7zekHHMbSj5Zo yi2bQO2FqPLzjb86eTVPwAMaRjmapCDHnwOhWzxtfy/LrI0msCu6aAJtQagu71qQpUZl e19rhwqogqhPhoF4n+vwTtlxLWDzdw8SQouzxslqRXjFTiZIddoCNSjxlKbff1Llyc2B jo6aB3mTmUGQlhvGjzDrNJ0l+XEoqRjlcDmwX+LJLdFZSFQcTY/8GfVJbVe6BJb0eihC WF/w== X-Gm-Message-State: AOAM530WNcfu7a6FU/f2QqWJhUJfdcNS7ZXtCtfy3WU52MfABkeyjOxh H9POdrtFjICuFdzYVZeaFpbwyg== X-Google-Smtp-Source: ABdhPJz6K8irYiu5FTpOKpnjEN09+Ya31TmVjG+0OFohgtS9awsgYTPUrh0x7uwFmGvY0xTqCXB1xA== X-Received: by 2002:a05:6a00:24c8:b0:44c:654b:403b with SMTP id d8-20020a056a0024c800b0044c654b403bmr5733786pfv.55.1633632351859; Thu, 07 Oct 2021 11:45:51 -0700 (PDT) Received: from srikanth-ThinkPad-T450.domain.name ([136.185.113.102]) by smtp.gmail.com with ESMTPSA id c11sm3311586pji.38.2021.10.07.11.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 11:45:51 -0700 (PDT) From: Srikanth Kaka To: Matan Azrad , Viacheslav Ovsiienko Cc: dev@dpdk.org, Vag Singh , Anand Thulasiram , Srikanth Kaka Date: Fri, 8 Oct 2021 00:13:45 +0530 Message-Id: <20211007184350.73858-37-srikanth.k@oneconvergence.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211007184350.73858-1-srikanth.k@oneconvergence.com> References: <20211007184350.73858-1-srikanth.k@oneconvergence.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 08 Oct 2021 12:55:54 +0200 Subject: [dpdk-dev] [PATCH v2 36/41] net/mlx5: set file descriptor as non-blocking X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" set file descriptor as non-blocking Signed-off-by: Srikanth Kaka Signed-off-by: Vag Singh Signed-off-by: Anand Thulasiram --- drivers/net/mlx5/freebsd/mlx5_os.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/mlx5/freebsd/mlx5_os.c b/drivers/net/mlx5/freebsd/mlx5_os.c index 54bd32ee86..c05bf021d1 100644 --- a/drivers/net/mlx5/freebsd/mlx5_os.c +++ b/drivers/net/mlx5/freebsd/mlx5_os.c @@ -100,6 +100,27 @@ static struct mlx5_indexed_pool_config icfg[] = { }, }; +/** + * Set the completion channel file descriptor interrupt as non-blocking. + * + * @param[in] rxq_obj + * Pointer to RQ channel object, which includes the channel fd + * + * @param[out] fd + * The file descriptor (representing the intetrrupt) used in this channel. + * + * @return + * 0 on successfully setting the fd to non-blocking, non-zero otherwise. + */ +int +mlx5_os_set_nonblock_channel_fd(int fd) +{ + int flags; + + flags = fcntl(fd, F_GETFL); + return fcntl(fd, F_SETFL, flags | O_NONBLOCK); +} + /** * Get mlx5 device attributes. The glue function query_device_ex() is called * with out parameter of type 'struct ibv_device_attr_ex *'. Then fill in mlx5 -- 2.30.2