Lines Matching refs:msg

151 				     struct sk_buff *msg,  in devlink_port_fn_caps_fill()  argument
176 err = nla_put_bitfield32(msg, DEVLINK_PORT_FN_ATTR_CAPS, caps.value, in devlink_port_fn_caps_fill()
185 int devlink_nl_port_handle_fill(struct sk_buff *msg, struct devlink_port *devlink_port) in devlink_nl_port_handle_fill() argument
187 if (devlink_nl_put_handle(msg, devlink_port->devlink)) in devlink_nl_port_handle_fill()
189 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_INDEX, devlink_port->index)) in devlink_nl_port_handle_fill()
203 static int devlink_nl_port_attrs_put(struct sk_buff *msg, in devlink_nl_port_attrs_put() argument
211 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_LANES, attrs->lanes)) in devlink_nl_port_attrs_put()
214 if (nla_put_u8(msg, DEVLINK_ATTR_PORT_SPLITTABLE, attrs->splittable)) in devlink_nl_port_attrs_put()
216 if (nla_put_u16(msg, DEVLINK_ATTR_PORT_FLAVOUR, attrs->flavour)) in devlink_nl_port_attrs_put()
220 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, in devlink_nl_port_attrs_put()
222 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_PF_NUMBER, attrs->pci_pf.pf)) in devlink_nl_port_attrs_put()
224 if (nla_put_u8(msg, DEVLINK_ATTR_PORT_EXTERNAL, attrs->pci_pf.external)) in devlink_nl_port_attrs_put()
228 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, in devlink_nl_port_attrs_put()
230 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_PF_NUMBER, attrs->pci_vf.pf) || in devlink_nl_port_attrs_put()
231 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_VF_NUMBER, attrs->pci_vf.vf)) in devlink_nl_port_attrs_put()
233 if (nla_put_u8(msg, DEVLINK_ATTR_PORT_EXTERNAL, attrs->pci_vf.external)) in devlink_nl_port_attrs_put()
237 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_CONTROLLER_NUMBER, in devlink_nl_port_attrs_put()
239 nla_put_u16(msg, DEVLINK_ATTR_PORT_PCI_PF_NUMBER, in devlink_nl_port_attrs_put()
241 nla_put_u32(msg, DEVLINK_ATTR_PORT_PCI_SF_NUMBER, in devlink_nl_port_attrs_put()
248 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_NUMBER, in devlink_nl_port_attrs_put()
253 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_SPLIT_GROUP, in devlink_nl_port_attrs_put()
256 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_SPLIT_SUBPORT_NUMBER, in devlink_nl_port_attrs_put()
267 struct sk_buff *msg, in devlink_port_fn_hw_addr_fill() argument
285 err = nla_put(msg, DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR, hw_addr_len, hw_addr); in devlink_port_fn_hw_addr_fill()
307 struct sk_buff *msg, in devlink_port_fn_state_fill() argument
334 if (nla_put_u8(msg, DEVLINK_PORT_FN_ATTR_STATE, state) || in devlink_port_fn_state_fill()
335 nla_put_u8(msg, DEVLINK_PORT_FN_ATTR_OPSTATE, opstate)) in devlink_port_fn_state_fill()
413 devlink_nl_port_function_attrs_put(struct sk_buff *msg, struct devlink_port *port, in devlink_nl_port_function_attrs_put() argument
420 function_attr = nla_nest_start_noflag(msg, DEVLINK_ATTR_PORT_FUNCTION); in devlink_nl_port_function_attrs_put()
424 err = devlink_port_fn_hw_addr_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
427 err = devlink_port_fn_caps_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
430 err = devlink_port_fn_state_fill(port, msg, extack, &msg_updated); in devlink_nl_port_function_attrs_put()
433 nla_nest_cancel(msg, function_attr); in devlink_nl_port_function_attrs_put()
435 nla_nest_end(msg, function_attr); in devlink_nl_port_function_attrs_put()
439 static int devlink_nl_port_fill(struct sk_buff *msg, in devlink_nl_port_fill() argument
447 hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd); in devlink_nl_port_fill()
451 if (devlink_nl_put_handle(msg, devlink)) in devlink_nl_port_fill()
453 if (nla_put_u32(msg, DEVLINK_ATTR_PORT_INDEX, devlink_port->index)) in devlink_nl_port_fill()
457 if (nla_put_u16(msg, DEVLINK_ATTR_PORT_TYPE, devlink_port->type)) in devlink_nl_port_fill()
460 nla_put_u16(msg, DEVLINK_ATTR_PORT_DESIRED_TYPE, in devlink_nl_port_fill()
465 (nla_put_u32(msg, DEVLINK_ATTR_PORT_NETDEV_IFINDEX, in devlink_nl_port_fill()
467 nla_put_string(msg, DEVLINK_ATTR_PORT_NETDEV_NAME, in devlink_nl_port_fill()
475 nla_put_string(msg, DEVLINK_ATTR_PORT_IBDEV_NAME, in devlink_nl_port_fill()
480 if (devlink_nl_port_attrs_put(msg, devlink_port)) in devlink_nl_port_fill()
482 if (devlink_nl_port_function_attrs_put(msg, devlink_port, extack)) in devlink_nl_port_fill()
485 nla_put_u32(msg, DEVLINK_ATTR_LINECARD_INDEX, in devlink_nl_port_fill()
489 genlmsg_end(msg, hdr); in devlink_nl_port_fill()
495 genlmsg_cancel(msg, hdr); in devlink_nl_port_fill()
503 struct sk_buff *msg; in devlink_port_notify() local
511 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in devlink_port_notify()
512 if (!msg) in devlink_port_notify()
515 err = devlink_nl_port_fill(msg, devlink_port, cmd, 0, 0, 0, NULL); in devlink_port_notify()
517 nlmsg_free(msg); in devlink_port_notify()
521 genlmsg_multicast_netns(&devlink_nl_family, devlink_net(devlink), msg, in devlink_port_notify()
548 struct sk_buff *msg; in devlink_nl_port_get_doit() local
551 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in devlink_nl_port_get_doit()
552 if (!msg) in devlink_nl_port_get_doit()
555 err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW, in devlink_nl_port_get_doit()
559 nlmsg_free(msg); in devlink_nl_port_get_doit()
563 return genlmsg_reply(msg, info); in devlink_nl_port_get_doit()
567 devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink, in devlink_nl_port_get_dump_one() argument
576 err = devlink_nl_port_fill(msg, devlink_port, in devlink_nl_port_get_dump_one()
842 struct sk_buff *msg; in devlink_nl_cmd_port_new_doit() local
879 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in devlink_nl_cmd_port_new_doit()
880 if (!msg) { in devlink_nl_cmd_port_new_doit()
884 err = devlink_nl_port_fill(msg, devlink_port, DEVLINK_CMD_PORT_NEW, in devlink_nl_cmd_port_new_doit()
888 err = genlmsg_reply(msg, info); in devlink_nl_cmd_port_new_doit()
894 nlmsg_free(msg); in devlink_nl_cmd_port_new_doit()