From: Simon Horman <horms@kernel.org>
To: Mengyuan Lou <mengyuanlou@net-swift.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, jiawenwu@trustnetic.com,
duanqiangwen@net-swift.com
Subject: Re: [PATCH net-next v8 2/6] net: libwx: Add sriov api for wangxun nics
Date: Sun, 16 Mar 2025 13:22:04 +0000 [thread overview]
Message-ID: <20250316132204.GB4159220@kernel.org> (raw)
In-Reply-To: <20250309154252.79234-3-mengyuanlou@net-swift.com>
On Sun, Mar 09, 2025 at 11:42:48PM +0800, Mengyuan Lou wrote:
> Implement sriov_configure interface for wangxun nics in libwx.
> Enable VT mode and initialize vf control structure, when sriov
> is enabled. Do not be allowed to disable sriov when vfs are
> assigned.
>
> Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com>
...
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_sriov.c b/drivers/net/ethernet/wangxun/libwx/wx_sriov.c
> new file mode 100644
> index 000000000000..2392df341ad1
> --- /dev/null
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_sriov.c
> @@ -0,0 +1,201 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2015 - 2025 Beijing WangXun Technology Co., Ltd. */
> +
> +#include <linux/etherdevice.h>
> +#include <linux/pci.h>
> +
> +#include "wx_type.h"
> +#include "wx_mbx.h"
> +#include "wx_sriov.h"
> +
> +static void wx_vf_configuration(struct pci_dev *pdev, int event_mask)
> +{
> + unsigned int vfn = (event_mask & GENMASK(5, 0));
> + struct wx *wx = pci_get_drvdata(pdev);
> +
> + bool enable = ((event_mask & BIT(31)) != 0);
Sorry to nit-pick, and I'd be happy for this to be addressed as a
follow-up, but I think that it would be nice to:
1. Both use some #defines and FIELD_GET() for the masking above.
2. Use !! in place of != 0
3. Arrange local variable declarations in reverse xmas tree order.
> +
> + if (enable)
> + eth_zero_addr(wx->vfinfo[vfn].vf_mac_addr);
> +}
...
next prev parent reply other threads:[~2025-03-16 13:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-09 15:42 [PATCH net-next v8 0/6] add sriov support for wangxun NICs Mengyuan Lou
2025-03-09 15:42 ` [PATCH net-next v8 1/6] net: libwx: Add mailbox api for wangxun pf drivers Mengyuan Lou
2025-03-09 15:42 ` [PATCH net-next v8 2/6] net: libwx: Add sriov api for wangxun nics Mengyuan Lou
2025-03-16 13:22 ` Simon Horman [this message]
2025-03-17 6:34 ` mengyuanlou
2025-03-17 17:08 ` Simon Horman
2025-03-18 9:36 ` Jiawen Wu
2025-03-09 15:42 ` [PATCH net-next v8 3/6] net: libwx: Redesign flow when sriov is enabled Mengyuan Lou
2025-03-09 15:42 ` [PATCH net-next v8 4/6] net: libwx: Add msg task func Mengyuan Lou
2025-03-09 15:42 ` [PATCH net-next v8 5/6] net: ngbe: add sriov function support Mengyuan Lou
2025-03-09 15:42 ` [PATCH net-next v8 6/6] net: txgbe: " Mengyuan Lou
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=20250316132204.GB4159220@kernel.org \
--to=horms@kernel.org \
--cc=duanqiangwen@net-swift.com \
--cc=jiawenwu@trustnetic.com \
--cc=kuba@kernel.org \
--cc=mengyuanlou@net-swift.com \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.