Lines Matching refs:msg

152 				     struct sk_buff *msg,  in devlink_port_fn_caps_fill()  argument
177 err = nla_put_bitfield32(msg, DEVLINK_PORT_FN_ATTR_CAPS, caps.value, in devlink_port_fn_caps_fill()
187 struct sk_buff *msg, in devlink_port_fn_max_io_eqs_fill() argument
203 err = nla_put_u32(msg, DEVLINK_PORT_FN_ATTR_MAX_IO_EQS, max_io_eqs); in devlink_port_fn_max_io_eqs_fill()
210 int devlink_nl_port_handle_fill(struct sk_buff *msg, struct devlink_port *devlink_port) in devlink_nl_port_handle_fill() argument
212 if (devlink_nl_put_handle(msg, devlink_port->devlink)) in devlink_nl_port_handle_fill()
214 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_INDEX, devlink_port->index)) in devlink_nl_port_handle_fill()
228 static int devlink_nl_port_attrs_put(struct sk_buff *msg, in devlink_nl_port_attrs_put() argument
236 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_LANES, attrs->lanes)) in devlink_nl_port_attrs_put()
239 if (nla_put_u8(msg, DEVLINK_ATTR_PORT_SPLITTABLE, attrs->splittable)) in devlink_nl_port_attrs_put()
241 if (nla_put_u16(msg, DEVLINK_ATTR_PORT_FLAVOUR, attrs->flavour)) in devlink_nl_port_attrs_put()
245 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, in devlink_nl_port_attrs_put()
247 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_PF_NUMBER, attrs->pci_pf.pf)) in devlink_nl_port_attrs_put()
249 if (nla_put_u8(msg, DEVLINK_ATTR_PORT_EXTERNAL, attrs->pci_pf.external)) in devlink_nl_port_attrs_put()
253 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, in devlink_nl_port_attrs_put()
255 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_PF_NUMBER, attrs->pci_vf.pf) || in devlink_nl_port_attrs_put()
256 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_VF_NUMBER, attrs->pci_vf.vf)) in devlink_nl_port_attrs_put()
258 if (nla_put_u8(msg, DEVLINK_ATTR_PORT_EXTERNAL, attrs->pci_vf.external)) in devlink_nl_port_attrs_put()
262 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, in devlink_nl_port_attrs_put()
264 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_PF_NUMBER, in devlink_nl_port_attrs_put()
266 nla_put_u32(msg, DEVLINK_ATTR_PORT_PCI_SF_NUMBER, in devlink_nl_port_attrs_put()
273 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_NUMBER, in devlink_nl_port_attrs_put()
278 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_SPLIT_GROUP, in devlink_nl_port_attrs_put()
281 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER, in devlink_nl_port_attrs_put()
292 struct sk_buff *msg, in devlink_port_fn_hw_addr_fill() argument
310 err = nla_put(msg, DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, hw_addr_len, hw_addr); in devlink_port_fn_hw_addr_fill()
332 struct sk_buff *msg, in devlink_port_fn_state_fill() argument
359 if (nla_put_u8(msg, DEVLINK_PORT_FN_ATTR_STATE, state) || in devlink_port_fn_state_fill()
360 nla_put_u8(msg, DEVLINK_PORT_FN_ATTR_OPSTATE, opstate)) in devlink_port_fn_state_fill()
450 devlink_nl_port_function_attrs_put(struct sk_buff *msg, struct devlink_port *port, in devlink_nl_port_function_attrs_put() argument
457 function_attr = nla_nest_start_noflag(msg, DEVLINK_ATTR_PORT_FUNCTION); in devlink_nl_port_function_attrs_put()
461 err = devlink_port_fn_hw_addr_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
464 err = devlink_port_fn_caps_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
467 err = devlink_port_fn_state_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
470 err = devlink_port_fn_max_io_eqs_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
473 err = devlink_rel_devlink_handle_put(msg, port->devlink, in devlink_nl_port_function_attrs_put()
480 nla_nest_cancel(msg, function_attr); in devlink_nl_port_function_attrs_put()
482 nla_nest_end(msg, function_attr); in devlink_nl_port_function_attrs_put()
486 static int devlink_nl_port_fill(struct sk_buff *msg, in devlink_nl_port_fill() argument
494 hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd); in devlink_nl_port_fill()
498 if (devlink_nl_put_handle(msg, devlink)) in devlink_nl_port_fill()
500 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_INDEX, devlink_port->index)) in devlink_nl_port_fill()
504 if (nla_put_u16(msg, DEVLINK_ATTR_PORT_TYPE, devlink_port->type)) in devlink_nl_port_fill()
507 nla_put_u16(msg, DEVLINK_ATTR_PORT_DESIRED_TYPE, in devlink_nl_port_fill()
512 (nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX, in devlink_nl_port_fill()
514 nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME, in devlink_nl_port_fill()
522 nla_put_string(msg, DEVLINK_ATTR_PORT_IBDEV_NAME, in devlink_nl_port_fill()
527 if (devlink_nl_port_attrs_put(msg, devlink_port)) in devlink_nl_port_fill()
529 if (devlink_nl_port_function_attrs_put(msg, devlink_port, extack)) in devlink_nl_port_fill()
532 nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX, in devlink_nl_port_fill()
536 genlmsg_end(msg, hdr); in devlink_nl_port_fill()
542 genlmsg_cancel(msg, hdr); in devlink_nl_port_fill()
551 struct sk_buff *msg; in devlink_port_notify() local
559 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in devlink_port_notify()
560 if (!msg) in devlink_port_notify()
563 err = devlink_nl_port_fill(msg, devlink_port, cmd, 0, 0, 0, NULL); in devlink_port_notify()
565 nlmsg_free(msg); in devlink_port_notify()
571 devlink_nl_notify_send_desc(devlink, msg, &desc); in devlink_port_notify()
597 struct sk_buff *msg; in devlink_nl_port_get_doit() local
600 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in devlink_nl_port_get_doit()
601 if (!msg) in devlink_nl_port_get_doit()
604 err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW, in devlink_nl_port_get_doit()
608 nlmsg_free(msg); in devlink_nl_port_get_doit()
612 return genlmsg_reply(msg, info); in devlink_nl_port_get_doit()
616 devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink, in devlink_nl_port_get_dump_one() argument
625 err = devlink_nl_port_fill(msg, devlink_port, in devlink_nl_port_get_dump_one()
903 struct sk_buff *msg; in devlink_nl_port_new_doit() local
940 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in devlink_nl_port_new_doit()
941 if (!msg) { in devlink_nl_port_new_doit()
945 err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW, in devlink_nl_port_new_doit()
949 err = genlmsg_reply(msg, info); in devlink_nl_port_new_doit()
955 nlmsg_free(msg); in devlink_nl_port_new_doit()