Here is the Chinuch’s gloss on the mitzva concerning a Jewish slave.
What is the mitzva concerning a Jewish slave? Locating the source of this mitzva in the verse beginning in the words “ki sikne eved ivri,” the Chinuch defines this mitzva as the obligation to treat the Jewish slave in precisely the manner delineated in this parsha (or passage of the Torah). The parsha has things to say, first and foremost, about the various ways in which a (Jewish) slave is freed from bondage. There are various events that trigger his release, whereupon he ceases to be subjugated to his master. They include, in particular, the completion of six years of servitude and, also, the arrival of the year of yovel. They also include the performance of a monetary redemption. The master is paid a sum corresponding to the amount of time left on the slave’s six-year-delimited obligation. (This sum constitutes a diminution of the original payment made in procurement of the slave.) Yet another trigger is the death of the master. Provided he dies sonless and, therefore, without a qualified heir, his death occasions the slave’s release. (For only a son inherits a Jewish slave.) The parsha also has things to say about how a nirtza is treated. A nirtza is a slave who has voluntarily opted to forego the opportunity to be released on the basis of the six year trigger. He undergoes a procedure involving having his ear bored and is thus made a permanent slave, meaning that he serves until the yovel year. This requirement too is part and parcel of the obligation concerning a Jewish slave; and fulfillment of the mitzva entails abiding by its provisions as well. Chazal delineated the various specifications in their Talmudic discussion; and a Jew fulfills the command by abiding by all of those specifications.