mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
net: devmem: TCP tx netlink api
Add bind-tx netlink call to attach dmabuf for TX; queue is not required, only ifindex and dmabuf fd for attachment. Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Signed-off-by: Mina Almasry <almasrymina@google.com> Link: https://patch.msgid.link/20250508004830.4100853-4-almasrymina@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
e9f3d61db5
commit
8802087d20
|
@ -743,6 +743,18 @@ operations:
|
||||||
- defer-hard-irqs
|
- defer-hard-irqs
|
||||||
- gro-flush-timeout
|
- gro-flush-timeout
|
||||||
- irq-suspend-timeout
|
- irq-suspend-timeout
|
||||||
|
-
|
||||||
|
name: bind-tx
|
||||||
|
doc: Bind dmabuf to netdev for TX
|
||||||
|
attribute-set: dmabuf
|
||||||
|
do:
|
||||||
|
request:
|
||||||
|
attributes:
|
||||||
|
- ifindex
|
||||||
|
- fd
|
||||||
|
reply:
|
||||||
|
attributes:
|
||||||
|
- id
|
||||||
|
|
||||||
kernel-family:
|
kernel-family:
|
||||||
headers: [ "net/netdev_netlink.h"]
|
headers: [ "net/netdev_netlink.h"]
|
||||||
|
|
|
@ -219,6 +219,7 @@ enum {
|
||||||
NETDEV_CMD_QSTATS_GET,
|
NETDEV_CMD_QSTATS_GET,
|
||||||
NETDEV_CMD_BIND_RX,
|
NETDEV_CMD_BIND_RX,
|
||||||
NETDEV_CMD_NAPI_SET,
|
NETDEV_CMD_NAPI_SET,
|
||||||
|
NETDEV_CMD_BIND_TX,
|
||||||
|
|
||||||
__NETDEV_CMD_MAX,
|
__NETDEV_CMD_MAX,
|
||||||
NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
|
NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
|
||||||
|
|
|
@ -99,6 +99,12 @@ static const struct nla_policy netdev_napi_set_nl_policy[NETDEV_A_NAPI_IRQ_SUSPE
|
||||||
[NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT] = { .type = NLA_UINT, },
|
[NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT] = { .type = NLA_UINT, },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* NETDEV_CMD_BIND_TX - do */
|
||||||
|
static const struct nla_policy netdev_bind_tx_nl_policy[NETDEV_A_DMABUF_FD + 1] = {
|
||||||
|
[NETDEV_A_DMABUF_IFINDEX] = NLA_POLICY_MIN(NLA_U32, 1),
|
||||||
|
[NETDEV_A_DMABUF_FD] = { .type = NLA_U32, },
|
||||||
|
};
|
||||||
|
|
||||||
/* Ops table for netdev */
|
/* Ops table for netdev */
|
||||||
static const struct genl_split_ops netdev_nl_ops[] = {
|
static const struct genl_split_ops netdev_nl_ops[] = {
|
||||||
{
|
{
|
||||||
|
@ -190,6 +196,13 @@ static const struct genl_split_ops netdev_nl_ops[] = {
|
||||||
.maxattr = NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT,
|
.maxattr = NETDEV_A_NAPI_IRQ_SUSPEND_TIMEOUT,
|
||||||
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
|
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.cmd = NETDEV_CMD_BIND_TX,
|
||||||
|
.doit = netdev_nl_bind_tx_doit,
|
||||||
|
.policy = netdev_bind_tx_nl_policy,
|
||||||
|
.maxattr = NETDEV_A_DMABUF_FD,
|
||||||
|
.flags = GENL_CMD_CAP_DO,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct genl_multicast_group netdev_nl_mcgrps[] = {
|
static const struct genl_multicast_group netdev_nl_mcgrps[] = {
|
||||||
|
|
|
@ -34,6 +34,7 @@ int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
|
||||||
struct netlink_callback *cb);
|
struct netlink_callback *cb);
|
||||||
int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info);
|
int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info);
|
||||||
int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info);
|
int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info);
|
||||||
|
int netdev_nl_bind_tx_doit(struct sk_buff *skb, struct genl_info *info);
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
NETDEV_NLGRP_MGMT,
|
NETDEV_NLGRP_MGMT,
|
||||||
|
|
|
@ -968,6 +968,12 @@ err_genlmsg_free:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* stub */
|
||||||
|
int netdev_nl_bind_tx_doit(struct sk_buff *skb, struct genl_info *info)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void netdev_nl_sock_priv_init(struct netdev_nl_sock *priv)
|
void netdev_nl_sock_priv_init(struct netdev_nl_sock *priv)
|
||||||
{
|
{
|
||||||
INIT_LIST_HEAD(&priv->bindings);
|
INIT_LIST_HEAD(&priv->bindings);
|
||||||
|
|
|
@ -219,6 +219,7 @@ enum {
|
||||||
NETDEV_CMD_QSTATS_GET,
|
NETDEV_CMD_QSTATS_GET,
|
||||||
NETDEV_CMD_BIND_RX,
|
NETDEV_CMD_BIND_RX,
|
||||||
NETDEV_CMD_NAPI_SET,
|
NETDEV_CMD_NAPI_SET,
|
||||||
|
NETDEV_CMD_BIND_TX,
|
||||||
|
|
||||||
__NETDEV_CMD_MAX,
|
__NETDEV_CMD_MAX,
|
||||||
NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
|
NETDEV_CMD_MAX = (__NETDEV_CMD_MAX - 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user